/* ============================================================
   Xuanwen Workbench · 深空极光主题
   ============================================================ */

:root {
  --bg: #04050a;
  --bg-2: #080b14;
  --modal: rgba(9, 12, 20, .92);
  --panel: rgba(255, 255, 255, .034);
  --panel-2: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .085);
  --line-2: rgba(255, 255, 255, .17);
  --text: #e9edf7;
  --dim: #a3adc4;
  --muted: #6e7893;

  --cyan: #22d3ee;
  --violet: #a855f7;
  --blue: #60a5fa;
  --pink: #f472b6;
  --green: #34d399;
  --amber: #fbbf24;

  /* 恶劣天气提示色（天气红点 / 警示条）。观象斋下改走朱砂 */
  --wx-alert: #ef4444;

  /* 绘图元素的发光色（计时环等）。canvas / SVG 无法直接吃 hex 变量拼 rgba，
     所以单独留一个 rgba 变量，供各皮肤覆盖层重映射 */
  --plot-glow: rgba(34, 211, 238, .5);

  --aurora-o: .55;
  --grid-o: 1;
  --shadow: 0 24px 54px -26px rgba(0, 0, 0, .8);
  --radius: 18px;
  --shell: 1180px;

  /* 排版节奏：4px 基准的间距阶梯 + 统一字号阶梯
     全站版式只从这里取值，改这几个数字就能整体收紧或放松 */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-7: 32px; --sp-8: 48px; --sp-9: 64px; --sp-10: 96px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px; --fs-lg: 19px; --fs-xl: 26px;
  --lh-tight: 1.15; --lh-body: 1.7;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
  /* 书法体栈：毛体优先，逐级降级到行楷 / 手写体 / 楷体
     本机若装了毛体（名字任意一种）会自动命中，无需改代码；
     Windows 退到华文行楷，macOS 退到 Hanzipen（手札体），都是毛笔手写感 */
  --mao: "毛体书法", "毛泽东字体", "毛体", "MaoTi", "Maoti", "FZMaoti",
         "STXingkai", "华文行楷", "HanziPen SC", "Hanzipen SC", "手札体-简",
         "方正舒体", "FZShuTi",
         "STKaiti", "华文楷体", "Kaiti SC", "STXinwei", "华文新魏",
         "KaiTi", "楷体", serif;
}

/* 日间（浅色） */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #ffffff;
  --modal: rgba(255, 255, 255, .96);
  --panel: rgba(255, 255, 255, .66);
  --panel-2: rgba(255, 255, 255, .88);
  --line: rgba(30, 41, 89, .1);
  --line-2: rgba(30, 41, 89, .18);
  --text: #0d1428;
  --dim: #475569;
  --muted: #66738f;

  --cyan: #0e7490;
  --violet: #6d28d9;
  --blue: #1d4ed8;
  --pink: #be185d;
  --green: #047857;
  --amber: #b45309;

  --plot-glow: rgba(14, 116, 144, .45);

  --aurora-o: .38;
  --shadow: 0 22px 46px -26px rgba(30, 41, 89, .3);
}

/* 日间的天空感：光晕换成暖亮色，网格更淡 */
[data-theme="light"] .blob-1 { background: radial-gradient(circle at 32% 32%, #7dd3fc, transparent 66%); }
[data-theme="light"] .blob-2 { background: radial-gradient(circle at 60% 40%, #c4b5fd, transparent 66%); }
[data-theme="light"] .blob-3 { background: radial-gradient(circle at 50% 50%, #fbc7d4, transparent 64%); }
[data-theme="light"] .mesh-grid { opacity: .8; }
[data-theme="light"] .noise { opacity: .018; }

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background .45s ease, color .45s ease;
}

::selection { background: rgba(34, 211, 238, .28); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ---------- 背景层 ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.aurora { position: absolute; inset: -25%; filter: blur(110px); }

.blob {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: var(--aurora-o);
  will-change: transform;
}
[data-theme="light"] .blob { mix-blend-mode: multiply; }

.blob-1 {
  width: 56vw; height: 56vw; left: -10vw; top: -16vw;
  background: radial-gradient(circle at 32% 32%, #0ea5e9, transparent 66%);
  animation: drift1 24s ease-in-out infinite;
}
.blob-2 {
  width: 48vw; height: 48vw; right: -8vw; top: -2vw;
  background: radial-gradient(circle at 60% 40%, #7c3aed, transparent 66%);
  animation: drift2 30s ease-in-out infinite;
}
.blob-3 {
  width: 44vw; height: 44vw; left: 26vw; top: 30vw;
  background: radial-gradient(circle at 50% 50%, #06b6d4, transparent 64%);
  animation: drift3 36s ease-in-out infinite;
  opacity: calc(var(--aurora-o) * .72);
}

@keyframes drift1 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(8vw, 6vw, 0) scale(1.14); }
}
@keyframes drift2 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-7vw, 9vw, 0) scale(1.1); }
}
@keyframes drift3 {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(6vw, -7vw, 0) scale(1.18); }
}

.mesh-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 92% 62% at 50% 0%, #000 18%, transparent 78%);
          mask-image: radial-gradient(ellipse 92% 62% at 50% 0%, #000 18%, transparent 78%);
  opacity: var(--grid-o);
}
[data-theme="light"] .mesh-grid {
  background-image:
    linear-gradient(to right, rgba(15, 23, 42, .06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 23, 42, .06) 1px, transparent 1px);
}

#particles { position: absolute; inset: 0; width: 100%; height: 100%; }

.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 74% 52% at 50% 26%, transparent 42%, var(--bg) 100%);
}

.noise {
  position: absolute; inset: 0;
  opacity: .035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 顶部滚动进度 ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 120;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 55%, var(--pink));
  box-shadow: 0 0 14px rgba(34, 211, 238, .7);
}

/* ---------- 布局 ---------- */
main { position: relative; z-index: 1; }
.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 24px; }

/* ---------- 导航 ---------- */
.nav { position: sticky; top: 0; z-index: 60; padding: 14px 0; transition: background .3s, backdrop-filter .3s; }
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
          backdrop-filter: blur(18px) saturate(150%);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .nav.scrolled { background: rgba(4, 5, 10, .62); }
  [data-theme="light"] .nav.scrolled { background: rgba(238, 241, 247, .74); }
}
.nav::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  opacity: 0; transition: opacity .3s;
}
.nav.scrolled::after { opacity: 1; }

.nav-inner { display: flex; align-items: center; gap: 20px; }

/* 字标图片本身已是「anwen」，右侧只接域名后缀 .work，间距收紧成一个词 */
.brand { display: flex; align-items: center; gap: 4px; text-decoration: none; color: var(--text); }
.brand-logo {
  height: 28px; width: auto; display: block;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), filter .25s;
}
.brand:hover .brand-logo {
  transform: scale(1.06);
  filter: brightness(1.15) drop-shadow(0 2px 10px rgba(34, 211, 238, .35));
}
.brand-text {
  display: flex; align-items: baseline; gap: 1px;
  font-size: 14.5px; font-weight: 650; letter-spacing: -.015em;
  color: var(--text);
}
.brand-text b {
  font-weight: 500; color: var(--muted); font-size: 13.5px;
}
/* 深色主题下字标略提亮，避免青紫渐变发闷 */
[data-theme="dark"] .brand-logo { filter: brightness(1.18) saturate(1.06); }
[data-theme="dark"] .brand:hover .brand-logo { filter: brightness(1.3) saturate(1.1) drop-shadow(0 2px 12px rgba(168, 85, 247, .4)); }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  position: relative;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--dim);
  text-decoration: none;
  transition: color .2s, background .2s, transform .2s cubic-bezier(.2,.8,.2,1);
}
.nav-links a:hover { color: var(--text); background: var(--panel-2); transform: translateY(-1px); }
.nav-links a:active { transform: translateY(0) scale(.97); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 2px; height: 2px;
  border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--violet));
  transform-origin: left center;
  animation: navline .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes navline { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

/* ---------- 导航内：页面区块折叠下拉 ---------- */
.nav-dd { display: flex; align-items: center; }

.nav-dd-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: color .2s, background .2s, border-color .2s, transform .2s cubic-bezier(.2,.8,.2,1);
}
.nav-dd-btn:hover {
  color: var(--text);
  background: var(--panel-2);
  transform: translateY(-1px);
}
.nav-dd-btn:active { transform: translateY(0) scale(.97); }
.nav-dd-btn[aria-expanded="true"] {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line-2);
}
.nav-dd-label {
  display: inline-block;
  min-width: 2.7em;
  text-align: left;
  transition: color .2s;
}
.nav-dd-caret {
  width: 12px; height: 12px;
  color: var(--muted);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), color .2s;
}
.nav-dd-btn:hover .nav-dd-caret { color: var(--text); }
.nav-dd-btn[aria-expanded="true"] .nav-dd-caret {
  transform: rotate(180deg);
  color: var(--cyan);
}

/* 菜单左对齐，避免从导航左侧溢出；从左缘生长，与触发按钮左缘对齐 */
.nav-dd-menu {
  left: 0; right: auto;
  min-width: 238px;
  transform-origin: top left;
}

/* 下拉项是锚点 <a>：压掉 .nav-links a 的导航样式，视觉与全局 .dd-item 对齐 */
.nav-links .nav-dd-menu .dd-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font-size: inherit;
}
.nav-links .nav-dd-menu .dd-item:hover {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--cyan) 12%, transparent),
    color-mix(in srgb, var(--violet) 8%, transparent));
  transform: translateX(2px);
}
.nav-links .nav-dd-menu .dd-item:active { transform: translateX(2px) scale(.985); }
.nav-links .nav-dd-menu .dd-item.active,
.nav-links .nav-dd-menu .dd-item[aria-selected="true"] {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--cyan) 14%, transparent),
    color-mix(in srgb, var(--violet) 10%, transparent));
  color: var(--text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 30%, transparent);
}
.nav-links .nav-dd-menu .dd-item.active::after { display: none; }
.nav-links .nav-dd-menu .dd-item:hover::after { display: none; }
.nav-links .nav-dd-menu .dd-item .dd-main b { color: inherit; }
.nav-links .nav-dd-menu .dd-item.active .dd-main b,
.nav-links .nav-dd-menu .dd-item[aria-selected="true"] .dd-main b { color: var(--cyan); }

/* 窄屏：下拉项与触控尺寸放宽 */
@media (max-width: 720px) {
  .nav-dd-menu { min-width: 210px; }
  .nav-links .nav-dd-menu .dd-item { padding: 11px 12px; }
}

/* 触控设备：加大热区到 ≥40px，对齐 WCAG 2.5.5 目标尺寸 */
@media (pointer: coarse) {
  .dd-item { padding: 12px 13px; }
  .dd-check { flex: 0 0 16px; width: 16px; height: 16px; }
  .dd-check svg { width: 16px; height: 16px; }
}

/* 减弱动效偏好：入场/位移/色条动画全部停用，只保留颜色变化 */
@media (prefers-reduced-motion: reduce) {
  .dd-menu, .dd-item { animation: none; }
  .dd-item, .dd-item::before, .dd-check, .nav-dd-caret { transition-duration: 0s; }
  .dd-item:hover, .dd-item:active { transform: none; }
}

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-links + .nav-actions { margin-left: 0; }

.cmd-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 10px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: .2s;
}
.cmd-trigger:hover { border-color: var(--line-2); color: var(--text); background: var(--panel-2); }
.cmd-trigger svg { width: 15px; height: 15px; }

kbd {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--dim);
}

.icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--dim);
  cursor: pointer;
  transition: .2s;
}
.icon-btn:hover { border-color: var(--line-2); color: var(--text); background: var(--panel-2); }
.icon-btn svg { width: 17px; height: 17px; }

/* 主题按钮三态：data-mode 是用户设置，data-theme 是最终生效 */
.i-sun, .i-moon, .i-auto { display: none; }
[data-mode="light"] .i-sun  { display: block; }
[data-mode="dark"]  .i-moon { display: block; }
[data-mode="auto"]  .i-auto { display: block; }

/* ---------- 下拉菜单（二级浮层） ---------- */
.dd { position: relative; }

.dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  min-width: 232px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line-2);
  background: var(--modal);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
          backdrop-filter: blur(22px) saturate(160%);
  /* 三层阴影：顶部内高光 + 近身投影 + 落地长影，层级比一级导航更「浮」 */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 4px 14px -6px rgba(0, 0, 0, .5),
    0 28px 60px -24px rgba(0, 0, 0, .72);
  transform-origin: top right;
  animation: ddIn .22s cubic-bezier(.16, 1, .3, 1);
  /* 长菜单（如云同步/页面较多时）：限高滚动而不是无限撑高 */
  max-height: min(72vh, 460px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.dd-menu::-webkit-scrollbar { width: 8px; }
.dd-menu::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}
[data-theme="light"] .dd-menu {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 4px 14px -8px rgba(30, 41, 89, .18),
    0 24px 48px -24px rgba(30, 41, 89, .32);
}
.dd-menu[hidden] { display: none; }
/* 从触发器下缘「生长」出来：上浮 + 轻微缩放回弹 */
@keyframes ddIn {
  from { opacity: 0; transform: translateY(-8px) scale(.96); }
}

.dd-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  letter-spacing: .005em;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .15s cubic-bezier(.2, .8, .2, 1);
  /* 逐项入场：backwards 保证结束后不残留终帧，:hover 位移不受影响 */
  animation: ddItemIn .24s cubic-bezier(.16, 1, .3, 1) backwards;
}
.dd-menu > .dd-item:nth-child(2) { animation-delay: .024s; }
.dd-menu > .dd-item:nth-child(3) { animation-delay: .048s; }
.dd-menu > .dd-item:nth-child(4) { animation-delay: .072s; }
.dd-menu > .dd-item:nth-child(5) { animation-delay: .096s; }
.dd-menu > .dd-item:nth-child(6) { animation-delay: .12s; }
@keyframes ddItemIn {
  from { opacity: 0; transform: translateY(-4px); }
}

/* 悬停：青→紫微渐变（取皮肤变量，gx 自动映射成朱砂→赭金）+ 右移 2px，
   与一级导航 hover 的上浮形成区分 */
.dd-item:hover {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--cyan) 12%, transparent),
    color-mix(in srgb, var(--violet) 8%, transparent));
  transform: translateX(2px);
}
.dd-item:active { transform: translateX(2px) scale(.985); }
/* 焦点：2px 皮肤色内环，键盘可达性比 1px 灰线醒目得多 */
.dd-item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cyan) 55%, transparent);
}

/* 左侧色条：悬停时半程长出，选中时全开；随皮肤变量换色 */
.dd-item::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 14px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  transform: translateY(-50%) scaleY(0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.dd-item:hover::before { opacity: .55; transform: translateY(-50%) scaleY(.68); }

/* 选中：同色系加深 + 内描边 + 色条全开，层级一目了然 */
.dd-item[aria-selected="true"] {
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--cyan) 14%, transparent),
    color-mix(in srgb, var(--violet) 10%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cyan) 30%, transparent);
}
.dd-item[aria-selected="true"]::before {
  opacity: 1;
  transform: translateY(-50%) scaleY(1);
}
.dd-item[aria-selected="true"] .dd-main b { color: var(--cyan); }

.dd-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dd-main b { font-size: 13.5px; font-weight: 600; letter-spacing: .01em; }
.dd-main i { font-style: normal; font-size: 11.5px; line-height: 1.45; color: var(--muted); }

/* 对勾：选中时弹性放大出现 */
.dd-check {
  flex: 0 0 14px; width: 14px; height: 14px;
  color: var(--cyan);
  opacity: 0;
  transform: scale(.5);
  transition: opacity .16s ease, transform .2s cubic-bezier(.34, 1.56, .64, 1);
}
.dd-check svg { width: 14px; height: 14px; display: block; }
.dd-item[aria-selected="true"] .dd-check { opacity: 1; transform: scale(1); }

/* 云同步菜单：状态行 + 动作项 */
.dd-status {
  padding: 8px 10px 10px;
  margin: 0 2px 6px;
  border-bottom: 1px solid var(--line);
}
.dd-status b { display: block; font-size: 12.5px; font-weight: 600; }
.dd-status span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.55; }
.dd-status code {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--cyan);
}

.dd-ico {
  flex: 0 0 26px; width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 12.5px;
  color: var(--dim);
}

/* 同步状态指示灯 */
.sync-btn { position: relative; }
.sync-dot {
  position: absolute;
  right: 3px; top: 3px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 1.5px var(--bg);
  transition: background .25s, box-shadow .25s;
}
[data-state="ok"]   .sync-dot { background: var(--green); box-shadow: 0 0 6px var(--green), 0 0 0 1.5px var(--bg); }
[data-state="err"]  .sync-dot { background: #f87171; box-shadow: 0 0 6px #f87171, 0 0 0 1.5px var(--bg); }
[data-state="sync"] .sync-dot {
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan), 0 0 0 1.5px var(--bg);
  animation: syncBlink 1s ease-in-out infinite;
}
@keyframes syncBlink { 50% { opacity: .3; } }

/* 预览色块 */
.dd-swatch {
  position: relative;
  flex: 0 0 26px; width: 26px; height: 26px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-2);
}
.sw-aurora {
  background:
    radial-gradient(circle at 30% 26%, #22d3ee, transparent 56%),
    radial-gradient(circle at 74% 72%, #8b5cf6, transparent 56%),
    #05060d;
}
.sw-glass {
  background:
    radial-gradient(circle at 26% 28%, #a78bfa, transparent 60%),
    radial-gradient(circle at 76% 74%, #f472b6, transparent 60%),
    #151233;
}
.sw-glass::after {
  content: ''; position: absolute; inset: 5px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .35));
  border: 1px solid rgba(255, 255, 255, .75);
}
.sw-light { background: linear-gradient(135deg, #dfe7fb, #fdfdff); }
.sw-light::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 7px rgba(245, 158, 11, .85);
}
.sw-dark { background: linear-gradient(135deg, #0b0e1c, #1d2544); }
.sw-dark::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  box-shadow: 3px -3px 0 0 #c7d2fe;
}
.sw-auto { background: linear-gradient(103deg, #dfe7fb 47%, #12172e 53%); }
.sw-auto::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  box-shadow: 3px -3px 0 0 #c7d2fe;
}

/* ---------- Hero ---------- */
.hero {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: var(--sp-10) 0 var(--sp-8);   /* 上下留白拉开，内容更聚焦 */
  gap: var(--sp-8);
}
.hero-copy { display: flex; flex-direction: column; align-items: center; }

h1 {
  font-size: clamp(34px, 5.8vw, 64px);
  line-height: var(--lh-tight);
  letter-spacing: -.03em;
  font-weight: 700;
}
.greet {
  display: block;
  font-size: var(--fs-base);
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--dim);
  margin-bottom: var(--sp-4);
}
.comma { display: none; }
.grad {
  background: linear-gradient(100deg, #fff 2%, #a5f3fc 30%, #818cf8 58%, #f0abfc 90%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
[data-theme="light"] .grad {
  background: linear-gradient(100deg, #0f172a 2%, #0369a1 32%, #6d28d9 64%, #c026d3 92%);
  -webkit-background-clip: text; background-clip: text;
}

.lede {
  margin-top: var(--sp-5);
  max-width: 520px;
  font-size: var(--fs-md);
  line-height: var(--lh-body);
  color: var(--dim);
}

.hero-cta { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); flex-wrap: wrap; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text);
  font: inherit; font-size: 14px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), box-shadow .22s, border-color .22s, background .22s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-2px); border-color: rgba(34, 211, 238, .5); box-shadow: 0 10px 34px -14px rgba(34, 211, 238, .55); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(120deg, #22d3ee, #6366f1);
  border-color: transparent;
  color: #04121a;
  font-weight: 600;
}
.btn-primary:hover { box-shadow: 0 14px 36px -12px rgba(99, 102, 241, .8); }
.btn-ghost { background: transparent; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

.link-btn {
  border: 0; background: none; padding: 0;
  font: inherit; font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}
.link-btn:hover { color: var(--cyan); }
.link-btn.danger:hover { color: #f87171; }

/* ---------- 搜索 ---------- */
.search-block { width: 100%; max-width: 640px; }
.engine-tabs { display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.engine-tab {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: .2s;
}
.engine-tab:hover { color: var(--text); border-color: var(--line-2); }
.engine-tab.active {
  color: #04121a;
  background: linear-gradient(120deg, #22d3ee, #818cf8);
  border-color: transparent;
  font-weight: 600;
}

.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px);
          backdrop-filter: blur(16px);
  transition: border-color .25s, box-shadow .25s;
}
.search-bar:focus-within {
  border-color: rgba(34, 211, 238, .55);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, .1);
}
.search-icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted); }
.search-bar input {
  flex: 1; min-width: 0;
  background: none; border: 0; outline: 0;
  color: var(--text);
  font: inherit; font-size: 15px;
}
.search-bar input::placeholder { color: var(--muted); }

/* ---------- 表单控件 ---------- */
.field {
  width: 100%;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit; font-size: 14px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field::placeholder { color: var(--muted); }
.field:focus { border-color: rgba(34, 211, 238, .55); box-shadow: 0 0 0 3px rgba(34, 211, 238, .1); }

.inline-form { display: flex; gap: 8px; }
.inline-form .field { flex: 1; min-width: 0; }

/* ---------- 每日一句 ---------- */
.quote-sec { margin-top: var(--sp-7); }
.quote {
  position: relative;
  max-width: 640px; margin: 0 auto;          /* 与上方搜索框同宽，左右边界对齐 */
  padding: var(--sp-1) 0 var(--sp-1) var(--sp-6);
}
.quote::before {                 /* 引文竖线：唯一保留的装饰，用来锚定引文起点 */
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  opacity: .7;
}
.quote-text {
  font-size: 17px; line-height: 1.75; letter-spacing: .01em;
  color: var(--text);
  text-wrap: pretty;
}
/* 毛主席语录 / 诗词：走书法体（毛体优先，见 :root 的 --mao）
   选择器多带一层 .quote 是为了压过各皮肤里 [data-style] .quote-text 的字号 */
.quote .quote-text.is-mao {
  font-family: var(--mao);
  font-size: clamp(19px, 2.6vw, 22px);
  line-height: 1.62;
  letter-spacing: .03em;
}
.quote-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); margin-top: var(--sp-4);
}
.quote-src { font-size: var(--fs-sm); color: var(--muted); }
.quote-src::before { content: '—— '; opacity: .7; }
.quote-refresh {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0;
  font: inherit; font-size: var(--fs-sm); color: var(--muted);
  cursor: pointer; transition: color .2s;
}
.quote-refresh:hover { color: var(--cyan); }
.quote-refresh svg { width: 15px; height: 15px; }
.quote-refresh.spin svg { animation: quoteSpin .5s ease; }
@keyframes quoteSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.quote-in { animation: quoteIn .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes quoteIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 概览区 ---------- */
#overview { margin-top: var(--sp-9); }   /* 与「每日一句」之间留出呼吸 */

.overview-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-6); flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}
.overview-title {
  font-size: var(--fs-lg); font-weight: 650; letter-spacing: -.01em;
  background: linear-gradient(100deg, var(--text), var(--dim));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.overview-progress { width: 100%; max-width: 260px; }
.overview-progress-label {
  display: flex; justify-content: space-between;
  font-size: var(--fs-xs); color: var(--muted); margin-bottom: var(--sp-2);
}
.overview-progress-label span:last-child { color: var(--cyan); font-weight: 600; }
.overview-progress-bar {
  height: 6px; border-radius: 999px;
  background: var(--panel-2); overflow: hidden;
  border: 1px solid var(--line);
}
.overview-progress-bar > div {
  height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  transition: width .6s cubic-bezier(.2,.8,.2,1);
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4);
  margin-bottom: var(--sp-7);
}
.stat-card {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  transition: transform .22s cubic-bezier(.2,.8,.2,1), border-color .22s, box-shadow .22s;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.stat-ico {
  flex: 0 0 42px; width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px; color: #fff;
}
.stat-ico svg { width: 22px; height: 22px; }
.stat-ico.i-todo { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.stat-ico.i-note { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.stat-ico.i-link { background: linear-gradient(135deg, #34d399, #059669); }
.stat-ico.i-focus { background: linear-gradient(135deg, #f472b6, #db2777); }
.stat-body { display: flex; flex-direction: column; gap: 2px; }
.stat-top { display: flex; align-items: baseline; gap: 4px; }
.stat-label { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .02em; }
.stat-value {
  font-size: var(--fs-xl); font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-unit { font-size: var(--fs-xs); color: var(--dim); font-weight: 500; }

/* ---------- Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-5);
  padding-bottom: var(--sp-7);
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-6 { grid-column: span 6; }

.card {
  position: relative;
  display: flex; flex-direction: column; gap: var(--sp-4);
  padding: var(--sp-6);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
          backdrop-filter: blur(18px) saturate(130%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), border-color .3s, box-shadow .3s;
}
.card > * { position: relative; z-index: 1; }
.card::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity .35s;
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 50%),
              rgba(34, 211, 238, .1), transparent 62%);
}
/* 原卡片顶部的渐变装饰线已移除，靠留白与卡片边界区分层次 */
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.card-head h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-md); font-weight: 600; letter-spacing: .01em;
}
.card-ico {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.card-ico svg { width: 17px; height: 17px; }
.i-cyan   { color: var(--cyan);   box-shadow: inset 0 0 18px -6px rgba(34, 211, 238, .55); }
.i-violet { color: var(--violet); box-shadow: inset 0 0 18px -6px rgba(168, 85, 247, .55); }
.i-blue   { color: var(--blue);   box-shadow: inset 0 0 18px -6px rgba(96, 165, 250, .55); }
.i-pink   { color: var(--pink);   box-shadow: inset 0 0 18px -6px rgba(244, 114, 182, .55); }
.i-green  { color: var(--green);  box-shadow: inset 0 0 18px -6px rgba(52, 211, 153, .55); }
.i-amber  { color: var(--amber);  box-shadow: inset 0 0 18px -6px rgba(251, 191, 36, .55); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip.saved i { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); transition: background .3s; }
.chip.saved.dirty i { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

/* 导航栏天气按钮（方形图标按钮） */
#weather .nw-emoji { font-size: 17px; line-height: 1; }

/* ---------- 天气：恶劣天气动画 + 提示红点 ---------- */
.wx-btn { position: relative; overflow: hidden; }
/* 动画层（雨丝 / 雪粒 / 雾带 / 闪电），只覆盖图标区域 */
.wx-fx { position: absolute; inset: 0; pointer-events: none; }
.wx-fx i { position: absolute; display: block; }

.wx-drop {
  top: -8px; width: 1.5px; height: 7px; border-radius: 2px;
  background: linear-gradient(180deg, transparent, var(--cyan));
  animation: wxFall 1s linear infinite;
}
/* 首尾淡入淡出，避免雨丝在图标上下边缘被硬切 */
@keyframes wxFall {
  0%   { transform: translateY(0); opacity: 0; }
  20%  { opacity: .85; }
  68%  { opacity: .7; }
  100% { transform: translateY(42px); opacity: 0; }
}

.wx-flake {
  top: -6px; width: 3px; height: 3px; border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 4px var(--violet);
  animation: wxSnow 1.7s linear infinite;
}
@keyframes wxSnow {
  0%   { transform: translate(0, 0); opacity: 0; }
  15%  { opacity: 1; }
  60%  { transform: translate(3px, 24px); opacity: .85; }
  100% { transform: translate(-2px, 42px); opacity: 0; }
}

.wx-fog {
  left: -34%; width: 62%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--muted), transparent);
  animation: wxFog 2.4s ease-in-out infinite;
}
@keyframes wxFog {
  0%   { transform: translateX(-6%); opacity: .15; }
  45%  { opacity: .85; }
  100% { transform: translateX(64%); opacity: .15; }
}

.wx-flash {
  inset: 0;
  background: radial-gradient(circle at 68% 22%, var(--violet), transparent 72%);
  opacity: 0;
  animation: wxFlash 2.8s linear infinite;
}
@keyframes wxFlash {
  0%, 87%, 100% { opacity: 0; }
  89% { opacity: .38; }
  90.5% { opacity: .06; }
  92% { opacity: .3; }
}

/* 提示红点：与 .sync-dot 同一套做法（皮肤变量兜底描边） */
.wx-dot {
  position: absolute; right: 3px; top: 3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--wx-alert);
  box-shadow: 0 0 6px var(--wx-alert), 0 0 0 1.5px var(--bg);
  animation: wxPulse 1.8s ease-in-out infinite;
}
.wx-dot[hidden] { display: none; }
.wx-btn[data-wx-level="2"] .wx-dot {
  box-shadow: 0 0 11px var(--wx-alert), 0 0 0 1.5px var(--bg);
  animation-duration: 1.1s;
}
@keyframes wxPulse { 50% { opacity: .4; transform: scale(.82); } }

/* ---------- 天气详情弹窗 ---------- */
.wx-modal {
  position: fixed; inset: 0; z-index: 210;
  display: grid; place-items: start center;
  padding: 10vh 20px 20px;
}
.wx-modal[hidden] { display: none; }
.wx-mask {
  position: absolute; inset: 0;
  background: rgba(2, 3, 8, .55);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  animation: fadeIn .22s ease;
}
[data-theme="light"] .wx-mask { background: rgba(15, 23, 42, .28); }

.wx-panel {
  position: relative;
  width: 100%; max-width: 460px; max-height: 82vh; overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--modal);
  -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
  box-shadow: 0 34px 80px -30px rgba(0, 0, 0, .75);
  animation: popIn .26s cubic-bezier(.2, .8, .2, 1);
}

.wx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) 0; }
.wx-city { display: block; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.wx-desc { display: block; margin-top: 3px; font-size: var(--fs-xs); color: var(--muted); }
.wx-close {
  flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer;
  transition: .18s;
}
.wx-close:hover { color: var(--text); border-color: var(--line-2); background: var(--panel-2); }

.wx-hero { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5) 0; }
.wx-hero-icon { font-size: 38px; line-height: 1; }
.wx-temp { font-size: 38px; font-weight: 600; letter-spacing: -.02em; color: var(--text); line-height: 1; }
.wx-range { font-size: var(--fs-xs); color: var(--muted); }

.wx-alert {
  margin: var(--sp-3) var(--sp-5) 0;
  padding: var(--sp-2) var(--sp-3);
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--wx-alert) 40%, transparent);
  background: color-mix(in srgb, var(--wx-alert) 12%, transparent);
  color: var(--text);
  font-size: var(--fs-sm); line-height: 1.55;
}
.wx-alert[hidden] { display: none; }
.wx-alert b { color: var(--wx-alert); }
.wx-alert-sub { display: block; margin-top: 2px; font-size: 11.5px; opacity: .72; }

.wx-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; margin: var(--sp-4) var(--sp-5) 0;
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; background: var(--line);
}
.wx-cell { background: var(--panel); padding: var(--sp-2) var(--sp-3); }
.wx-cell span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.wx-cell b { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text); }

.wx-days { margin: var(--sp-4) var(--sp-5) 0; }
.wx-day { display: flex; align-items: center; gap: var(--sp-2); padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.wx-day-name { flex: 0 0 52px; color: var(--dim); }
.wx-day-ico { flex: 0 0 24px; text-align: center; font-size: 15px; }
.wx-day-bar { flex: 1; height: 4px; border-radius: 99px; background: var(--panel-2); position: relative; overflow: hidden; }
.wx-day-bar i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--cyan); }
.wx-day-temp { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--dim); }
.wx-day-temp b { color: var(--text); font-weight: 600; }

.wx-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) var(--sp-4); }
.wx-act {
  padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--line-2); background: var(--panel-2);
  color: var(--text); font-size: var(--fs-sm); cursor: pointer;
  transition: .18s;
}
.wx-act:hover { border-color: var(--cyan); color: var(--cyan); }
.wx-src { font-size: 11.5px; color: var(--muted); }

@media (max-width: 560px) {
  .wx-modal { padding: 6vh 14px 14px; }
  .wx-grid { grid-template-columns: repeat(2, 1fr); }
  .wx-panel { max-height: 86vh; }
}

.bar {
  height: 6px; border-radius: 99px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.bar i {
  display: block; height: 100%; width: 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--violet));
  box-shadow: 0 0 12px rgba(34, 211, 238, .5);
  transition: width .6s cubic-bezier(.2, .8, .2, 1);
}
.bar.sm { height: 4px; }

/* ---------- 待办 ---------- */
.todo-list {
  list-style: none;
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
  max-height: 268px;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 0 6px;
}
.todo-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px;
  border-radius: 11px;
  border: 1px solid transparent;
  transition: background .2s, border-color .2s;
  animation: slideIn .3s cubic-bezier(.2, .8, .2, 1);
}
.todo-item:hover { background: var(--panel-2); border-color: var(--line); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } }

.tick {
  position: relative;
  flex: 0 0 18px; width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 6px;
  border: 1.6px solid var(--line-2);
  cursor: pointer;
  transition: background .2s, border-color .2s, transform .15s;
}
.tick:hover { transform: scale(1.12); }
.tick::after {
  content: '';
  width: 9px; height: 5px;
  margin-top: -2px;
  border-left: 2px solid #04121a;
  border-bottom: 2px solid #04121a;
  transform: rotate(-45deg) scale(.3);
  opacity: 0;
  transition: .2s cubic-bezier(.2, .8, .2, 1);
}
.todo-item.done .tick { background: linear-gradient(120deg, #22d3ee, #6366f1); border-color: transparent; }
.todo-item.done .tick::after { opacity: 1; transform: rotate(-45deg) scale(1); }

.todo-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.5; word-break: break-word; transition: color .2s; }
.todo-item.done .todo-text { color: var(--muted); text-decoration: line-through; }

.todo-del {
  flex: 0 0 auto;
  border: 0; background: none; padding: 0 2px;
  font: inherit; font-size: 17px; line-height: 1;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: .2s;
}
.todo-item:hover .todo-del { opacity: .55; }
.todo-del:hover { opacity: 1 !important; color: #f87171; }

.todo-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.empty {
  padding: 22px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

/* ---------- 速记 ---------- */
#note {
  flex: 1;
  min-height: 210px;
  resize: vertical;
  padding: 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit; font-size: 14px; line-height: 1.78;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
#note::placeholder { color: var(--muted); }
#note:focus { border-color: rgba(168, 85, 247, .5); box-shadow: 0 0 0 3px rgba(168, 85, 247, .1); }

.note-foot { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* ---------- 时钟 ---------- */
.clock-face { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 4px; }
.clock-time {
  font-family: var(--mono);
  font-size: 42px; font-weight: 600; letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, var(--text), var(--dim));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.clock-time em {
  font-style: normal; font-size: .48em; margin-left: 5px;
  -webkit-text-fill-color: var(--muted); color: var(--muted);
}
.blink { animation: blink 1s steps(1) infinite; -webkit-text-fill-color: var(--dim); }
@keyframes blink { 50% { opacity: .25; } }
.clock-date { font-size: 12.5px; color: var(--muted); }

.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 专注 ---------- */
/* SVG 渐变停止点：交给皮肤变量驱动，避免把青紫写死在标记里
   （presentation attribute 特异性为 0，这里的类规则可稳定压过它） */
.acc-grad-a { stop-color: var(--cyan); }
.acc-grad-b { stop-color: var(--violet); }

.dial-wrap { position: relative; display: grid; place-items: center; padding: 6px 0; }
.dial { width: 152px; height: 152px; transform: rotate(-90deg); }
.dial-track { fill: none; stroke: var(--panel-2); stroke-width: 8; }
.dial-fill {
  fill: none; stroke: url(#dialGrad); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 326.73; stroke-dashoffset: 0;
  transition: stroke-dashoffset .45s linear;
  filter: drop-shadow(0 0 7px var(--plot-glow));
}
.dial-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  pointer-events: none;
}
.dial-time { font-family: var(--mono); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dial-sub { font-size: 11.5px; color: var(--muted); }
.focus-ctrl { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.card.running { border-color: rgba(34, 211, 238, .45); box-shadow: 0 0 0 1px rgba(34, 211, 238, .18), var(--shadow); }

/* ---------- 状态 ---------- */
.fps { width: 100%; height: 46px; display: block; }
.kv { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.kv li { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.kv b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- 链接 ---------- */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.link-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 14px 8px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  text-decoration: none;
  color: var(--text);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), border-color .22s, box-shadow .22s;
}
.link-item:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: 0 14px 30px -16px rgba(0, 0, 0, .55); }
.link-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: #fff;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.link-name { font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-del {
  position: absolute; top: 3px; right: 6px;
  border: 0; background: none; padding: 0;
  font: inherit; font-size: 16px; line-height: 1;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: .2s;
}
.link-item:hover .link-del { opacity: .6; }
.link-del:hover { opacity: 1 !important; color: #f87171; }
.link-item.add { cursor: pointer; border-style: dashed; }
.link-item.add .link-icon { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }

/* ---------- 页脚 ---------- */
.foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 24px 0 52px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.foot-links { display: flex; align-items: center; gap: 16px; }
.foot-links a { color: var(--muted); text-decoration: none; transition: color .2s; }
.foot-links a:hover { color: var(--cyan); }

/* ---------- 命令面板 ---------- */
.palette { position: fixed; inset: 0; z-index: 200; display: grid; place-items: start center; padding: 13vh 20px 20px; }
.palette[hidden] { display: none; }
.palette-mask { position: absolute; inset: 0; background: rgba(2, 3, 8, .55); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); animation: fadeIn .22s ease; }
[data-theme="light"] .palette-mask { background: rgba(15, 23, 42, .28); }
@keyframes fadeIn { from { opacity: 0; } }

.palette-box {
  position: relative;
  width: 100%; max-width: 620px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: var(--modal);
  -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px);
  box-shadow: 0 34px 80px -30px rgba(0, 0, 0, .75);
  overflow: hidden;
  animation: popIn .26s cubic-bezier(.2, .8, .2, 1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } }

.palette-input { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--line); }
.palette-input svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted); }
.palette-input input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 15px; }
.palette-input input::placeholder { color: var(--muted); }

.palette-list { list-style: none; max-height: 340px; overflow-y: auto; padding: 8px; }
.palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s;
}
.palette-item .p-ico {
  width: 28px; height: 28px; flex: 0 0 28px;
  display: grid; place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 14px;
}
.palette-item .p-main { flex: 1; min-width: 0; }
.palette-item .p-title { font-size: 14px; }
.palette-item .p-desc { font-size: 12px; color: var(--muted); margin-top: 1px; }
.palette-item .p-hint { font-size: 11.5px; color: var(--muted); }
.palette-item.sel { background: linear-gradient(90deg, rgba(34, 211, 238, .14), rgba(168, 85, 247, .1)); box-shadow: inset 0 0 0 1px rgba(34, 211, 238, .28); }
.palette-empty { padding: 26px; text-align: center; font-size: 13.5px; color: var(--muted); }

.palette-foot {
  display: flex; gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--muted);
}
.palette-foot kbd { margin-right: 3px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 300;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: var(--modal);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: 13.5px;
  box-shadow: 0 20px 44px -22px rgba(0, 0, 0, .7);
  opacity: 0;
  transform: translate(-50%, 18px);
  pointer-events: none;
  transition: opacity .3s, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 揭示动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .75s cubic-bezier(.2, .8, .2, 1), transform .75s cubic-bezier(.2, .8, .2, 1);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .span-2, .span-3, .span-6 { grid-column: span 6; }
  .nav-links { display: none; }
  .hero { padding: var(--sp-9) 0 var(--sp-7); gap: var(--sp-7); }
  .todo-list { max-height: none; }
  #note { min-height: 170px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-progress { max-width: 220px; }
  .quote { padding-left: var(--sp-5); }
}

@media (max-width: 700px) {
  .shell { padding: 0 16px; }
  .overview-head { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
  .overview-progress { max-width: none; width: 100%; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); }
  .stat-card { padding: var(--sp-4); gap: var(--sp-3); }
  .quote-text { font-size: var(--fs-md); }
  .quote-foot { flex-wrap: wrap; }
  .stat-ico { flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; }
  .stat-ico svg { width: 18px; height: 18px; }
  .stat-value { font-size: 22px; }
  .cmd-trigger span { display: none; }
  .palette { padding: 8vh 14px 14px; }
  .hero-cta .btn { flex: 1; }
  .links { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
