/* 八方集团 · 工作计划与进度管理
   视觉：高端极简 / 炭灰 + 翡翠 / 移动优先 */

:root {
  --bg: #F4F5F7;
  --bg-elev: #FFFFFF;
  --bg-sunken: #EDEFF2;
  --line: #E4E7EB;
  --line-strong: #D3D8DF;
  --ink: #15191F;
  --ink-2: #5A6472;
  --ink-3: #98A2B0;
  --accent: #0E8F6E;
  --accent-ink: #0A6E55;
  --accent-soft: #E4F4EF;
  --danger: #DC2F49;
  --danger-soft: #FDECEF;
  --warn: #C2700A;
  --warn-soft: #FDF3E3;
  --aero: #2C6BE0;
  --deyi: #0E9F6E;
  --agri: #E0553F;
  --hui: #7A55D8;
  --radius-l: 20px;
  --radius: 14px;
  --radius-s: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 2px 6px rgba(16, 24, 40, .05), 0 16px 32px -20px rgba(16, 24, 40, .28);
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.22, .8, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1116;
    --bg-elev: #171B21;
    --bg-sunken: #12161B;
    --line: #262C35;
    --line-strong: #333A45;
    --ink: #F1F4F8;
    --ink-2: #A2ADBB;
    --ink-3: #6D7887;
    --accent: #2BC08E;
    --accent-ink: #6EE0B7;
    --accent-soft: #12302A;
    --danger: #FF6B7F;
    --danger-soft: #2E1720;
    --warn: #F0A93C;
    --warn-soft: #2C2114;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, .35), 0 20px 40px -24px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; }
button, input, textarea, select { font-family: inherit; font-size: 16px; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
input, textarea, select { -webkit-appearance: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- 登录 ---------- */
#login {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 28px calc(32px + var(--safe-b));
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(14, 143, 110, .14), transparent 60%),
    radial-gradient(100% 70% at 0% 100%, rgba(44, 107, 224, .10), transparent 55%),
    var(--bg);
  z-index: 60;
}
#login > * { width: 100%; max-width: 420px; align-self: center; }
#login .brand { font-size: 13px; letter-spacing: .22em; color: var(--ink-3); text-transform: uppercase; }
#login h1 { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 10px 0 6px; }
#login .sub { color: var(--ink-2); font-size: 14px; margin-bottom: 34px; }
#login .field {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4px 6px 4px 16px;
  box-shadow: var(--shadow-1);
}
#login input { flex: 1; border: none; background: none; outline: none; padding: 14px 0; letter-spacing: .1em; }
#login .btn-primary { margin-top: 16px; width: 100%; padding: 16px; border-radius: var(--radius); }
#login .hint { margin-top: 18px; font-size: 12.5px; color: var(--ink-3); text-align: center; }
#login .err { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; min-height: 18px; }

.btn-primary {
  background: var(--ink); color: var(--bg-elev);
  font-weight: 600; font-size: 15px; letter-spacing: .03em;
  border-radius: var(--radius); min-height: 46px; transition: transform .18s var(--ease), opacity .2s;
}
.btn-primary:active { transform: scale(.975); }
.btn-primary.accent { background: var(--accent); color: #fff; }
.btn-primary[disabled] { opacity: .5; }

/* ---------- 应用骨架 ---------- */
#app { display: none; }
#app.on { display: block; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.topbar .hello { font-size: 12px; letter-spacing: .16em; color: var(--ink-3); text-transform: uppercase; }
.topbar .day-line { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.topbar .day-big { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.topbar .day-sub { font-size: 13px; color: var(--ink-2); }
.topbar .tools { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--bg-elev); border: 1px solid var(--line);
  color: var(--ink-2); box-shadow: var(--shadow-1);
  transition: transform .16s var(--ease);
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 18px; height: 18px; }

main { padding: 4px 16px calc(var(--tab-h) + var(--safe-b) + 26px); max-width: 760px; margin: 0 auto; }
.page { display: none; animation: fade .26s var(--ease); }
.page.on { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sec-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 10px; font-size: 13px; font-weight: 600;
  letter-spacing: .06em; color: var(--ink-2);
}
.sec-title .tail { font-weight: 400; color: var(--ink-3); font-size: 12.5px; letter-spacing: 0; }

.card {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius-l); box-shadow: var(--shadow-1);
}

/* ---------- 今日：日期条 ---------- */
.datebar {
  display: flex; align-items: center; gap: 4px;
  margin: 6px 0 2px;
}
.datebar .nav {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: var(--ink-3); font-size: 17px;
}
.datebar .nav:active { background: var(--bg-sunken); }
.datebar .label { font-size: 14px; color: var(--ink-2); font-weight: 500; }
.datebar .today-btn { margin-left: auto; font-size: 12.5px; color: var(--accent-ink); font-weight: 600; padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); }

/* ---------- 今日进度卡 ---------- */
.focus-card {
  margin-top: 12px; padding: 18px 18px 16px;
  border-radius: var(--radius-l);
  background: linear-gradient(150deg, #1B2027 0%, #101418 100%);
  color: #fff; position: relative; overflow: hidden;
  box-shadow: var(--shadow-2);
}
@media (prefers-color-scheme: dark) {
  .focus-card { background: linear-gradient(150deg, #1D2A2A 0%, #141A1F 100%); border: 1px solid var(--line); }
}
.focus-card::after {
  content: ""; position: absolute; width: 240px; height: 240px; right: -90px; top: -120px;
  background: radial-gradient(circle, rgba(43, 192, 142, .38), transparent 68%);
  pointer-events: none;
}
.focus-top { display: flex; align-items: center; gap: 16px; position: relative; z-index: 1; }
.focus-card .k { font-size: 11.5px; letter-spacing: .18em; color: rgba(255, 255, 255, .55); text-transform: uppercase; }
.focus-card .v { font-size: 15px; font-weight: 600; margin-top: 3px; }
.focus-card .v small { font-weight: 400; font-size: 12.5px; color: rgba(255, 255, 255, .55); margin-left: 4px; }
.focus-metrics { display: flex; gap: 22px; margin-top: 14px; position: relative; z-index: 1; }
.focus-metrics .m { font-size: 12px; color: rgba(255, 255, 255, .55); }
.focus-metrics .m b { display: block; font-size: 19px; font-weight: 600; color: #fff; letter-spacing: -.02em; margin-top: 1px; }
.ring { width: 62px; height: 62px; flex: none; }
.ring circle { fill: none; stroke-width: 5.5; stroke-linecap: round; }
.ring .bg { stroke: rgba(255, 255, 255, .13); }
.ring .fg { stroke: #2BC08E; transition: stroke-dashoffset .7s var(--ease); }
.ring text { fill: #fff; font-size: 15px; font-weight: 600; }

/* ---------- 快速录入 ---------- */
.quick {
  margin-top: 12px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 5px 5px 5px 14px; box-shadow: var(--shadow-1);
  transition: border-color .2s, box-shadow .2s;
}
.quick:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 3px var(--accent-soft); }
.quick input { flex: 1; border: none; outline: none; background: none; padding: 11px 0; font-size: 15px; min-width: 0; }
.quick input::placeholder { color: var(--ink-3); }
.quick .add {
  width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: #fff;
  display: grid; place-items: center; flex: none; transition: transform .16s var(--ease);
}
.quick .add:active { transform: scale(.9); }
.quick .add svg { width: 19px; height: 19px; }
.quick-opts { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.quick-opts::-webkit-scrollbar { display: none; }

.chip {
  flex: none; padding: 6px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: var(--bg-elev); border: 1px solid var(--line); color: var(--ink-2);
  transition: all .16s var(--ease); white-space: nowrap;
}
.chip.on { color: #fff; border-color: transparent; }
.chip:active { transform: scale(.95); }
.chip.on[data-company="aero"] { background: var(--aero); }
.chip.on[data-company="deyi"] { background: var(--deyi); }
.chip.on[data-company="agri"] { background: var(--agri); }
.chip.on[data-company="hui"] { background: var(--hui); }
.chip.on[data-prio="P0"] { background: var(--danger); }
.chip.on[data-prio="P1"] { background: var(--warn); }
.chip.on[data-prio="P2"] { background: var(--ink-2); }

/* ---------- 逾期提示 ---------- */
.alert {
  margin-top: 12px; padding: 13px 15px; border-radius: var(--radius);
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 26%, transparent);
  display: flex; gap: 11px; align-items: flex-start;
}
.alert .ico { color: var(--warn); flex: none; margin-top: 1px; }
.alert .t { font-size: 13.5px; font-weight: 600; color: var(--warn); }
.alert .d { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

/* ---------- 任务列表 ---------- */
.group { margin-top: 16px; }
.group-head {
  display: flex; align-items: center; gap: 8px; padding: 0 3px 8px;
}
.group-head .dot { width: 7px; height: 7px; border-radius: 50%; }
.group-head .nm { font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.group-head .ct { font-size: 12px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.group-head .collapse { color: var(--ink-3); font-size: 11px; padding: 2px 4px; }

.task {
  position: relative; display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 14px 13px 16px;
  margin-bottom: 8px; box-shadow: var(--shadow-1);
  transition: transform .18s var(--ease), opacity .25s, border-color .2s;
  overflow: hidden;
}
.task::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--c, var(--ink-3)); opacity: .9;
}
.task:active { transform: scale(.994); }
.task.done { opacity: .55; }
.task.done .t-title { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--ink-3); }
.task .body { flex: 1; min-width: 0; }
.task .t-title { font-size: 14.5px; font-weight: 500; line-height: 1.45; word-break: break-word; }
.task .t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.task .t-meta .sep { width: 1px; height: 10px; background: var(--line-strong); }
.task .t-meta .facts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; margin-left: 2px; }
.task .t-meta .facts i { font-style: normal; color: var(--line-strong); }
.pill {
  font-size: 11px; padding: 1.5px 7px; border-radius: 999px; font-weight: 600; letter-spacing: .02em;
}
.pill.P0 { background: var(--danger-soft); color: var(--danger); }
.pill.P1 { background: var(--warn-soft); color: var(--warn); }
.pill.P2 { background: var(--bg-sunken); color: var(--ink-2); }
.pill.doing { background: var(--accent-soft); color: var(--accent-ink); }
.pill.blocked { background: var(--danger-soft); color: var(--danger); }
.pill.carry { background: var(--bg-sunken); color: var(--ink-2); }

.t-check {
  width: 26px; height: 26px; border-radius: 50%; border: 1.8px solid var(--line-strong);
  flex: none; display: grid; place-items: center; margin-top: 1px;
  transition: all .2s var(--ease);
}
.t-check svg { width: 14px; height: 14px; opacity: 0; transform: scale(.6); transition: all .2s var(--ease); color: #fff; }
.t-check.on { background: var(--accent); border-color: var(--accent); }
.t-check.on svg { opacity: 1; transform: none; }
.t-check:active { transform: scale(.88); }

.mini-bar { height: 3px; border-radius: 2px; background: var(--bg-sunken); overflow: hidden; margin-top: 8px; }
.mini-bar i { display: block; height: 100%; border-radius: 2px; background: var(--c, var(--accent)); transition: width .5s var(--ease); }

.empty {
  text-align: center; padding: 40px 20px; color: var(--ink-3); font-size: 13.5px;
}
.empty .big { font-size: 30px; margin-bottom: 10px; opacity: .5; }

/* ---------- 看板 ---------- */
.seg {
  display: flex; gap: 4px; padding: 4px; background: var(--bg-sunken);
  border-radius: 12px; margin-top: 10px;
}
.seg button {
  flex: 1; padding: 9px 6px; border-radius: 9px; font-size: 13px; font-weight: 500;
  color: var(--ink-2); transition: all .2s var(--ease); white-space: nowrap;
}
.seg button.on { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.stat-strip .s {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 11px 8px; text-align: center; box-shadow: var(--shadow-1);
}
.stat-strip .s b { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-strip .s span { font-size: 11.5px; color: var(--ink-3); }

/* ---------- 复盘 ---------- */
.review-auto { padding: 16px 17px; margin-top: 12px; }
.review-auto .row { display: flex; align-items: center; justify-content: space-between; }
.review-auto .head { font-size: 12px; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.big-num { display: flex; align-items: baseline; gap: 6px; margin-top: 8px; }
.big-num b { font-size: 32px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.big-num span { font-size: 13px; color: var(--ink-2); }
.dist { display: flex; height: 8px; border-radius: 5px; overflow: hidden; margin-top: 14px; gap: 2px; background: var(--bg-sunken); }
.dist i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.legend em { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 5px; }

.list-lite { margin-top: 8px; }
.list-lite li {
  display: flex; gap: 9px; align-items: flex-start; padding: 9px 2px;
  border-bottom: 1px dashed var(--line); font-size: 13.5px; color: var(--ink-2);
}
.list-lite li:last-child { border-bottom: none; }
.list-lite .b { width: 5px; height: 5px; border-radius: 50%; margin-top: 7px; flex: none; }

.form-card { padding: 16px 17px; margin-top: 12px; }
.form-row { margin-bottom: 15px; }
.form-row:last-child { margin-bottom: 0; }
.form-row label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; letter-spacing: .02em; }
.form-row label .opt { font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.form-row textarea, .form-row input[type="text"], .form-row input[type="date"], .form-row select {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--bg-sunken);
  outline: none; resize: vertical; font-size: 15px; line-height: 1.6;
  transition: border-color .2s, box-shadow .2s;
}
.form-row textarea:focus, .form-row input:focus, .form-row select:focus {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg-elev);
}
.form-row textarea { min-height: 74px; }
.form-row .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.score-row { display: flex; align-items: center; gap: 12px; }
.score-row input[type="range"] { flex: 1; accent-color: var(--accent); height: 26px; }
.score-row .sv { width: 42px; text-align: center; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--accent-ink); }

.hist-item { padding: 13px 15px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--line); margin-bottom: 8px; }
.hist-item .h { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.hist-item .h em { font-style: normal; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.hist-item .p { font-size: 13px; color: var(--ink-2); margin-top: 6px; white-space: pre-wrap; word-break: break-word; }

/* ---------- 驾驶舱 ---------- */
.hero {
  margin-top: 12px; padding: 20px; border-radius: var(--radius-l);
  background: linear-gradient(160deg, #1B2027, #0F1317); color: #fff;
  box-shadow: var(--shadow-2); position: relative; overflow: hidden;
}
@media (prefers-color-scheme: dark) { .hero { background: linear-gradient(160deg, #1D2A2A, #141A1F); border: 1px solid var(--line); } }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 100% 0%, rgba(43, 192, 142, .3), transparent 62%);
}
.hero .h-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; }
.hero .h-k { font-size: 11.5px; letter-spacing: .18em; color: rgba(255, 255, 255, .5); text-transform: uppercase; }
.hero .h-v { font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1.08; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hero .h-v small { font-size: 16px; font-weight: 400; color: rgba(255, 255, 255, .5); margin-left: 2px; }
.hero .h-sub { font-size: 12.5px; color: rgba(255, 255, 255, .6); margin-top: 6px; }
.hero .kpis { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.hero .kpis div { font-size: 11.5px; color: rgba(255, 255, 255, .5); }
.hero .kpis b { display: block; font-size: 21px; font-weight: 600; color: #fff; letter-spacing: -.02em; margin-top: 2px; }

.co-grid { display: grid; gap: 9px; margin-top: 10px; }
.co-card { padding: 14px 15px; border-radius: var(--radius); background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.co-card .c-top { display: flex; align-items: center; gap: 9px; }
.co-card .c-badge {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff; flex: none;
}
.co-card .c-nm { font-size: 14px; font-weight: 600; }
.co-card .c-ds { font-size: 11.5px; color: var(--ink-3); }
.co-card .c-rate { margin-left: auto; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.co-card .c-meta { display: flex; gap: 14px; margin-top: 10px; font-size: 11.5px; color: var(--ink-3); }
.co-card .c-meta b { color: var(--ink-2); font-weight: 600; }

.chart-card { padding: 16px 14px 10px; margin-top: 12px; }
.chart-card .c-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 3px 10px; }
.chart-card .c-head .t { font-size: 13.5px; font-weight: 600; }
.chart-card .c-head .s { font-size: 11.5px; color: var(--ink-3); }
.bars { display: flex; align-items: flex-end; gap: 5px; height: 108px; padding: 0 2px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; height: 100%; position: relative; }
.bars .col .bwrap { width: 100%; display: flex; flex-direction: column; justify-content: flex-end; flex: 1; }
.bars .col .tot { width: 100%; background: var(--bg-sunken); border-radius: 4px 4px 0 0; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; min-height: 2px; }
.bars .col .dn { width: 100%; background: var(--accent); border-radius: 0 0 0 0; min-height: 0; transition: height .5s var(--ease); }
.bars .col .lb { font-size: 9.5px; color: var(--ink-3); margin-top: 5px; letter-spacing: -.02em; }
.bars .col .vl { font-size: 9.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-bottom: 2px; height: 11px; }

.menu-list { margin-top: 18px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 16px; background: var(--bg-elev); border: 1px solid var(--line);
  border-bottom: none; text-align: left; font-size: 14.5px;
}
.menu-item:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.menu-item:last-child { border-radius: 0 0 var(--radius) var(--radius); border-bottom: 1px solid var(--line); }
.menu-item .mi-ic { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-sunken); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.menu-item .mi-ic svg { width: 15px; height: 15px; }
.menu-item .mi-t { flex: 1; }
.menu-item .mi-t small { display: block; font-size: 11.5px; color: var(--ink-3); }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; align-items: stretch;
  background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 500; letter-spacing: .02em;
  transition: color .2s; position: relative;
}
.tabbar button svg { width: 21px; height: 21px; }
.tabbar button.on { color: var(--accent-ink); }
.tabbar button.on .dot-ind { opacity: 1; transform: none; }
.tabbar .dot-ind {
  position: absolute; top: 6px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); opacity: 0; transform: translateY(3px); transition: all .25s var(--ease);
}

/* ---------- 抽屉 / 弹窗 ---------- */
.sheet-mask, .modal-mask {
  position: fixed; inset: 0; background: rgba(8, 11, 15, .42);
  backdrop-filter: blur(2px); z-index: 50;
  opacity: 0; pointer-events: none; transition: opacity .26s var(--ease);
}
.sheet-mask.on, .modal-mask.on { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg-elev); border-radius: 24px 24px 0 0;
  transform: translateY(100%); transition: transform .32s var(--ease);
  box-shadow: 0 -12px 40px -12px rgba(0, 0, 0, .3);
}
.sheet.on { transform: none; }
.sheet-grip { padding: 9px 0 4px; display: grid; place-items: center; flex: none; }
.sheet-grip i { width: 36px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 20px 12px; flex: none; }
.sheet-head .st { font-size: 16px; font-weight: 600; flex: 1; }
.sheet-body { overflow-y: auto; padding: 0 20px calc(20px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 20px calc(14px + var(--safe-b)); border-top: 1px solid var(--line); display: flex; gap: 9px; flex: none; }

.field-line { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
.field-line:last-of-type { border-bottom: none; }
.field-line .fl-k { font-size: 13.5px; color: var(--ink-2); }
.field-line .fl-v { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.field-line input, .field-line select, .field-line textarea {
  border: none; background: none; outline: none; text-align: right; font-size: 14px; max-width: 60%;
}
.field-line textarea { text-align: left; width: 100%; max-width: 100%; min-height: 60px; background: var(--bg-sunken); border-radius: 10px; padding: 9px 11px; }
.field-col { padding: 12px 0; border-bottom: 1px solid var(--line); }
.field-col .fl-k { font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 8px; }
.field-col textarea {
  width: 100%; background: var(--bg-sunken); border: 1px solid transparent;
  border-radius: 10px; padding: 10px 12px; outline: none; resize: vertical;
  font-size: 14.5px; line-height: 1.6; min-height: 62px;
  transition: border-color .2s, box-shadow .2s;
}
.field-col textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-col textarea::placeholder { color: var(--ink-3); }
.sheet-body > .field-col:first-child { padding-top: 2px; border-bottom: none; }
.sheet-body > .field-col:first-child textarea {
  background: transparent; border: none; padding: 0; min-height: 0;
  font-size: 18px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; resize: none;
}

.status-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.status-pick button {
  padding: 9px 4px; border-radius: 10px; font-size: 12.5px; font-weight: 500;
  background: var(--bg-sunken); color: var(--ink-2); border: 1px solid transparent;
  transition: all .18s var(--ease);
}
.status-pick button.on { background: var(--ink); color: var(--bg-elev); }

.progress-pick { display: flex; align-items: center; gap: 12px; }
.progress-pick input[type="range"] { flex: 1; accent-color: var(--accent); height: 28px; }
.progress-pick b { width: 44px; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; }

.log-list li { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.log-list li:last-child { border-bottom: none; }
.log-list .lg-t { color: var(--ink-3); font-size: 11.5px; margin-bottom: 3px; }
.log-list .lg-c { color: var(--ink-2); white-space: pre-wrap; }

.modal {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.96);
  width: min(340px, calc(100vw - 48px)); z-index: 52;
  background: var(--bg-elev); border-radius: 18px; padding: 20px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none; transition: all .24s var(--ease);
}
.modal.on { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal .m-t { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.modal .m-d { font-size: 13.5px; color: var(--ink-2); margin-bottom: 18px; }
.modal .m-a { display: flex; gap: 9px; }
.modal .m-a button { flex: 1; padding: 12px; border-radius: 11px; font-size: 14px; font-weight: 600; }
.modal .m-a .cancel { background: var(--bg-sunken); color: var(--ink-2); }
.modal .m-a .ok { background: var(--danger); color: #fff; }
.modal .m-a .ok.safe { background: var(--accent); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  transform: translate(-50%, 12px); z-index: 70;
  background: var(--ink); color: var(--bg-elev);
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .26s var(--ease);
  max-width: calc(100vw - 48px); text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 桌面适配 ---------- */
@media (min-width: 900px) {
  :root { --tab-h: 0px; }
  body { padding-bottom: 0; }
  .tabbar {
    position: fixed; left: 0; top: 0; bottom: 0; right: auto; width: 210px;
    height: 100dvh; flex-direction: column; justify-content: flex-start;
    padding: 26px 14px; border-top: none; border-right: 1px solid var(--line);
    gap: 4px;
  }
  .tabbar button {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 12px 14px; border-radius: 12px; font-size: 14px;
  }
  .tabbar button.on { background: var(--accent-soft); }
  .tabbar .dot-ind { display: none; }
  #app.on { padding-left: 210px; }
  main { padding-bottom: 40px; max-width: 820px; }
  .topbar { padding-top: 20px; }
  .sheet { left: 50%; right: auto; width: 520px; transform: translate(-50%, 100%); border-radius: 24px 24px 0 0; }
  .sheet.on { transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
