/* daydayup · 武侠少侠主题 v0.3.2 */

* { box-sizing: border-box; }

:root {
  /* 古卷焕新 · 提亮通透 + 强对比 + 纵深（暖陶土 → 江湖） */
  --bg-base: #f5eedb;                /* 宣纸米黄（提亮） */
  --bg-elev: #ece0c2;                /* 深米黄（层次） */
  --bg-card: rgba(255, 253, 246, 0.92);   /* 卡片：宣纸半透（更亮） */
  --bg-card-hover: rgba(255, 254, 249, 1);
  --bg-input: rgba(255, 254, 249, 0.92);  /* 输入框：奶白 */
  --border: rgba(160, 90, 44, 0.22);       /* 陶土棕边框 */
  --border-strong: rgba(160, 90, 44, 0.42);
  --text: #1b2418;                   /* 主文字：墨青（加深，强对比） */
  --text-dim: #5c4a38;               /* 次文字：陶土褐 */
  --text-mute: #6b5c4a;              /* 弱文字（通过 WCAG AA 4.5:1） */
  --accent: #a05a2c;                 /* 陶土主色（暖棕金） */
  --accent-soft: #d4a373;            /* 暖陶土金 */
  --accent-deep: #5c3a1e;            /* 深陶土 */
  --accent-bg: rgba(160, 90, 44, 0.10);
  --accent-glow: rgba(160, 90, 44, 0.32);
  --success: #4a8b46;                /* 墨绿（成功态，保持功能性） */
  --danger: #c0341f;                 /* 朱砂红（更亮） */
  --gold: #c79a3b;                   /* 古铜金 */
  --shadow-sm: 0 2px 6px rgba(92, 58, 30, 0.10);
  --shadow-md: 0 8px 24px rgba(92, 58, 30, 0.16);
  --shadow-glow: 0 0 32px rgba(160, 90, 44, 0.26);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --sidebar-width: 72px;             /* 桌面侧边栏：竖排木牌，足够空间容纳竖排文字 */
  /* 字体配对：标题宋体（秀气文化感）+ 正文黑体（清晰） */
  --font-serif: "Songti SC", "宋体", "SimSun", "Source Han Serif SC", "Noto Serif CJK SC", "STSong", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "DengXian", "Source Han Sans SC", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, sans-serif;
  /* 水墨调色：墨色 / 朱砂印泥 / 宣纸二色 */
  --ink: #23211c;
  --ink-soft: #4a463d;
  --ink-wash: rgba(35, 33, 28, 0.10);
  --cinnabar: #b23a2e;            /* 朱砂印泥 */
  --cinnabar-soft: #c75a4a;
  --paper-2: #efe5cc;             /* 宣纸深纹 */
  --seal-bg: rgba(178, 58, 46, 0.92);
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

/* 标题统一宋体（秀气文化感）；正文继承黑体 */
h1, h2, h3, .auth-title, .modal-title, .card-head h2, .calendar-head h2, .section-title {
  font-family: var(--font-serif);
}

/* 背景水墨层：远山雾霭 + 斜竹影 */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 50% -5%, rgba(255, 250, 235, 0.55), transparent 60%),   /* 顶部提亮通透 */
    radial-gradient(ellipse 60% 45% at 85% 8%, rgba(181, 133, 47, 0.20), transparent 60%),     /* 右上暖金 */
    radial-gradient(ellipse 70% 55% at 12% 35%, rgba(160, 90, 44, 0.14), transparent 65%),    /* 左上陶土暖雾 */
    radial-gradient(ellipse 80% 60% at 50% 105%, rgba(92, 58, 30, 0.22), transparent 60%),    /* 底部深陶土 */
    radial-gradient(ellipse 120% 120% at 50% 50%, transparent 52%, rgba(60, 45, 30, 0.12) 100%); /* 四角暗角纵深 */
  pointer-events: none;
}
.bg-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(115deg, transparent 0%, transparent 78%, rgba(120, 80, 40, 0.06) 79%, rgba(120, 80, 40, 0.06) 79.4%, transparent 79.8%),
    linear-gradient(105deg, transparent 0%, transparent 82%, rgba(120, 80, 40, 0.05) 82.4%, transparent 83%),
    linear-gradient(125deg, transparent 0%, transparent 88%, rgba(90, 60, 35, 0.07) 88.3%, transparent 88.8%);
  pointer-events: none;
}
.bg-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  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='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* =============== 水墨视觉强化（全局） =============== */
/* 卡片：宣纸内纹 + 角落淡墨晕 */
.card {
  position: relative;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  background: radial-gradient(120% 80% at 100% 0%, rgba(35, 33, 28, 0.05), transparent 55%);
  pointer-events: none;
}
/* 卡片标题：笔触下划线（墨色斜锋） */
.card-head h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 2px;
}
.card-head h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 62%;
  height: 4px;
  background: linear-gradient(90deg, var(--ink), var(--ink-soft) 58%, transparent);
  border-radius: 0 3px 3px 0;
  transform: skewX(-14deg);
  opacity: 0.5;
}
body {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 18px 88px;
}

/* ---------- 顶部 · 少侠�?---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 18px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.brand .sword {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(92, 58, 30, 0.25));
}
.brand .title {
  font-size: 24px;
  background: linear-gradient(120deg, var(--accent-deep) 0%, var(--accent) 60%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 2px rgba(92, 58, 30, 0.08);
  font-family: var(--font-serif);
  letter-spacing: 2px;
}
.brand .version {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: var(--accent-deep);
  background: rgba(176, 138, 62, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid rgba(176, 138, 62, 0.35);
}
.meta {
  font-size: 13px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 6px;
}
.meta .dot { color: var(--text-mute); }

/* ---------- 当前时间段卡�?---------- */
.current-block {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 248, 230, 0.95) 0%, rgba(245, 230, 200, 0.95) 100%);
  border: 1px solid rgba(160, 90, 44, 0.4);
  border-radius: var(--r-lg);
  padding: 18px 22px 16px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.current-block::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--accent-soft), var(--accent));
  box-shadow: 0 0 16px var(--accent-glow);
}
.current-block::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(232, 195, 130, 0.4), transparent 60%);
  pointer-events: none;
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%      { opacity: 1.0; transform: scale(1.08); }
}
.cb-label {
  font-size: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.cb-main {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}
.cb-time {
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-soft);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  letter-spacing: -0.5px;
}
.cb-dash { color: var(--text-mute); font-size: 16px; font-weight: 400; }
.cb-info { flex: 1; min-width: 0; }
.cb-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.cb-note {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.cb-next {
  position: relative;
  z-index: 1;
  font-size: 12px;
  color: var(--text-dim);
  padding-top: 10px;
  border-top: 1px dashed rgba(139, 90, 43, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
}
.cb-next-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-mute);
  font-weight: 600;
}
.cb-next strong {
  color: var(--accent-soft);
  font-weight: 600;
  font-size: 13px;
}

/* ---------- 内容卡片通用 ---------- */
.content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.badge {
  background: var(--bg-elev);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
  letter-spacing: 0.5px;
}
.card-hint {
  margin: -8px 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-mute);
}
.ch-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ch-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-bg);
  border: 1px solid rgba(160, 90, 44, 0.28);
}
.ch-tag-record {
  color: var(--success);
  background: rgba(74, 139, 70, 0.12);
  border-color: rgba(74, 139, 70, 0.32);
}

/* ---------- 每日真实记录 ---------- */
.actual-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.actual-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px;
  background: rgba(255, 253, 246, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  transition: border-color 0.15s, background 0.15s;
}
.actual-item.is-current {
  border-color: var(--accent);
  background: rgba(160, 90, 44, 0.08);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.actual-item.is-past { opacity: 0.78; }
.actual-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  line-height: 1.4;
  padding-top: 3px;
  color: var(--text-mute);
}
.actual-time .a-start,
.actual-time .a-end {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.actual-time .a-dash {
  font-size: 9px;
  color: var(--text-mute);
  margin: 1px 0;
}
.actual-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.actual-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.3px;
}
.actual-input {
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 13px;
  color: var(--text);
  resize: none;
  width: 100%;
  outline: none;
  font-family: inherit;
  line-height: 1.45;
  min-height: 34px;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
  word-break: break-word;
}
.actual-input:focus {
  border-color: var(--accent);
  background: rgba(253, 248, 232, 0.95);
}
.actual-input::placeholder { color: var(--text-mute); font-style: italic; }
.actual-save {
  font-size: 10px;
  color: var(--text-mute);
  text-align: right;
  height: 13px;
  line-height: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.actual-save.saving { color: var(--accent); }
.actual-save.saved  { color: var(--success); }
.actual-save.error  { color: var(--danger); }
.actual-empty {
  padding: 18px;
  text-align: center;
  color: var(--text-mute);
  font-size: 12px;
  font-style: italic;
}

/* ---------- 作息时间轴：AI 定制对话框 ---------- */
.ai-schedule-box {
  margin-top: 16px;
  padding: 14px;
  background: rgba(253, 248, 232, 0.55);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
}
.ai-schedule-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.ai-schedule-box textarea {
  width: 100%;
  min-height: 56px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.45;
  transition: border-color 0.15s, background 0.15s;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.ai-schedule-box textarea:focus {
  border-color: var(--accent);
  background: rgba(253, 248, 232, 0.95);
}
.ai-schedule-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.ai-schedule-actions button {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.ai-schedule-actions button:active { transform: scale(0.97); }
.ai-schedule-actions button:disabled { opacity: 0.6; cursor: not-allowed; }
#ai-schedule-btn {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(160, 90, 44, 0.25);
}
#ai-schedule-btn:hover { background: var(--accent-deep); }
#ai-schedule-reset {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
#ai-schedule-reset:hover { background: rgba(160, 90, 44, 0.08); }
.ai-schedule-status {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  min-height: 18px;
}
.ai-schedule-status.error { color: var(--danger); }

/* ---------- 每日真实记录：时间网格 ---------- */
.actual-grid {
  display: grid;
  grid-template-columns: 44px 1fr;
  position: relative;
  height: 1152px; /* 24h * 48px */
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: rgba(255, 253, 246, 0.4);
  --hour-height: 48px;
}
.actual-grid-ruler {
  border-right: 1px solid var(--border);
  position: relative;
  background: rgba(250, 247, 240, 0.6);
}
.actual-grid-track {
  position: relative;
}
.actual-grid-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.actual-grid-hour {
  height: var(--hour-height);
  border-bottom: 1px dashed var(--border);
  position: relative;
}
.actual-grid-ruler .actual-grid-hour::after {
  content: attr(data-hour);
  position: absolute;
  right: 6px;
  top: -7px;
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.actual-grid-bars {
  position: absolute;
  inset: 0;
}
.actual-grid-bar {
  position: absolute;
  left: 6px;
  right: 6px;
  background: linear-gradient(180deg, rgba(212, 163, 115, 0.92), rgba(160, 90, 44, 0.85));
  border: 1px solid rgba(160, 90, 44, 0.55);
  border-radius: 10px;
  padding: 5px 8px;
  overflow: hidden;
  cursor: grab;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(92, 58, 30, 0.12);
  transition: box-shadow 0.15s, transform 0.05s;
  display: flex;
  flex-direction: column;
}
.actual-grid-bar:hover {
  box-shadow: 0 4px 12px rgba(92, 58, 30, 0.18);
  z-index: 3;
}
.actual-grid-bar.dragging {
  cursor: grabbing;
  z-index: 10;
  box-shadow: 0 6px 16px rgba(92, 58, 30, 0.22);
}
.actual-grid-bar.creating {
  background: linear-gradient(180deg, rgba(212, 163, 115, 0.5), rgba(160, 90, 44, 0.4));
  border: 1.5px dashed rgba(160, 90, 44, 0.85);
  border-radius: 10px;
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.15);
  pointer-events: none;
  opacity: 0.92;
}
.actual-grid-bar .bar-time {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.actual-grid-bar .bar-text {
  flex: 1;
  width: 100%;
  min-height: 22px;
  font-size: 12px;
  line-height: 1.35;
  color: #fff;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 0;
  margin-top: 2px;
  overflow: hidden;
  word-break: break-word;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
.actual-grid-bar .bar-text::placeholder { color: rgba(255, 255, 255, 0.7); font-style: italic; }
.actual-grid-bar .bar-handle {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  cursor: ns-resize;
  border-radius: 0 0 9px 9px;
}
.actual-grid-bar .bar-delete {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  z-index: 4;
}
.actual-grid-bar:hover .bar-delete { opacity: 1; }
.actual-grid-bar .bar-delete:hover { background: rgba(255, 255, 255, 0.35); }
.actual-grid-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--danger);
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(160, 60, 50, 0.4);
}
.actual-grid-now::before {
  content: '';
  position: absolute;
  left: -5px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}

/* 今日任务跨两列 */
.today-tasks-card { grid-column: 1 / -1; }

/* ---------- 时间轴 ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 78px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(to bottom, var(--border-strong), var(--border), var(--border-strong));
  border-radius: 1px;
}
.tl-item {
  display: grid;
  grid-template-columns: 70px 14px 1fr;
  gap: 0;
  padding: 8px 0;
  position: relative;
  align-items: start;
  transition: all 0.2s ease;
  border-radius: var(--r-sm);
}
.tl-item:hover {
  background: rgba(139, 90, 43, 0.04);
}
.tl-item.is-past { opacity: 0.4; }
.tl-item.is-future { opacity: 0.72; }
.tl-item.is-current { opacity: 1; }

.tl-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  line-height: 1.4;
  padding-top: 1px;
  padding-right: 8px;
  color: var(--text-mute);
}
.tl-time .tl-start,
.tl-time .tl-end {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}
.tl-time .tl-dash {
  font-size: 9px;
  color: var(--text-mute);
  margin: 1px 0;
}

.tl-marker {
  position: relative;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.tl-marker::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 2px solid var(--text-mute);
  transition: all 0.3s ease;
}
.tl-item.is-current .tl-marker::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-bg), 0 0 16px var(--accent-glow);
  animation: marker-pulse 2s ease-in-out infinite;
}
@keyframes marker-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--accent-bg), 0 0 16px var(--accent-glow); }
  50%      { box-shadow: 0 0 0 7px rgba(160, 90, 44, 0.18), 0 0 24px var(--accent-glow); }
}
.tl-item.is-past .tl-marker::before {
  background: var(--text-mute);
  border-color: var(--text-mute);
}

.tl-body {
  padding-left: 14px;
  min-width: 0;
}
.tl-plan {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tl-actual-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tl-actual {
  background: rgba(160, 90, 44, 0.08);
  border: 1px solid rgba(160, 90, 44, 0.22);
  border-radius: 6px;
  padding: 5px 7px;
  font-size: 11px;
  color: var(--text);
  resize: none;
  width: 100%;
  outline: none;
  font-family: inherit;
  line-height: 1.45;
  min-height: 22px;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
  word-break: break-word;
}
.tl-actual:focus {
  border-color: var(--accent);
  background: rgba(160, 90, 44, 0.14);
}
.tl-actual::placeholder { color: var(--text-mute); font-style: italic; }
.tl-actual-save {
  font-size: 9px;
  color: var(--text-mute);
  text-align: right;
  height: 12px;
  line-height: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.tl-actual-save.saving { color: var(--accent); }
.tl-actual-save.saved  { color: var(--success); }
.tl-actual-save.error  { color: var(--danger); }

.tl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tl-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}
.tl-item.is-current .tl-title {
  color: var(--accent-soft);
  font-weight: 700;
}
.tl-dur {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-mute);
  background: var(--bg-elev);
  padding: 2px 7px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--border);
}
.tl-item.is-current .tl-dur {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: rgba(160, 90, 44, 0.28);
}
.tl-note {
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.5;
  margin-top: 3px;
}

/* ---------- 任务列表 ---------- */
ul.task-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.task-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-radius: var(--r-sm);
  transition: background 0.15s;
  border-bottom: 1px solid rgba(139, 90, 43, 0.06);
}
.task-list li:last-child { border-bottom: none; }
.task-list li:hover { background: rgba(139, 90, 43, 0.05); }

.task-empty {
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  padding: 24px 8px !important;
  font-style: italic;
}
.task-empty:hover { background: transparent !important; }

.time-chip {
  display: inline-block;
  min-width: 50px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
  font-size: 12px;
  padding: 2px 0;
}
.time-chip.dim { color: var(--text-mute); }

.label {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
  word-break: break-word;
}
.label small { color: var(--text-mute); font-size: 11px; margin-left: 4px; }

.task-list .checkbox {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--text-mute);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
  background: transparent;
}
.task-list .checkbox:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}
.task-list li.done .checkbox {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-base);
}
.task-list li.done .label {
  color: var(--text-mute);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--text-mute);
}
.task-list .delete {
  visibility: hidden;
  color: var(--text-mute);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  font-weight: 300;
}
.task-list li:hover .delete { visibility: visible; }
.task-list .delete:hover {
  color: var(--danger);
  background: rgba(160, 64, 48, 0.16);
}

/* ---------- 添加任务 ---------- */
.add-task {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.add-task input[type=text] {
  flex: 2;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.add-task input[type=text]:focus {
  border-color: var(--accent);
  background: rgba(253, 248, 232, 0.95);
}
.add-task input[type=text]::placeholder { color: var(--text-mute); }
.add-task input[type=time] {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  transition: border-color 0.2s;
  color-scheme: dark;
}
.add-task input[type=time]:focus { border-color: var(--accent); }
.add-task button {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: var(--bg-base);
  border: none;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.5px;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(160, 90, 44, 0.28);
}
.add-task button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(160, 90, 44, 0.4);
}
.add-task button:active { transform: translateY(0); }

/* ---------- 计划视图：添加事件（今日事件面板） ---------- */
.add-event {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  background: rgba(255, 253, 246, 0.72);
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
}
.event-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.event-row-time {
  gap: 6px;
  align-items: stretch;
}
.event-row-meta {
  align-items: stretch;
}
.event-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.event-field span {
  font-size: 10px;
  color: var(--text-mute);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.event-field input[type="time"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.event-field input[type="time"]:focus {
  border-color: var(--accent);
  background: rgba(253, 248, 232, 0.95);
}
.event-field output {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 8px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.event-field-dur {
  flex: 0 0 84px;
}
.event-arrow {
  color: var(--text-mute);
  font-size: 13px;
  padding-top: 14px;
  flex-shrink: 0;
}
.add-event input[type="text"] {
  flex: 1;
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.add-event input[type="text"]:focus {
  border-color: var(--accent);
  background: rgba(253, 248, 232, 0.95);
}
.add-event input[type="text"]::placeholder { color: var(--text-mute); }
.add-event select {
  flex: 1;
  min-width: 90px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.add-event select:focus { border-color: var(--accent); background: rgba(253, 248, 232, 0.95); }
.add-event button {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: var(--bg-base);
  border: none;
  padding: 10px 22px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  letter-spacing: 0.5px;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(160, 90, 44, 0.28);
  flex-shrink: 0;
}
.add-event button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(160, 90, 44, 0.4);
}
.add-event button:active { transform: translateY(0); }

@media (max-width: 480px) {
  .event-row { flex-wrap: wrap; }
  .event-row-time { gap: 4px; }
  .event-field { min-width: 80px; }
  .event-field-dur { flex: 0 0 72px; }
  .event-arrow { padding-top: 12px; }
  .add-event button { flex: 1; }
}

/* 今日事件列表：统一使用 task-list 风格，补齐未定义的类 */
#day-tasks .task-toggle,
#day-tasks .task-del { display: none; } /* 旧类名兜底，新版用 checkbox/delete */
#day-tasks .checkbox {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--text-mute);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: transparent;
  transition: all 0.2s cubic-bezier(.4, 0, .2, 1);
  background: transparent;
  padding: 0;
  margin: 0;
}
#day-tasks .checkbox:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}
#day-tasks li.done .checkbox {
  background: var(--success);
  border-color: var(--success);
  color: var(--bg-base);
}
#day-tasks li.done .label {
  color: var(--text-mute);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--text-mute);
}
#day-tasks .delete {
  visibility: hidden;
  color: var(--text-mute);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
  font-weight: 300;
}
#day-tasks li:hover .delete { visibility: visible; }
#day-tasks .delete:hover {
  color: var(--danger);
  background: rgba(160, 64, 48, 0.16);
}
#day-tasks .task-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: rgba(212, 163, 115, 0.18);
  color: var(--accent-deep);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}
#day-tasks .task-title {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  min-width: 0;
  word-break: break-word;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 12px;
  font-size: 11px;
  color: var(--text-mute);
  background: linear-gradient(to top, var(--bg-base) 60%, transparent);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
}
.footer .sep { color: rgba(139, 90, 43, 0.2); }
.footer #health-status { color: var(--success); transition: color 0.3s; }
.footer #health-status.offline { color: var(--danger); }

/* ---------- Tab 切换 ---------- */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;                     /* 防止内容撑开 */
  flex-shrink: 0;                       /* 不被压缩 */
}
.tab {
  flex: 1 1 0;                          /* 等宽分配，不随文字长度变化 */
  min-width: 0;                         /* 允许 flex 收缩 */
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 10px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  text-align: center;                   /* 确保文字居中 */
  white-space: nowrap;                  /* 不换行 */
  overflow: hidden;                     /* 超长文字不撑开 */
  text-overflow: ellipsis;              /* 超长截断 */
}
.tab:hover:not(:disabled):not(.is-active) {
  color: var(--text);
  background: rgba(139, 90, 43, 0.06);
}
.tab.is-active {
  background: linear-gradient(135deg, rgba(160, 90, 44, 0.28), rgba(160, 90, 44, 0.14));
  color: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgba(160, 90, 44, 0.32);
}
.tab:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
@media (max-width: 360px) {
  .tabs { gap: 2px; padding: 3px; }
  .tab { padding: 8px 4px; font-size: 12px; letter-spacing: 0; }
}

/* 视图切换 */
.view { animation: fade-in 0.25s ease backwards; }
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 日历 v2 ---------- */
.calendar-card { padding: 16px 14px 14px; }
.calendar-head { margin-bottom: 14px; padding-bottom: 14px; gap: 12px; }
.calendar-head h2 {
  flex: 1;
  text-align: center;
  font-size: 20px !important;
  color: var(--text) !important;
  letter-spacing: 1px !important;
  text-transform: none !important;
  font-weight: 700;
}
.cal-nav {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
}
.cal-nav:hover {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  padding: 0 2px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mute);
  padding: 6px 0;
  letter-spacing: 2px;
}
.cal-weekdays .weekend { color: rgba(160, 64, 48, 0.55); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  min-height: 64px;
  height: auto;
  padding: 8px 4px 6px;
  background: rgba(139, 90, 43, 0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  position: relative;
  transition: all 0.15s;
  font-variant-numeric: tabular-nums;
  gap: 6px;
  font-family: inherit;
}
.cal-day:hover:not(.is-other) {
  background: rgba(139, 90, 43, 0.08);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.cal-day.is-other {
  color: var(--text-mute);
  opacity: 0.25;
  background: transparent;
  cursor: default;
  pointer-events: none;
}
.cal-day.is-today {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  border-color: var(--accent);
  color: var(--bg-base);
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(160, 90, 44, 0.4), inset 0 0 0 1px rgba(255, 248, 230, 0.6);
}
.cal-day.is-today .cal-dot { background: var(--bg-base) !important; opacity: 0.7; }
.cal-day.is-today.is-selected {
  box-shadow: 0 0 0 3px var(--accent), 0 4px 18px rgba(160, 90, 44, 0.5);
}
.cal-day.is-selected:not(.is-today) {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent-soft);
  font-weight: 700;
}
.cal-day.is-weekend:not(.is-other):not(.is-today) { color: rgba(160, 64, 48, 0.75); }

.cal-num { font-size: 15px; line-height: 1; font-weight: 600; }
.cal-dots { display: flex; gap: 3px; height: 5px; align-items: center; }
.cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: block;
}
.cal-dot-todo { background: var(--accent); }
.cal-dot-done { background: var(--success); }

.cal-day .cal-count {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.cal-day.is-today .cal-count { color: var(--bg-base); opacity: 0.6; }

.cal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  gap: 10px;
}
.cal-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-mute);
  flex-wrap: wrap;
}
.cal-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot-todo { background: var(--accent); }
.legend-dot-done { background: var(--success); }
.legend-dot-today { background: var(--accent-soft); }
.cal-today-btn {
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.cal-today-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}
.cal-summary-line {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 8px 0 0;
  border-top: 1px dashed var(--border);
  letter-spacing: 0.3px;
}

/* ---------- 日历选中日期：状态徽标 / 概览 / AI 日报 / 未来提醒 ---------- */
.cal-day-mode {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  margin: 2px 0 12px;
  letter-spacing: 0.5px;
}
.cal-day-mode.past { background: rgba(160, 90, 44, 0.14); color: var(--accent-deep); }
.cal-day-mode.today { background: rgba(212, 163, 115, 0.2); color: var(--accent-deep); }
.cal-day-mode.future { background: rgba(90, 120, 160, 0.16); color: #5a78a0; }

.cal-overview { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.overview-block {
  background: var(--bg-elev, rgba(255, 253, 246, 0.5));
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.overview-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-deep);
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.overview-body { display: flex; flex-direction: column; gap: 6px; }
.ov-empty { font-size: 12px; color: var(--text-mute); font-style: italic; }
.ov-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.ov-row.done .ov-text { color: var(--text-mute); text-decoration: line-through; text-decoration-color: var(--text-mute); }
.ov-time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent); font-size: 12px; flex-shrink: 0; }
.ov-check { width: 16px; text-align: center; font-weight: 700; flex-shrink: 0; }
.ov-row.done .ov-check { color: var(--success); }
.ov-row:not(.done) .ov-check { color: var(--danger); }
.ov-text { flex: 1; min-width: 0; word-break: break-word; }

.coin-dist-row {
  display: grid;
  grid-template-columns: 12px auto auto 1fr;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.cd-dot { width: 10px; height: 10px; border-radius: 50%; }
.cd-label { color: var(--text); }
.coin-dist-row strong { color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.cd-track { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.cd-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }

.ai-report-box {
  margin-top: 4px;
  padding: 14px;
  background: rgba(253, 248, 232, 0.55);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
}
.report-head {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-deep);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#ai-report-btn {
  border: none;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(160, 90, 44, 0.25);
  transition: transform .12s, background .12s;
}
#ai-report-btn:hover { background: var(--accent-deep); }
#ai-report-btn:active { transform: scale(0.97); }
#ai-report-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ai-report-status { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--text-dim); min-height: 16px; }
.ai-report-status.error { color: var(--danger); }
.ai-report-text {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  display: none;
  padding: 12px 14px;
  background: var(--bg-input);
  border-left: 3px solid var(--accent-soft);
  border-radius: var(--r-sm);
}
.ai-report-text.show { display: block; }

.future-head {
  font-size: 13px;
  font-weight: 600;
  color: #5a78a0;
  margin: 4px 0 10px;
  letter-spacing: 0.3px;
}

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
  body { padding: 14px 14px 88px; font-size: 14px; }
  .brand .title { font-size: 19px; }
  .cb-main { gap: 14px; flex-wrap: wrap; }
  .cb-time { font-size: 22px; gap: 6px; }
  .topbar { padding: 6px 0 14px; margin-bottom: 14px; }
  .timeline::before { left: 60px; }
  .tl-item { grid-template-columns: 52px 14px 1fr; }
  .tl-time .tl-start, .tl-time .tl-end { font-size: 11px; }
  .tl-body { padding-left: 12px; grid-template-columns: 1fr 1fr; gap: 6px; }
  .tl-actual { font-size: 10px; padding: 4px 6px; }
  .card { padding: 14px 14px; }
  .tab { padding: 8px 4px; font-size: 12px; }
  .cal-day { font-size: 12px; }
  .cal-num { font-size: 12px; }
}
/* =============== v0.3 云备份设置页（米黄主题） =============== */
.cloud-form { display: flex; flex-direction: column; gap: 12px; }
.cloud-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-dim); font-weight: 500; }
.cloud-form input {
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  transition: border-color .15s, background .15s;
  outline: none;
}
.cloud-form input:focus { border-color: var(--accent); background: rgba(253, 248, 232, 0.95); }
.cloud-form-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.cloud-form button {
  padding: 9px 16px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.cloud-form button:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.cloud-form button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-soft)); color: var(--bg-base); border-color: var(--accent); box-shadow: 0 2px 8px rgba(160, 90, 44, 0.28); }
.cloud-form button.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(160, 90, 44, 0.4); }
.cloud-form button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.cloud-form button.danger:hover { filter: brightness(1.1); }
.cloud-msg { font-size: 12px; min-height: 18px; margin-top: 4px; color: var(--text-mute); }
.cloud-msg.ok { color: var(--success); font-weight: 500; }
.cloud-msg.err { color: var(--danger); font-weight: 500; }
.cloud-section-title { margin: 16px 0 8px; font-size: 11px; color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.cloud-backup-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cloud-backup-list li {
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  flex-wrap: wrap;
  gap: 8px;
}
.cloud-backup-list li.cloud-empty { color: var(--text-mute); font-style: italic; font-family: inherit; }
.cloud-backup-list .cb-key { color: var(--text); flex: 1; min-width: 0; word-break: break-all; font-size: 11px; }
.cloud-backup-list .cb-meta { color: var(--text-mute); font-size: 11px; }
.cloud-backup-list .cb-actions { display: flex; gap: 4px; }
.cloud-backup-list .cb-actions button {
  padding: 5px 10px; font-size: 11px; background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 6px; cursor: pointer; font-weight: 600;
  font-family: inherit; transition: all .15s;
}
.cloud-backup-list .cb-actions button:hover { background: var(--accent); color: var(--bg-base); border-color: var(--accent); }
.cloud-restore-info { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; word-break: break-all; }
.cloud-restore-info code { color: var(--text); font-size: 11px; background: var(--bg-elev); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }
.cloud-form .warn { color: var(--danger); font-size: 13px; margin: 10px 0; padding: 10px 12px; background: rgba(160, 64, 48, 0.08); border-left: 3px solid var(--danger); border-radius: 4px; }
.cloud-form .hint { color: var(--text-mute); font-size: 11px; margin: 6px 0 0; }

.cloud-row { display: flex; gap: 10px; align-items: stretch; }
.cloud-row .cloud-grow { flex: 2; }
.cloud-row .cloud-port { flex: 0 0 90px; }
.cloud-form select {
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.cloud-form select:focus { border-color: var(--accent); }
.cloud-form textarea {
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  outline: none;
  transition: border-color .15s;
  resize: vertical;
  min-height: 70px;
}
.cloud-form textarea:focus { border-color: var(--accent); }

/* =============== v0.3.2 鉴权门 · 少侠入门 =============== */
.auth-gate {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(92, 58, 30, 0.10) 0%, transparent 35%, transparent 70%, rgba(92, 58, 30, 0.18) 100%);
}
.auth-gate::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/static/assets/shaoxia/hero.jpg');
  background-size: cover;
  background-position: center 30%;
  opacity: 0.18;
  filter: grayscale(0.3) blur(0.5px);
  pointer-events: none;
  z-index: -1;
}
.auth-gate::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(239, 230, 207, 0.6) 0%, rgba(239, 230, 207, 0.3) 40%, rgba(239, 230, 207, 0.5) 100%);
  pointer-events: none;
  z-index: -1;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 32px 28px 28px;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  max-width: 380px;
  width: 100%;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: 8px; bottom: 8px;
  border: 1px solid rgba(176, 138, 62, 0.25);
  border-radius: calc(var(--r-lg) - 6px);
  pointer-events: none;
}
.auth-title {
  margin: 0 0 4px;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 4px;
  background: linear-gradient(120deg, var(--accent-deep) 0%, var(--accent) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}
.auth-subtitle {
  margin: 0 0 14px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-mute);
  text-transform: uppercase;
}
/* 登录页武侠励志语录 */
.auth-quote {
  margin: 0 0 18px;
  padding: 12px 16px 12px 18px;
  border-left: 3px solid var(--accent-soft);
  background: linear-gradient(90deg, rgba(120, 80, 40, 0.10), rgba(120, 80, 40, 0));
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  text-align: left;
  transition: opacity 0.42s ease;
}
.auth-quote.is-fading { opacity: 0; }
.auth-quote-text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  letter-spacing: 0.4px;
}
.auth-quote-cite {
  display: block;
  margin-top: 6px;
  text-align: right;
  font-size: 13px;
  font-style: normal;
  color: var(--text-mute);
}
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg-elev);
  border-radius: var(--r-sm);
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.auth-tab.is-active {
  background: var(--bg-base);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.auth-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text-dim); font-weight: 500;
  margin-bottom: 14px;
}
.auth-form input {
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-msg {
  font-size: 12px; min-height: 18px; margin: 8px 0;
  color: var(--text-mute);
}
.auth-msg.err { color: var(--danger); font-weight: 500; }
.auth-submit {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: var(--bg-base);
  border: none;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
  margin-top: 4px;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(160, 90, 44, 0.32);
}
.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(160, 90, 44, 0.45);
}
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.5;
}

/* =============== v0.3 账号信息 =============== */
.account-info {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 13px;
}
.account-info dt {
  color: var(--text-dim);
  font-weight: 500;
}
.account-info dd {
  margin: 0;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  word-break: break-all;
}

.app .hint {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.55;
}
.app .hint code {
  background: var(--bg-elev);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  border: 1px solid var(--border);
}

/* =============== v0.3 audio =============== */
.audio-toggle-row {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  margin-bottom: 12px;
}
.audio-toggle-row input[type=checkbox] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
}
.cloud-form input[type=range] {
  padding: 0;
  background: transparent;
  border: none;
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  outline: none;
}
.cloud-form input[type=range]:focus { border: none; background: transparent; }
.cloud-form-actions button[data-audio-preview] {
  font-size: 11px;
  padding: 7px 12px;
}
.cloud-form-actions button[data-audio-preview]:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

/* =============== v0.3 data mgmt =============== */
.data-stats { font-size: 12px; color: var(--text-dim); }
.data-stats-table { width: 100%; border-collapse: collapse; }
.data-stats-table th, .data-stats-table td { text-align: left; padding: 4px 8px; border-bottom: 1px dashed var(--border); }
.data-stats-table th { color: var(--text-mute); font-weight: 500; width: 30%; }
.data-stats-table td { color: var(--text); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.cloud-form-actions button { color: var(--text); }

/* =============== modal 弹窗（goal-modal / pwd-modal） =============== */
/* 注意：用 :not([hidden]) 取代裸 .modal，避免 display:flex 覆盖 HTML hidden 属性 */
.modal {
  display: none;
}
.modal:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 20px;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  width: 100%;
  max-width: 380px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.modal-card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.modal-card .cloud-form label {
  display: block;
  margin-bottom: 12px;
}
.modal-card .cloud-form label > span {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.modal-card .cloud-form input[type=text],
.modal-card .cloud-form input[type=password],
.modal-card .cloud-form textarea,
.modal-card .cloud-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.modal-card .cloud-form input:focus,
.modal-card .cloud-form textarea:focus,
.modal-card .cloud-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* =============== 无障碍：键盘焦点可见 =============== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible,
.tab:focus-visible,
.auth-tab:focus-visible,
.cal-day:focus-visible,
.cal-nav:focus-visible,
.task-list .checkbox:focus-visible,
.task-list .delete:focus-visible,
.add-task button:focus-visible,
.cloud-form button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
/* 输入框已有边框高亮作反馈，去掉默认 outline 避免双重 */
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: none; }

/* =============== 无障碍：尊重 prefers-reduced-motion =============== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .current-block::after { animation: none; }
}

/* =============== 通用确认弹窗 =============== */
.confirm-card { max-width: 340px; }
.confirm-message {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 18px;
  white-space: pre-line;
}
.confirm-dialog .primary,
.confirm-dialog #confirm-ok {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: var(--bg-base);
  border: 1px solid var(--accent);
  box-shadow: 0 2px 8px rgba(160, 90, 44, 0.28);
}
.confirm-dialog.is-danger #confirm-ok {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: none;
}
.confirm-dialog .cloud-form-actions { justify-content: flex-end; }

/* =============== 轻提示 toast =============== */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}
.toast {
  pointer-events: auto;
  background: var(--accent-deep);
  color: var(--bg-base);
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 248, 230, 0.18);
  max-width: 90vw;
  animation: toast-in 0.2s ease;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--success); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============== 任务完成「剑气」微交互 =============== */
.task-list li.just-done { animation: sword-slash 0.42s ease forwards; }
@keyframes sword-slash {
  0%   { box-shadow: inset 0 0 0 0 rgba(94, 124, 84, 0); background: transparent; }
  35%  { box-shadow: inset 3px 0 0 0 var(--success); background: rgba(94, 124, 84, 0.16); }
  100% { box-shadow: inset 3px 0 0 0 var(--success); background: transparent; }
}

/* 模态在矮屏可滚动，避免内容被截断 */
.modal:not([hidden]) { overflow-y: auto; }
.modal-card { max-height: calc(100vh - 40px); overflow-y: auto; }

/* =============== 视觉强化 v2 · 交错入场 + 触感悬浮 =============== */
/* 关键：用 backwards 填充模式——入场播完后交还基础样式，悬浮变换(hover)照常生效，
   且不会与每分钟 fetchToday 的列表重建冲突（列表项不在此动画范围内）。 */

/* 视图切入时，外层容器交错揭示（仅随 Tab 切换重播，不受每分钟刷新影响） */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.view .current-block  { animation: rise-in 0.55s cubic-bezier(.22,.61,.36,1) backwards; animation-delay: 0.08s; }
.view .card           { animation: rise-in 0.6s cubic-bezier(.22,.61,.36,1) backwards; }
/* 内容卡片按序交错（.card 均为 .content 直接子元素，nth-child 可靠） */
.view .content > .card:nth-child(1)  { animation-delay: 0.14s; }
.view .content > .card:nth-child(2)  { animation-delay: 0.20s; }
.view .content > .card:nth-child(3)  { animation-delay: 0.26s; }
.view .content > .card:nth-child(4)  { animation-delay: 0.32s; }
.view .content > .card:nth-child(5)  { animation-delay: 0.38s; }
.view .content > .card:nth-child(6)  { animation-delay: 0.44s; }
.view .content > .card:nth-child(n+7){ animation-delay: 0.50s; }

/* 卡片触感：悬浮轻微抬升 + 描边微亮 + 纵深加深 */
.card {
  transition: transform 0.22s cubic-bezier(.22,.61,.36,1), box-shadow 0.22s ease, border-color 0.22s ease;
  will-change: transform;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--shadow-glow), 0 14px 32px rgba(92, 58, 30, 0.22);
  border-color: rgba(160, 90, 44, 0.45);
}

/* 任务行 hover：左侧墨痕点缀，呼应武侠笔锋 */
.task-list li { transition: background 0.15s, box-shadow 0.15s; }
.task-list li:hover {
  box-shadow: inset 3px 0 0 0 var(--accent-soft);
  background: rgba(139, 90, 43, 0.06);
}

/* 品牌标题：缓慢流光（渐变位移），作为全局记忆点 */
.brand .title {
  background-size: 220% auto;
  animation: title-shimmer 9s ease-in-out infinite;
}
@keyframes title-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* 日历格子：随翻月/点击重播的横向波浪入场（仅用户主动操作触发，作为反馈正合适） */
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.cal-day { animation: pop-in 0.42s cubic-bezier(.34, 1.56, .64, 1) backwards; }
.cal-grid .cal-day:nth-child(7n+1) { animation-delay: 0.00s; }
.cal-grid .cal-day:nth-child(7n+2) { animation-delay: 0.03s; }
.cal-grid .cal-day:nth-child(7n+3) { animation-delay: 0.06s; }
.cal-grid .cal-day:nth-child(7n+4) { animation-delay: 0.09s; }
.cal-grid .cal-day:nth-child(7n+5) { animation-delay: 0.12s; }
.cal-grid .cal-day:nth-child(7n+6) { animation-delay: 0.15s; }
.cal-grid .cal-day:nth-child(7n+7) { animation-delay: 0.18s; }

/* 目标列表项：轻量弹入（随 loadGoals 重播，属用户主动操作） */
@keyframes goal-pop {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.goal-list > li { animation: goal-pop 0.4s cubic-bezier(.22,.61,.36,1) backwards; }
.goal-list > li:nth-child(1) { animation-delay: 0.04s; }
.goal-list > li:nth-child(2) { animation-delay: 0.09s; }
.goal-list > li:nth-child(3) { animation-delay: 0.14s; }
.goal-list > li:nth-child(4) { animation-delay: 0.19s; }
.goal-list > li:nth-child(5) { animation-delay: 0.24s; }
.goal-list > li:nth-child(n+6){ animation-delay: 0.29s; }

/* 激活 Tab：柔和辉光，强化当前所在 */
.tab.is-active { box-shadow: inset 0 0 0 1px rgba(160, 90, 44, 0.32), 0 2px 10px rgba(160, 90, 44, 0.18); }

/* 年度进度概览（时间进度 vs 目标进度） */
.year-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  padding: 12px 14px;
  margin: 4px 0 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.year-overview .yo-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.year-overview .yo-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(92, 58, 30, 0.12);
  overflow: hidden;
}
.year-overview .yo-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.9s cubic-bezier(.22, .61, .36, 1);
}
.year-overview .yo-fill-time { background: linear-gradient(90deg, var(--accent-soft), var(--accent)); }
.year-overview .yo-fill-goal { background: linear-gradient(90deg, var(--gold), #c79a4a); }
.year-overview .yo-val {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
}
.year-overview .yo-status {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--text-mute);
  border-top: 1px dashed var(--border-strong);
  padding-top: 8px;
}
@media (max-width: 520px) {
  .year-overview { grid-template-columns: 1fr; }
}

/* 减少动效偏好：上述所有入场/流光均被全局规则关闭，此处补强关闭流光定位与进度过渡 */
@media (prefers-reduced-motion: reduce) {
  .brand .title { animation: none; background-position: 0% 50%; }
  .auth-quote { transition: none; }
.year-overview .yo-fill { transition: none; }
}

/* ===================== 目标页：AI 荐策 + 日/周/月/年 ===================== */
.ai-rec-card {
  border: 1px solid rgba(160, 90, 44, 0.38);
  background: linear-gradient(180deg, rgba(252, 248, 235, 0.96), rgba(244, 236, 214, 0.92));
  color: #3a2e25;
  /* 浅色谋士卡片内复写变量，让输入框/列表项自动适配 */
  --text: #3a2e25;
  --text-dim: #5c4a3d;
  --text-mute: #7d6a58;
  --bg-input: #fffdf8;
  --bg-card: #fffdf8;
  --border: rgba(160, 90, 44, 0.22);
  --border-strong: rgba(160, 90, 44, 0.42);
  --accent: #a05a2c;
  --accent-soft: #d4a373;
  --accent-deep: #5c3a1e;
}
.ai-rec-card .card-head h2 { color: #3a2e25; margin: 0; font-size: 17px; }
.ai-card-head { gap: 12px; align-items: flex-start; }
.ai-head-left { display: flex; align-items: center; gap: 14px; }
.ai-head-title { display: flex; flex-direction: column; gap: 2px; }
.ai-head-sub { margin: 0; font-size: 11.5px; color: var(--text-mute); font-weight: 500; }
.strategist-figure {
  width: 76px; height: 76px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(212, 163, 115, 0.15), 0 8px 22px rgba(160, 90, 44, 0.22);
  flex-shrink: 0;
  background: #fffdf8;
  animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.strategist-figure img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  display: block;
}
@media (max-width: 520px) {
  .strategist-figure { width: 60px; height: 60px; }
  .ai-head-title h2 { font-size: 15px; }
}
.ai-rec-sub { margin: 2px 0 14px; font-size: 12.5px; color: var(--text-mute); line-height: 1.5; }
.ai-plan-box {
  margin: 0 0 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(160, 90, 44, 0.18);
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(160, 90, 44, 0.06);
}
.ai-plan-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .04em; margin-bottom: 10px; }
.ai-plan-box textarea {
  width: 100%; resize: vertical; min-height: 68px;
  padding: 10px 12px; font-size: 13.5px; line-height: 1.6;
  font-family: var(--font-sans); color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
}
.ai-plan-box textarea:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
.ai-plan-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ai-plan-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ai-plan-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-plan-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
}
.ai-plan-field select,
.ai-plan-field input[type="date"],
.ai-plan-field input[type="number"] {
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.ai-plan-field select:focus,
.ai-plan-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(212, 163, 115, 0.18);
}
.ai-plan-daily-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-plan-daily-wrap input[type="number"] {
  width: 60px;
  text-align: center;
}
.ai-plan-daily-wrap span {
  font-size: 12px;
  color: var(--text-mute);
}
@media (max-width: 560px) {
  .ai-plan-options { grid-template-columns: 1fr; }
}
.ai-plan-actions .primary,
#ai-plan-btn {
  border-radius: 20px; padding: 8px 16px; font-weight: 600; font-size: 13px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(160, 90, 44, 0.28);
  transition: transform .12s ease, box-shadow .12s ease;
}
.ai-plan-actions .primary:hover,
#ai-plan-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(160, 90, 44, 0.34); }
.ai-plan-btn[disabled] { opacity: .62; cursor: progress; transform: none !important; }
.ai-plan-hint { font-size: 11.5px; color: var(--text-mute); }
.ai-rec-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ai-rec-date-header {
  font-size: 13px; font-weight: 700; color: var(--accent);
  padding: 6px 14px 2px 14px; margin-top: 6px;
  border-bottom: 1px dashed var(--border);
}
.ai-rec-adopt-all {
  list-style: none; padding: 4px 0;
  display: flex; justify-content: center;
}
.ai-rec-adopt-all .primary {
  border-radius: 20px; padding: 8px 18px; font-weight: 600; font-size: 13px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 4px 12px rgba(160, 90, 44, 0.28);
  transition: transform .12s ease, box-shadow .12s ease;
}
.ai-rec-adopt-all .primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(160, 90, 44, 0.34); }
.ai-rec-adopt-all .primary[disabled] { opacity: .62; cursor: progress; transform: none !important; }
.ai-rec-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 2px 8px rgba(160, 90, 44, 0.05);
  animation: rise-in 0.35s ease backwards;
}
.ai-rec-main { flex: 1; min-width: 0; }
.ai-rec-title { font-weight: 600; color: var(--text); font-size: 14px; line-height: 1.35; }
.ai-rec-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-mute); margin-top: 6px; }
.ai-rec-time { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: rgba(212, 163, 115, 0.18); color: var(--accent-deep); border-radius: 999px; font-weight: 600; }
.ai-rec-reason { color: var(--text-mute); }
.ai-rec-actions { display: flex; gap: 6px; flex-shrink: 0; margin-top: 2px; }
.ai-rec-adopt {
  background: var(--accent); color: #fff; border: none;
  border-radius: 20px; padding: 6px 14px; font-weight: 600;
  cursor: pointer; font-family: inherit; font-size: 12.5px;
  box-shadow: 0 3px 10px rgba(160, 90, 44, 0.22);
  transition: transform .12s ease, background .12s ease;
}
.ai-rec-adopt:hover { background: var(--accent-deep); transform: translateY(-1px); }
.ai-rec-edit, .ai-rec-skip {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--text-dim); border-radius: 20px; padding: 6px 12px;
  cursor: pointer; font-family: inherit; font-size: 12.5px;
  transition: background .12s ease, color .12s ease;
}
.ai-rec-edit:hover, .ai-rec-skip:hover { background: rgba(160, 90, 44, 0.08); color: var(--text); }
.ai-edit-title {
  flex: 1; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--bg-card); font-family: inherit; font-size: 13.5px; color: var(--text);
}
.ai-edit-row { display: flex; gap: 8px; margin-top: 8px; }
.ai-edit-time, .ai-edit-duration {
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--bg-card); font-family: inherit; color: var(--text); font-size: 13px;
}
.ai-edit-duration { width: 80px; }

.ghost-btn {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--text-dim); border-radius: 20px; padding: 6px 12px;
  cursor: pointer; font-family: inherit; font-size: 12px;
  transition: background .12s ease, color .12s ease;
}
.ghost-btn:hover { background: rgba(160, 90, 44, 0.08); color: var(--text); }

.subtabs {
  display: flex; gap: 4px; margin-bottom: 14px; padding: 4px;
  background: var(--bg-card); border: 1px solid var(--border-strong); border-radius: var(--r-md);
}
.subtab {
  flex: 1; background: transparent; border: none; color: var(--text-dim);
  padding: 8px 4px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.2s; letter-spacing: 0.3px;
}
.subtab:hover:not(.is-active) { color: var(--text); background: rgba(139, 90, 43, 0.06); }
.subtab.is-active {
  background: linear-gradient(135deg, rgba(160, 90, 44, 0.28), rgba(160, 90, 44, 0.14));
  color: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(160, 90, 44, 0.32);
}

.target-panel { animation: rise-in 0.3s ease backwards; }

.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-col {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 8px 6px; min-height: 80px;
}
.week-col.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-glow); }
.week-col-head {
  font-size: 12px; font-weight: 700; color: var(--text-dim);
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.week-col-count { font-size: 10px; background: var(--bg-elev); border-radius: 8px; padding: 1px 6px; color: var(--text-mute); }
.week-col-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.week-col-list li { font-size: 11.5px; color: var(--text); display: flex; flex-direction: column; line-height: 1.3; }
.week-col-list li.done { text-decoration: line-through; color: var(--text-mute); }
.week-col-list li em { font-style: normal; font-size: 10px; color: var(--text-mute); }
.week-empty { color: var(--text-mute); text-align: center; }

.month-weeks { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.month-week-row {
  display: grid; grid-template-columns: 64px 56px 1fr; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px;
}
.month-week-label { font-weight: 600; color: var(--text-dim); }
.month-week-rate { color: var(--accent-soft); font-weight: 700; }
.month-week-count { color: var(--text-mute); text-align: right; }

/* 月度时间进度 */
.month-time-progress {
  margin: 8px 0;
  display: flex; flex-direction: column; gap: 4px;
}
.mtp-bar { height: 6px; border-radius: 999px; background: rgba(92, 58, 30, 0.12); overflow: hidden; }
.mtp-fill { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent-soft), var(--accent)); transition: width 0.6s ease; }
.mtp-info { display: flex; justify-content: space-between; font-size: 12px; }
.mtp-label { color: var(--text-dim); }
.mtp-val { color: var(--accent-deep); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 月度统计摘要 */
.month-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 10px 0; padding: 10px 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md);
}
.ms-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ms-icon { font-size: 18px; }
.ms-num { font-size: 16px; font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.ms-label { font-size: 11px; color: var(--text-mute); }

/* 日历热力图 */
.month-heatmap { margin: 10px 0; }
.hm-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px;
  font-size: 11px; text-align: center;
}
.hm-header { font-size: 10px; color: var(--text-mute); font-weight: 600; padding: 2px 0; }
.hm-cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 4px; font-weight: 500; color: var(--text);
  transition: transform 0.15s;
}
.hm-cell:hover { transform: scale(1.15); }
.hm-empty { background: transparent; }
.hm-none { background: rgba(92, 58, 30, 0.05); color: var(--text-mute); }
.hm-zero { background: rgba(180, 60, 40, 0.18); color: #b44; }
.hm-partial { background: rgba(212, 163, 115, 0.3); color: var(--accent); }
.hm-full { background: rgba(76, 175, 80, 0.25); color: #4caf50; }
.hm-today { outline: 2px solid var(--accent); outline-offset: -1px; font-weight: 700; }
.hm-future { background: rgba(92, 58, 30, 0.04); color: var(--text-mute); opacity: 0.55; }

/* 丰富每周卡片 */
.month-week-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 10px 12px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px;
}
.mw-left { display: flex; flex-direction: column; gap: 4px; min-width: 72px; }
.mw-label { font-weight: 600; color: var(--text-dim); }
.mw-mini-bar { height: 4px; border-radius: 999px; background: rgba(92, 58, 30, 0.12); overflow: hidden; }
.mw-mini-fill { height: 100%; background: var(--accent-soft); border-radius: 999px; transition: width 0.5s ease; }
.mw-rate { font-size: 11px; color: var(--accent-soft); font-weight: 700; }
.mw-right { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.mw-count { font-size: 12px; color: var(--text-mute); }
.mw-tasks { display: flex; flex-wrap: wrap; gap: 4px; }
.mw-task {
  font-size: 11.5px; padding: 2px 6px; border-radius: 4px;
  background: rgba(92, 58, 30, 0.08); color: var(--text-dim);
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mw-task-done { background: rgba(76, 175, 80, 0.12); color: #4caf50; }
.mw-more { font-size: 11px; color: var(--text-mute); padding: 2px 4px; }

/* 年度统计仪表盘 */
.year-dashboard {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 10px 0; padding: 10px 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md);
}
.yd-item { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.yd-icon { font-size: 18px; }
.yd-num { font-size: 16px; font-weight: 700; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.yd-label { font-size: 11px; color: var(--text-mute); }

/* 季度里程碑 */
.year-quarters {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 10px 0; padding: 10px 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md);
}
.yq-card { display: flex; flex-direction: column; gap: 4px; }
.yq-label { font-size: 13px; font-weight: 700; color: var(--accent); }
.yq-bar { height: 6px; border-radius: 999px; background: rgba(92, 58, 30, 0.12); overflow: hidden; }
.yq-fill { height: 100%; width: 0; border-radius: 999px; background: var(--accent-soft); transition: width 0.6s ease; }
.yq-val { font-size: 11.5px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* 月度趋势柱状图 */
.year-trend { margin: 10px 0; }
.yt-chart {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px;
  padding: 8px 4px; align-items: flex-end;
  height: 80px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-md);
}
.yt-col { display: flex; flex-direction: column; align-items: center; height: 100%; }
.yt-bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; width: 100%; }
.yt-bar {
  width: 100%; min-height: 2px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-soft));
  transition: height 0.5s ease;
}
.yt-month { font-size: 10px; color: var(--text-mute); padding-top: 2px; }

@media (max-width: 520px) {
  .month-stats, .year-dashboard { grid-template-columns: repeat(2, 1fr); }
  .year-quarters { grid-template-columns: repeat(2, 1fr); }
  .yt-chart { grid-template-columns: repeat(6, 1fr); height: 60px; }
  .hm-grid { gap: 2px; font-size: 10px; }
  .month-week-row { flex-direction: column; }
}

@media (max-width: 520px) {
  .week-grid { grid-template-columns: repeat(4, 1fr); }
  .week-col.is-today { order: -1; grid-column: span 4; }
}

/* ===================== 桌面布局（≥900px）：三国志13 风格游戏界面 ===================== */
@media (min-width: 900px) {
  body {
    max-width: none;
    margin: 0;
    padding: 0;
    background: #0c0906;
  }
  .bg-glow {
    position: fixed;
    inset: 0;
    opacity: 0.18;
  }

  /* 应用外框：清新浅木质感 */
  .app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 0;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background:
      linear-gradient(135deg, #5d4a36 0%, #3d2f22 50%, #5d4a36 100%);
    border: 3px solid #c49a4a;
    box-shadow:
      inset 0 0 0 2px rgba(20, 14, 10, 0.5),
      0 0 0 1px rgba(20, 14, 10, 0.35),
      0 0 50px rgba(0, 0, 0, 0.55);
  }

  /* 顶部标题栏 */
  .topbar {
    grid-column: 2;
    grid-row: 1;
    position: relative;
    top: 0;
    z-index: 6;
    margin: 0;
    padding: 16px 28px;
    background:
      linear-gradient(180deg, #6b5a48, #4a3d30),
      repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0px, rgba(255, 255, 255, 0.04) 1px, transparent 1px, transparent 10px);
    border-bottom: 2px solid #c49a4a;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .brand .title {
    color: #f7efd6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
  .brand .version { color: #d4bb8a; }
  .meta {
    color: #e6d8b3;
    font-size: 15px;
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
  }

  /* 左侧导航面板：精简为左侧上中部5个竖向方块 */
  .tabs {
    /* 强制覆盖基础样式 */
    margin: 0 !important;
    padding: 12px 8px !important;
    width: 60px !important;
    height: auto !important;
    max-height: 320px !important;
    background: rgba(30, 30, 35, 0.6) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
    /* 网格布局 */
    grid-column: 1 !important;
    grid-row: 1 / -1 !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
  }

  .tab {
    /* 强制覆盖基础样式 */
    flex: 0 0 auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 6px 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    letter-spacing: 0 !important;
    border: 1px solid rgba(196, 154, 74, 0.35) !important;
    background: rgba(255, 253, 246, 0.06) !important;
    color: rgba(255, 255, 255, 0.65) !important;
    font-family: var(--font-sans) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
    transition: all .2s ease !important;
    position: relative !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4) !important;
    white-space: normal !important;
    text-overflow: clip !important;
    overflow: visible !important;
  }
  .tab:hover {
    background: rgba(196, 154, 74, 0.25) !important;
    border-color: rgba(196, 154, 74, 0.8) !important;
    color: #fff !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  }
  .tab.is-active {
    background: linear-gradient(135deg, rgba(160, 90, 44, 0.5), rgba(160, 90, 44, 0.25)) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 2px 12px rgba(160, 90, 44, 0.4) !important;
    transform: scale(1.02) !important;
  }
  .tab.is-active::before {
    display: none !important;
  }

  /* 主内容区：淡宣纸纹理 */
  .view {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding: 28px 30px;
    background:
      linear-gradient(180deg, rgba(251, 247, 239, 0.98), rgba(242, 234, 218, 0.97)),
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
    background-blend-mode: multiply;
    position: relative;
    overflow-y: auto;
  }
  .view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, #c49a4a 50%, transparent 100%);
    opacity: 0.7;
  }

  /* 卡片：边角纹饰 */
  .card {
    border: 1px solid rgba(139, 118, 86, 0.55);
    box-shadow: inset 0 0 0 1px rgba(255, 253, 246, 0.35), 0 8px 30px rgba(0, 0, 0, 0.15);
  }
  .card::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 26px;
    height: 26px;
    border-top: 3px solid #c49a4a;
    border-left: 3px solid #c49a4a;
    border-radius: 3px 0 0 0;
    pointer-events: none;
  }
  .card::after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border-bottom: 3px solid #c49a4a;
    border-right: 3px solid #c49a4a;
    border-radius: 0 0 3px 0;
    pointer-events: none;
  }

  /* 桌面下主内容更舒展 */
  .view { padding: 32px 36px; }

  /* 底部状态栏 */
  .footer {
    position: relative;
    grid-column: 2;
    grid-row: 3;
    margin: 0;
    padding: 12px 28px;
    background: #4a3d30;
    border-top: 2px solid #c49a4a;
    color: #d8ccb0;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .footer .sep { color: #a07d38; }
  .footer #health-status { color: #6ba568; }
  .footer #health-status.offline { color: #c75a4a; }

  /* 内容双栏 */
  .view .content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    align-items: start;
  }
  .view .content > .card { margin-bottom: 0; }
  #view-calendar .content { grid-template-columns: 1.5fr 1fr; }
  #view-year .content { display: block; }
}

@media (min-width: 1500px) {
  .app { max-width: none; }
}

/* ===================== 光阴金币（v0.3.3 · 取代英雄/成长系统） ===================== */

/* 状态栏：当天剩余金币 pill */
.coin-pill {
  margin-left: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  background: rgba(181, 133, 47, 0.12);
  border: 1px solid rgba(181, 133, 47, 0.38);
  letter-spacing: 0.3px;
}
.coin-pill.is-over {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

/* 今日光阴金币卡片 */
.coin-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 249, 232, 0.96) 0%, rgba(244, 226, 194, 0.96) 100%);
  border: 1px solid rgba(181, 133, 47, 0.40);
  border-radius: var(--r-lg);
  padding: 16px 20px 14px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md), var(--shadow-glow);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.coin-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--gold), #8a5a1c);
  box-shadow: 0 0 16px rgba(181, 133, 47, 0.4);
}
.coin-head {
  display: flex;
  align-items: center;
  gap: 18px;
}
.coin-remain-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
  flex-shrink: 0;
}
.coin-remain-num {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.coin-remain-unit {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 1px;
}
.coin-meter { flex: 1; min-width: 0; }
.coin-meter-row {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.coin-meter-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.coin-track {
  height: 12px;
  background: rgba(120, 90, 50, 0.16);
  border-radius: 999px;
  overflow: hidden;
}
.coin-fill {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--gold));
  transition: width 0.5s ease;
}
.coin-fill.is-over { background: linear-gradient(90deg, var(--cinnabar-soft), var(--danger)); }
.coin-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.coin-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.coin-cat-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.coin-cat strong { color: var(--text); font-variant-numeric: tabular-nums; }
.coin-cat small { color: var(--text-mute); font-variant-numeric: tabular-nums; }
.coin-cat-empty { color: var(--text-mute); font-style: italic; font-size: 12px; }

/* 光阴金币库房：24 枚实体金币可视化（AI 生成金币贴图 + 武侠质感） */
.coin-vault {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 11px 9px;
  margin: 16px 0 12px;
  padding: 16px 14px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 215, 90, 0.16), transparent 45%),
    linear-gradient(135deg, rgba(120, 90, 50, 0.16) 0%, rgba(120, 90, 50, 0.06) 100%);
  border: 1px dashed rgba(255, 215, 90, 0.45);
  border-radius: var(--r-md);
  justify-items: center;
  align-items: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.10);
}
.coin {
  --coin-size: 34px;
  width: var(--coin-size);
  height: var(--coin-size);
  border-radius: 50%;
  background-image: url('/static/assets/shaoxia/coin-gold.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 215, 90, 0.35), 0 2px 5px rgba(0, 0, 0, 0.28);
  position: relative;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), filter 0.45s ease, opacity 0.45s ease, box-shadow 0.45s ease;
  animation: coin-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.coin.is-used {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.4);
  filter: brightness(0.5) saturate(0.55) sepia(0.08);
  opacity: 0.82;
}
.coin.is-remain:hover { transform: scale(1.12) translateY(-1px); filter: brightness(1.12); }
.coin.is-remain {
  animation: coin-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both, coin-glow 2.6s ease-in-out 0.6s infinite;
}
@keyframes coin-in {
  from { opacity: 0; transform: scale(0.4) rotate(-25deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes coin-glow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 215, 90, 0.35), 0 2px 5px rgba(0, 0, 0, 0.28), 0 0 10px rgba(255, 215, 90, 0.55); }
  50%      { box-shadow: inset 0 0 0 1px rgba(255, 215, 90, 0.35), 0 2px 5px rgba(0, 0, 0, 0.28), 0 0 24px rgba(255, 215, 90, 0.92); }
}
.coin-vault-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -4px 0 12px;
  font-size: 11px;
  color: var(--text-mute);
}
.coin-vault-legend .lg-remain,
.coin-vault-legend .lg-used {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.coin-vault-legend .lg-remain { background-image: url('/static/assets/shaoxia/coin-gold.png'); background-size: cover; background-position: center; box-shadow: 0 0 8px rgba(255, 215, 90, 0.7); }
.coin-vault-legend .lg-used { background-image: url('/static/assets/shaoxia/coin-gold.png'); background-size: cover; background-position: center; filter: brightness(0.5) saturate(0.55) sepia(0.08); opacity: 0.82; }
@media (max-width: 560px) {
  .coin-vault { grid-template-columns: repeat(8, 1fr); gap: 9px 6px; padding: 14px 10px; }
  .coin { --coin-size: 28px; }
}

/* 损失条目：时间流逝但未用于事项的金币，朱砂暗红警示 */
.coin-cat-lost { color: #9e3b2e; font-weight: 600; }
.coin-cat-lost .coin-cat-dot { box-shadow: 0 0 0 2px rgba(158, 59, 46, 0.18); }
.coin-cat-lost strong { color: #9e3b2e; }
.coin-cat-lost small { color: rgba(158, 59, 46, 0.7); }

/* 事项类目 chip + 金币迷你标记 */
.cat-chip {
  display: inline-block;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--cat, #8a8276);
  white-space: nowrap;
}
.coin-mini { color: var(--gold); font-weight: 600; }

/* 任务表单：类目下拉 + 时长输入 */
.add-task { flex-wrap: wrap; }
.add-task select {
  flex: 1 1 88px;
  min-width: 82px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}
.add-task select:focus { border-color: var(--accent); background: rgba(253, 248, 232, 0.95); }
.add-task input.dur-input {
  flex: 0 1 84px;
  min-width: 70px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 9px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s, background 0.2s;
}
.add-task input.dur-input:focus { border-color: var(--accent); background: rgba(253, 248, 232, 0.95); }
.add-task input.dur-input::placeholder { color: var(--text-mute); font-size: 12px; }

/* 回顾视图 */
.review-summary-card {
  background: linear-gradient(135deg, rgba(255, 249, 232, 0.96), rgba(244, 226, 194, 0.96));
  border-color: rgba(181, 133, 47, 0.40);
}
.review-budget { display: flex; align-items: center; gap: 20px; margin-bottom: 14px; }
.review-remain { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; flex-shrink: 0; }
.review-remain-num {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.review-remain-unit { font-size: 12px; color: var(--text-dim); margin-top: 2px; letter-spacing: 1px; }
.review-meter { flex: 1; min-width: 0; }
.review-meter-row { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.review-meter-row strong { color: var(--text); }
.review-track { height: 12px; background: rgba(120, 90, 50, 0.16); border-radius: 999px; overflow: hidden; }
.review-fill {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--gold));
  transition: width 0.5s ease;
}
.review-fill.is-over { background: linear-gradient(90deg, var(--cinnabar-soft), var(--danger)); }
.review-cats { display: flex; flex-direction: column; gap: 10px; }
.review-cat { display: flex; flex-direction: column; gap: 4px; }
.review-cat-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.review-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.review-cat-label { color: var(--text); font-weight: 600; }
.review-cat-head strong { color: var(--text); font-variant-numeric: tabular-nums; }
.review-cat-head small { color: var(--text-mute); font-variant-numeric: tabular-nums; margin-left: auto; }
.review-cat-track { height: 10px; background: rgba(120, 90, 50, 0.14); border-radius: 999px; overflow: hidden; }
.review-cat-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }
.review-cat-pct { font-size: 11px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.review-date {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

/* 损失条目（回顾）：朱砂暗红，与时间流逝未记录的金币对应 */
.review-cat.is-lost {
  padding: 8px 10px;
  background: rgba(158, 59, 46, 0.06);
  border: 1px solid rgba(158, 59, 46, 0.22);
  border-radius: var(--r-sm);
}
.review-cat.is-lost .review-cat-label { color: #9e3b2e; }
.review-cat.is-lost .review-cat-head strong { color: #9e3b2e; }
.review-cat.is-lost .review-cat-head small { color: rgba(158, 59, 46, 0.7); }
.review-cat.is-lost .review-cat-pct { color: rgba(158, 59, 46, 0.7); }

/* 移动端：金币卡片与时间轴信息纵向堆叠 */
@media (max-width: 560px) {
  .coin-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .coin-remain-num { font-size: 34px; }
  .review-budget { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* ===== 强制左侧上中部5个竖向方块导航（始终生效） ===== */
@media (min-width: 768px) {
  .app {
    display: grid !important;
    grid-template-columns: 60px 1fr !important;
    grid-template-rows: auto 1fr auto !important;
    padding-left: 60px !important;
  }
  .tabs {
    /* 强制覆盖基础样式 */
    margin: 0 !important;
    padding: 12px 8px !important;
    width: 60px !important;
    height: auto !important;
    max-height: 320px !important;
    background: rgba(30, 30, 35, 0.8) !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3) !important;
    /* 固定定位在左侧中间 */
    position: fixed !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    z-index: 1000 !important;
  }
  .tab {
    /* 强制覆盖基础样式 */
    flex: 0 0 auto !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
    padding: 6px 4px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    letter-spacing: 0 !important;
    border: 1px solid rgba(196, 154, 74, 0.35) !important;
    background: rgba(255, 253, 246, 0.06) !important;
    color: rgba(255, 255, 255, 0.65) !important;
    font-family: var(--font-sans) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
    transition: all .2s ease !important;
    position: relative !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4) !important;
    white-space: normal !important;
    text-overflow: clip !important;
    overflow: visible !important;
  }
  .tab:hover {
    background: rgba(196, 154, 74, 0.25) !important;
    border-color: rgba(196, 154, 74, 0.8) !important;
    color: #fff !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  }
  .tab.is-active {
    background: linear-gradient(135deg, rgba(160, 90, 44, 0.5), rgba(160, 90, 44, 0.25)) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 12px rgba(160, 90, 44, 0.4) !important;
    transform: scale(1.02) !important;
  }
  .tab.is-active::before { display: none !important; }
  .view {
    grid-column: 2 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    padding: 28px 30px !important;
  }
  .topbar {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
}

/* ===== 报告类型切换标签 ===== */
.report-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.report-tab {
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.report-tab:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}
.report-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
