/* ============================================================
   Workbench Mobile — 应用外壳 & 主题变量
   对齐《组件制作规范》：深色 #08090c / 卡片 #1a1c25 / accent #8b93ff
   ============================================================ */

:root {
  color-scheme: dark;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "HarmonyOS Sans SC", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  /* 语义色 —— 深色模式 */
  --bg: #08090c;                 /* 应用背景（纯色） */
  --card: #1a1c25;               /* 卡片底 */
  --bg-1: #101218;               /* 弹层/浮层底 */
  --bg-2: #171a22;
  --panel: rgba(255, 255, 255, 0.032);
  --panel-strong: rgba(255, 255, 255, 0.055);

  --text-0: #f1f2f7;             /* 主文字 */
  --text-1: #9aa1b1;             /* 次要 */
  --text-2: #5e6474;             /* 弱化/占位 */
  --on-accent: #171822;          /* accent 实底上的文字（深色=深字） */

  --accent: #8b93ff;             /* 主强调 */
  --accent-strong: #a9aeff;
  --accent-soft: rgba(139, 147, 255, 0.12);
  --accent-glow: rgba(139, 147, 255, 0.3);
  --accent-light: #a5a9ff;       /* Tab 渐变浅端 */
  --accent-dark: #4e52c4;        /* Tab 渐变深端 */
  --icon-inactive: #5a5a66;      /* Tab 未选中线条 */
  --fill-detail: #e8e9ff;        /* 面形内部细节笔画 */
  --fill-shadow: #6b6ec9;        /* 面形阴影笔画 */

  --ok: #34d399;
  --warn: #f5b54a;
  --bad: #f36d7f;

  --stroke: rgba(255, 255, 255, 0.065);     /* 弱描边 */
  --stroke-strong: rgba(255, 255, 255, 0.13); /* 卡片细描边 */

  /* 字号档（手机端固定，参考规范但不再跟随网格行高） */
  --fs-aux-s: 11px;
  --fs-aux-m: 12px;
  --fs-aux-l: 13px;
  --fs-body: 14px;
  --fs-title: 17px;
  --fs-huge: 30px;
}

/* 浅色模式 */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f8;
  --card: #ffffff;
  --bg-1: #ffffff;
  --bg-2: #eceef4;
  --panel: rgba(18, 21, 38, 0.03);
  --panel-strong: rgba(18, 21, 38, 0.05);

  --text-0: #171822;
  --text-1: #52525b;
  --text-2: #8a91a3;
  --on-accent: #ffffff;          /* 浅色下 accent 实底用白字 */

  --accent: #4b3fe3;
  --accent-strong: #6054f1;
  --accent-soft: rgba(75, 63, 227, 0.1);
  --accent-glow: rgba(75, 63, 227, 0.25);
  --accent-light: #9196f7;       /* Tab 渐变浅端 */
  --accent-dark: #4e52c4;        /* Tab 渐变深端 */
  --icon-inactive: #b0b0b8;      /* Tab 未选中线条 */
  --fill-detail: #ffffff;        /* 面形内部细节笔画 */
  --fill-shadow: #6b6ec9;        /* 面形阴影笔画 */

  --stroke: rgba(18, 21, 38, 0.07);
  --stroke-strong: rgba(18, 21, 38, 0.14);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-0);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  overscroll-behavior-y: contain;
  -webkit-user-select: none;
  user-select: none;
}

/* 输入类允许选中 */
input, textarea { -webkit-user-select: text; user-select: text; }

button { font-family: inherit; }

/* ============ 应用骨架 ============ */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
}

.app-head {
  flex: none;
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

#views { flex: 1; min-height: 0; position: relative; }

.view {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(14px + env(safe-area-inset-bottom));
  display: none;
}
.view.active { display: block; }

/* ============ 底部 Tab（底面细指示条，图标保持灰色） ============ */
.tabbar {
  flex: none;
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--stroke);
  background: var(--card);
  padding-top: 4px;
  padding-bottom: env(safe-area-inset-bottom);
  overflow: hidden;
  z-index: 0;
}

/* 底面细指示条：宽度=单列(25%)的一半=12.5%。
   translateX 百分比相对【自身宽度】，一格栏宽=25%=自身宽的200%，故用 200%/400%/600% */
.tabbar::before {
  content: '';
  position: absolute;
  left: 5%;
  bottom: calc(env(safe-area-inset-bottom) + 3px);
  width: 10%;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  z-index: 2;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.32, 1.25, 0.6, 1);
  transform: translateX(0%);
}
.tabbar.arch-at-1::before { transform: translateX(200%); }
.tabbar.arch-at-2::before { transform: translateX(400%); }
.tabbar.arch-at-3::before { transform: translateX(600%); }
.tabbar.arch-at-4::before { transform: translateX(800%); }

.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--text-1);
  padding: 12px 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}
.tab:active { transform: scale(0.96); }
.tab:active .tab-ic { transform: scale(0.9); }

/* 图标容器 */
.tab-ic {
  position: relative;
  width: 23px;
  height: 23px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.tab-ic > svg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
  overflow: visible;
}
.tab-lb { font-size: 12.5px; }

/* ============ 双层图标：默认灰色线形，激活渐变面形弹入（果冻）============ */
.icon-outline {
  fill: none;
  stroke: var(--icon-inactive);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 1;
  transition: opacity 0.25s ease, stroke 0.25s ease;
}
.icon-filled {
  fill: none;
  opacity: 0;
  transform-origin: center;
  transition: none;
}

.tab.active .tab-ic { animation: tabIconPop 0.55s cubic-bezier(0.34, 1.8, 0.64, 1); }
.tab.active .icon-outline {
  opacity: 0;
  animation: jellyLineOut 0.35s ease forwards;
}
.tab.active .icon-filled {
  opacity: 1;
  animation: jellyFaceIn 0.55s cubic-bezier(0.34, 1.8, 0.64, 1) forwards;
}
.tab.active .tab-lb {
  animation: labelSlide 0.3s ease forwards;
}
.tab.active .tab-lb { font-weight: 650; }

@keyframes tabIconPop {
  0%   { transform: scale(0.85) translateY(3px); }
  55%  { transform: scale(1.1) translateY(-1px); }
  78%  { transform: scale(0.96) translateY(0); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes jellyLineOut {
  0%   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  40%  { opacity: 0.5; transform: translateY(-2px) scale(0.92); filter: blur(0.5px); }
  100% { opacity: 0; transform: translateY(-5px) scale(0.85); filter: blur(1px); }
}
@keyframes jellyFaceIn {
  0%   { opacity: 0; transform: scale(0.5) translateY(5px) rotate(-6deg); filter: blur(2px); }
  50%  { opacity: 1; transform: scale(1.12) translateY(-2px) rotate(2deg); filter: blur(0); }
  70%  { transform: scale(0.96) translateY(0) rotate(-1deg); }
  100% { opacity: 1; transform: scale(1) translateY(0) rotate(0); filter: blur(0); }
}
@keyframes labelSlide {
  0%   { opacity: 0.4; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* 按压涟漪 */
.tab::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 32px; height: 32px;
  margin: -16px 0 0 -16px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
  z-index: -1;
}
.tab:active::before {
  animation: pressRipple 0.35s ease-out;
}
@keyframes pressRipple {
  0%   { opacity: 0.12; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(1.6); }
}

/* ============ 标题 ============ */
.page-title { font-size: var(--fs-title); font-weight: 650; margin: 0; }
.page-sub { font-size: var(--fs-aux-m); color: var(--text-1); }
.head-space { flex: 1; }
.icon-head-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text-0);
  font-size: 16px;
  cursor: pointer;
  display: grid; place-items: center;
}

/* 头部刷新按钮（右上角圆形） */
.head-refresh-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text-0);
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.15s ease;
}
.head-refresh-btn:active { background: var(--panel-strong); transform: scale(0.94); }
.head-refresh-btn svg { width: 18px; height: 18px; display: block; }
.head-refresh-btn.spinning svg { animation: headSpin 0.9s linear infinite; }
.head-add-btn {
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font-size: 23px;
  line-height: 1; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 5px 14px var(--accent-glow);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), opacity .15s ease;
}
.head-add-btn:active { transform: scale(.9); opacity: .85; }
@keyframes headSpin { to { transform: rotate(360deg); } }

/* ============================================================
   顶部下拉刷新指示器（PWA 加到主屏 / Safari 均可用）
   ============================================================ */
.pull-indicator {
  flex: none;
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: height 0.22s ease;
  color: var(--text-1);
  will-change: height;
}
.pull-indicator .pull-ind-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 12px;
  font-size: 12px;
}
.pull-indicator .pull-ic {
  width: 16px; height: 16px;
  transition: transform 0.2s ease;
}
.pull-indicator.ready .pull-ic { transform: rotate(180deg); color: var(--accent); }
.pull-indicator.ready .pull-txt { color: var(--accent); }
.pull-indicator.refreshing .pull-ic { animation: headSpin 0.9s linear infinite; color: var(--accent); }
.pull-indicator.refreshing .pull-txt { color: var(--accent); }

/* 下拉时 main 跟着位移，避免突兀 */
#views { transition: transform 0.18s ease; }

/* ============================================================
   头部右侧 · 通用 pill（记账页年月选择入口；可复用其他 Tab）
   - 显式 border-radius: 999px（不依赖 --radius-full），确保胶囊外观稳定
   - 高度 40px，和头部左对齐的标题行视觉同一基线
   ============================================================ */
.ym-pill {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;            /* 强制圆角胶囊，不受 token 缺失影响 */
  background: var(--card);
  border: 1px solid var(--stroke-strong);
  font-size: 13px;
  color: var(--text-0);
  user-select: none;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}
.ym-pill:active {
  background: var(--bg-1);
  transform: scale(0.98);
}
.ym-pill .caret {
  margin-right: 6px;
  font-size: 10px;
  color: var(--text-1);
}
.ym-pill .lbl {
  font-weight: 600;
  color: var(--accent-strong);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ============================================================
   年月选择器 · Bottom Sheet（复用通用弹层容器 + 专用内部结构）
   - 年月范围：2020 年 ~ 2050 年（与桌面端一致）
   ============================================================ */
.ym-pick-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.ym-pick-year {
  display: inline-flex; align-items: center;
  height: 38px; padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--stroke);
  font-size: 14px;
}
.ym-pick-year .nav {
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-1);
  transition: background 0.1s ease;
}
.ym-pick-year .nav:active { background: var(--bg-3); color: var(--accent-strong); }
.ym-pick-year .nav[disabled] { opacity: 0.3; pointer-events: none; }
.ym-pick-year .lbl {
  padding: 0 10px;
  font-weight: 700;
  font-size: 15px;
  min-width: 52px;
  text-align: center;
}
.ym-pick-actions {
  display: flex; align-items: center; gap: 8px;
}
.ym-pick-btn {
  border: 1px solid var(--stroke-strong);
  background: var(--bg-2);
  color: var(--text-0);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.ym-pick-btn:active { background: var(--bg-3); }
.follow-along-icon { filter: brightness(0); }
html[data-theme="light"] .follow-along-icon { filter: brightness(0) invert(1); }
.ym-pick-btn.today {
  border-color: color-mix(in srgb, var(--accent-strong) 45%, transparent);
  background: color-mix(in srgb, var(--accent-strong) 14%, transparent);
  color: var(--accent-strong);
  font-weight: 600;
}
.ym-pick-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.ym-month-cell {
  padding: 16px 0;
  border-radius: 12px;
  text-align: center;
  background: var(--bg-2);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-0);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.1s ease, border-color 0.1s ease, transform 0.06s ease;
}
.ym-month-cell:active { transform: scale(0.98); background: var(--bg-3); }
.ym-month-cell.today-mark {
  border-color: color-mix(in srgb, var(--accent-strong) 55%, transparent);
  color: var(--accent-strong);
}
.ym-month-cell.selected {
  background: var(--accent-strong);
  color: var(--on-accent);
  font-weight: 600;
  border-color: var(--accent-strong);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--accent-strong) 28%, transparent);
}

/* 旧版记账页内容区顶部 header 视觉残留清理 */
.acct-hdr { display: none; }

/* ============ 卡片 & 通用控件 ============ */
.card {
  background: var(--card);
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.card-title { font-size: var(--fs-aux-l); font-weight: 600; color: var(--text-1); margin: 0 0 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--text-1); }
.btn {
  flex: 1;
  border: 1px solid var(--stroke-strong);
  background: var(--card);
  color: var(--text-0);
  font-size: var(--fs-body);
  font-weight: 600;
  padding: 13px 0;
  border-radius: 12px;
  cursor: pointer;
}
.btn-accent {
  flex: 1;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-size: var(--fs-body);
  font-weight: 650;
  padding: 14px 0;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--accent-glow);
}
.btn-soft {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text-1);
  font-size: var(--fs-body);
  padding: 12px 0;
  border-radius: 12px;
  cursor: pointer;
}
.btn-danger { flex: 1; border: 0; background: transparent; color: var(--bad); font-size: var(--fs-body); font-weight: 600; padding: 13px 0; border-radius: 12px; cursor: pointer; }
.btn:active, .btn-accent:active, .btn-soft:active, .btn-danger:active { opacity: 0.85; }

.input {
  width: 100%;
  border: 1px solid var(--stroke);
  background: var(--card);
  color: var(--text-0);
  font-size: var(--fs-body);
  font-family: inherit;
  padding: 13px 14px;
  border-radius: 12px;
  outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--text-2); }

/* 分段控件 */
.seg { display: flex; background: var(--bg-1); border-radius: 12px; padding: 3px; gap: 3px; }
.seg-btn { flex: 1; border: 0; background: transparent; color: var(--text-1); font-size: var(--fs-body); font-weight: 600; padding: 10px 0; border-radius: 9px; cursor: pointer; }
.seg-btn.active { background: var(--accent-soft); color: var(--accent); }

.switch { width: 48px; height: 29px; border-radius: 999px; background: var(--text-2); position: relative; cursor: pointer; transition: background 0.2s; flex: none; }
.switch:after { content: ""; position: absolute; left: 3px; top: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; transition: left 0.2s; }
.switch.on { background: var(--accent); }
.switch.on:after { left: 22px; }

/* FAB */
.fab {
  position: fixed;
  right: calc(max(20px, (100vw - 520px) / 2 + 20px));
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  border: 0; font-size: 28px; font-weight: 300;
  display: grid; place-items: center;
  box-shadow: 0 10px 26px var(--accent-glow);
  cursor: pointer; z-index: 20;
}

/* 空态 */
.empty { text-align: center; color: var(--text-1); font-size: var(--fs-aux-m); padding: 40px 0; }
.empty .em-ic { font-size: 34px; display: block; margin-bottom: 8px; opacity: 0.6; }

/* 增强空态：整卡引导，首屏无数据时依然饱满有行动路径 */
.empty-hero {
  text-align: center;
  padding: 34px 20px 30px;
  margin: 12px 0 0;
  border: 1px dashed var(--stroke-strong);
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--accent-soft), transparent 60%),
    var(--card);
  margin-bottom: 12px;
}
.empty-hero .eh-ic {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: 20px;
  display: grid; place-items: center;
  font-size: 30px;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--stroke-strong);
}
.empty-hero .eh-title { font-size: var(--fs-title); font-weight: 700; color: var(--text-0); }
.empty-hero .eh-desc { font-size: var(--fs-aux-l); color: var(--text-1); margin: 8px auto 0; max-width: 260px; line-height: 1.55; }
.empty-hero .eh-steps {
  display: flex; flex-direction: column; gap: 8px;
  margin: 18px 0; text-align: left;
}
.empty-hero .eh-step {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-body); color: var(--text-0);
  background: var(--bg-2); border: 1px solid var(--stroke);
  border-radius: 12px; padding: 11px 14px;
}
.empty-hero .eh-step .eh-n {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-aux-s); font-weight: 700; color: var(--on-accent);
  background: var(--accent);
}
.empty-hero .eh-btn { width: 100%; margin-top: 4px; }

/* 弹层 */
.pop-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  z-index: 40; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.18s ease;
}
.pop-mask.show { opacity: 1; visibility: visible; pointer-events: auto; }
.pop {
  width: 100%; max-width: 520px;
  background: var(--bg-1);
  border: 1px solid var(--stroke);
  border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 82%;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.22, 1.2, 0.36, 1);
}
.pop-mask.show .pop { transform: translateY(0); }
.pop-title { font-size: var(--fs-title); font-weight: 650; margin: 2px 0 14px; text-align: center; }
.pop-grip { width: 40px; height: 4px; background: var(--stroke-strong); border-radius: 999px; margin: 0 auto 14px; }

/* ============ 随笔 ============ */
.notes-hero {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  margin: 2px 0 10px; background: linear-gradient(135deg, var(--accent-soft), var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--stroke-strong)); border-radius: 16px;
}
.notes-hero-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; color: var(--accent-strong); background: var(--card); border-radius: 12px; }
.notes-hero-icon svg { width: 21px; height: 21px; }
.notes-hero-title { font-size: var(--fs-body); font-weight: 650; }
.notes-hero-sub { margin-top: 2px; color: var(--text-1); font-size: var(--fs-aux-m); }
.notes-list { display: grid; gap: 10px; }
.note-card { padding: 14px 15px 11px; background: var(--card); border: 1px solid var(--stroke-strong); border-radius: 15px; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.note-card:active { transform: scale(.985); background: var(--panel-hover, var(--panel-strong)); }
.note-card.pinned { border-color: color-mix(in srgb, var(--accent) 42%, var(--stroke-strong)); }
.note-card-top, .note-card-foot { display: flex; align-items: center; gap: 8px; }
.note-card-title { min-width: 0; flex: 1; font-size: var(--fs-body); font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.note-pin-badge { flex: none; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 2px 7px; font-size: var(--fs-aux-s); }
.note-card-body { color: var(--text-1); font-size: var(--fs-body); line-height: 1.55; margin: 8px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-card-foot { color: var(--text-2); font-size: var(--fs-aux-s); justify-content: space-between; }
.note-delete { border: 0; background: transparent; color: var(--bad); font: inherit; font-size: var(--fs-aux-s); padding: 3px 0 3px 10px; cursor: pointer; }
.notes-empty { color: var(--text-2); text-align: center; font-size: var(--fs-aux-m); padding: 30px 0; }
.note-editor { display: flex; flex-direction: column; gap: 12px; min-height: min(560px, 74vh); }
.note-editor-head { display: flex; align-items: center; gap: 8px; margin: -3px 0 2px; }
.note-editor-head .btn-soft { flex: none; width: 48px; padding: 8px 0; text-align: left; }
.note-editor-title { flex: 1; text-align: center; font-size: var(--fs-title); font-weight: 650; }
.note-save-btn { flex: none; width: 68px; padding: 9px 0; }
.note-title-input { font-size: 16px; font-weight: 600; }
.note-body-input { flex: 1; min-height: 260px; resize: none; line-height: 1.75; }
.note-editor-meta { color: var(--text-2); font-size: var(--fs-aux-s); }
.note-pin-row { padding: 11px 0 2px; border-top: 1px solid var(--stroke); color: var(--text-1); font-size: var(--fs-body); }

/* 记账 · 图标墙 + 统计 */
.acct-hdr { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 2px; }
.acct-title { font-size: var(--fs-title); font-weight: 700; }
.acct-dpill { display: flex; align-items: center; gap: 1px; background: var(--card); border: 1px solid var(--stroke-strong); border-radius: 999px; padding: 5px 8px; font-size: var(--fs-aux-l); }
.acct-dpill .nav { color: var(--text-1); font-size: 16px; line-height: 1; padding: 0 3px; }
.acct-dpill .lbl { font-weight: 600; padding: 0 6px; color: var(--accent-strong); }

.acct-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 0; }
.acct-tile { background: var(--bg-1); border: 1px solid var(--stroke); border-radius: 11px; padding: 9px 4px 7px; text-align: center; }
.acct-tile img { width: 34px; height: 34px; display: block; margin: 0 auto; }
.acct-tile .n { font-size: var(--fs-aux-s); color: var(--text-1); margin-top: 4px; }
.acct-tile .a { font-size: var(--fs-aux-m); font-weight: 650; margin-top: 1px; }
.acct-tile .bar { height: 3px; border-radius: 999px; background: var(--bg-2); margin: 5px 12px 0; overflow: hidden; }
.acct-tile .bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.acct-blk { margin: 12px 0 0; background: var(--card); border: 1px solid var(--stroke-strong); border-radius: 14px; padding: 11px 14px 12px; }
.acct-bt { display: flex; align-items: center; gap: 8px; font-size: var(--fs-aux-l); font-weight: 650; margin-bottom: 9px; }
.acct-bt i { font-style: normal; background: var(--accent-soft); color: var(--accent-strong); width: 18px; height: 18px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: var(--fs-aux-s); font-weight: 700; }
.acct-bt .dim { margin-left: auto; color: var(--text-2); font-weight: 400; font-size: var(--fs-aux-s); }

.acct-donut { display: flex; align-items: center; gap: 16px; }
.acct-leg { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.acct-li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 6px; font-size: var(--fs-aux-l); color: var(--text-0); }
.acct-li .d { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.acct-li .v { margin-left: 0; color: var(--text-1); font-size: var(--fs-aux-s); text-align: left; white-space: nowrap; }

.acct-rk { display: grid; grid-template-columns: 20px 42px minmax(56px, 1fr) 42px 68px; align-items: center; gap: 7px; padding: 7px 0; border-top: 1px solid var(--stroke); }
.acct-rk:first-of-type { border-top: none; }
.acct-rk .no { width: 20px; height: 20px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--stroke-strong); color: var(--text-1); font-size: var(--fs-aux-s); display: flex; align-items: center; justify-content: center; flex: none; }
.acct-rk .no.t { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); font-weight: 700; }
.acct-rk .nm { min-width: 0; font-size: var(--fs-aux-l); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-rk .bar { width: 100%; height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.acct-rk .bar i { display: block; height: 100%; border-radius: 999px; }
.acct-rk .pct { width: auto; text-align: left; font-size: var(--fs-aux-s); color: var(--text-1); white-space: nowrap; }
.acct-rk .amt { width: auto; justify-self: end; text-align: right; font-size: var(--fs-aux-l); font-weight: 650; white-space: nowrap; }
.acct-rk .mt { width: auto; text-align: left; font-size: var(--fs-aux-s); color: var(--text-2); white-space: nowrap; }

.acct-empty { text-align: center; color: var(--text-2); font-size: var(--fs-aux-m); padding: 14px 0; }
.acct-axis { font-size: 10px; fill: var(--text-2); }

/* 数格表单布局 */
.form-group { margin-bottom: 14px; }
.form-label { font-size: var(--fs-aux-m); color: var(--text-1); margin-bottom: 6px; display: block; }
.flex { display: flex; gap: 10px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 108px; transform: translateX(-50%);
  background: var(--bg-2); color: var(--text-0);
  border: 1px solid var(--stroke-strong);
  padding: 10px 16px; border-radius: 10px;
  font-size: var(--fs-aux-l);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity 0.25s;
}
#toast.show { opacity: 1; }

/* ============================================================
   英语学习 · 底部内容流「今日打卡」大按钮（方案②）
   - 普通流式元素，排在内容末尾，滚到底才见，不遮内容
   - 全宽、文字居中；未打卡 = 紫色渐变；已打卡 = 绿底禁用
   ============================================================ */
.en-fixed-btn {
  width: 100%;
  box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 18px 0;
  margin: 4px 0 6px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--on-accent);
  font-size: 17px; font-weight: 700; line-height: 1;
  box-shadow: 0 8px 24px var(--accent-glow);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, opacity 0.2s ease;
}
.en-fixed-btn:active { transform: scale(0.98); }
.en-fixed-btn.is-done {
  background: linear-gradient(135deg, var(--ok), color-mix(in srgb, var(--ok) 78%, #0e9f6e));
  color: #04271a;
  cursor: default;
  box-shadow: none;
}
.en-fixed-btn.is-done:active { transform: scale(1); }

/* ============================================================
   倒计时 · 双栏日期格墙（重构，信息密度更高）
   - 即将发生 / 已过 两组，未到升序、已过降序（桌面端 cdSortItems）
   ============================================================ */
.cd-sec { font-size: var(--fs-aux-s); color: var(--text-1); font-weight: 600; margin: 14px 0 8px; display: flex; align-items: center; gap: 8px; }
.cd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.cd-cell {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 13px 11px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.cd-cell-t { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cd-cell-name { font-size: var(--fs-body); font-weight: 700; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-cell-repeat-badge { position: absolute; top: 8px; right: 9px; padding: 2px 5px; border-radius: 999px; background: color-mix(in srgb, var(--cd-color, var(--accent)) 16%, transparent); color: var(--cd-color, var(--accent)); font-size: 10px; line-height: 1.2; font-weight: 600; }
.cd-cell-n { margin-top: 6px; display: flex; align-items: baseline; gap: 3px; }
.cd-cell-num { font-size: clamp(22px, 6.5vw, 30px); font-weight: 700; line-height: 1.05; color: var(--accent); font-family: var(--font-metric, inherit); }
.cd-cell-unit { font-size: var(--fs-aux-s); color: var(--text-1); }
.cd-cell-sub { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 5px; min-width: 0; font-size: var(--fs-aux-s); color: var(--text-2); line-height: 1.35; }
.cd-cell-date, .cd-cell-solar { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-cell-solar { color: var(--text-2); }
.cd-date-input, .cd-lunar-select { min-height: 44px; }
.cd-mobile-lunar-hint {
  margin: 9px 2px 16px;
  line-height: 1.5;
  letter-spacing: .01em;
}
.cd-mobile-remind-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--surface-muted);
}
.cd-mobile-remind-row .form-label { margin: 0; color: var(--text-1); }
.cd-mobile-remind-select {
  width: 148px;
  min-height: 44px;
  flex: 0 0 148px;
}
@media (max-width: 380px) {
  .cd-mobile-remind-row {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }
  .cd-mobile-remind-select {
    width: 100%;
    flex-basis: auto;
  }
}
.cd-cell.is-today { border-color: var(--stroke); }
.cd-cell.is-today .cd-cell-num { color: var(--ok); }
.cd-cell.is-past { opacity: 0.6; }
.cd-cell.is-past .cd-cell-num { color: var(--text-2); }

/* 表单公历/农历分段 */
.seg-btn.on { background: var(--accent-soft); color: var(--accent); }

/* 滚动条极细 */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: var(--stroke); border-radius: 999px; }

/* 异步操作反馈：方案切换与倒计时保存/删除 */
@keyframes wbViewSwitchIn {
  from { opacity: .35; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes wbBusySpin {
  to { transform: rotate(360deg); }
}
.en-view-switching { animation: wbViewSwitchIn .38s cubic-bezier(.2,.8,.2,1); }
.en-plan-row { transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.en-plan-row:active { transform: scale(.985); }
.en-plan-switch { transition: background .18s ease, transform .18s ease; }
.en-plan-switch:active { transform: scale(.94); }
button.is-busy { position: relative; opacity: .72; cursor: wait; }
button.is-busy::after {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 7px;
  vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: wbBusySpin .7s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .en-view-switching { animation: none; }
  button.is-busy::after { animation-duration: 1.5s; }
}
