/*
 * 场景工作台 · 公共样式（v2）
 * 颜色全部来自 palettes.css 里的变量，这里只写结构和组件。
 * 手机优先：窄屏底部导航，宽屏（≥ 960px）左侧导航 + 双栏。
 */

@font-face {
  font-family: 'WB Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(fonts/inter-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font: 'WB Inter', 'HarmonyOS Sans SC', 'MiSans', 'Noto Sans SC', 'Source Han Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  --r-xl: 28px; --r-lg: 22px; --r-md: 16px; --r-sm: 11px;
  --blur: 26px; --sat: 170%;
  --ease: cubic-bezier(.3, .7, .2, 1); --fast: 160ms; --mid: 240ms;
  --gap: 16px; --pad: 18px; --grain: .07;
  --side-w: 236px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; font-variant-numeric: tabular-nums;
}
html.ready body, html.ready .glass, html.ready .btn, html.ready input, html.ready select, html.ready textarea {
  transition: background-color var(--mid) var(--ease), color var(--mid) var(--ease), border-color var(--mid) var(--ease);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex: none; display: block; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ---------- 背景 ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg); }
.bg i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--blob-opacity, .9); animation: drift 40s ease-in-out infinite alternate; }
.bg i:nth-child(1) { width: 62vmax; height: 62vmax; left: -22vmax; top: -30vmax; background: var(--c1); }
.bg i:nth-child(2) { width: 48vmax; height: 48vmax; right: -18vmax; top: 6vh; background: var(--c2); animation-duration: 48s; animation-delay: -12s; }
.bg i:nth-child(3) { width: 52vmax; height: 52vmax; left: 14vw; bottom: -34vmax; background: var(--c3); animation-duration: 56s; animation-delay: -24s; }
.bg i:nth-child(4) { width: 30vmax; height: 30vmax; right: 2vw; bottom: -10vmax; background: var(--c4); animation-duration: 44s; animation-delay: -6s; }
@keyframes drift { 0% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(4vw,-3vh,0) scale(1.06); } 100% { transform: translate3d(-3vw,4vh,0) scale(.96); } }
.bg .grain {
  position: absolute; inset: 0; opacity: var(--grain); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 玻璃 ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat)); backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  border: 1px solid var(--stroke); box-shadow: inset 0 1px 0 var(--hl), var(--shadow); border-radius: var(--r-lg);
}

/* ---------- 应用框架 ---------- */
.app { min-height: 100vh; }
.main { padding: 0 16px calc(104px + var(--safe-b)); max-width: 640px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 18px 2px 14px; }
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent); flex: none; box-shadow: 0 6px 16px -8px var(--accent); }
.brand-mark .ico { width: 22px; height: 22px; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .02em; line-height: 1.2; }
.brand-slogan { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .page-title { display: none; font-size: 22px; font-weight: 700; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.date-chip { font-size: 12.5px; color: var(--text-2); padding: 6px 12px; border-radius: 999px; white-space: nowrap; }

.sidebar { display: none; }
.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 24px; max-width: 616px; margin: 0 auto;
  background: var(--glass-2);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 5px; border-radius: 16px; font-size: 11px; color: var(--text-3); transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.tab .ico { width: 22px; height: 22px; }
.tab.on { color: var(--accent); background: var(--accent-soft); }
.fab {
  position: fixed; right: 20px; bottom: calc(92px + var(--safe-b)); z-index: 21;
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -8px var(--accent), inset 0 1px 0 rgba(255,255,255,.3);
  transition: transform var(--fast) var(--ease);
}
.fab:active { transform: scale(.94); }
.fab .ico { width: 26px; height: 26px; stroke-width: 2; }

/* 首页：手机上单列并按 order 排序，宽屏变左右两栏 */
.home { display: flex; flex-direction: column; gap: var(--gap); }
.home > .col { display: contents; }
@media (min-width: 960px) {
  .home { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
  .home > .col { display: flex; }
  .home > .demo-banner { grid-column: 1 / -1; }
}
.view { display: flex; flex-direction: column; gap: var(--gap); animation: fade var(--mid) var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 16px; height: calc(100vh - 32px);
    margin: 16px 0 16px 16px; padding: 18px 14px; border-radius: var(--r-xl);
  }
  .sidebar .brand { padding: 4px 6px 18px; }
  .side-nav { display: flex; flex-direction: column; gap: 4px; }
  .side-nav .tab { flex-direction: row; gap: 12px; padding: 11px 14px; font-size: 14.5px; color: var(--text-2); border-radius: 14px; }
  .side-nav .tab:hover { background: var(--hover); color: var(--text); }
  .side-nav .tab.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
  .side-foot { margin-top: auto; padding: 12px 8px 2px; font-size: 12px; color: var(--text-3); line-height: 1.6; border-top: 1px solid var(--line); }
  .main { max-width: 1180px; width: 100%; padding: 0 28px 40px; margin: 0; }
  .topbar { padding: 26px 0 18px; }
  .topbar .brand { display: none; }
  .topbar .page-title { display: block; }
  .tabbar { display: none; }
  .fab { right: 32px; bottom: 32px; }
  .grid-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
  .grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
}

/* ---------- 卡片和分区 ---------- */
.card { padding: var(--pad); min-width: 0; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sec-head h2, .sec-head h3 { font-size: 15.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.sec-head h2 .ico { width: 18px; height: 18px; color: var(--accent); }
.sec-head .sub { font-size: 12px; color: var(--text-3); }
.sec-head .link { margin-left: auto; font-size: 12.5px; color: var(--accent); display: inline-flex; align-items: center; gap: 2px; padding: 4px 6px; border-radius: 8px; }
.sec-head .link:hover { background: var(--hover); }
.sec-head .link .ico { width: 14px; height: 14px; }

/* ---------- 首页大卡片 ---------- */
.hero {
  position: relative; overflow: hidden; padding: 20px 20px 18px; border-radius: var(--r-xl);
  color: var(--hero-ink); background: var(--hero); border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 18px 40px -20px var(--accent);
}
.hero-art { position: absolute; right: -10px; top: -10px; width: 210px; height: 190px; opacity: .9; pointer-events: none; }
.hero > *:not(.hero-art) { position: relative; }
.hero-eyebrow { font-size: 12.5px; opacity: .82; display: flex; align-items: center; gap: 6px; }
.hero-title { font-size: 19px; font-weight: 700; margin-top: 6px; line-height: 1.35; max-width: 78%; }
.hero-big { display: flex; align-items: baseline; gap: 6px; margin-top: 12px; }
.hero-big b { font-size: 44px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.hero-big span { font-size: 14px; opacity: .85; }
.hero-sub { font-size: 12.5px; opacity: .82; margin-top: 6px; }
.hero-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.25); margin-top: 14px; overflow: hidden; }
.hero-bar i { display: block; height: 100%; border-radius: inherit; background: rgba(255,255,255,.95); transition: width 600ms var(--ease); }
.hero-bar-meta { display: flex; justify-content: space-between; font-size: 12px; opacity: .82; margin-top: 6px; }
.hero-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.hero-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  background: rgba(255,255,255,.95); color: #1d1d1f; box-shadow: 0 6px 16px -8px rgba(0,0,0,.35); transition: transform var(--fast) var(--ease);
}
.hero-btn .ico { width: 17px; height: 17px; }
.hero-btn.ghost { background: rgba(255,255,255,.18); color: inherit; box-shadow: none; border: 1px solid rgba(255,255,255,.3); }
.hero-btn:active { transform: scale(.97); }
[data-palette="jijian"][data-theme="dark"] .hero-btn { background: #111; color: #fff; }
[data-palette="jijian"][data-theme="dark"] .hero-btn.ghost { background: rgba(0,0,0,.08); border-color: rgba(0,0,0,.2); color: #111; }
[data-palette="jijian"][data-theme="dark"] .hero-bar { background: rgba(0,0,0,.15); }
[data-palette="jijian"][data-theme="dark"] .hero-bar i { background: #111; }

/* ---------- 提醒 ---------- */
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); background: var(--field); border: 1px solid var(--field-stroke); }
.alert .a-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.alert .a-ico .ico { width: 17px; height: 17px; }
.alert.warn .a-ico { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.alert.danger .a-ico { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.alert.ok .a-ico { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.alert-text { flex: 1; min-width: 0; }
.alert-text b { display: block; font-size: 13.5px; font-weight: 600; }
.alert-text span { font-size: 12.5px; color: var(--text-2); }
.alert .a-go { align-self: center; color: var(--text-3); }
.alert .a-go .ico { width: 16px; height: 16px; }
button.alert { width: 100%; transition: background-color var(--fast) var(--ease); }
button.alert:hover { background: var(--hover); }

/* ---------- 列表行 ---------- */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border-radius: 12px; min-height: 52px; transition: background-color var(--fast) var(--ease); }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: var(--hover); }
.row:hover + .row { border-top-color: transparent; }
.row-main { flex: 1; min-width: 0; cursor: pointer; }
.row-title { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.row-right { text-align: right; font-size: 13px; color: var(--text-2); white-space: nowrap; flex: none; }
.row-right b { display: block; font-size: 15px; color: var(--text); font-weight: 650; }
.row-time { font-size: 12.5px; color: var(--text-2); width: 44px; flex: none; font-variant-numeric: tabular-nums; }
.row .row-ico { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.row .row-ico .ico { width: 18px; height: 18px; }
.row-btns { display: flex; gap: 6px; flex: none; }
.done .row-title { color: var(--text-3); text-decoration: line-through; }
.check {
  width: 22px; height: 22px; border-radius: 50%; flex: none; border: 1.7px solid var(--text-3);
  display: grid; place-items: center; color: transparent; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
.check .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.check:hover { border-color: var(--accent); }
.done .check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.empty { padding: 22px 8px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty .btn { margin-top: 10px; }

/* 标签 */
.chip { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.chip.c1 { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.chip.c2 { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.chip.c3 { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip.c4 { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.chip.c5 { background: var(--field); color: var(--text-2); border: 1px solid var(--field-stroke); }

/* ---------- 数据格子 ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { padding: 14px 14px 12px; border-radius: var(--r-md); background: var(--field); border: 1px solid var(--field-stroke); min-width: 0; display: flex; flex-direction: column; }
.stat-label { font-size: 12px; color: var(--text-2); }
.stat-val { display: flex; align-items: baseline; gap: 4px; margin-top: 6px; }
.stat-val b { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-val span { font-size: 12px; color: var(--text-2); }
.stat-sub { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.stat-sub.up { color: var(--ok); }
.stat-sub.down { color: var(--danger); }
.stat .spark { margin-top: 8px; height: 30px; width: 100%; }
.stat.feature { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.stat.feature .stat-label, .stat.feature .stat-val span, .stat.feature .stat-sub { color: inherit; opacity: .8; }
.stat.feature .chart .line { stroke: var(--accent-ink); opacity: .85; }
@media (max-width: 480px) { .date-time { display: none; } }

/* ---------- 快捷操作 ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.q-btn { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 4px 10px; border-radius: var(--r-md); font-size: 12px; color: var(--text-2); transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.q-btn:hover { background: var(--hover); color: var(--text); }
.q-btn:active { transform: scale(.96); }
.q-btn .q-ico { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: var(--field); border: 1px solid var(--field-stroke); color: var(--accent); }
.q-btn .q-ico .ico { width: 21px; height: 21px; }

/* ---------- 进度条小部件 ---------- */
.meter-top { display: flex; align-items: baseline; gap: 6px; }
.meter-top b { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.meter-top span { font-size: 13px; color: var(--text-2); }
.meter-bar { height: 10px; border-radius: 999px; background: var(--field); border: 1px solid var(--field-stroke); margin: 10px 0 12px; overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 500ms var(--ease); }
.meter-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--text-2); transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm .ico { width: 16px; height: 16px; }
.icon-btn.glass { border-radius: 50%; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px;
  background: var(--field); border: 1px solid var(--field-stroke); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background-color var(--fast) var(--ease), transform var(--fast) var(--ease), filter var(--fast) var(--ease);
}
.btn .ico { width: 17px; height: 17px; }
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 6px 18px -8px var(--accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn.block { width: 100%; height: 44px; }

/* 分段选择 */
.seg { display: flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--field); border: 1px solid var(--field-stroke); overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1; padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--text-2); white-space: nowrap; text-align: center; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.seg button.on { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 500; }

/* ---------- 表单 ---------- */
input:not([type]), input[type="text"], input[type="number"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  width: 100%; background: var(--field); border: 1px solid var(--field-stroke); border-radius: var(--r-sm);
  padding: 10px 12px; outline: none; min-width: 0; font-size: 14.5px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { color: #222; background: #fff; }
[data-theme="dark"] input[type="date"], [data-theme="dark"] input[type="time"] { color-scheme: dark; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.field > label, .field > .lbl { font-size: 12.5px; color: var(--text-2); display: flex; gap: 4px; }
.field .req { color: var(--danger); }
.field-row { display: flex; gap: 12px; }
.unit-wrap { position: relative; }
.unit-wrap input { padding-right: 48px; }
.unit-wrap .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12.5px; color: var(--text-3); pointer-events: none; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--field); border: 1px solid var(--field-stroke); cursor: pointer; }
.toggle input { width: 20px; height: 20px; accent-color: var(--accent); }
.hint { font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.hint.err { color: var(--danger); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.form-actions .grow { flex: 1; }

/* ---------- 底部弹层 / 对话框 ---------- */
dialog.sheet {
  padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  color: var(--text); background: var(--glass-2); border: 1px solid var(--stroke); border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 40px -10px rgba(0,0,0,.3);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(var(--sat)); backdrop-filter: blur(var(--blur)) saturate(var(--sat));
  animation: up var(--mid) var(--ease);
}
dialog.sheet::backdrop { background: var(--scrim, rgba(10,12,20,.3)); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-inner { padding: 10px 20px calc(22px + var(--safe-b)); }
.sheet-grip { width: 38px; height: 5px; border-radius: 999px; background: var(--line-strong); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { font-size: 17px; font-weight: 650; }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; border-radius: var(--r-xl); max-width: 480px; animation-name: pop; }
  .sheet-grip { display: none; }
  .sheet-inner { padding: 20px 22px 22px; }
  @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
}

/* ---------- 计划页：周历 ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 14px; font-size: 11.5px; color: var(--text-3); position: relative; transition: background-color var(--fast) var(--ease); }
.day b { font-size: 16px; color: var(--text); font-weight: 600; }
.day:hover { background: var(--hover); }
.day.today b { color: var(--accent); }
.day.on { background: var(--accent); color: var(--accent-ink); }
.day.on b { color: var(--accent-ink); }
.day .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); opacity: 0; }
.day .dot.has { opacity: 1; }
.day.on .dot { background: var(--accent-ink); }
.week-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 14px; font-weight: 600; }

/* ---------- 图表 ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 10.5px; fill: var(--text-3); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--accent); }
.chart .bar.dim { fill: var(--accent-soft); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent); opacity: .12; }
.chart .pt { fill: var(--glass-2); stroke: var(--accent); stroke-width: 2; }
.chart .goal { stroke: var(--accent-2); stroke-dasharray: 4 4; stroke-width: 1.4; }
.chart .val { fill: var(--text-2); font-weight: 600; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.hbar-top span { color: var(--text-2); }
.hbar-track { height: 8px; border-radius: 999px; background: var(--field); border: 1px solid var(--field-stroke); overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.hbars > div:nth-child(5n+2) .hbar-track i { background: var(--accent-2); }
.hbars > div:nth-child(5n+3) .hbar-track i { background: var(--ok); }
.hbars > div:nth-child(5n+4) .hbar-track i { background: var(--warn); }
.hbars > div:nth-child(5n+5) .hbar-track i { background: var(--text-3); }
.ring { display: block; }
.ring circle { fill: none; }
.ring .r-bg { stroke: var(--line-strong); }
.ring .r-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 600ms var(--ease); }
.insight-note { font-size: 12.5px; color: var(--text-2); margin-top: 10px; line-height: 1.6; }

/* ---------- 专注计时 ---------- */
.focus-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 6px 0; }
.focus-ring { position: relative; width: 220px; height: 220px; }
.focus-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.focus-ring circle { fill: none; stroke-width: 7; }
.focus-time { position: absolute; inset: 0; display: grid; place-items: center; font-size: 52px; font-weight: 300; letter-spacing: -.02em; }
.focus-bar { position: sticky; top: 8px; z-index: 15; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px; font-size: 13.5px; }
.focus-bar b { font-variant-numeric: tabular-nums; }
.focus-bar .grow { flex: 1; }

/* ---------- 我的 ---------- */
.palettes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pal { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: var(--r-md); border: 1.5px solid transparent; font-size: 12.5px; color: var(--text-2); transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.pal:hover { background: var(--hover); }
.pal.on { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.pal-sw { width: 100%; height: 40px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.menu { display: flex; flex-direction: column; }
.menu .row { cursor: pointer; }
.demo-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: var(--r-md); font-size: 13px; background: var(--accent-soft); color: var(--text); }
.demo-banner .grow { flex: 1; }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); z-index: 60; transform: translate(-50%, 14px);
  padding: 10px 18px; border-radius: 999px; font-size: 13.5px; background: var(--glass-2); max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none; transition: opacity var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 960px) { .toast { bottom: 36px; } }

@media (max-width: 380px) {
  .quick { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .hero-big b { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* xiaowu 2026-11-25: iOS touch and input compatibility */
@media (max-width: 700px) {
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; max-width: 100%; }
  .row-btns { display: flex; flex-wrap: wrap; gap: 6px; }
  .row-btns .btn { min-height: 44px; white-space: normal; }
  .row-main, .row-title, .row-meta { min-width: 0; overflow-wrap: anywhere; }
  body { -webkit-text-size-adjust: 100%; }
}
/* Keep review controls on a separate line on narrow touch screens. */
@media (max-width: 700px) {
  .row { flex-wrap: wrap; }
  .row-btns { flex: 0 0 100%; width: 100%; min-width: 0; max-width: 100%; }
  .row-btns .btn { flex: 1 1 auto; min-width: 0; }
  .row-main { flex: 1 1 120px; }
}

.xw-board {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0;color:var(--text-2);}
.xw-board>div {background:var(--hover);border-radius:10px;padding:10px;overflow-wrap:anywhere;}
.xw-board b {color:var(--text);font-size:18px;}
#xw-print {display:none;}
@media print {
  body>*:not(#xw-print){display:none!important;}
  body{background:white!important;color:black!important;}
  #xw-print {display:block!important;color:black;background:white;padding:1cm;white-space:pre-wrap;}
  #xw-print p{break-inside:avoid;margin:0 0 1.2cm;}
}
