/* 禅意番茄钟 · 自然禅（绿）。换风格只改这一段 :root 变量即可。 */
:root {
  --bg1: #eef3ea;
  --bg2: #dce7d8;
  --card: rgba(255, 255, 255, 0.55);
  --card-solid: #ffffff;
  --ink: #3f5a48;
  --ink-soft: #4a6350;
  --sub: #8a9a86;
  --line: #d5e0d0;
  --accent: #5c9a4a;
  --accent-soft: #7cb35f;
  --ring-track: #dbe7d8;
  --ring-focus: #5c9a4a;
  --ring-break: #6fb0c4;
  --shadow: 0 20px 50px rgba(90, 120, 90, 0.16);

  /* 植物用色 */
  --stem-a: #7a5a3a; --stem-b: #5f8a4e;
  --leaf-a: #8fbf6e; --leaf-b: #5c9a4a;
  --petal: #f6e8ef; --petal-core: #e8b3c8;
  --soil-a: #c2d0b8; --soil-b: #b3c3a8;
}

/* 预设主题：给 <html> 加 data-theme 即整体换肤 */
html[data-theme="ink"] {
  --bg1:#f4f1e9; --bg2:#e6e1d3; --ink:#2b2b28; --ink-soft:#3d3d38; --sub:#9a9384; --line:#ddd6c6;
  --accent:#5c574e; --accent-soft:#7a7469; --ring-track:#e0dac9; --ring-focus:#3d3d38; --ring-break:#9a9384;
  --stem-a:#6b5a44; --stem-b:#5a6b4e; --leaf-a:#9aa17e; --leaf-b:#6f7a56;
  --petal:#efe9dd; --petal-core:#c9b98f; --soil-a:#ded7c6; --soil-b:#cfc7b3;
}
html[data-theme="wabi"] {
  --bg1:#ece2d3; --bg2:#ddcfba; --ink:#5a4a38; --ink-soft:#6b5842; --sub:#a1927d; --line:#d8c9b0;
  --accent:#a1794f; --accent-soft:#bb9165; --ring-track:#d8c9b0; --ring-focus:#a1794f; --ring-break:#8a9a5b;
  --stem-a:#7a5a3a; --stem-b:#6b7a45; --leaf-a:#a3aa6e; --leaf-b:#7d8a4a;
  --petal:#f0e6d6; --petal-core:#d8a07a; --soil-a:#d8c9b0; --soil-b:#c8b89c;
}
html[data-theme="morandi"] {
  --bg1:#dcd7cf; --bg2:#cac4bb; --ink:#514b46; --ink-soft:#5f5852; --sub:#9a938b; --line:#c8c1b8;
  --accent:#8f8478; --accent-soft:#a89d90; --ring-track:#c8c1b8; --ring-focus:#8f8478; --ring-break:#8a94a0;
  --stem-a:#7d6f5f; --stem-b:#7a8570; --leaf-a:#a7ad9a; --leaf-b:#828d76;
  --petal:#e9e2da; --petal-core:#c9a9a0; --soil-a:#cec7bd; --soil-b:#beb6ab;
}
html[data-theme="jade"] {
  --bg1:#eef3ee; --bg2:#d8e6de; --ink:#254f3d; --ink-soft:#2f6b52; --sub:#8aa79a; --line:#cfe0d4;
  --accent:#2f8b6a; --accent-soft:#4aa583; --ring-track:#cfe0d4; --ring-focus:#2f8b6a; --ring-break:#c9a24a;
  --stem-a:#6b5a3a; --stem-b:#3f8b5e; --leaf-a:#7fc79a; --leaf-b:#3f9a6a;
  --petal:#f6eef2; --petal-core:#d98fb0; --soil-a:#cfe0d4; --soil-b:#bcd3c4;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(140% 120% at 50% -10%, var(--bg1), var(--bg2));
  color: var(--ink-soft);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: 1040px; margin: 0 auto; padding: 28px 18px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.brand { font-size: 20px; font-weight: 600; letter-spacing: 4px; color: var(--ink); }
.brand small { display: block; font-size: 11px; letter-spacing: 2px; color: var(--sub); font-weight: 400; margin-top: 2px; }
.iconbtn {
  border: none; background: var(--card); color: var(--ink-soft);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  font-size: 18px; box-shadow: 0 4px 12px rgba(90, 120, 90, 0.12);
  transition: transform .12s;
}
.iconbtn:active { transform: scale(.94); }

.layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; }
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .6), var(--card));
  border-radius: 22px; box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .6);
  padding: 22px;
}

/* 模式切换 */
.modes { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }
.modes button {
  border: none; cursor: pointer; font-family: inherit; font-size: 13px;
  padding: 7px 16px; border-radius: 999px; color: var(--sub);
  background: transparent; transition: all .15s; letter-spacing: 1px;
}
.modes button.active { background: var(--accent); color: #fff; box-shadow: 0 6px 14px rgba(92, 154, 74, .3); }

/* 计时器圆环 */
.timer-wrap { display: flex; flex-direction: column; align-items: center; }
.ring-box { position: relative; width: min(280px, 70vw); aspect-ratio: 1; }
.ring-box svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-box .track { fill: none; stroke: var(--ring-track); stroke-width: 10; }
.ring-box .prog { fill: none; stroke: var(--ring-focus); stroke-width: 10; stroke-linecap: round; transition: stroke .4s, stroke-dashoffset .25s linear; }
.ring-box .dot { fill: #fff; stroke: var(--ring-focus); stroke-width: 3; filter: drop-shadow(0 0 5px var(--ring-focus)); transition: stroke .4s; }
#dotG { transition: transform .25s linear; }
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
}
.time { font-size: 54px; font-weight: 300; letter-spacing: 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mode-label { font-size: 13px; letter-spacing: 3px; color: var(--sub); }

.adjust { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.adjust #durLabel { font-size: 14px; color: var(--sub); min-width: 62px; text-align: center; letter-spacing: 1px; }
.step {
  border: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%;
  font-size: 18px; line-height: 1; color: var(--ink-soft); background: var(--card);
  box-shadow: 0 3px 10px rgba(90,120,90,.14); touch-action: manipulation;
}
.step:active { transform: scale(.92); }
.controls { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.btn {
  border: none; cursor: pointer; font-family: inherit; font-size: 15px;
  padding: 11px 30px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  box-shadow: 0 8px 18px rgba(92, 154, 74, .32); transition: transform .12s, opacity .12s;
}
.btn:active { transform: translateY(1px) scale(.98); }
.btn.ghost { background: var(--card); color: var(--ink-soft); box-shadow: 0 4px 12px rgba(90, 120, 90, .14); }
.btn, .iconbtn, .modes button, .add-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* 植物卡 */
.plant-card { text-align: center; }
.plant-svg { width: 100%; height: 300px; }
.plant-meta { display: flex; justify-content: center; gap: 18px; color: var(--sub); font-size: 13px; margin-top: 6px; }
.plant-meta b { color: var(--accent); }

/* 任务 */
.task-head { display: flex; gap: 8px; margin-bottom: 14px; }
.task-head input {
  flex: 1; border: 1px solid var(--line); background: rgba(255,255,255,.7);
  border-radius: 12px; padding: 10px 12px; font-family: inherit; font-size: 14px; color: var(--ink-soft);
}
.task-head input:focus { outline: none; border-color: var(--accent-soft); }
.est-input { width: 58px !important; flex: none !important; text-align: center; }
.add-btn { border: none; background: var(--accent); color: #fff; border-radius: 12px; padding: 0 16px; cursor: pointer; font-size: 20px; }

.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: rgba(255, 255, 255, .5); border-radius: 12px; border: 1px solid transparent;
  transition: border-color .15s;
}
.task.active { border-color: var(--accent-soft); background: rgba(124, 179, 95, .12); }
.task.done .name { text-decoration: line-through; color: var(--sub); }
.task .check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; flex: none; }
.task.done .check { background: var(--accent); border-color: var(--accent); }
.task .name { flex: 1; font-size: 14px; cursor: pointer; word-break: break-all; }
.task .pomo { font-size: 12px; color: var(--sub); white-space: nowrap; }
.task .ops { display: flex; gap: 2px; }
.task .ops button { border: none; background: transparent; cursor: pointer; color: var(--sub); font-size: 14px; padding: 2px 4px; border-radius: 6px; }
.task .ops button:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.empty { color: var(--sub); font-size: 13px; text-align: center; padding: 18px; }

/* 提示条 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 设置弹层 */
.modal-bg {
  position: fixed; inset: 0; background: rgba(60, 80, 60, .35); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 16px;
}
.modal-bg.show { display: flex; }
.modal { background: var(--card-solid); border-radius: 20px; padding: 24px; width: min(360px, 92vw); box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 16px; color: var(--ink); letter-spacing: 2px; }
.field { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 14px; }
.field input[type=number] { width: 70px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-family: inherit; text-align: center; }
.field input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
/* 提示音选择 */
.sound-pick { display: flex; gap: 8px; align-items: center; }
.sound-pick select {
  font-family: inherit; font-size: 14px; padding: 7px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.8); color: var(--ink-soft);
}
.mini {
  border: none; cursor: pointer; font-family: inherit; font-size: 13px; white-space: nowrap;
  padding: 7px 12px; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  box-shadow: 0 4px 10px rgba(92,154,74,.28);
}
.mini:active { transform: translateY(1px); }

/* 配色主题选择 */
.theme-field { display: block; margin-bottom: 16px; }
.theme-field > span { display: block; font-size: 14px; margin-bottom: 10px; }
.themes { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.sw {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0;
  border: 2px solid transparent; box-shadow: 0 2px 6px rgba(0,0,0,.15); position: relative;
}
.sw.selected { border-color: var(--ink); }
.sw.custom { overflow: hidden; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(from 0deg, #f66, #fd6, #6f6, #6ff, #66f, #f6f, #f66); }
.sw.custom input { position: absolute; inset: -6px; width: 200%; height: 200%; border: none; padding: 0; cursor: pointer; opacity: 0; }
.sw.custom::after { content: "✎"; color: #fff; font-size: 13px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

.modal-ops { display: flex; gap: 10px; margin-top: 20px; }
.modal-ops .btn { flex: 1; padding: 10px; }

/* 响应式：手机单列，计时器在上，任务在下 */
@media (max-width: 760px) {
  .app { padding: 20px 14px 40px; }
  .layout { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 18px; border-radius: 20px; }
  .time { font-size: 46px; }
  .plant-svg { height: 230px; }
  /* 按钮自动换行、变窄，避免窄屏挤出边界 */
  .controls { gap: 10px; flex-wrap: wrap; }
  .controls .btn { flex: 1 1 auto; min-width: 92px; padding: 12px 16px; text-align: center; }
}

/* 超窄屏（小手机）再收一档 */
@media (max-width: 380px) {
  .brand { font-size: 18px; letter-spacing: 2px; }
  .time { font-size: 40px; }
  .ring-box { width: min(240px, 74vw); }
  .task-head input { font-size: 13px; padding: 9px 10px; }
  .task .pomo { font-size: 11px; }
}

/* 触屏没有 hover，避免按住残留高亮 */
@media (hover: none) {
  .task .ops button:hover { background: transparent; color: var(--sub); }
}
