/* ---------- 字体：Apple 设备直接用 SF / 苹方；Windows / 安卓回落到自托管 Inter（拉丁）+ MiSans VF（中文） ---------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --font-ui: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-num: -apple-system, BlinkMacSystemFont, "Inter", "MiSans", sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-apple-spring: cubic-bezier(0.22, 1.12, 0.36, 1);
  --ease-apple-snappy: cubic-bezier(0.22, 1.18, 0.36, 1);

  /* iPadOS 26 浅色液态玻璃色系（通透极光底 + 棱镜菲涅尔玻璃边，120fps 零重绘） */
  --bg-base: #eaf0fa;
  --wallpaper-grad:
    radial-gradient(960px circle at 8% 6%, rgba(82, 162, 255, 0.44), transparent 54%),
    radial-gradient(640px circle at 32% 46%, rgba(92, 212, 255, 0.24), transparent 52%),
    radial-gradient(820px circle at 92% 10%, rgba(255, 146, 202, 0.34), transparent 52%),
    radial-gradient(900px circle at 64% 94%, rgba(112, 224, 192, 0.34), transparent 58%);

  --widget-bg: linear-gradient(155deg, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.68) 54%, rgba(246, 250, 255, 0.80) 100%);
  --widget-border: rgba(255, 255, 255, 0.65);
  --widget-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.96),
    inset 0 -1px 1px rgba(110, 170, 255, 0.18),
    0 1px 3px rgba(15, 23, 42, 0.04),
    0 18px 42px -16px rgba(24, 42, 88, 0.14);

  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(130, 206, 255, 0.56) 28%, rgba(255, 255, 255, 0.20) 52%, rgba(255, 164, 218, 0.42) 78%, rgba(255, 255, 255, 0.82) 100%);
  --lg-sheen: radial-gradient(circle, rgba(255, 255, 255, 0.72) 0%, rgba(180, 226, 255, 0.24) 36%, transparent 70%);

  --chrome-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.70) 0%, rgba(255, 255, 255, 0.44) 55%, rgba(255, 255, 255, 0.60) 100%);
  --chrome-border: rgba(255, 255, 255, 0.72);
  --chrome-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(120, 175, 255, 0.20),
    0 14px 38px -8px rgba(15, 28, 60, 0.16),
    0 0 0 0.5px rgba(15, 23, 42, 0.06);

  --lens-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(244, 249, 255, 0.78) 100%);
  --lens-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 1),
    inset 0 -1px 1px rgba(0, 122, 255, 0.14),
    0 4px 14px -2px rgba(15, 28, 60, 0.14),
    0 0 0 0.5px rgba(255, 255, 255, 0.8);

  --fill-secondary: rgba(118, 118, 128, 0.08);
  --fill-tertiary: rgba(118, 118, 128, 0.12);
  --fill-hover: rgba(118, 118, 128, 0.14);
  --separator: rgba(60, 60, 67, 0.16);

  --text-primary: #000000;
  --text-secondary: #6e6e73;
  --text-muted: #8e8e93;

  --ios-blue: #007aff;
  --ios-blue-soft: rgba(0, 122, 255, 0.11);
  --ios-green: #34c759;
  --ios-green-text: #248a3d;
  --ios-green-soft: rgba(52, 199, 89, 0.13);
  --ios-green-border: rgba(52, 199, 89, 0.36);
  --ios-coral: #ff3b30;
  --ios-coral-soft: rgba(255, 59, 48, 0.11);
  --ios-amber: #ff9500;
  --ios-amber-text: #c93400;
  --ios-amber-soft: rgba(255, 149, 0, 0.12);
  --ios-amber-border: rgba(255, 149, 0, 0.36);
  --ios-indigo: #5856d6;
  --ios-indigo-soft: rgba(88, 86, 214, 0.12);
  --sheet-bg: #ffffff;
  --sheet-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.99) 0%, #f5f7fb 100%);
  --zen-pill-bg: linear-gradient(160deg, rgba(255, 255, 255, 0.92) 0%, rgba(246, 248, 252, 0.86) 100%);
  --scrollbar-thumb: rgba(60, 60, 67, 0.22);
  --scrollbar-thumb-hover: rgba(60, 60, 67, 0.40);

  --heat-0: rgba(118, 118, 128, 0.12);
  --heat-1: rgba(52, 199, 89, 0.3);
  --heat-2: rgba(52, 199, 89, 0.55);
  --heat-3: rgba(52, 199, 89, 0.8);
  --heat-4: #28a745;

  /* iOS 搜索框式填充输入框 */
  --input-bg: rgba(118, 118, 128, 0.12);
  --input-bg-focus: rgba(118, 118, 128, 0.16);
  --input-border: transparent;
  --check-border: #c7c7cc;
  --toggle-off: rgba(120, 120, 128, 0.16);

  --seg-active-bg: #ffffff;
  --seg-active-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);

  --toast-bg: rgba(28, 28, 30, 0.92);
  --toast-text: #ffffff;
}

/* iPadOS 26 深色液态玻璃：纯黑深邃极光底 + 棱镜镜面玻璃材质 */
[data-theme="dark"] {
  color-scheme: dark;
  --bg-base: #000000;
  --wallpaper-grad:
    radial-gradient(960px circle at 10% 8%, rgba(10, 132, 255, 0.28), transparent 54%),
    radial-gradient(720px circle at 48% 34%, rgba(94, 92, 230, 0.17), transparent 54%),
    radial-gradient(800px circle at 92% 12%, rgba(255, 55, 95, 0.18), transparent 52%),
    radial-gradient(920px circle at 60% 96%, rgba(48, 209, 88, 0.16), transparent 58%);

  --widget-bg: linear-gradient(155deg, rgba(44, 45, 52, 0.84) 0%, rgba(24, 24, 28, 0.78) 54%, rgba(30, 32, 40, 0.82) 100%);
  --widget-border: rgba(255, 255, 255, 0.08);
  --widget-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.24),
    inset 0 -1px 1px rgba(10, 132, 255, 0.14),
    0 20px 46px -14px rgba(0, 0, 0, 0.76);

  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(90, 200, 250, 0.34) 28%, rgba(255, 255, 255, 0.07) 52%, rgba(255, 105, 180, 0.24) 78%, rgba(255, 255, 255, 0.28) 100%);
  --lg-sheen: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(90, 200, 250, 0.11) 36%, transparent 70%);

  --chrome-bg: linear-gradient(160deg, rgba(50, 52, 60, 0.64) 0%, rgba(24, 25, 30, 0.48) 55%, rgba(36, 38, 46, 0.58) 100%);
  --chrome-border: rgba(255, 255, 255, 0.14);
  --chrome-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.34),
    inset 0 -1px 1px rgba(10, 132, 255, 0.16),
    0 18px 46px -10px rgba(0, 0, 0, 0.80),
    0 0 0 0.5px rgba(255, 255, 255, 0.08);

  --lens-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.12) 100%);
  --lens-shadow:
    inset 0 1px 0.5px rgba(255, 255, 255, 0.42),
    inset 0 -1px 1px rgba(90, 200, 250, 0.20),
    0 4px 14px -2px rgba(0, 0, 0, 0.45);

  --fill-secondary: rgba(118, 118, 128, 0.18);
  --fill-tertiary: rgba(118, 118, 128, 0.24);
  --fill-hover: rgba(118, 118, 128, 0.28);
  --separator: rgba(84, 84, 88, 0.55);

  --text-primary: #ffffff;
  --text-secondary: #aeaeb2;
  --text-muted: #8e8e93;

  --ios-blue: #0a84ff;
  --ios-blue-soft: rgba(10, 132, 255, 0.2);
  --ios-green: #30d158;
  --ios-green-text: #30d158;
  --ios-green-soft: rgba(48, 209, 88, 0.17);
  --ios-green-border: rgba(48, 209, 88, 0.38);
  --ios-coral: #ff453a;
  --ios-coral-soft: rgba(255, 69, 58, 0.18);
  --ios-amber: #ff9f0a;
  --ios-amber-text: #ff9f0a;
  --ios-amber-soft: rgba(255, 159, 10, 0.17);
  --ios-amber-border: rgba(255, 159, 10, 0.38);
  --ios-indigo: #5e5ce6;
  --ios-indigo-soft: rgba(94, 92, 230, 0.22);
  --sheet-bg: #1c1c1e;
  --sheet-surface: linear-gradient(180deg, #252529 0%, #1c1c1e 100%);
  --zen-pill-bg: linear-gradient(160deg, rgba(44, 46, 54, 0.92) 0%, rgba(28, 29, 34, 0.88) 100%);
  --scrollbar-thumb: rgba(235, 235, 245, 0.22);
  --scrollbar-thumb-hover: rgba(235, 235, 245, 0.40);

  --heat-0: rgba(118, 118, 128, 0.2);
  --heat-1: rgba(48, 209, 88, 0.3);
  --heat-2: rgba(48, 209, 88, 0.55);
  --heat-3: rgba(48, 209, 88, 0.8);
  --heat-4: #4be381;

  --input-bg: rgba(118, 118, 128, 0.24);
  --input-bg-focus: rgba(118, 118, 128, 0.3);
  --input-border: transparent;
  --check-border: #545458;
  --toggle-off: rgba(120, 120, 128, 0.32);

  --seg-active-bg: #636366;
  --seg-active-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);

  --toast-bg: rgba(242, 242, 247, 0.95);
  --toast-text: #000000;
}

/* 4 套静态极光壁纸色系（glacier 为默认，零每帧重绘开销，联动 --lg-rim 与 --lg-sheen） */
[data-wallpaper="lavender"] {
  --bg-base: #f2eefb;
  --wallpaper-grad:
    radial-gradient(940px circle at 10% 8%, rgba(152, 128, 255, 0.42), transparent 54%),
    radial-gradient(680px circle at 34% 48%, rgba(120, 180, 255, 0.26), transparent 54%),
    radial-gradient(840px circle at 90% 10%, rgba(255, 134, 200, 0.36), transparent 52%),
    radial-gradient(880px circle at 64% 94%, rgba(255, 194, 166, 0.34), transparent 58%);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(182, 156, 255, 0.56) 28%, rgba(255, 255, 255, 0.20) 52%, rgba(255, 148, 212, 0.44) 78%, rgba(255, 255, 255, 0.84) 100%);
  --lg-sheen: radial-gradient(circle, rgba(255, 255, 255, 0.72) 0%, rgba(204, 184, 255, 0.26) 38%, transparent 70%);
}
[data-theme="dark"][data-wallpaper="lavender"] {
  --bg-base: #040308;
  --wallpaper-grad:
    radial-gradient(960px circle at 10% 8%, rgba(148, 108, 255, 0.28), transparent 54%),
    radial-gradient(720px circle at 48% 34%, rgba(88, 86, 214, 0.20), transparent 54%),
    radial-gradient(820px circle at 92% 12%, rgba(255, 92, 168, 0.18), transparent 52%),
    radial-gradient(900px circle at 60% 96%, rgba(100, 168, 255, 0.15), transparent 58%);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.40) 0%, rgba(172, 144, 255, 0.34) 28%, rgba(255, 255, 255, 0.07) 52%, rgba(255, 114, 186, 0.26) 78%, rgba(255, 255, 255, 0.28) 100%);
  --lg-sheen: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(172, 144, 255, 0.12) 38%, transparent 70%);
}

[data-wallpaper="forest"] {
  --bg-base: #eaf5f0;
  --wallpaper-grad:
    radial-gradient(960px circle at 8% 8%, rgba(72, 208, 152, 0.40), transparent 54%),
    radial-gradient(660px circle at 36% 46%, rgba(102, 212, 232, 0.26), transparent 54%),
    radial-gradient(820px circle at 90% 10%, rgba(154, 224, 138, 0.36), transparent 52%),
    radial-gradient(900px circle at 62% 94%, rgba(248, 218, 136, 0.30), transparent 58%);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(108, 224, 178, 0.52) 28%, rgba(255, 255, 255, 0.20) 52%, rgba(132, 218, 234, 0.42) 78%, rgba(255, 255, 255, 0.84) 100%);
  --lg-sheen: radial-gradient(circle, rgba(255, 255, 255, 0.72) 0%, rgba(154, 232, 198, 0.24) 38%, transparent 70%);
}
[data-theme="dark"][data-wallpaper="forest"] {
  --bg-base: #020705;
  --wallpaper-grad:
    radial-gradient(960px circle at 10% 8%, rgba(48, 209, 88, 0.24), transparent 54%),
    radial-gradient(720px circle at 48% 36%, rgba(64, 200, 224, 0.17), transparent 54%),
    radial-gradient(800px circle at 92% 12%, rgba(42, 156, 108, 0.20), transparent 52%),
    radial-gradient(920px circle at 60% 96%, rgba(164, 214, 124, 0.13), transparent 58%);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.40) 0%, rgba(86, 220, 156, 0.32) 28%, rgba(255, 255, 255, 0.07) 52%, rgba(96, 208, 228, 0.24) 78%, rgba(255, 255, 255, 0.28) 100%);
  --lg-sheen: radial-gradient(circle, rgba(255, 255, 255, 0.16) 0%, rgba(86, 220, 156, 0.11) 38%, transparent 70%);
}

[data-wallpaper="graphite"] {
  --bg-base: #eef1f5;
  --wallpaper-grad:
    radial-gradient(960px circle at 10% 8%, rgba(142, 154, 174, 0.34), transparent 54%),
    radial-gradient(660px circle at 36% 46%, rgba(188, 202, 222, 0.28), transparent 54%),
    radial-gradient(820px circle at 90% 10%, rgba(168, 174, 186, 0.26), transparent 52%),
    radial-gradient(900px circle at 62% 94%, rgba(255, 255, 255, 0.56), transparent 58%);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(184, 194, 210, 0.52) 28%, rgba(255, 255, 255, 0.22) 52%, rgba(164, 174, 190, 0.42) 78%, rgba(255, 255, 255, 0.88) 100%);
  --lg-sheen: radial-gradient(circle, rgba(255, 255, 255, 0.74) 0%, rgba(206, 214, 228, 0.24) 38%, transparent 70%);
}
[data-theme="dark"][data-wallpaper="graphite"] {
  --bg-base: #050507;
  --wallpaper-grad:
    radial-gradient(960px circle at 10% 8%, rgba(142, 146, 160, 0.20), transparent 54%),
    radial-gradient(720px circle at 48% 36%, rgba(98, 108, 128, 0.16), transparent 54%),
    radial-gradient(800px circle at 92% 12%, rgba(220, 224, 234, 0.10), transparent 52%),
    radial-gradient(920px circle at 60% 96%, rgba(84, 88, 102, 0.16), transparent 58%);
  --lg-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, rgba(180, 186, 200, 0.28) 28%, rgba(255, 255, 255, 0.08) 52%, rgba(154, 160, 174, 0.24) 78%, rgba(255, 255, 255, 0.30) 100%);
  --lg-sheen: radial-gradient(circle, rgba(255, 255, 255, 0.17) 0%, rgba(180, 186, 200, 0.10) 38%, transparent 70%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 20px calc(92px + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-ui);
  font-optical-sizing: auto;
  letter-spacing: -0.008em;
  color: var(--text-primary);
  background-color: var(--bg-base);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 240ms ease, color 200ms ease;
}

/* 极细圆角半透明胶囊滚动条（R1.1，深浅色自适应） */
.note-preview,
.mistake-list,
.sheet-body,
.note-area,
.mini-area,
.note-preview .katex-display {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}
.note-preview::-webkit-scrollbar,
.mistake-list::-webkit-scrollbar,
.sheet-body::-webkit-scrollbar,
.note-area::-webkit-scrollbar,
.mini-area::-webkit-scrollbar,
.note-preview .katex-display::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.note-preview::-webkit-scrollbar-track,
.mistake-list::-webkit-scrollbar-track,
.sheet-body::-webkit-scrollbar-track,
.note-area::-webkit-scrollbar-track,
.mini-area::-webkit-scrollbar-track,
.note-preview .katex-display::-webkit-scrollbar-track {
  background: transparent;
}
.note-preview::-webkit-scrollbar-thumb,
.mistake-list::-webkit-scrollbar-thumb,
.sheet-body::-webkit-scrollbar-thumb,
.note-area::-webkit-scrollbar-thumb,
.mini-area::-webkit-scrollbar-thumb,
.note-preview .katex-display::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 1px solid transparent;
  background-clip: padding-box;
}

/* 静态 iPadOS Mesh 壁纸（0 每帧重绘开销） */
.wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--bg-base);
  background-image: var(--wallpaper-grad);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1040px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

/* iPadOS 顶部系统状态栏 + 灵动专注胶囊 */
.ios-statusbar {
  position: sticky;
  top: 10px;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 24px;
  flex-wrap: wrap;
}
.ios-statusbar > *:not(.sb-glass-bg) {
  position: relative;
  z-index: 2;
}
.ios-statusbar > .di-anchor {
  z-index: 45;
}
.sb-glass-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 0;
  pointer-events: none;
  background: var(--chrome-bg);
  backdrop-filter: blur(14px) saturate(185%);
  -webkit-backdrop-filter: blur(14px) saturate(185%);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  opacity: 0;
  will-change: opacity;
  transition: opacity 220ms var(--ease-out);
}
.ios-statusbar.scrolled .sb-glass-bg {
  opacity: 1;
}
.ios-statusbar.scrolled .status-controls {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: transparent;
  box-shadow: none;
}
.ios-statusbar.scrolled .status-controls::before { display: none; }

/* 灵动岛容器与弹性展开 Live Activity 大卡片（纯实体黑曜石材质，零模糊嵌套，120fps） */
.di-anchor {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
}

.dynamic-island {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 7px;
  border-radius: 999px;
  background: #141416;
  color: #f5f5f7;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.34), 0 0 0 0.5px rgba(255, 255, 255, 0.15) inset;
  opacity: 0;
  transform: translate3d(0, -6px, 0) scale(0.92);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 200ms var(--ease-out), transform 260ms var(--ease-drawer), visibility 0s linear 200ms;
}

[data-theme="dark"] .dynamic-island {
  background: #1f2024;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.dynamic-island.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition: opacity 260ms var(--ease-drawer), transform 420ms var(--ease-apple-spring), visibility 0s linear 0s;
}

.dynamic-island:active { transform: scale(0.955); transition-duration: 90ms; }
.dynamic-island.running { padding: 5px 7px 5px 7px; }
.dynamic-island.di-pop { animation: diPop 440ms var(--ease-apple-spring); }
@keyframes diPop {
  0% { transform: scale(0.92, 0.88); }
  55% { transform: scale(1.04, 1.02); }
  100% { transform: scale(1, 1); }
}

.di-anchor.expanded .dynamic-island {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  transition: opacity 120ms ease, transform 160ms var(--ease-out);
}

.di-subj-ico {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #f5f5f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.di-subj-ico svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.di-subj-ico.math { background: rgba(10, 132, 255, 0.28); color: #5ac8fa; }
.di-subj-ico.comm { background: rgba(48, 209, 88, 0.28); color: #30d158; }
.di-subj-ico.english { background: rgba(255, 69, 58, 0.28); color: #ff6961; }

.di-wave {
  display: none;
  align-items: center;
  gap: 2px;
  height: 12px;
  flex-shrink: 0;
}
.dynamic-island.running .di-wave { display: inline-flex; }
.di-wave i {
  width: 2px;
  height: 100%;
  border-radius: 2px;
  background: #30d158;
  transform-origin: center;
  animation: diWave 1.1s ease-in-out infinite;
}
.di-wave i:nth-child(2) { animation-delay: 0.18s; }
.di-wave i:nth-child(3) { animation-delay: 0.36s; }
.dynamic-island.warning .di-wave i { background: #ff9f0a; }
@keyframes diWave {
  0%, 100% { transform: scaleY(0.32); }
  50% { transform: scaleY(1); }
}

.di-subj {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(245, 245, 247, 0.88);
  white-space: nowrap;
}
.dynamic-island.idle .di-subj { color: rgba(245, 245, 247, 0.72); font-weight: 500; }

.di-clock {
  font-family: var(--font-num);
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.dynamic-island.idle .di-clock {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

.di-actions {
  display: none;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
}
.dynamic-island.running .di-actions { display: inline-flex; }

.di-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #f5f5f7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 140ms ease, transform 100ms var(--ease-out);
}
.di-btn:active { transform: scale(0.9); }
.di-btn.stop { background: #ff453a; color: #fff; }
.di-btn svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.di-btn.stop svg { fill: currentColor; stroke: none; }

.di-prog {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, #30d158, #0a84ff);
  transition: width 0.8s linear;
  pointer-events: none;
}

/* 灵动岛展开态大卡片 */
.di-expanded {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 348px;
  max-width: calc(100vw - 24px);
  padding: 16px 16px 15px;
  border-radius: 28px;
  background: #141416;
  color: #ffffff;
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
  transform-origin: top center;
  opacity: 0;
  clip-path: inset(0 28% 74% 28% round 999px);
  transform: translate3d(-50%, -6px, 0);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 180ms var(--ease-out), clip-path 240ms var(--ease-out), transform 220ms var(--ease-out), visibility 0s linear 220ms;
}
[data-theme="dark"] .di-expanded {
  background: #1c1c1f;
  box-shadow: 0 28px 70px -10px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}
.di-anchor.expanded .di-expanded {
  opacity: 1;
  clip-path: inset(0 0 0 0 round 28px);
  transform: translate3d(-50%, 0, 0);
  pointer-events: auto;
  visibility: visible;
  transition: opacity 220ms var(--ease-out), clip-path 480ms var(--ease-apple-spring), transform 480ms var(--ease-apple-spring), visibility 0s linear 0s;
}
@media (min-width: 561px) {
  .ios-statusbar.scrolled .di-expanded {
    top: calc(100% + 10px);
  }
}

.di-exp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.di-exp-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.di-exp-ico {
  width: 36px; height: 36px; border-radius: 11px;
  background: rgba(255, 255, 255, 0.12); color: #ffffff;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.di-exp-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.di-exp-ico.math { background: rgba(10, 132, 255, 0.25); color: #5ac8fa; }
.di-exp-ico.comm { background: rgba(48, 209, 88, 0.25); color: #30d158; }
.di-exp-ico.english { background: rgba(255, 69, 58, 0.25); color: #ff6961; }
.di-exp-titles { display: flex; flex-direction: column; min-width: 0; }
.di-exp-subj { font-size: 14.5px; font-weight: 600; color: #ffffff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.di-exp-meta { font-size: 11.5px; color: rgba(235, 235, 245, 0.62); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.di-exp-close {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.11); color: rgba(255, 255, 255, 0.78);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
  transition: background-color 140ms ease, transform 100ms var(--ease-out);
}
.di-exp-close:active { transform: scale(0.9); }
.di-exp-close svg { width: 14px; height: 14px; }

.di-exp-running { margin-top: 14px; }
.di-exp-running[hidden], .di-exp-idle[hidden] { display: none; }
.di-exp-clock-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.di-exp-clock {
  font-family: var(--font-num);
  font-size: 38px; font-weight: 200; line-height: 1.1; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums; color: #ffffff;
}
.di-exp-badge {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: rgba(48, 209, 88, 0.2); color: #30d158; flex-shrink: 0;
}
.di-exp-track {
  margin-top: 10px; height: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12); overflow: hidden;
}
.di-exp-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #30d158, #0a84ff);
  transition: width 0.8s linear;
}
.di-exp-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 13px; }
.di-ctl-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 9px 4px; border-radius: 15px; border: none;
  background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.92);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: background-color 140ms ease, transform 100ms var(--ease-out);
}
.di-ctl-btn:active { transform: scale(0.94); }
.di-ctl-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.di-ctl-btn.active { background: rgba(48, 209, 88, 0.24); color: #30d158; }
.di-ctl-btn.danger { background: rgba(255, 69, 58, 0.24); color: #ff6961; }

.di-exp-idle { margin-top: 14px; }
.di-quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.di-quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 6px; border-radius: 16px; border: none;
  background: rgba(255, 255, 255, 0.09); color: #ffffff;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background-color 140ms ease, transform 100ms var(--ease-out);
}
.di-quick-btn:active { transform: scale(0.95); }
.di-q-ico {
  width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
}
.di-q-ico svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.di-quick-btn.math .di-q-ico { background: rgba(10, 132, 255, 0.26); color: #5ac8fa; }
.di-quick-btn.comm .di-q-ico { background: rgba(48, 209, 88, 0.26); color: #30d158; }
.di-quick-btn.english .di-q-ico { background: rgba(255, 69, 58, 0.26); color: #ff6961; }

body.is-locked .di-anchor { display: none !important; }

.status-left {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.app-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  object-fit: cover;
  display: block;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.55);
  flex-shrink: 0;
}

.status-titles { display: flex; flex-direction: column; }
.status-title-stack {
  position: relative;
  height: 20px;
  overflow: hidden;
}
.status-app { font-size: 17px; font-weight: 700; letter-spacing: -0.022em; line-height: 20px; display: block; white-space: nowrap; }
.status-brand, .status-compact-title {
  transition: transform 240ms var(--ease-apple-snappy), opacity 200ms var(--ease-out);
}
.status-compact-title {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transform: translate3d(0, 100%, 0);
}
body.title-collapsed .status-brand {
  opacity: 0;
  transform: translate3d(0, -100%, 0);
}
body.title-collapsed .status-compact-title {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.status-sub { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

.status-controls {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: var(--chrome-bg);
  backdrop-filter: blur(18px) saturate(210%);
  -webkit-backdrop-filter: blur(18px) saturate(210%);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.status-controls::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.cc-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 360ms var(--ease-apple-spring);
}
.cc-btn:active { transform: scale(0.92); transition-duration: 90ms; }
.cc-btn.active { background: var(--ios-green-soft); color: var(--ios-green-text); }
.cc-btn.muted { opacity: 0.45; }
.cc-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* 顶栏壁纸色系切换浮层（body 直属，严禁模糊层 scale，仅 opacity + translate3d） */
.wallpaper-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 55;
  width: 236px;
  padding: 12px;
  border-radius: 20px;
  background: var(--chrome-bg);
  backdrop-filter: blur(18px) saturate(210%);
  -webkit-backdrop-filter: blur(18px) saturate(210%);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  transform-origin: top right;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transform: translate3d(0, -10px, 0);
  transition: opacity 170ms var(--ease-out), transform 220ms var(--ease-out), visibility 0s linear 170ms;
}
.wallpaper-popover.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  transition: opacity 200ms var(--ease-out), transform 380ms var(--ease-apple-spring), visibility 0s linear 0s;
}
.wallpaper-popover .rg-ctl,
.wallpaper-popover .wp-grid .wp-swatch {
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition: opacity 200ms var(--ease-out), transform 340ms var(--ease-apple-spring), background-color 150ms ease, border-color 150ms ease;
}
.wallpaper-popover.open .rg-ctl,
.wallpaper-popover.open .wp-grid .wp-swatch {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}
.wallpaper-popover.open .rg-ctl:nth-child(1),
.wallpaper-popover.open .wp-grid .wp-swatch:nth-child(1) { transition-delay: 28ms; }
.wallpaper-popover.open .rg-ctl:nth-child(2),
.wallpaper-popover.open .wp-grid .wp-swatch:nth-child(2) { transition-delay: 56ms; }
.wallpaper-popover.open .rg-ctl:nth-child(3),
.wallpaper-popover.open .wp-grid .wp-swatch:nth-child(3) { transition-delay: 84ms; }
.wallpaper-popover.open .rg-ctl:nth-child(4),
.wallpaper-popover.open .wp-grid .wp-swatch:nth-child(4) { transition-delay: 112ms; }
.wallpaper-popover::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.wp-pop-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 4px 8px;
}
.wp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.wp-swatch {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 9px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: var(--fill-secondary);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease, transform 360ms var(--ease-apple-spring);
}
.wp-swatch:active { transform: scale(0.955); transition-duration: 90ms; }
.wp-swatch.active {
  background: var(--ios-blue-soft);
  border-color: rgba(0, 122, 255, 0.35);
}
.wp-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7), 0 2px 6px rgba(15, 23, 42, 0.14);
}
.wp-glacier { background: linear-gradient(135deg, #52a2ff 0%, #5cd4ff 48%, #ff92ca 100%); }
.wp-lavender { background: linear-gradient(135deg, #9880ff 0%, #ff86c8 55%, #ffc2a6 100%); }
.wp-forest { background: linear-gradient(135deg, #38cf8c 0%, #66d4e8 55%, #f8da88 100%); }
.wp-graphite { background: linear-gradient(135deg, #687082 0%, #a8b2c4 55%, #e4e8ef 100%); }
.wp-name {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
}

/* iPadOS 26 液态玻璃主卡片（菲涅尔棱镜光边 + 叶子节点 120fps 追光，零嵌套模糊） */
.widget {
  position: relative;
  background: var(--widget-bg);
  border: 1px solid var(--widget-border);
  border-radius: 26px;
  padding: 20px 22px;
  box-shadow: var(--widget-shadow);
  transition: border-color 240ms ease;
}
.widget::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
.widget > *:not(.lg-layer) {
  position: relative;
  z-index: 1;
}

/* 120fps 液态玻璃镜面追光层（纯 GPU translate3d + opacity，零 CSS 变量继承重算） */
.lg-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.lg-sheen {
  position: absolute;
  top: 0;
  left: 0;
  width: 260px;
  height: 260px;
  margin: -130px 0 0 -130px;
  border-radius: 50%;
  background: var(--lg-sheen);
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 240ms ease;
}

/* iOS Large Title 导航大标题（下滚平滑折叠至顶栏紧凑标题） */
.page-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px 14px;
  transition: opacity 200ms var(--ease-out), transform 220ms var(--ease-out);
}
body.title-collapsed .page-hero {
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  pointer-events: none;
}
.page-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  margin-bottom: 2px;
}
.page-large-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.12;
  color: var(--text-primary);
}

.widget-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
  flex-wrap: wrap;
}

.widget-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.016em;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.widget-meta { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.inline-actions { display: inline-flex; align-items: center; gap: 10px; }

.w-ico {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.w-ico svg { width: 13.5px; height: 13.5px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.w-ico.blue { background: var(--ios-blue-soft); color: var(--ios-blue); }
.w-ico.green { background: var(--ios-green-soft); color: var(--ios-green-text); }
.w-ico.coral { background: var(--ios-coral-soft); color: var(--ios-coral); }

.icon-inline { display: inline-flex; align-items: center; gap: 3px; }
.inline-chev { width: 6px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sf-inline-ico { width: 14px; height: 14px; flex-shrink: 0; }
.sf-x { width: 12px; height: 12px; display: block; }

/* Apple Watch Activity Rings 今日专注环小组件 */
.rings-layout {
  display: flex;
  align-items: center;
  gap: 18px;
}
.rings-stage {
  position: relative;
  width: 144px;
  height: 144px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rings-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.ring-track {
  fill: none;
  stroke-width: 9.2;
  opacity: 0.16;
}
[data-theme="dark"] .ring-track { opacity: 0.22; }
.ring-track.math { stroke: var(--ios-blue); }
.ring-track.comm { stroke: var(--ios-green); }
.ring-track.english { stroke: var(--ios-coral); }

.ring-arc {
  fill: none;
  stroke-width: 9.2;
  stroke-linecap: round;
  transition: stroke-dashoffset 620ms var(--ease-drawer);
}
.ring-arc.completed { filter: drop-shadow(0 0 5px rgba(52, 199, 89, 0.35)); }

.rings-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.rings-pct {
  font-family: var(--font-num);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.rings-sub { font-size: 9px; color: var(--text-muted); margin-top: 2px; line-height: 1.1; font-weight: 500; }

.rings-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ring-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
  border-radius: 12px;
  background: var(--fill-secondary);
  transition: background-color 180ms ease;
}
.ring-stat.active { background: var(--ios-green-soft); }
.ring-badge {
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ring-badge svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ring-badge.math { background: var(--ios-blue-soft); color: var(--ios-blue); }
.ring-badge.comm { background: var(--ios-green-soft); color: var(--ios-green-text); }
.ring-badge.english { background: var(--ios-coral-soft); color: var(--ios-coral); }
.ring-stat-body { flex: 1; min-width: 0; }
.ring-stat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.ring-stat-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.ring-stat-pct { font-family: var(--font-num); font-size: 11.5px; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ring-stat.done .ring-stat-pct { color: var(--ios-green-text); }
.ring-stat-val { font-family: var(--font-num); font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; margin-top: 1px; }

/* iPadOS 26 底部悬浮液态玻璃 Dock 导航栏 */
.ios-dock {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  padding: 5px;
  border-radius: 24px;
  gap: 4px;
  background: var(--chrome-bg);
  backdrop-filter: blur(18px) saturate(220%);
  -webkit-backdrop-filter: blur(18px) saturate(220%);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}
.ios-dock::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.nav-indicator {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  z-index: 1;
  border-radius: 19px;
  background: var(--lens-bg);
  box-shadow: var(--lens-shadow);
  opacity: 0;
  pointer-events: none;
  will-change: transform, width;
  transition: transform 420ms var(--ease-apple-spring), width 360ms var(--ease-apple-snappy), opacity 160ms ease;
}

.nav-btn {
  position: relative;
  z-index: 2;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 19px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 150ms ease, transform 360ms var(--ease-apple-spring);
}
.nav-btn.active { color: var(--ios-blue); font-weight: 600; }
[data-theme="dark"] .nav-btn.active { color: #ffffff; }
.nav-btn:active { transform: scale(0.955); transition-duration: 90ms; }
.nav-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.nav-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ios-coral);
  color: #fff;
  line-height: 1.3;
}

/* 视图切换（卡片与标题入场由 JS 物理弹簧与 WebGL 同帧锁定驱动） */
.view { display: none; }
.view.active {
  display: block;
}

/* Bento 网格 */
.bento-focus { display: grid; grid-template-columns: 410px 1fr; gap: 18px; align-items: start; }
.bento-trends { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 18px; align-items: start; }
.bento-2col { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; align-items: start; }
.bento-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.bento-focus > *, .bento-trends > *, .bento-2col > *, .widget { min-width: 0; }

/* 倒计时 Widget（R4.1 瓦片微内凹玻璃高光与层次感） */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time-tile {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64) 0%, rgba(118, 118, 128, 0.08) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1.5px 2px rgba(255, 255, 255, 0.84),
    inset 0 -1.5px 3px rgba(15, 23, 42, 0.06),
    0 2px 6px -2px rgba(15, 23, 42, 0.05);
  border-radius: 18px;
  padding: 14px 4px 11px;
  text-align: center;
  min-width: 0;
}
[data-theme="dark"] .time-tile {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07) 0%, rgba(118, 118, 128, 0.16) 100%);
  border-color: rgba(255, 255, 255, 0.11);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, 0.15),
    inset 0 -1.5px 3px rgba(0, 0, 0, 0.44),
    0 4px 10px -4px rgba(0, 0, 0, 0.45);
}
.num {
  display: inline-flex;
  justify-content: center;
  font-family: var(--font-num);
  font-size: 38px;
  font-weight: 300;
  line-height: 1.14;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
}
.time-tile:first-child .num { color: var(--ios-blue); font-weight: 400; }
.t-lbl { display: block; margin-top: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }

.exam-meta { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ios-pill { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--ios-blue-soft); color: var(--ios-blue); font-size: 12px; font-weight: 600; }
.progress-track { margin-top: 10px; height: 5px; border-radius: 999px; background: var(--fill-tertiary); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ios-blue), var(--ios-green)); transition: width 400ms var(--ease-out); }

.quote-row {
  margin-top: 13px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 13px;
  background: var(--fill-secondary);
  transition: background-color 140ms ease, transform 120ms var(--ease-out);
}
.quote-row:active { transform: scale(0.985); }
#quoteText { transition: opacity 120ms ease, filter 120ms ease; }
#quoteText.is-swapping { opacity: 0.35; filter: blur(2px); }
.quote-tag { font-size: 11px; color: var(--ios-blue); font-weight: 500; flex-shrink: 0; }

/* 统计与热力图 */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi-cell { background: var(--fill-secondary); border-radius: 15px; padding: 11px 8px; text-align: center; }
.kpi-val { font-family: var(--font-num); font-size: 21px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -0.025em; }
.kpi-val.blue { color: var(--ios-blue); }
.kpi-val.green { color: var(--ios-green-text); }
.kpi-lbl { margin-top: 3px; font-size: 11px; color: var(--text-muted); }

.ratio-bar { display: flex; width: 100%; height: 6px; border-radius: 999px; overflow: hidden; background: var(--fill-tertiary); gap: 2px; margin-bottom: 12px; }
.ratio-seg { height: 100%; border-radius: 999px; transition: width 350ms var(--ease-out); }
.seg-math { background: var(--ios-blue); }
.seg-english { background: var(--ios-coral); }
.seg-comm { background: var(--ios-green); }

.imbalance-banner {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  padding: 9px 12px; border-radius: 13px; cursor: pointer;
  background: var(--ios-amber-soft); border: 1px solid var(--ios-amber-border);
  font-size: 12px; color: var(--text-primary); line-height: 1.45;
  transition: transform 120ms var(--ease-out);
}
.imbalance-banner:active { transform: scale(0.985); }
.imbalance-banner.balanced { background: var(--ios-green-soft); border-color: var(--ios-green-border); }
.imbalance-pill {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--ios-amber); color: #fff; flex-shrink: 0;
}
.imbalance-banner.balanced .imbalance-pill { background: var(--ios-green); }
.imbalance-text { flex: 1; min-width: 0; }
.row-chev { width: 7px; height: 12px; flex-shrink: 0; stroke: var(--text-muted); opacity: 0.7; fill: none; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }

.heat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.heat-title { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.heat-legend { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-muted); }
.legend-sq { width: 9px; height: 9px; border-radius: 2.5px; display: inline-block; }

.heat-grid { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; }
.heat-dot {
  aspect-ratio: 1;
  border-radius: 4.5px;
  background: var(--heat-0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}
[data-theme="dark"] .heat-dot {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.heat-dot.l1 { background: var(--heat-1); }
.heat-dot.l2 { background: var(--heat-2); }
.heat-dot.l3 { background: var(--heat-3); }
.heat-dot.l4 { background: var(--heat-4); }
.heat-dot.today { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 0 0 1.5px var(--ios-green); }
[data-theme="dark"] .heat-dot.today { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1.5px var(--ios-green); }

/* 28 天热力图悬浮玻璃 Tooltip（body 直属，纯 translate3d + opacity，无 scale） */
.heat-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 95;
  pointer-events: none;
  opacity: 0;
  min-width: 182px;
  max-width: min(244px, calc(100vw - 24px));
  padding: 10px 12px;
  border-radius: 15px;
  background: var(--chrome-bg);
  backdrop-filter: blur(16px) saturate(190%);
  -webkit-backdrop-filter: blur(16px) saturate(190%);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.45;
  transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.heat-tooltip.show { opacity: 1; }
.ht-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 0.5px solid var(--separator);
}
.ht-date {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}
.ht-today {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ios-green-soft);
  color: var(--ios-green-text);
}
.ht-total {
  font-family: var(--font-num);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.ht-rows { display: flex; flex-direction: column; gap: 3px; }
.ht-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11.5px; }
.ht-lbl { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.ht-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.ht-dot.math { background: var(--ios-blue); }
.ht-dot.english { background: var(--ios-coral); }
.ht-dot.comm { background: var(--ios-green); }
.ht-val { font-family: var(--font-num); font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* ECharts 容器 */
.chart-box { width: 100%; height: 340px; }
.chart-box-sm { height: 220px; }
.imbalance-report {
  margin-top: 12px; padding: 13px 15px; border-radius: 15px;
  background: var(--fill-secondary); font-size: 12.5px; line-height: 1.65; color: var(--text-secondary);
}
.imbalance-report strong { color: var(--text-primary); }
.imbalance-report .warn-line { display: inline-flex; align-items: center; gap: 6px; color: var(--ios-coral); font-weight: 600; margin-bottom: 5px; }

/* 专注计时器（iOS Inset Grouped List） */
.active-banner {
  display: none; margin-bottom: 14px; padding: 14px 16px; border-radius: 18px;
  background: var(--ios-green-soft); border: 1px solid var(--ios-green-border);
}
.active-banner.visible { display: block; }
.active-banner.warning { background: var(--ios-amber-soft); border-color: var(--ios-amber-border); }
.active-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.active-info { min-width: 0; }
.active-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ios-green-text); }
.active-banner.warning .active-label { color: var(--ios-amber-text); }
.active-clock { margin-top: 2px; font-size: 32px; font-weight: 300; line-height: 1.12; color: var(--text-primary); font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; letter-spacing: -0.03em; }
#activeClockText { font-family: var(--font-num); display: inline-flex; }
.active-sub { font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--text-secondary); }
.active-btns { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; }

.zen-trigger {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--ios-green-border);
  background: var(--widget-bg); color: var(--ios-green-text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform 120ms var(--ease-out);
}
.zen-trigger:active { transform: scale(0.94); }
.zen-trigger svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.active-prog-track { margin-top: 10px; height: 4px; border-radius: 999px; background: rgba(40, 167, 90, 0.18); overflow: hidden; display: none; }
.active-prog-track.show { display: block; }
.active-prog-fill { height: 100%; border-radius: 999px; background: var(--ios-green); transition: width 0.8s linear; }

.guard-box { display: none; margin-top: 11px; padding-top: 10px; border-top: 1px dashed var(--ios-amber-border); justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.guard-box.show { display: flex; }
.guard-msg { font-size: 12px; color: var(--ios-amber-text); font-weight: 500; }
.guard-actions { display: inline-flex; gap: 6px; }
.mini-btn { border: 1px solid var(--ios-amber-border); background: var(--widget-bg); color: var(--text-primary); font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; cursor: pointer; transition: transform 360ms var(--ease-apple-spring), background-color 150ms ease, border-color 150ms ease; }
.mini-btn:active { transform: scale(0.955); transition-duration: 90ms; }

.preset-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; flex-wrap: wrap; }
.preset-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }

.ios-seg {
  position: relative;
  display: inline-flex;
  background: var(--fill-secondary);
  padding: 3px;
  border-radius: 11px;
  gap: 2px;
  flex-wrap: wrap;
}
.seg-indicator {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 8px;
  background: var(--seg-active-bg);
  box-shadow: var(--seg-active-shadow);
  opacity: 0;
  pointer-events: none;
  will-change: transform, width;
  transition: transform 380ms var(--ease-apple-spring), width 320ms var(--ease-apple-snappy), height 260ms var(--ease-out), opacity 140ms ease;
}
.seg-btn {
  position: relative;
  z-index: 1;
  border: none; background: transparent; color: var(--text-secondary);
  font-size: 12px; font-weight: 500; padding: 5px 10px; border-radius: 8px;
  cursor: pointer; transition: color 140ms ease, transform 120ms var(--ease-out);
}
.seg-btn:active { transform: scale(0.96); }
.seg-btn.active { color: var(--text-primary); font-weight: 600; }

.inset-group {
  background: var(--fill-secondary);
  border-radius: 16px;
  overflow: hidden;
}

.subject {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  position: relative;
  transition: background-color 140ms ease;
}
.subject + .subject::before {
  content: "";
  position: absolute;
  top: 0; left: 59px; right: 0;
  height: 0.5px;
  background: var(--separator);
}
.subject.running { background: var(--ios-green-soft); }

.subject-left { min-width: 0; flex: 1; display: flex; align-items: center; gap: 12px; }
.subject-meta { min-width: 0; flex: 1; }
.subject-title-row { display: flex; align-items: center; gap: 8px; }
.subj-ico {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.subj-ico svg { width: 16px; height: 16px; }
.subj-ico.math { background: var(--ios-blue-soft); color: var(--ios-blue); }
.subj-ico.english { background: var(--ios-coral-soft); color: var(--ios-coral); }
.subj-ico.comm { background: var(--ios-green-soft); color: var(--ios-green-text); }
.subject-name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-status { margin-top: 2px; font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; min-height: 17px; }
.subject.running .subject-status { color: var(--ios-green-text); font-weight: 500; }

.pulse-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; animation: pulse 1.8s ease-in-out infinite; }
.subject:not(.running) .pulse-dot { display: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.subject-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.subject-total { font-family: var(--font-num); font-size: 16px; font-weight: 500; color: var(--text-primary); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; min-width: 66px; text-align: right; }

/* Apple 液态玻璃按钮 */
.ios-btn {
  border: none;
  border-radius: 999px;
  padding: 7.5px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 55%), var(--ios-blue);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.45), 0 6px 16px -6px rgba(0, 122, 255, 0.55);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 140ms ease, background-color 150ms ease, border-color 150ms ease, transform 360ms var(--ease-apple-spring);
}
.ios-btn:active:not(:disabled) { transform: scale(0.955); opacity: 0.88; transition-duration: 90ms; }
.ios-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ios-btn.stop {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 55%), var(--ios-coral);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.42), 0 6px 16px -6px rgba(255, 59, 48, 0.5);
}
.ios-btn.tinted {
  background: var(--ios-blue-soft);
  color: var(--ios-blue);
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.4);
}
[data-theme="dark"] .ios-btn.tinted { box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.12); }
.ios-btn.compact { padding: 6px 12px; font-size: 12.5px; }
.ios-btn.full { width: 100%; padding: 11px 16px; border-radius: 13px; font-size: 14px; }
.icon-btn-pill { display: inline-flex; align-items: center; gap: 5px; }
.icon-btn-pill svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.subject .ios-btn { min-width: 62px; padding: 7px 14px; }

/* iOS 偏好开关组（Inset Grouped + 原生绿色 UISwitch） */
.pref-group { margin-top: 12px; }
.pref-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 15px;
}
.pref-row + .pref-row::before {
  content: "";
  position: absolute;
  top: 0; left: 55px; right: 0;
  height: 0.5px;
  background: var(--separator);
}
.pref-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.pref-ico {
  width: 28px; height: 28px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pref-ico svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pref-ico.blue { background: var(--ios-blue-soft); color: var(--ios-blue); }
.pref-ico.green { background: var(--ios-green-soft); color: var(--ios-green-text); }
.pref-info { display: flex; flex-direction: column; min-width: 0; }
.pref-label { font-size: 13.5px; font-weight: 500; color: var(--text-primary); line-height: 1.25; }
.pref-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.ios-switch {
  position: relative;
  width: 46px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--toggle-off);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 220ms var(--ease-out);
}
.ios-switch[aria-checked="true"] { background: var(--ios-green); }
.ios-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16), 0 1px 1px rgba(0, 0, 0, 0.08);
  transition: transform 380ms var(--ease-apple-spring), width 160ms var(--ease-out);
  will-change: transform;
}
.ios-switch[aria-checked="true"] .ios-switch-thumb { transform: translate3d(18px, 0, 0); }
.ios-switch:active .ios-switch-thumb { width: 28px; }
.ios-switch[aria-checked="true"]:active .ios-switch-thumb { transform: translate3d(14px, 0, 0); }
.ios-switch:focus-visible { outline: 2px solid var(--ios-blue); outline-offset: 2px; }

.text-btn {
  background: none; border: none; color: var(--ios-blue); font-size: 13px; font-weight: 500;
  cursor: pointer; padding: 4px 6px; border-radius: 8px;
  transition: opacity 120ms ease, transform 100ms var(--ease-out);
}
.text-btn:active { transform: scale(0.96); opacity: 0.7; }

.widget-foot { margin-top: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.preview-badge { display: none; font-size: 10.5px; padding: 2px 8px; border-radius: 999px; background: var(--ios-blue-soft); color: var(--ios-blue); font-weight: 600; }

/* 输入框 & 登录门禁 */
.ios-input, .ios-select, .mini-area, .note-area {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  letter-spacing: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.ios-input { flex: 1; min-width: 0; padding: 9px 12px; font-size: 14px; line-height: 1.3; }
.ios-select {
  padding: 0 28px 0 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='8 10 12 6 16 10'/%3E%3Cpolyline points='8 14 12 18 16 14'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px 14px;
}
.ios-select option { color: #000; background: #fff; }
[data-theme="dark"] .ios-select option { color: #fff; background: #1c1c1e; }
.ios-input::placeholder, .mini-area::placeholder, .note-area::placeholder { color: var(--text-muted); opacity: 1; }
.ios-input:focus, .ios-select:focus-visible, .mini-area:focus, .note-area:focus { background-color: var(--input-bg-focus); box-shadow: 0 0 0 3px var(--ios-blue-soft); }
.search-field { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; }
.search-field .ios-input { padding-left: 33px; padding-right: 30px; border-radius: 11px; }
.search-field .ios-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-field svg { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); stroke: var(--text-muted); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: var(--text-muted); color: var(--sheet-bg);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.search-clear svg { position: static; transform: none; width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.8; }
.search-clear[hidden] { display: none; }
.mistake-toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.mistake-toolbar .ios-seg { align-self: flex-start; }
.mistake-search { margin-bottom: 0; }

body.is-locked .auth-only,
body.is-locked .ios-dock,
body.is-locked #view-trends,
body.is-locked #view-plan,
body.is-locked #view-study {
  display: none !important;
}
body.is-locked .bento-focus { grid-template-columns: minmax(0, 500px); justify-content: center; }

.auth-gate { display: flex; justify-content: center; width: 100%; }
.auth-card { width: 100%; max-width: 500px; text-align: center; padding: 30px 26px 28px; }
.lock-avatar-halo {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  padding: 3px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(0, 122, 255, 0.28));
  box-shadow: 0 12px 28px -8px rgba(0, 122, 255, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.65);
}
[data-theme="dark"] .lock-avatar-halo {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(10, 132, 255, 0.34));
  box-shadow: 0 14px 32px -8px rgba(0, 0, 0, 0.68), 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.lock-app-icon {
  width: 100%;
  height: 100%;
  border-radius: 19px;
  object-fit: cover;
  display: block;
}
.lock-clock-wrap { margin-bottom: 14px; }
.lock-clock {
  font-family: var(--font-num);
  font-size: clamp(46px, 8vw, 64px);
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.lock-date {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}
.auth-title { font-size: 19px; font-weight: 700; letter-spacing: -0.024em; margin-bottom: 5px; }
.auth-desc { font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); margin: 0 auto 18px; max-width: 42ch; }
.auth-form.lock-capsule {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 340px;
  margin: 0 auto;
  padding: 5px;
  border-radius: 999px;
  background: var(--fill-secondary);
  border: 1px solid var(--separator);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
[data-theme="dark"] .auth-form.lock-capsule {
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.12);
}
.auth-form.lock-capsule:focus-within {
  border-color: var(--ios-blue);
  box-shadow: 0 0 0 3px var(--ios-blue-soft);
}
.lock-input {
  background: transparent;
  border: none;
  padding: 9px 14px;
  font-size: 14px;
}
.lock-input:focus { background-color: transparent; box-shadow: none; }
.lock-btn { padding: 9px 20px; border-radius: 999px; font-size: 13.5px; flex-shrink: 0; }
@keyframes authShake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  15% { transform: translate3d(-9px, 0, 0); }
  30% { transform: translate3d(8px, 0, 0); }
  45% { transform: translate3d(-6px, 0, 0); }
  60% { transform: translate3d(5px, 0, 0); }
  75% { transform: translate3d(-3px, 0, 0); }
}
.lock-capsule.is-shaking { animation: authShake 380ms var(--ease-out); }
.login-msg { font-size: 12.5px; color: var(--ios-coral); min-height: 18px; margin-top: 10px; }

/* 待办清单 */
.todo-add { display: flex; gap: 8px; margin-bottom: 12px; }
.todo-list { display: flex; flex-direction: column; background: var(--fill-secondary); border-radius: 14px; overflow: hidden; }
.todo-item {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px 11px 14px;
  transition: background-color 140ms ease;
}
.todo-item + .todo-item::before {
  content: ""; position: absolute; top: 0; left: 48px; right: 0; height: 0.5px; background: var(--separator);
}
.todo-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.todo-check {
  position: relative;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--check-border);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #fff;
  transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out), transform 120ms var(--ease-out);
}
.todo-left:active .todo-check { transform: scale(0.88); }
.todo-item.done .todo-check { background: var(--ios-blue); border-color: var(--ios-blue); }
.todo-check svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset 160ms ease; }
.todo-item.done .todo-check svg { stroke-dashoffset: 0; }
.todo-item.pop .todo-check { animation: checkPop 420ms var(--ease-spring); }
.todo-item.pop.done .todo-check svg { transition: stroke-dashoffset 240ms var(--ease-out) 90ms; }
@keyframes checkPop { 0% { transform: scale(0.72); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
.todo-text { font-size: 14px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 200ms ease; }
.todo-item.done .todo-text { color: var(--text-muted); }
.todo-item.done .todo-tag { opacity: 0.5; }

.todo-tag { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; font-weight: 600; flex-shrink: 0; }
.tag-math { background: var(--ios-blue-soft); color: var(--ios-blue); }
.tag-english { background: var(--ios-coral-soft); color: var(--ios-coral); }
.tag-comm { background: var(--ios-green-soft); color: var(--ios-green-text); }
.tag-other { background: var(--ios-amber-soft); color: var(--ios-amber-text); }

.todo-del { width: 24px; height: 24px; border-radius: 50%; border: none; background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: background-color 140ms ease, color 140ms ease, transform 100ms var(--ease-out); }
.todo-del:active { transform: scale(0.88); }
.empty-hint { text-align: center; font-size: 13px; color: var(--text-muted); padding: 20px 8px; }

/* 路线图（R3.2 纵向连续轨道 + 完成勾选徽章 + 当前脉冲光环与进度标签） */
.timeline { position: relative; display: flex; flex-direction: column; gap: 12px; }
.stage { position: relative; padding-left: 34px; }
.stage:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 25px;
  bottom: -28px;
  width: 2px;
  border-radius: 2px;
  background: var(--separator);
}
.stage.done:not(:last-child)::before {
  background: var(--ios-green);
  opacity: 0.45;
}
.stage-node {
  position: absolute;
  left: 0;
  top: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--sheet-bg);
  border: 2px solid var(--separator);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.stage.done .stage-node {
  background: var(--ios-green);
  border-color: var(--ios-green);
  color: #ffffff;
}
.stage-check-ico {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.stage.current .stage-node {
  background: var(--ios-blue);
  border-color: var(--ios-blue);
}
.stage.current .stage-node::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
}
.stage.current .stage-node::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--ios-blue);
  opacity: 0.35;
  pointer-events: none;
  animation: stagePulse 2s ease-out infinite;
}
@keyframes stagePulse {
  0% { transform: scale(0.72); opacity: 0.48; }
  75% { transform: scale(1.45); opacity: 0; }
  100% { transform: scale(1.45); opacity: 0; }
}
.stage-card { padding: 13px 15px; border-radius: 15px; background: var(--fill-secondary); }
.stage.current .stage-card { background: var(--ios-blue-soft); border: 1px solid rgba(0, 122, 255, 0.22); }
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.stage-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ios-blue);
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}
.stage-badge.done {
  background: var(--ios-green-soft);
  color: var(--ios-green-text);
}
.stage-date { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.stage-desc { margin-top: 4px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

/* 自习室：KaTeX + 错题本 + 传送门 */
.formula-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: none; background: var(--fill-secondary); color: var(--text-secondary);
  font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 100ms var(--ease-out);
}
.chip-btn svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.chip-btn:active { transform: scale(0.95); }

.katex-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.note-area {
  width: 100%; min-height: 230px; resize: vertical; padding: 13px 14px;
  font-size: 13px; line-height: 1.65; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC", monospace;
}
.note-preview {
  min-height: 230px; max-height: 400px; overflow-y: auto;
  padding: 13px 15px; border-radius: 13px; background: var(--fill-secondary);
  font-size: 13.5px; line-height: 1.75; color: var(--text-primary);
}
.note-preview h3 { font-size: 14.5px; margin: 4px 0 8px; color: var(--ios-blue); }
.note-preview p { margin-bottom: 8px; max-width: 65ch; }
.note-preview .katex-display { margin: 8px 0; overflow-x: auto; overflow-y: hidden; }

.mistake-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 0.5px solid var(--separator); }
.mistake-form-row { display: flex; gap: 8px; }
.mini-area { width: 100%; min-height: 54px; resize: vertical; padding: 8px 12px; font-size: 12.5px; line-height: 1.5; }
.mistake-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

.mistake-list { display: flex; flex-direction: column; gap: 10px; max-height: 440px; overflow-y: auto; }
.mistake-card { padding: 13px 14px; border-radius: 15px; background: var(--fill-secondary); }
.mistake-card.due { background: var(--ios-amber-soft); border: 1px solid var(--ios-amber-border); }
.mistake-card.mastered { opacity: 0.6; }
.mistake-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.mistake-title { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; }
.mistake-stage { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.mistake-body { font-size: 12.5px; line-height: 1.6; color: var(--text-secondary); margin-bottom: 6px; max-width: 65ch; }
.mistake-ans-wrap {
  position: relative;
  font-size: 12.5px;
  line-height: 1.6;
  padding: 9px 12px;
  border-radius: 12px;
  background: var(--widget-bg);
  margin-bottom: 9px;
  max-width: 65ch;
  cursor: pointer;
  overflow: hidden;
  user-select: none;
}
.mistake-ans-wrap.revealed { user-select: text; }
.mistake-ans-body {
  filter: blur(6px);
  opacity: 0.35;
  transition: filter 220ms var(--ease-out), opacity 220ms var(--ease-out);
}
.mistake-ans-wrap.revealed .mistake-ans-body {
  filter: blur(0px);
  opacity: 1;
}
.mistake-ans-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.48));
  pointer-events: none;
  transition: opacity 180ms var(--ease-out);
}
[data-theme="dark"] .mistake-ans-veil {
  background: linear-gradient(180deg, rgba(28, 28, 30, 0.26), rgba(28, 28, 30, 0.52));
}
.mistake-ans-wrap.revealed .mistake-ans-veil { opacity: 0; }
.mistake-veil-pill {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ios-blue);
  background: var(--sheet-bg);
  border: 0.5px solid var(--separator);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.mistake-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-btns { display: inline-flex; gap: 6px; }
.rev-btn { border: none; background: var(--widget-bg); color: var(--text-primary); font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer; }
.rev-btn:active { transform: scale(0.96); }
.rev-btn.ok { background: var(--ios-green-soft); color: var(--ios-green-text); }
.rev-btn.no { background: var(--ios-coral-soft); color: var(--ios-coral); }

.links-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.portal-card {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  min-width: 0; overflow: hidden;
  border-radius: 14px; background: var(--fill-secondary); text-decoration: none; color: var(--text-primary);
  transition: background-color 140ms ease, transform 120ms var(--ease-out);
}
.portal-card:active { transform: scale(0.97); }
.portal-ico {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--ios-blue-soft); color: var(--ios-blue);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.portal-ico svg { width: 17px; height: 17px; }
.portal-ico.blue { background: var(--ios-blue-soft); color: var(--ios-blue); }
.portal-ico.coral { background: var(--ios-coral-soft); color: var(--ios-coral); }
.portal-ico.green { background: var(--ios-green-soft); color: var(--ios-green-text); }
.portal-ico.amber { background: var(--ios-amber-soft); color: var(--ios-amber-text); }
.portal-ico.indigo { background: var(--ios-indigo-soft); color: var(--ios-indigo); }
.portal-meta { min-width: 0; flex: 1; }
.portal-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-chev { width: 8px; height: 13px; flex-shrink: 0; stroke: var(--text-muted); opacity: 0.6; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.portal-del {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: var(--widget-bg); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0;
  transition: opacity 140ms ease, color 140ms ease;
}
@media (hover: none) {
  .portal-del { opacity: 0.72; }
}

/* ============ 可拖拽底部弹出 iOS Sheet ============ */
body.sheet-open { overflow: hidden; }
.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}
.sheet-root.open {
  pointer-events: auto;
  visibility: visible;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
}
.ios-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 540px;
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--sheet-surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 26px 26px 0 0;
  box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.38), 0 -16px 54px rgba(0, 0, 0, 0.30);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  will-change: transform;
  transform: translate3d(0, 100%, 0);
}
.ios-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px 1px 0 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.18) 34%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
[data-theme="dark"] .ios-sheet::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.06) 34%, transparent 100%);
}
.ios-sheet.sheet-wide { max-width: 920px; }
.ios-sheet.is-dragging { user-select: none; }

.sheet-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 6px;
  cursor: grab;
  flex-shrink: 0;
}
.ios-sheet.is-dragging .sheet-handle { cursor: grabbing; }
.sheet-grabber {
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.36);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 20px 14px;
  border-bottom: 0.5px solid var(--separator);
  flex-shrink: 0;
}
.sheet-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); }
.sheet-close {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--fill-tertiary); color: var(--text-secondary);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background-color 140ms ease, transform 100ms var(--ease-out);
}
.sheet-close:active { transform: scale(0.9); }
.sheet-close svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }

.sheet-body {
  padding: 16px 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }
.sheet-form { display: flex; flex-direction: column; gap: 10px; }
.sheet-field-lbl { font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-top: 2px; }
.sheet-area { min-height: 82px; }
.sheet-foot { margin-top: 16px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.sheet-foot.split { justify-content: space-between; flex-wrap: wrap; }

.sheet-katex .note-area { min-height: 46vh; }
.sheet-katex .note-preview { min-height: 46vh; max-height: 54vh; }

/* 每日目标滑块组 */
.goal-editor { margin-bottom: 4px; }
.goal-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
}
.goal-row + .goal-row::before {
  content: "";
  position: absolute;
  top: 0; left: 53px; right: 0;
  height: 0.5px;
  background: var(--separator);
}
.goal-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.goal-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.goal-val { font-family: var(--font-num); font-size: 14px; font-weight: 600; color: var(--text-primary); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

.ios-range {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(to right, var(--range-c, var(--ios-blue)) 0%, var(--range-c, var(--ios-blue)) var(--range-pct, 30%), var(--fill-tertiary) var(--range-pct, 30%), var(--fill-tertiary) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.ios-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition: transform 120ms var(--ease-out);
}
.ios-range:active::-webkit-slider-thumb { transform: scale(1.12); }
.ios-range.math { --range-c: var(--ios-blue); accent-color: var(--ios-blue); }
.ios-range.comm { --range-c: var(--ios-green); accent-color: var(--ios-green); }
.ios-range.english { --range-c: var(--ios-coral); accent-color: var(--ios-coral); }

.footer { text-align: center; font-size: 11.5px; margin-top: 4px; }
.footer a { color: var(--text-muted); text-decoration: none; }

/* Zen Mode（Apple StandBy 液态玻璃表盘：遮罩纯 opacity，内层 .zen-stage 弹性入场，零模糊层 scale） */
.zen-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 64px 20px calc(88px + env(safe-area-inset-bottom, 0px));
  background: rgba(242, 242, 247, 0.86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-out);
}
[data-theme="dark"] .zen-overlay { background: rgba(0, 0, 0, 0.86); }
.zen-overlay.open {
  opacity: 1;
  pointer-events: auto;
  transition: opacity 280ms var(--ease-drawer);
}

.zen-ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(640px circle at 50% 44%, rgba(110, 165, 255, 0.16), transparent 66%);
  transition: opacity 240ms var(--ease-out);
}
.zen-overlay[data-subject="math"] .zen-ambient {
  background: radial-gradient(720px circle at 50% 44%, rgba(0, 122, 255, 0.24), transparent 66%);
}
.zen-overlay[data-subject="comm"] .zen-ambient {
  background: radial-gradient(720px circle at 50% 44%, rgba(52, 199, 89, 0.22), transparent 66%);
}
.zen-overlay[data-subject="english"] .zen-ambient {
  background: radial-gradient(720px circle at 50% 44%, rgba(255, 59, 48, 0.20), transparent 66%);
}
[data-theme="dark"] .zen-overlay[data-subject="math"] .zen-ambient {
  background: radial-gradient(740px circle at 50% 44%, rgba(10, 132, 255, 0.30), transparent 66%);
}
[data-theme="dark"] .zen-overlay[data-subject="comm"] .zen-ambient {
  background: radial-gradient(740px circle at 50% 44%, rgba(48, 209, 88, 0.26), transparent 66%);
}
[data-theme="dark"] .zen-overlay[data-subject="english"] .zen-ambient {
  background: radial-gradient(740px circle at 50% 44%, rgba(255, 69, 58, 0.25), transparent 66%);
}

.zen-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translate3d(0, 14px, 0) scale(0.96);
  transition: opacity 200ms var(--ease-out), transform 220ms var(--ease-out);
}
.zen-overlay.open .zen-stage {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity 320ms var(--ease-drawer), transform 380ms cubic-bezier(0.22, 1.08, 0.36, 1);
}

/* 顶部退出胶囊 & 底部控制条：严禁嵌套 backdrop-filter */
.zen-exit-pill {
  position: fixed;
  top: max(20px, env(safe-area-inset-top, 20px));
  right: 20px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--chrome-border);
  background: var(--zen-pill-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--chrome-shadow);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 140ms ease, transform 120ms var(--ease-out);
}
.zen-exit-pill:active { transform: scale(0.96); }
.zen-exit-pill svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.zen-exit-pill::before,
.zen-dock-bar::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.zen-ring-wrap {
  position: relative;
  width: clamp(296px, 54vmin, 420px);
  height: clamp(296px, 54vmin, 420px);
  display: flex;
  justify-content: center;
  align-items: center;
}
.zen-breath {
  position: absolute;
  inset: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ios-green-soft) 0%, transparent 70%);
  animation: zenBreath 5.2s ease-in-out infinite;
}
.zen-overlay[data-subject="math"] .zen-breath {
  background: radial-gradient(circle, var(--ios-blue-soft) 0%, transparent 70%);
}
.zen-overlay[data-subject="english"] .zen-breath {
  background: radial-gradient(circle, var(--ios-coral-soft) 0%, transparent 70%);
}
@keyframes zenBreath { 0%, 100% { transform: scale(0.94); opacity: 0.55; } 50% { transform: scale(1.08); opacity: 1; } }
.zen-svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.zen-track { fill: none; stroke: var(--separator); stroke-width: 4; }
.zen-progress { fill: none; stroke: var(--ios-green); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 722.57; stroke-dashoffset: 0; transition: stroke-dashoffset 0.8s linear, stroke 240ms ease; }
.zen-overlay[data-subject="math"] .zen-progress { stroke: var(--ios-blue); }
.zen-overlay[data-subject="english"] .zen-progress { stroke: var(--ios-coral); }
.zen-center { position: relative; text-align: center; padding: 0 12px; }
.zen-subj { font-size: 13.5px; font-weight: 600; color: var(--ios-green-text); letter-spacing: 0.01em; }
.zen-overlay[data-subject="math"] .zen-subj { color: var(--ios-blue); }
.zen-overlay[data-subject="english"] .zen-subj { color: var(--ios-coral); }
.zen-overlay[data-subject="idle"] .zen-subj { color: var(--text-secondary); }
.zen-time {
  margin-top: 6px;
  display: inline-flex;
  font-family: var(--font-num);
  font-size: clamp(56px, 11vw, 96px);
  font-weight: 200;
  line-height: 1.02;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  white-space: nowrap;
}
.zen-sub { margin-top: 8px; font-size: 12.5px; color: var(--text-muted); }
.zen-quote { margin-top: 22px; font-size: 13.5px; color: var(--text-secondary); text-align: center; max-width: 58ch; }

.zen-dock-bar {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--chrome-border);
  background: var(--zen-pill-bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--chrome-shadow);
  opacity: 0;
  transform: translate3d(-50%, 10px, 0);
  transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-drawer);
}
.zen-overlay.open .zen-dock-bar {
  opacity: 1;
  transform: translate3d(-50%, 0, 0);
}
.zen-dock-btn {
  position: relative;
  z-index: 1;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, color 140ms ease, transform 120ms var(--ease-out);
}
.zen-dock-btn[hidden] { display: none; }
.zen-dock-btn:active { transform: scale(0.95); }
.zen-dock-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zen-dock-btn.active { background: var(--ios-green-soft); color: var(--ios-green-text); }
.zen-dock-btn.danger { background: var(--ios-coral-soft); color: var(--ios-coral); }

.roll { display: inline-flex; }
.rd { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.rd-c { display: inline-block; }
.rd-out { position: absolute; left: 0; top: 0; animation: rdOutUp 240ms var(--ease-out) forwards; }
.rd-in { animation: rdInUp 340ms var(--ease-out) both; }
.roll-down .rd-out { animation-name: rdOutDown; }
.roll-down .rd-in { animation-name: rdInDown; }
@keyframes rdInUp { from { transform: translate3d(0, 70%, 0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rdOutUp { to { transform: translate3d(0, -70%, 0); opacity: 0; } }
@keyframes rdInDown { from { transform: translate3d(0, -70%, 0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rdOutDown { to { transform: translate3d(0, 70%, 0); opacity: 0; } }

#sparkCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

/* Liquid Glass Toast（无 scale，纯 translate3d + opacity + SF 图标徽章） */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translate3d(-50%, calc(100% + 28px), 0);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px 9px 10px;
  border-radius: 999px;
  background: var(--chrome-bg);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--chrome-border);
  box-shadow: var(--chrome-shadow);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
  max-width: calc(100vw - 32px);
  z-index: 100;
}
.toast::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--lg-rim);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate3d(-50%, 0, 0);
  transition: opacity 320ms var(--ease-drawer), transform 340ms var(--ease-drawer);
}
.toast-ico {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-ico.green { background: var(--ios-green-soft); color: var(--ios-green-text); }
.toast-ico.blue { background: var(--ios-blue-soft); color: var(--ios-blue); }
.toast-ico.amber { background: var(--ios-amber-soft); color: var(--ios-amber-text); }
.toast-svg { width: 13px; height: 13px; }
.toast-msg { line-height: 1.35; }

/* 仅鼠标精细指针设备启用悬停高亮 */
@media (hover: hover) and (pointer: fine) {
  .cc-btn:hover { background: var(--fill-hover); color: var(--text-primary); }
  .nav-btn:hover { color: var(--text-primary); }
  .quote-row:hover { background: var(--fill-hover); }
  .subject:hover { background: var(--fill-hover); }
  .subject.running:hover { background: var(--ios-green-soft); }
  .ios-btn:hover:not(:disabled) { opacity: 0.94; transform: translate3d(0, -1.5px, 0); }
  .chip-btn:hover { background: var(--ios-blue-soft); color: var(--ios-blue); }
  .portal-card:hover { background: var(--fill-hover); transform: translate3d(0, -1.5px, 0); }
  .portal-card:hover .portal-del { opacity: 1; }
  .todo-item:hover { background: var(--fill-secondary); }
  .todo-del:hover { background: var(--ios-coral-soft); color: var(--ios-coral); }
  .ios-btn.tinted:hover:not(:disabled) { opacity: 1; background: rgba(0, 122, 255, 0.17); }
  [data-theme="dark"] .ios-btn.tinted:hover:not(:disabled) { background: rgba(10, 132, 255, 0.28); }
  .dynamic-island:hover { box-shadow: 0 14px 34px -8px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.22) inset; }
  .di-ctl-btn:hover, .di-quick-btn:hover { background: rgba(255, 255, 255, 0.16); }
  .di-ctl-btn.danger:hover { background: rgba(255, 69, 58, 0.34); }
  .di-exp-close:hover { background: rgba(255, 255, 255, 0.2); color: #ffffff; }
  .sheet-close:hover { background: var(--fill-hover); color: var(--text-primary); }
  .portal-del:hover { color: var(--ios-coral); }
  .heat-dot:hover { transform: scale(1.16); }
  .wp-swatch:hover { background: var(--fill-hover); }
  .zen-exit-pill:hover, .zen-dock-btn:hover { opacity: 0.9; }
  .note-preview::-webkit-scrollbar-thumb:hover,
  .mistake-list::-webkit-scrollbar-thumb:hover,
  .sheet-body::-webkit-scrollbar-thumb:hover,
  .note-area::-webkit-scrollbar-thumb:hover,
  .mini-area::-webkit-scrollbar-thumb:hover,
  .note-preview .katex-display::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    border: 1px solid transparent;
    background-clip: padding-box;
  }
}

@media (max-width: 900px) {
  .bento-focus, .bento-trends, .bento-2col, .katex-split { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { padding: 14px 12px calc(88px + env(safe-area-inset-bottom, 0px)); }
  .ios-statusbar { gap: 6px; padding: 5px 6px; }
  .status-left { gap: 8px; }
  .status-controls { padding: 3px; gap: 1px; }
  .cc-btn { width: 29px; height: 29px; }
  .page-hero { padding: 0 2px 10px; }
  .page-large-title { font-size: 30px; }
  .di-anchor { order: 3; width: 100%; margin: 2px auto 0; }
  .di-expanded { position: fixed; top: 12px; left: 50%; width: calc(100vw - 24px); max-width: 380px; z-index: 75; }
  .widget { padding: 18px 15px; border-radius: 20px; }
  .num { font-size: 30px; }
  .active-clock { font-size: 28px; }
  .zen-ring-wrap { width: min(304px, 80vw); height: min(304px, 80vw); }
  .zen-dock-bar { max-width: calc(100vw - 24px); }
  .zen-dock-btn { padding: 0 11px; font-size: 12px; }
  .rings-layout { gap: 12px; }
  .rings-stage { width: 128px; height: 128px; }
  .rings-pct { font-size: 16px; }
  .ios-dock { width: calc(100vw - 24px); justify-content: space-between; border-radius: 20px; }
  .nav-btn { flex: 1; justify-content: center; padding: 8px 6px; font-size: 12px; gap: 4px; }
  .links-grid { grid-template-columns: minmax(0, 1fr); }
  .todo-add, .mistake-form-row { flex-wrap: wrap; }
  .auth-form.lock-capsule { flex-wrap: nowrap; }
  .heat-grid { gap: 4px; }
  .seg-btn { padding: 5px 8px; font-size: 11.5px; }
  .sheet-katex .note-area, .sheet-katex .note-preview { min-height: 28vh; }
}

@media (prefers-reduced-motion: reduce) {
  .zen-breath, .pulse-dot, .rd-in, .rd-out, .todo-item.pop .todo-check, .di-wave i, .dynamic-island.di-pop, .lock-capsule.is-shaking, .stage.current .stage-node::after { animation: none !important; }
  .wallpaper-popover .rg-ctl, .wallpaper-popover .wp-grid .wp-swatch { opacity: 1; transform: none; transition: none; }
  .rd-out { display: none; }
  .zen-overlay, .zen-stage, .toast, .nav-indicator { transform: none; }
  .zen-dock-bar, .zen-overlay.open .zen-dock-bar { transform: translateX(-50%); transition: opacity 150ms ease; }
  .wallpaper-popover, .wallpaper-popover.open { transform: none; transition: opacity 150ms ease; }
  .ios-switch, .ios-switch-thumb, .ring-arc, .page-hero, .status-brand, .status-compact-title { transition: none; }
  .mistake-ans-body, .mistake-ans-veil { transition: opacity 120ms ease; }
  .lg-sheen { display: none; }
  .di-expanded, .di-anchor.expanded .di-expanded { transform: translateX(-50%); clip-path: none; transition: opacity 150ms ease; }
  .sb-glass-bg { transition: opacity 150ms ease; transform: none; }
  .toast, .toast.show { transform: translateX(-50%); }
}

@media (prefers-reduced-transparency: reduce) {
  .ios-statusbar.scrolled, .status-controls, .ios-dock, .zen-overlay, .toast, .heat-tooltip, .wallpaper-popover { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--sheet-bg); }
  .widget { background: var(--sheet-bg); }
  .widget::before, .ios-dock::before, .ios-statusbar.scrolled::before, .toast::before, .wallpaper-popover::before, .lg-layer { display: none; }
}


/* ==========================================================================
   v9.0 实景雨窗 · 夹丝玻璃（方案 A1：全局雾面雨滴夹丝窗 + 直角局部清透光学视窗）
   ========================================================================== */

.rainglass-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  z-index: 0;
  pointer-events: none;
}
.rainglass-canvas.is-active {
  display: block;
}

.app-shell {
  position: relative;
  z-index: 1;
}

/* 壁纸浮层扩展：置顶实景雨窗项 + 内联光学调试条 */
.wallpaper-popover {
  width: 268px;
}
.wp-swatch-featured {
  width: 100%;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-bottom: 8px;
}
.wp-feat-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wp-sub {
  font-size: 10.5px;
  color: var(--text-secondary);
  line-height: 1.25;
}
.wp-dot.wp-rainwindow {
  flex-shrink: 0;
  background:
    repeating-linear-gradient(0deg, rgba(10, 26, 16, 0.45) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(90deg, rgba(10, 26, 16, 0.45) 0 1px, transparent 1px 6px),
    radial-gradient(circle at 65% 68%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 44%),
    linear-gradient(135deg, #c7e8b4 0%, #4da950 52%, #143620 100%);
  box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.45), inset -1px -1px 2px rgba(255, 255, 255, 0.45);
}
.wp-pop-subhead {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 4px 6px;
}
.rg-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px 10px;
  margin-bottom: 4px;
  border-top: 0.5px solid var(--separator);
  border-bottom: 0.5px solid var(--separator);
}
.rg-controls[hidden] {
  display: none;
}
.rg-ctl {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}
.rg-ctl-top {
  display: flex;
  justify-content: space-between;
  font-variant-numeric: tabular-nums;
}
.rg-ctl .ios-range {
  width: 100%;
  height: 4px;
}
.rg-actions {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  margin-top: 2px;
}
.rg-act-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0.5px solid var(--separator);
  border-radius: 9px;
  background: var(--fill-secondary);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 140ms ease, transform 100ms ease;
}
.rg-act-btn:active {
  transform: scale(0.96);
}

/* ---------- 启用「实景液态玻璃」后的全局圆角透明光学视觉语言 ---------- */
html[data-wallpaper="rainwindow"] {
  color-scheme: dark;
  --bg-base: #0d1d13;
  --text-primary: #ffffff;
  --text-secondary: rgba(240, 249, 236, 0.84);
  --text-muted: rgba(226, 240, 222, 0.68);

  --fill-secondary: rgba(255, 255, 255, 0.08);
  --fill-tertiary: rgba(255, 255, 255, 0.13);
  --fill-hover: rgba(255, 255, 255, 0.17);
  --separator: rgba(255, 255, 255, 0.20);

  --ios-blue: #64d2ff;
  --ios-blue-soft: rgba(100, 210, 255, 0.18);
  --ios-green: #63e688;
  --ios-green-text: #7cf29c;
  --ios-green-soft: rgba(99, 230, 136, 0.18);
  --ios-green-border: rgba(124, 242, 156, 0.42);
  --ios-coral: #ff746c;
  --ios-coral-soft: rgba(255, 116, 108, 0.20);
  --ios-amber: #ffd166;
  --ios-amber-text: #ffe08a;
  --ios-amber-soft: rgba(255, 209, 102, 0.18);
  --ios-amber-border: rgba(255, 209, 102, 0.42);
  --ios-indigo: #a5a6ff;
  --ios-indigo-soft: rgba(165, 166, 255, 0.20);

  --input-bg: rgba(8, 22, 14, 0.36);
  --input-bg-focus: rgba(8, 22, 14, 0.52);
  --input-border: rgba(255, 255, 255, 0.24);
  --check-border: rgba(255, 255, 255, 0.50);
  --toggle-off: rgba(255, 255, 255, 0.22);

  --seg-active-bg: rgba(255, 255, 255, 0.22);
  --seg-active-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.45);

  --lens-bg: rgba(255, 255, 255, 0.18);
  --lens-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.48);

  --heat-0: rgba(255, 255, 255, 0.12);
  --heat-1: rgba(99, 230, 136, 0.34);
  --heat-2: rgba(99, 230, 136, 0.58);
  --heat-3: rgba(99, 230, 136, 0.80);
  --heat-4: #7ef7a0;

  --sheet-bg: rgba(10, 22, 15, 0.90);
  --sheet-surface: linear-gradient(180deg, rgba(14, 30, 20, 0.94) 0%, rgba(8, 19, 13, 0.96) 100%);
  --chrome-bg: rgba(10, 23, 15, 0.84);
  --chrome-border: rgba(255, 255, 255, 0.22);
  --chrome-shadow: 0 20px 50px rgba(0, 0, 0, 0.46);
  --zen-pill-bg: rgba(10, 24, 16, 0.56);
  --toast-bg: rgba(10, 24, 16, 0.88);
  --toast-text: #ffffff;
  --scrollbar-thumb: rgba(255, 255, 255, 0.26);
  --scrollbar-thumb-hover: rgba(255, 255, 255, 0.48);
}

html[data-wallpaper="rainwindow"] .wallpaper {
  display: none;
}

html[data-wallpaper="rainwindow"] body {
  background: #0b1a11;
  color: #ffffff;
  text-shadow: 0 1px 10px rgba(4, 14, 8, 0.58), 0 0 2px rgba(4, 14, 8, 0.38);
}

html[data-wallpaper="rainwindow"] .status-left,
html[data-wallpaper="rainwindow"] .page-hero {
  text-shadow: 0 1px 14px rgba(4, 18, 10, 0.78), 0 1px 3px rgba(4, 18, 10, 0.62);
}

/* 主卡片由 WebGL 在文档流中同像素绘制真实凹槽与光学折射，DOM 外壳保持 100% 透明与圆角 */
html[data-wallpaper="rainwindow"] .widget {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 悬浮/粘滞胶囊（顶部状态栏胶囊、灵动岛、心流药丸）：采用清透 CSS Apple Liquid Glass 以便丝滑悬浮固定 */
html[data-wallpaper="rainwindow"] .status-controls,
html[data-wallpaper="rainwindow"] .dynamic-island,
html[data-wallpaper="rainwindow"] .zen-exit-pill,
html[data-wallpaper="rainwindow"] .zen-dock-bar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.21) 0%, rgba(232, 252, 240, 0.08) 48%, rgba(14, 34, 22, 0.26) 100%) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.36) !important;
  box-shadow:
    inset 0 1.2px 0.8px rgba(255, 255, 255, 0.66),
    inset 0 -1px 1.2px rgba(190, 255, 220, 0.26),
    inset 1px 0 1px rgba(255, 255, 255, 0.20),
    0 14px 36px -10px rgba(0, 0, 0, 0.36) !important;
  backdrop-filter: blur(14px) saturate(185%) brightness(1.06) !important;
  -webkit-backdrop-filter: blur(14px) saturate(185%) brightness(1.06) !important;
}

/* 悬浮 Dock 与顶部滚动融合栏（.sb-glass-bg 独立同级层避免子代灵动岛 blur 失效，轻量 14px 模糊兼顾高帧率） */
html[data-wallpaper="rainwindow"] .ios-dock,
html[data-wallpaper="rainwindow"] .ios-statusbar .sb-glass-bg {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(232, 252, 240, 0.09) 48%, rgba(14, 34, 22, 0.26) 100%) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.36) !important;
  box-shadow:
    inset 0 1.2px 0.8px rgba(255, 255, 255, 0.68),
    inset 0 -1px 1.2px rgba(190, 255, 220, 0.28),
    inset 1px 0 1px rgba(255, 255, 255, 0.22),
    0 16px 40px -10px rgba(0, 0, 0, 0.36) !important;
  backdrop-filter: blur(14px) saturate(185%) brightness(1.06) !important;
  -webkit-backdrop-filter: blur(14px) saturate(185%) brightness(1.06) !important;
}
html[data-wallpaper="rainwindow"] .ios-statusbar.scrolled .status-controls,
html[data-wallpaper="rainwindow"] .ios-statusbar.scrolled .dynamic-island {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 彻底移除所有白色四角框与旧版彩虹棱镜边 */
html[data-wallpaper="rainwindow"] .lg-layer,
html[data-wallpaper="rainwindow"] .widget::before,
html[data-wallpaper="rainwindow"] .status-controls::before,
html[data-wallpaper="rainwindow"] .ios-dock::before,
html[data-wallpaper="rainwindow"] .ios-statusbar.scrolled::before,
html[data-wallpaper="rainwindow"] .wallpaper-popover::before,
html[data-wallpaper="rainwindow"] .toast::before,
html[data-wallpaper="rainwindow"] .zen-exit-pill::before,
html[data-wallpaper="rainwindow"] .zen-dock-bar::before {
  display: none !important;
}

/* 次级内凹子凹槽（时间块 / KPI / 分组列表 / 输入框 / 锁屏输入胶囊）：真实刻入卡片玻璃底的内凹槽 */
html[data-wallpaper="rainwindow"] .inset-group,
html[data-wallpaper="rainwindow"] .time-tile,
html[data-wallpaper="rainwindow"] .kpi-cell,
html[data-wallpaper="rainwindow"] .quote-row,
html[data-wallpaper="rainwindow"] .imbalance-banner,
html[data-wallpaper="rainwindow"] .portal-card,
html[data-wallpaper="rainwindow"] .mistake-card,
html[data-wallpaper="rainwindow"] .stage-card,
html[data-wallpaper="rainwindow"] .ios-seg,
html[data-wallpaper="rainwindow"] .lock-capsule {
  background: linear-gradient(160deg, rgba(4, 16, 10, 0.30) 0%, rgba(10, 28, 18, 0.15) 64%, rgba(255, 255, 255, 0.06) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 2px 6px rgba(2, 10, 6, 0.38),
    inset 1px 1px 1.5px rgba(2, 10, 6, 0.24),
    inset 0 -1px 0.8px rgba(225, 255, 236, 0.24),
    inset -0.5px -0.5px 1px rgba(225, 255, 236, 0.14);
}
html[data-wallpaper="rainwindow"] .ios-input,
html[data-wallpaper="rainwindow"] .ios-select,
html[data-wallpaper="rainwindow"] .note-area,
html[data-wallpaper="rainwindow"] .note-preview,
html[data-wallpaper="rainwindow"] .mini-area {
  background: linear-gradient(162deg, rgba(4, 16, 10, 0.32) 0%, rgba(10, 26, 17, 0.18) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.16);
  box-shadow:
    inset 0 2px 5px rgba(2, 10, 6, 0.36),
    inset 0 -1px 0.5px rgba(225, 255, 236, 0.20);
  color: #ffffff;
}
html[data-wallpaper="rainwindow"] .ios-input::placeholder,
html[data-wallpaper="rainwindow"] .note-area::placeholder,
html[data-wallpaper="rainwindow"] .mini-area::placeholder {
  color: rgba(230, 244, 226, 0.58);
}
html[data-wallpaper="rainwindow"] .ios-select option {
  background: #102117;
  color: #ffffff;
}

/* 液滴凸透交互按钮与分段透镜滑块：顶部高光弧 + 水滴通透光泽 */
html[data-wallpaper="rainwindow"] .ios-btn,
html[data-wallpaper="rainwindow"] .mini-btn,
html[data-wallpaper="rainwindow"] .lock-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.10) 58%, rgba(255, 255, 255, 0.16) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.42);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0.8px rgba(255, 255, 255, 0.52),
    inset 0 -1px 1px rgba(4, 18, 10, 0.26),
    0 4px 12px rgba(0, 0, 0, 0.20);
}
html[data-wallpaper="rainwindow"] .ios-btn.tinted {
  background: linear-gradient(180deg, rgba(124, 242, 156, 0.28) 0%, rgba(99, 230, 136, 0.14) 100%);
  border-color: rgba(124, 242, 156, 0.48);
  color: #deffe6;
}
html[data-wallpaper="rainwindow"] .ios-btn.stop {
  background: linear-gradient(180deg, rgba(255, 134, 126, 0.34) 0%, rgba(255, 104, 96, 0.18) 100%);
  border-color: rgba(255, 148, 142, 0.56);
  color: #fff2f0;
}
html[data-wallpaper="rainwindow"] .nav-indicator,
html[data-wallpaper="rainwindow"] .seg-thumb,
html[data-wallpaper="rainwindow"] .seg-indicator {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.14) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.34);
  box-shadow:
    inset 0 1px 0.8px rgba(255, 255, 255, 0.54),
    inset 0 -1px 1px rgba(4, 18, 10, 0.22),
    0 4px 12px rgba(0, 0, 0, 0.20);
}
html[data-wallpaper="rainwindow"] .active-banner {
  background: linear-gradient(162deg, rgba(12, 36, 22, 0.44) 0%, rgba(16, 48, 30, 0.28) 100%);
  border: 0.5px solid rgba(124, 242, 156, 0.36);
  box-shadow: inset 0 1px 0.8px rgba(180, 255, 205, 0.28), inset 0 -1px 2px rgba(4, 18, 10, 0.28);
}
html[data-wallpaper="rainwindow"] .dynamic-island {
  color: #ffffff;
}

/* 灵动岛展开卡片与壁纸浮层、热力提示、Toast：高纯度清透 Apple 液态玻璃 */
html[data-wallpaper="rainwindow"] .di-expanded,
html[data-wallpaper="rainwindow"] .wallpaper-popover,
html[data-wallpaper="rainwindow"] .heat-tooltip,
html[data-wallpaper="rainwindow"] .toast {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.24) 0%, rgba(226, 250, 236, 0.11) 44%, rgba(12, 30, 20, 0.28) 100%) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.40) !important;
  backdrop-filter: blur(14px) saturate(185%) brightness(1.06) !important;
  -webkit-backdrop-filter: blur(14px) saturate(185%) brightness(1.06) !important;
  box-shadow:
    inset 0 1.2px 0.9px rgba(255, 255, 255, 0.72),
    inset 0 -1px 1.2px rgba(185, 255, 218, 0.26),
    inset 1px 0 1px rgba(255, 255, 255, 0.22),
    0 24px 60px -10px rgba(0, 0, 0, 0.46) !important;
}
html[data-wallpaper="rainwindow"] .di-exp-meta {
  color: rgba(242, 252, 245, 0.80);
}
html[data-wallpaper="rainwindow"] .di-quick-btn,
html[data-wallpaper="rainwindow"] .di-ctl-btn,
html[data-wallpaper="rainwindow"] .di-exp-close {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0.6px rgba(255, 255, 255, 0.42), inset 0 -1px 1px rgba(0, 0, 0, 0.18);
}
html[data-wallpaper="rainwindow"] .di-ctl-btn.active {
  background: linear-gradient(160deg, rgba(124, 242, 156, 0.30) 0%, rgba(48, 209, 88, 0.16) 100%);
  border-color: rgba(124, 242, 156, 0.48);
}
html[data-wallpaper="rainwindow"] .di-ctl-btn.danger {
  background: linear-gradient(160deg, rgba(255, 116, 108, 0.32) 0%, rgba(255, 69, 58, 0.18) 100%);
  border-color: rgba(255, 138, 132, 0.48);
}
/* 底部拖拽 Sheet 保持零 backdrop-filter 以维持 120fps 跟手拖拽，同时升级透光高光质感 */
html[data-wallpaper="rainwindow"] .ios-sheet {
  background: linear-gradient(168deg, rgba(20, 42, 28, 0.92) 0%, rgba(10, 22, 15, 0.94) 100%);
  border-top: 0.5px solid rgba(255, 255, 255, 0.30);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: inset 0 1px 0.8px rgba(255, 255, 255, 0.36), 0 -16px 54px rgba(0, 0, 0, 0.42);
}
html[data-wallpaper="rainwindow"] .wp-swatch {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 0.5px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0.6px rgba(255, 255, 255, 0.22);
}
html[data-wallpaper="rainwindow"] .wp-swatch.active {
  background: linear-gradient(160deg, rgba(124, 242, 156, 0.26) 0%, rgba(99, 230, 136, 0.14) 100%);
  border-color: rgba(124, 242, 156, 0.52);
  box-shadow: inset 0 1px 0.8px rgba(220, 255, 230, 0.42), 0 4px 14px rgba(10, 40, 20, 0.28);
}
html[data-wallpaper="rainwindow"] .lock-input {
  background: transparent;
  border: none;
  box-shadow: none;
}
html[data-wallpaper="rainwindow"] .lock-avatar-halo {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.18), rgba(124, 242, 156, 0.14));
  border: 0.5px solid rgba(255, 255, 255, 0.34);
  box-shadow: inset 0 1px 0.8px rgba(255, 255, 255, 0.42), 0 8px 22px rgba(0, 0, 0, 0.28);
}
html[data-wallpaper="rainwindow"] .footer a {
  color: rgba(235, 248, 232, 0.72);
}

/* 心流沉浸模式：遮罩柔和压暗，药丸栏采用上方统一 CSS Liquid Glass */
html[data-wallpaper="rainwindow"] .zen-overlay {
  background: rgba(6, 16, 10, 0.28);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-wallpaper="rainwindow"] .ring-track {
  stroke: rgba(255, 255, 255, 0.16);
}
html[data-wallpaper="rainwindow"] .zen-track {
  stroke: rgba(255, 255, 255, 0.18);
}
