/* ============================================================
   主题变量 —— 深色：星空 / 亮色：晨空
   ============================================================ */
:root {
  /* 晨空：桃色晨光 → 薰衣草 → 天青，像清晨天边的过渡 */
  --bg-grad: radial-gradient(ellipse 70% 46% at 82% -8%, rgba(255, 205, 178, .5) 0%, transparent 60%),
             radial-gradient(ellipse 60% 42% at 6% 100%, rgba(186, 214, 255, .55) 0%, transparent 62%),
             linear-gradient(165deg, #fdf2ec 0%, #f4eefe 40%, #ecf2fe 74%, #fbeef6 100%);
  --bg: #f5f2fb;
  --card: rgba(255, 255, 255, .72);
  --card-solid: #ffffff;
  --card-2: rgba(124, 111, 240, .06);
  --text: #2a2547;
  --muted: #7b76a0;
  --border: rgba(140, 124, 238, .17);
  --accent: #7c6ff0;
  --accent-2: #c26fe8;
  --accent-3: #4cb8f0;
  --aurora: linear-gradient(118deg, #8a7ef2, #c98fe9 50%, #66b6e8);
  --accent-weak: rgba(124, 111, 240, .1);
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --shadow: 0 1px 2px rgba(84, 68, 160, .04), 0 8px 24px rgba(84, 68, 160, .06), 0 24px 64px rgba(140, 124, 238, .1);
  --radius: 18px;
  --blur: 18px;
  --star-opacity: .55;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg-grad: radial-gradient(ellipse 90% 60% at 70% -10%, #2b2a5e 0%, transparent 55%),
             radial-gradient(ellipse 70% 50% at 10% 100%, #1b2b52 0%, transparent 60%),
             linear-gradient(180deg, #090d21 0%, #0b1029 50%, #0d0f2b 100%);
  --bg: #090d21;
  --card: rgba(22, 27, 58, .62);
  --card-solid: #161b3a;
  --card-2: rgba(129, 140, 248, .09);
  --text: #e7eaff;
  --muted: #8b93c4;
  --border: rgba(129, 140, 248, .14);
  --accent: #8b8ffa;
  --accent-2: #c084fc;
  --accent-3: #22d3ee;
  --aurora: linear-gradient(118deg, #8489f4, #b585ef 52%, #4cc3e6);
  --accent-weak: rgba(139, 143, 250, .13);
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .3), 0 30px 80px rgba(76, 81, 191, .14);
  --star-opacity: 1;
  color-scheme: dark;
}

/* ============ 基础 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-grad); background-attachment: fixed; background-color: var(--bg);
  color: var(--text); font-size: 15px; line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
::selection { background: var(--accent-weak); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ============ 真实摄影天空层（4K 级质感的根基） ============
   暗色：Black Rock Desert 银河实拍（Steve Jurvetson, CC BY 2.0）
   亮色：卷云全景实拍（公有领域），叠白纱保持淡雅
   缓慢的 Ken Burns 运镜让静态照片"活"起来 */
#skyPhoto {
  position: fixed; inset: -7%; z-index: -2; pointer-events: none;
  background: url('../img/milkyway.jpg') center 32% / cover no-repeat;
  animation: kenburns 55s ease-in-out infinite alternate; /* 提速：肉眼可见的电影运镜 */
  transition: opacity .6s;
}
#skyPhoto::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 9, 24, .30) 0%, rgba(6, 9, 24, .44) 55%, rgba(5, 7, 20, .62) 100%),
    radial-gradient(ellipse 95% 80% at 50% 35%, transparent 45%, rgba(3, 5, 14, .5) 100%);
}
:root:not([data-theme="dark"]) #skyPhoto {
  background-image: url('../img/morningsky.jpg');
  animation-duration: 75s;
}
:root:not([data-theme="dark"]) #skyPhoto::after {
  background:
    linear-gradient(180deg, rgba(252, 248, 255, .38) 0%, rgba(250, 245, 252, .66) 60%, rgba(250, 244, 250, .84) 100%),
    radial-gradient(ellipse 80% 55% at 78% 0%, rgba(255, 214, 178, .3) 0%, transparent 55%);
}
@keyframes kenburns {
  from { transform: scale(1.03) translate(0, 0); }
  to { transform: scale(1.15) translate(-2.6%, -2%); }
}
@media (prefers-reduced-motion: reduce) { #skyPhoto { animation: none; } }

/* 星空画布（叠在照片之上：活的闪烁与流星） */
#starfield {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: var(--star-opacity); transition: opacity .4s;
}

/* ============ 布局 ============ */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0; padding: 18px 12px;
  display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border);
  background: var(--card); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand {
  font-weight: 800; font-size: 16px; padding: 8px 12px 16px; line-height: 1.35;
  word-break: break-word; /* 站点名较长时换行完整显示，不截断 */
  background: var(--aurora); background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: aurora-flow 9s ease-in-out infinite;
}
.nav-group { font-size: 10.5px; color: var(--muted); letter-spacing: 2px; padding: 12px 12px 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-radius: 10px; color: var(--muted); font-size: 14px;
}
.nav-item:hover { background: var(--card-2); color: var(--text); }
.nav-item.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.nav-item.mobile-nav { display: none; } /* 手机底部导航项：桌面端隐藏，避免与分组导航重复 */
.nav-icon { font-size: 16px; width: 22px; text-align: center; }
.sidebar-foot { margin-top: auto; display: flex; gap: 6px; padding: 10px 6px 0; }
.icon-btn {
  flex: 1; border: 1px solid var(--border); background: var(--card-2); color: var(--muted);
  border-radius: 9px; padding: 8px 0; cursor: pointer; font-size: 13px;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

.main { flex: 1; padding: 28px 32px 60px; max-width: 1120px; margin: 0 auto; width: 100%; min-width: 0; }
.page-title { font-size: 22px; font-weight: 750; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

/* ============ 卡片与网格 ============ */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  /* 顶部一线高光：玻璃的"厚度感" */
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .07);
  padding: 20px; position: relative;
  backdrop-filter: blur(var(--blur)) saturate(1.25);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(1.25);
}
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 650; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.glow-line { height: 2px; border-radius: 1px; background: var(--aurora); opacity: .7; margin: -6px 0 14px; }

/* ============ 表单控件 ============ */
input[type=text], input[type=password], input[type=date], input[type=number], input[type=time], input[type=url], input[type=email],
input:not([type]), textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card-2); color: var(--text); font-size: 14.5px; font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; line-height: 1.7; }
input[type=color] { border: 1px solid var(--border); border-radius: 9px; background: var(--card-2); padding: 4px; height: 42px; width: 48px; }
.btn {
  border: 1px solid var(--border); background: var(--card-2); color: var(--text);
  border-radius: 10px; padding: 9px 16px; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--aurora); border-color: transparent; color: #fff; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-danger { color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > input { flex: 1; }
.wrap { flex-wrap: wrap; }

/* ============ 登录/安装页 ============ */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  padding: 36px 32px; width: 100%; max-width: 380px; text-align: center;
}
.login-logo { font-size: 44px; margin-bottom: 8px; }
.login-card h1 { font-size: 20px; margin-bottom: 18px; }
.login-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.login-card input { text-align: center; font-size: 16px; margin-bottom: 10px; }
.login-hint { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.err { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 20px; }
.cf-turnstile { margin: 6px auto; }

/* ============ Dashboard ============ */
.greeting { font-size: 24px; font-weight: 750; }
.quote { color: var(--muted); font-size: 13.5px; margin: 6px 0 20px; }
.focus-card {
  background: var(--aurora); color: #fff;
  border-radius: var(--radius); padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.focus-card::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.35) 0, rgba(255,255,255,.06) 2px, transparent 3px),
              radial-gradient(circle at 70% 70%, rgba(255,255,255,.3) 0, rgba(255,255,255,.05) 1.5px, transparent 2.5px),
              radial-gradient(circle at 92% 55%, rgba(255,255,255,.4) 0, transparent 2px),
              radial-gradient(circle at 60% 30%, rgba(255,255,255,.25) 0, transparent 1.5px);
}
.focus-label { font-size: 12px; opacity: .85; letter-spacing: 1px; }
.focus-title { font-size: 20px; font-weight: 700; margin-top: 6px; word-break: break-word; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
}
.stat b { font-size: 22px; }
.stat span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.tp-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.tp-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--card-2); overflow: hidden; }
.tp-fill { height: 100%; border-radius: 3px; background: var(--aurora); transition: width 1.1s cubic-bezier(.25, .8, .3, 1); }

/* ============ 标签页 ============ */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 7px 16px; border-radius: 999px; font-size: 13.5px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
}
.tab.active { background: var(--aurora); border-color: transparent; color: #fff; font-weight: 600; }

/* ============ 待办/列表条目 ============ */
.todo-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.todo-item:last-child { border-bottom: 0; }
.todo-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border);
  cursor: pointer; flex-shrink: 0; margin-top: 3px; background: none; position: relative;
}
.todo-check.done { background: var(--green); border-color: var(--green); }
.todo-check.done::after { content: '✓'; color: #fff; position: absolute; inset: 0; font-size: 13px; line-height: 18px; }
.todo-body { flex: 1; min-width: 0; }
.todo-title { word-break: break-word; }
.todo-title.done { text-decoration: line-through; color: var(--muted); }
.todo-meta { font-size: 12px; color: var(--muted); }
.todo-meta .overdue { color: var(--red); font-weight: 600; }
.todo-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.todo-item:hover .todo-actions, .touch .todo-actions { opacity: 1; }
.mini-btn { border: 0; background: none; cursor: pointer; font-size: 15px; padding: 4px 6px; color: var(--muted); border-radius: 6px; }
.mini-btn:hover { background: var(--card-2); color: var(--text); }
.star-on { color: var(--amber); }

/* ============ 打卡热力图 ============ */
.habit-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.habit-check-btn {
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card-2); cursor: pointer; font-size: 14px; color: var(--text);
}
.habit-check-btn.done { background: var(--green); border-color: var(--green); color: #fff; }
.habit-stats { font-size: 12.5px; color: var(--muted); }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 10px); gap: 3px; overflow-x: auto; padding-bottom: 6px; }
.hm-cell { width: 10px; height: 10px; border-radius: 2.5px; background: var(--card-2); border: 1px solid var(--border); }

/* ============ 番茄钟 ============ */
.pomo-wrap { text-align: center; padding: 10px 0 4px; }
.pomo-ring { position: relative; width: 240px; height: 240px; margin: 0 auto 18px; }
.pomo-ring svg { transform: rotate(-90deg); filter: drop-shadow(0 0 12px var(--accent-weak)); }
.pomo-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pomo-time b { font-size: 44px; font-variant-numeric: tabular-nums; font-weight: 700; }
.pomo-time span { color: var(--muted); font-size: 13px; }
.pomo-presets { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.bar-chart { display: flex; align-items: stretch; gap: 6px; height: 120px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.bar-space { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { width: 100%; max-width: 26px; border-radius: 5px 5px 0 0; background: var(--aurora); min-height: 2px; }
.bar-label { font-size: 10.5px; color: var(--muted); }

/* ============ 倒计时/目标 ============ */
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.cd-card { border-radius: var(--radius); padding: 18px; color: #fff; box-shadow: var(--shadow); position: relative; }
.cd-days { font-size: 32px; font-weight: 800; }
.cd-title { font-size: 14px; opacity: .92; word-break: break-word; }
.cd-date { font-size: 12px; opacity: .75; }
.cd-del { position: absolute; top: 8px; right: 8px; opacity: 0; color: #fff; }
.cd-card:hover .cd-del, .touch .cd-del { opacity: .9; }
.goal-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.goal-item:last-child { border-bottom: 0; }
.goal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.goal-bar { height: 8px; border-radius: 4px; background: var(--card-2); margin-top: 8px; overflow: hidden; }
.goal-fill { height: 100%; border-radius: 4px; background: var(--aurora); transition: width .3s; }

/* ============ 笔记 ============ */
.notes-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; align-items: start; }
.note-list-item { padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; }
.note-list-item:hover { background: var(--card-2); }
.note-list-item.active { background: var(--accent-weak); border-color: var(--accent); }
.note-list-item b { display: block; font-size: 14px; word-break: break-word; }
.note-list-item small { color: var(--muted); font-size: 12px; display: block; word-break: break-word; }
.note-editor textarea { min-height: 56vh; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13.5px; line-height: 1.85; }
.md-preview { line-height: 1.8; word-break: break-word; }
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 14px 0 8px; line-height: 1.4; }
.md-preview p { margin: 8px 0; }
.md-preview ul, .md-preview ol { margin: 8px 0 8px 22px; }
.md-preview code { background: var(--card-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; font-size: 13px; font-family: ui-monospace, monospace; }
.md-preview pre { background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 10px 0; }
.md-preview pre code { background: none; border: 0; padding: 0; }
.md-preview blockquote { border-left: 3px solid var(--accent); padding-left: 12px; color: var(--muted); margin: 10px 0; }
.md-preview a { color: var(--accent); text-decoration: underline; }

/* ============ 记忆卡片 ============ */
.deck-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; margin: 0 8px 8px 0;
  border: 1px solid var(--border); border-radius: 12px; background: var(--card-2); cursor: pointer; font-size: 14px;
}
.deck-chip.active { border-color: var(--accent); background: var(--accent-weak); }
.deck-due { background: var(--red); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.flashcard {
  min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 28px; cursor: pointer; gap: 14px;
}
.flashcard .fc-front { font-size: 22px; font-weight: 700; word-break: break-word; }
.flashcard .fc-back { font-size: 16px; color: var(--muted); word-break: break-word; border-top: 1px dashed var(--border); padding-top: 14px; width: 100%; }
.fc-btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* ============ 课程表 ============ */
.tt-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; overflow-x: auto; }
.tt-day-head { text-align: center; font-size: 12.5px; color: var(--muted); padding: 4px 0; }
.tt-day-head.today { color: var(--accent); font-weight: 700; }
.tt-col { display: flex; flex-direction: column; gap: 8px; min-width: 96px; }
.tt-course { border-radius: 12px; padding: 10px; color: #fff; font-size: 12.5px; line-height: 1.5; cursor: pointer; }
.tt-course b { display: block; font-size: 13px; }

/* ============ 看板 ============ */
.kb-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.kb-col { background: var(--card-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px; min-height: 120px; }
.kb-col-title { font-size: 13px; color: var(--muted); font-weight: 650; margin-bottom: 10px; display: flex; justify-content: space-between; }
.kb-card {
  background: var(--card-solid); border: 1px solid var(--border); border-radius: 11px;
  padding: 10px 12px; margin-bottom: 8px; font-size: 14px; cursor: grab; word-break: break-word;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.kb-card:active { cursor: grabbing; }
.kb-card small { color: var(--muted); display: block; font-size: 12px; }
.kb-col.dragover { outline: 2px dashed var(--accent); outline-offset: -4px; }

/* ============ 日历 ============ */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-cell {
  min-height: 76px; border: 1px solid var(--border); border-radius: 10px; padding: 6px;
  font-size: 12px; cursor: pointer; background: var(--card-2); overflow: hidden;
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.other { opacity: .35; }
.cal-cell.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cal-num { font-weight: 650; margin-bottom: 3px; }
.cal-ev { border-radius: 5px; padding: 0 5px; margin-bottom: 2px; color: #fff; font-size: 10.5px;
          white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { color: var(--muted); font-size: 10.5px; }

/* ============ 片段/代码 ============ */
.snip-code {
  background: #10142e; color: #dbe2ff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px; line-height: 1.65; white-space: pre; tab-size: 4;
}
:root:not([data-theme="dark"]) .snip-code,
[data-theme="light"] .snip-code { background: #1e2140; }
.tok-k { color: #c792ea; } .tok-s { color: #c3e88d; } .tok-c { color: #697098; font-style: italic; }
.tok-n { color: #f78c6c; } .tok-f { color: #82aaff; }

/* ============ 工具箱 ============ */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool-out {
  background: var(--card-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  font-family: ui-monospace, monospace; font-size: 13px; word-break: break-all; min-height: 42px;
  white-space: pre-wrap; cursor: pointer;
}

/* ============ 监控 ============ */
.mon-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mon-label { width: 74px; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.mon-bar { flex: 1; height: 10px; border-radius: 5px; background: var(--card-2); overflow: hidden; }
.mon-fill { height: 100%; border-radius: 5px; background: var(--aurora); transition: width .4s; }
.mon-val { width: 110px; text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.site-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.site-dot.up { background: var(--green); box-shadow: 0 0 8px var(--green); }
.site-dot.down { background: var(--red); box-shadow: 0 0 8px var(--red); }
.site-dot.na { background: var(--muted); }

/* ============ AI 聊天 ============ */
.chat-box { display: flex; flex-direction: column; height: 60vh; min-height: 380px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 12px; }
.chat-msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; word-break: break-word; }
.chat-msg.user { align-self: flex-end; background: var(--aurora); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--card-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg.sys { align-self: center; color: var(--muted); font-size: 12.5px; background: none; }

/* ============ 命令面板 ============ */
.palette-mask {
  position: fixed; inset: 0; background: rgba(5, 8, 28, .55); z-index: 100;
  display: flex; justify-content: center; padding-top: 14vh; backdrop-filter: blur(3px);
}
.palette {
  width: 92%; max-width: 540px; background: var(--card-solid); border-radius: 16px;
  border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.4); height: fit-content; overflow: hidden;
}
.palette input { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 15px 18px; font-size: 15px; background: none; }
.palette input:focus { outline: none; }
.palette-results { max-height: 340px; overflow-y: auto; padding: 6px; }
.pal-item { padding: 10px 12px; border-radius: 9px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.pal-item:hover, .pal-item.sel { background: var(--accent-weak); }
.pal-group { font-size: 11px; color: var(--muted); padding: 8px 12px 2px; letter-spacing: 1px; }

/* ============ Toast / 杂项 ============ */
.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 999px;
  font-size: 13.5px; z-index: 200; box-shadow: var(--shadow); max-width: 90vw;
}
.empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 13.5px; }
.tag { display: inline-block; background: var(--accent-weak); color: var(--accent); border-radius: 6px; padding: 1px 8px; font-size: 12px; margin-right: 4px; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; color: #fff; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.setting-row:last-child { border-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 3px; }
.mood-btn { font-size: 24px; background: none; border: 2px solid transparent; border-radius: 12px; padding: 4px 8px; cursor: pointer; opacity: .45; }
.mood-btn.sel { opacity: 1; border-color: var(--accent); background: var(--accent-weak); }
.rating { cursor: pointer; color: var(--amber); user-select: none; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; color: var(--muted); font-weight: 550; padding: 8px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--border); word-break: break-word; }
.table tr:last-child td { border-bottom: 0; }

/* 更多页宫格 */
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.more-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 14px;
  text-align: center; box-shadow: var(--shadow); font-size: 14px;
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
}
.more-item .mi-icon { font-size: 26px; display: block; margin-bottom: 6px; }

/* ============ 响应式 ============ */
@media (max-width: 767px) {
  .shell { flex-direction: column; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: auto; z-index: 50;
    flex-direction: row; width: 100%; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--border); justify-content: space-around; overflow: visible;
  }
  .brand, .nav-label, .sidebar-foot, .nav-group, .sidebar .nav-item { display: none; }
  .sidebar .nav-item.mobile-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; font-size: 10px; }
  .sidebar .nav-item.mobile-nav .nav-label { display: block; }
  .nav-icon { font-size: 20px; }
  .main { padding: 18px 16px 96px; }
  .grid-2, .grid-3, .stat-row, .tool-grid, .form-grid { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: 1fr; }
  .notes-layout3 { grid-template-columns: 1fr; }
  .notes-layout3 > .card { max-height: none; }
  .notes-cats { display: flex; overflow-x: auto; gap: 4px; padding: 10px; }
  .notes-cats .cats-head { display: none; }
  .notes-cats .cat-item { flex-shrink: 0; margin-bottom: 0; }
  .notes-cats .cat-new { width: auto; margin-top: 0; flex-shrink: 0; padding: 7px 12px; }
  .live-clock b { font-size: 24px; }
  .todo-actions { opacity: 1; }
  .cd-del { opacity: .9; }
  .pomo-ring { width: 200px; height: 200px; }
  .pomo-ring svg { width: 200px; height: 200px; }
  .pomo-time b { font-size: 36px; }
  .kb-cols { grid-template-columns: 1fr; }
  .cal-cell { min-height: 54px; }
  .chat-msg { max-width: 92%; }
}
@media (min-width: 768px) and (max-width: 1000px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  #starfield { display: none; }
  .brand, .focus-card { animation: none !important; }
}

/* ============ 主题切换动画（圆形揭开） ============ */
::view-transition-old(root), ::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 9999; }

/* ============ 极光流动 & 微交互 ============ */
@keyframes aurora-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.focus-card {
  background-size: 220% 220%;
  animation: aurora-flow 14s ease-in-out infinite;
}
.stat, .cd-card, .more-item {
  transition: transform .22s cubic-bezier(.3,0,.2,1), box-shadow .22s;
}
.stat:hover, .cd-card:hover, .more-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.14), 0 14px 44px rgba(109,111,242,.2);
}
.btn, .tab, .icon-btn, .habit-check-btn { transition: transform .12s, border-color .15s, filter .15s, background .2s; }
.btn:active, .tab:active, .icon-btn:active, .habit-check-btn:active { transform: scale(.96); }

/* ============ Markdown 工具栏 ============ */
.md-toolbar { display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 8px; }
.md-toolbar button {
  border: 1px solid var(--border); background: var(--card-2); color: var(--muted);
  border-radius: 7px; min-width: 30px; height: 28px; padding: 0 7px;
  font-size: 12.5px; cursor: pointer; font-family: ui-monospace, monospace;
}
.md-toolbar button:hover { color: var(--accent); border-color: var(--accent); }
.md-preview del { opacity: .55; }

/* ============ 迷你音乐播放器 v2 ============ */
.music-bar {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 12px 7px 7px; box-shadow: var(--shadow);
  backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur));
  max-width: 320px; transition: box-shadow .4s, border-color .4s;
}
.music-bar.spinning {
  border-color: transparent;
  box-shadow: 0 0 0 1.5px transparent, 0 6px 24px rgba(139, 143, 250, .35);
  background:
    linear-gradient(var(--card-solid), var(--card-solid)) padding-box,
    var(--aurora) border-box;
  border: 1.5px solid transparent;
}
.mp-disc-wrap {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--aurora); display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.25);
}
.mp-disc { font-size: 17px; line-height: 1; }
.music-bar.spinning .mp-disc-wrap { animation: disc-spin 4s linear infinite; }
@keyframes disc-spin { to { transform: rotate(360deg); } }
.music-bar.pending .mp-main { animation: mp-pulse 1.4s ease-in-out infinite; color: var(--accent); }
@keyframes mp-pulse { 50% { transform: scale(1.35); } }
.mp-mid { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mp-title {
  font-size: 12.5px; color: var(--text); font-weight: 550; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mp-progress {
  height: 4px; border-radius: 2px; background: var(--card-2); cursor: pointer;
  overflow: hidden; min-width: 90px;
}
.mp-fill { height: 100%; width: 0; border-radius: 2px; background: var(--aurora); transition: width .3s linear; }
.mp-btn { border: 0; background: none; cursor: pointer; font-size: 14px; color: var(--muted); padding: 2px 3px; border-radius: 6px; }
.mp-btn:hover { color: var(--accent); }
.mp-main { font-size: 17px; color: var(--text); }
.mp-body { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mp-mid { cursor: pointer; }
.mp-fold { font-size: 11px; }
/* 收缩态：只剩一个旋转小圆盘 */
.music-bar.mini { padding: 5px; border-radius: 50%; gap: 0; }
.music-bar.mini .mp-body, .music-bar.mini .mp-playlist { display: none; }
.music-bar.mini .mp-disc-wrap { width: 40px; height: 40px; cursor: pointer; }
/* 歌单弹层 */
.mp-playlist {
  position: absolute; right: 0; bottom: calc(100% + 10px); width: 240px; max-height: 280px;
  overflow-y: auto; background: var(--card-solid); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 14px 44px rgba(0, 0, 0, .35); padding: 6px;
  animation: pageIn .22s cubic-bezier(.25, 0, .2, 1);
}
.mp-list-head { font-size: 11.5px; color: var(--muted); padding: 6px 10px 4px; letter-spacing: 1px; }
.mp-list-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 9px;
  cursor: pointer; font-size: 13px;
}
.mp-list-row:hover { background: var(--card-2); }
.mp-list-row.now { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.mp-list-ic { width: 18px; text-align: center; flex-shrink: 0; }
.mp-list-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767px) {
  .music-bar { bottom: calc(76px + env(safe-area-inset-bottom)); right: 10px; }
  .mp-title { max-width: 84px; }
  .mp-progress { min-width: 64px; }
}

/* ============ 星空感上传区（替代原生 file input） ============ */
.upload-zone {
  position: relative; border: 1.5px dashed var(--border); border-radius: 16px;
  padding: 26px 18px; text-align: center; cursor: pointer; color: var(--muted);
  background:
    radial-gradient(circle at 18% 28%, rgba(139, 143, 250, .07) 0, transparent 34%),
    radial-gradient(circle at 82% 70%, rgba(34, 211, 238, .06) 0, transparent 30%),
    var(--card-2);
  transition: border-color .2s, box-shadow .25s, transform .15s;
  overflow: hidden;
}
.upload-zone::after { /* 静态小星星点缀 */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .6;
  background-image:
    radial-gradient(circle at 12% 20%, rgba(255,255,255,.5) 0 1px, transparent 1.6px),
    radial-gradient(circle at 88% 26%, rgba(255,255,255,.4) 0 1px, transparent 1.6px),
    radial-gradient(circle at 26% 78%, rgba(255,255,255,.35) 0 .8px, transparent 1.4px),
    radial-gradient(circle at 68% 14%, rgba(255,255,255,.45) 0 .8px, transparent 1.4px),
    radial-gradient(circle at 78% 84%, rgba(255,255,255,.4) 0 1px, transparent 1.6px);
}
.upload-zone:hover, .upload-zone.drag {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-weak), 0 8px 30px rgba(139, 143, 250, .18);
  transform: translateY(-1px);
}
.upload-zone .uz-icon { font-size: 30px; display: block; margin-bottom: 8px; filter: drop-shadow(0 2px 10px rgba(139,143,250,.5)); }
.upload-zone b { color: var(--text); font-weight: 600; }
.upload-zone small { display: block; margin-top: 4px; font-size: 12px; }
.upload-zone.drag .uz-icon { animation: mp-pulse 1s ease-in-out infinite; }

/* ============ 每日心语卡 ============ */
.hero-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 148px; margin: 14px 0 20px; box-shadow: var(--shadow);
  background: var(--aurora); background-size: cover; background-position: center;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 18px 22px;
  color: #fff; isolation: isolate;
}
.hero-card::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(9, 13, 33, .05) 30%, rgba(9, 13, 33, .62) 100%),
              linear-gradient(100deg, rgba(9, 13, 33, .45) 0%, transparent 55%);
}
.hero-quote {
  font-family: "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  font-size: 19px; font-weight: 600; line-height: 1.75; letter-spacing: .5px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .6); max-width: 640px;
}
.hero-from {
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: 12.5px; opacity: .85; margin-top: 5px; text-shadow: 0 1px 8px rgba(0, 0, 0, .5);
}
.hero-copy { position: absolute; right: 12px; bottom: 8px; font-size: 10px; opacity: .5; }

/* ============ 笔记：三栏（分类 | 列表 | 编辑器）
   三块面板等高、各自内部滚动 —— 长文再多也不会把页面拖出半屏空白 ============ */
.notes-layout3 { display: grid; grid-template-columns: 152px 236px 1fr; gap: 14px; align-items: stretch; }
.notes-layout3 > .card { max-height: calc(100vh - 176px); overflow-y: auto; }
.notes-layout3 .note-editor { display: flex; flex-direction: column; }
.notes-layout3 .note-editor textarea { flex: 1; min-height: 300px; }
.notes-layout3 .md-preview { overflow-y: auto; }
/* 专注写作：收起左侧两栏，全宽写作 */
.notes-layout3.zen { grid-template-columns: 1fr; }
.notes-layout3.zen .notes-cats, .notes-layout3.zen > .card:nth-child(2) { display: none; }
.notes-layout3.zen .note-editor textarea { min-height: calc(100vh - 320px); font-size: 14.5px; }
.notes-cats { padding: 12px 10px; }
.cats-head { font-size: 11px; color: var(--muted); letter-spacing: 2px; padding: 4px 10px 10px; }
.cat-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px;
  cursor: pointer; font-size: 13.5px; color: var(--muted); position: relative; margin-bottom: 2px;
}
.cat-item:hover { background: var(--card-2); color: var(--text); }
.cat-item.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.cat-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px;
  border-radius: 2px; background: var(--aurora);
}
.cat-ic { width: 18px; text-align: center; flex-shrink: 0; }
.cat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-n { font-size: 11px; color: var(--muted); background: var(--card-2); border-radius: 999px; padding: 0 7px; }
.cat-item.active .cat-n { color: var(--accent); }
.cat-new {
  width: 100%; margin-top: 8px; padding: 7px; border: 1px dashed var(--border); border-radius: 10px;
  background: none; color: var(--muted); font-size: 12.5px; cursor: pointer;
}
.cat-new:hover { border-color: var(--accent); color: var(--accent); }
.note-meta .tag { font-size: 10.5px; padding: 0 6px; }

/* ============ 首页实时时钟 ============ */
.live-clock { text-align: right; line-height: 1.2; }
.live-clock b {
  display: block; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--aurora); background-size: 200% 200%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: aurora-flow 9s ease-in-out infinite;
}
.live-clock span { font-size: 12px; color: var(--muted); }

/* ============ AI 聊天美化 ============ */
.chat-row { display: flex; gap: 9px; align-items: flex-end; }
.chat-row.user { justify-content: flex-end; }
.chat-row.sys { justify-content: center; }
.chat-ava {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--aurora); display: flex; align-items: center; justify-content: center;
  font-size: 15px; box-shadow: 0 3px 12px rgba(139, 143, 250, .4);
}
.chat-msg.user { box-shadow: 0 4px 16px rgba(139, 143, 250, .3); }
.chat-welcome { text-align: center; padding: 42px 16px; color: var(--muted); }
.chat-welcome .cw-orb {
  width: 62px; height: 62px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--aurora); display: flex; align-items: center; justify-content: center;
  font-size: 27px; box-shadow: 0 8px 32px rgba(139, 143, 250, .45);
  animation: orb-float 4s ease-in-out infinite;
}
@keyframes orb-float { 50% { transform: translateY(-7px); } }
.chat-welcome b { color: var(--text); font-size: 16px; }
.chat-welcome p { font-size: 13px; margin: 6px 0 16px; }
.cw-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cw-chips button {
  border: 1px solid var(--border); background: var(--card-2); color: var(--text);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; cursor: pointer;
}
.cw-chips button:hover { border-color: var(--accent); color: var(--accent); }
.chat-input-row {
  display: flex; gap: 8px; align-items: flex-end;
  border: 1px solid var(--border); border-radius: 16px; padding: 7px 7px 7px 14px;
  background: var(--card-2);
}
.chat-input-row textarea { border: 0; background: none; padding: 6px 0; resize: none; }
.chat-input-row textarea:focus { outline: none; }
.chat-send {
  width: 38px; height: 38px; border-radius: 12px; border: 0; flex-shrink: 0;
  background: var(--aurora); color: #fff; font-size: 15px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(139, 143, 250, .4);
}
.chat-send:hover { filter: brightness(1.12); }
.chat-send:disabled { opacity: .5; }

/* ============ 时光信 ============ */
.letter-compose {
  background:
    radial-gradient(circle at 88% 10%, rgba(211, 139, 240, .1) 0, transparent 42%),
    radial-gradient(circle at 8% 92%, rgba(99, 184, 242, .09) 0, transparent 38%),
    var(--card);
}
.letter-compose textarea {
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif; font-size: 15px; line-height: 2;
}
.letter-sealed {
  display: flex; align-items: center; gap: 12px; padding: 13px 12px;
  border: 1px dashed var(--border); border-radius: 14px; margin-bottom: 10px;
}
.letter-env {
  font-size: 24px; filter: drop-shadow(0 3px 10px rgba(139, 143, 250, .45));
  animation: orb-float 5s ease-in-out infinite;
}

/* ============ 暗色画面暗角（摄影质感） ============ */
[data-theme="dark"] body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse 90% 75% at 50% 38%, transparent 62%, rgba(3, 5, 16, .3) 100%);
}

/* ============ 电影颗粒（整站极低透明度噪点 → 质感、去"塑料感"） ============ */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  opacity: .028; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before { opacity: .05; }

/* ============ 折叠卡片（配置类内容默认收起） ============ */
.collapse-card .cc-body { display: none; }
.collapse-card:not(.collapsed) .cc-body { display: block; }
.cc-chevron { transition: transform .25s; color: var(--muted); font-size: 12px; }
.collapse-card.collapsed .cc-chevron { transform: rotate(-90deg); }
.cc-head:hover .cc-chevron { color: var(--accent); }

/* ============ 高端感细节 ============ */
.stat b { font-size: 25px; font-weight: 800; letter-spacing: .3px; }
.nav-item.active { box-shadow: 0 0 18px var(--accent-weak); }
.page-title { letter-spacing: .3px; }
.card-title { letter-spacing: .2px; }
.btn-primary { box-shadow: 0 4px 16px rgba(139, 143, 250, .3), inset 0 1px 0 rgba(255, 255, 255, .22); }

/* ============ 音乐页 ============ */
.music-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 10px;
  border-radius: 12px; border: 1px solid transparent;
}
.music-row:hover { background: var(--card-2); }
.music-row.now { background: var(--accent-weak); border-color: var(--accent); }
.music-row-icon { width: 26px; text-align: center; flex-shrink: 0; }
.music-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1.5px; animation: eq-bounce 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: .2s; }
.eq i:nth-child(3) { animation-delay: .4s; }
@keyframes eq-bounce { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* ============ 页面切换进入动画 ============ */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.main.page-in { animation: pageIn .38s cubic-bezier(.25, 0, .2, 1); }
/* 卡片错峰入场：像涟漪一样一层层浮现（高级感的关键是节奏） */
.main.page-in > * { animation: pageIn .55s cubic-bezier(.22, .9, .3, 1) both; }
.main.page-in > *:nth-child(1) { animation-delay: .02s; }
.main.page-in > *:nth-child(2) { animation-delay: .06s; }
.main.page-in > *:nth-child(3) { animation-delay: .1s; }
.main.page-in > *:nth-child(4) { animation-delay: .14s; }
.main.page-in > *:nth-child(5) { animation-delay: .18s; }
.main.page-in > *:nth-child(6) { animation-delay: .22s; }
.main.page-in > *:nth-child(n+7) { animation-delay: .26s; }

/* ============ 首页两列等高 ============ */
.vstack { display: flex; flex-direction: column; gap: 16px; }
.vstack > .card + .card { margin-top: 0; }
.vstack > .card { display: flex; flex-direction: column; }
.vstack > .card > [id^="dash"] { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; }
.vstack > .card > .empty, .vstack .empty { display: flex; align-items: center; justify-content: center; flex: 1; }

/* ============ 待办拖拽 ============ */
.drag-handle { color: var(--muted); cursor: grab; font-size: 13px; margin-top: 5px; opacity: .4; flex-shrink: 0; }
.todo-item:hover .drag-handle { opacity: .9; }
.todo-item.dragging { opacity: .35; }
.todo-item[draggable="true"] { transition: background .15s; }
.todo-item[draggable="true"]:hover { background: var(--card-2); border-radius: 10px; }

/* ============ 动效精修 ============ */
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
.toast { animation: toastIn .32s cubic-bezier(.22, .9, .3, 1); }
@keyframes palettePop { from { opacity: 0; transform: translateY(-8px) scale(.97); } }
.palette { animation: palettePop .28s cubic-bezier(.22, .9, .3, 1); }

/* ============ Markdown 扩展：图片/任务/思维导图 ============ */
.md-img { max-width: 100%; border-radius: 12px; margin: 8px 0; box-shadow: var(--shadow); display: block; }
.md-tasks { list-style: none; margin-left: 4px !important; }
.md-task { display: flex; align-items: flex-start; gap: 8px; padding: 2px 0; }
.md-task .md-check {
  width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border); flex-shrink: 0;
  margin-top: 4px; font-size: 12px; line-height: 15px; text-align: center; color: #fff;
}
.md-task.done .md-check { background: var(--green); border-color: var(--green); }
.md-task.done { color: var(--muted); text-decoration: line-through; }
.md-table th { background: var(--card-2); }
.mindmap text { font-family: inherit; }

/* ============ 时间轴课程表 ============ */
.ttx-head { display: grid; grid-template-columns: 46px repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.ttx-head b { text-align: center; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 5px 0; border-radius: 8px; }
.ttx-head b.today { color: #fff; background: var(--aurora); }
.ttx-body { display: grid; grid-template-columns: 46px repeat(7, 1fr); gap: 4px; overflow-x: auto; }
.ttx-time { position: relative; }
.ttx-time span { position: absolute; right: 8px; font-size: 10.5px; color: var(--muted); transform: translateY(-6px); }
.ttx-col { position: relative; background: var(--card-2); border-radius: 10px; min-width: 76px; }
.ttx-col.today { background: var(--accent-weak); box-shadow: inset 0 0 0 1px var(--border); }
.ttx-line { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); opacity: .5; }
.ttx-block {
  position: absolute; border-radius: 9px; padding: 5px 7px; font-size: 11px; line-height: 1.45;
  cursor: pointer; overflow: hidden; backdrop-filter: blur(2px);
  transition: transform .15s, box-shadow .15s; z-index: 1;
}
.ttx-block:hover { transform: scale(1.03); z-index: 2; box-shadow: var(--shadow); }
.ttx-block b { display: block; font-size: 12px; }
.ttx-block span { display: block; color: var(--muted); font-size: 10.5px; }
.ttx-block.clash { outline: 1.5px solid var(--red); }
.ttx-conflicts { color: var(--red); font-size: 12.5px; padding: 10px 4px 0; }

/* ============ 日历美化 ============ */
.cal-grid { gap: 7px; }
.cal-dow { font-weight: 600; letter-spacing: 1px; }
.cal-cell {
  min-height: 86px; border-radius: 12px; padding: 7px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cal-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cal-cell.today {
  border-color: transparent;
  background: linear-gradient(var(--card-solid), var(--card-solid)) padding-box, var(--aurora) border-box;
  border: 1.5px solid transparent; box-shadow: 0 4px 16px rgba(139, 143, 250, .25);
}
.cal-cell.today .cal-num {
  background: var(--aurora); color: #fff; width: 21px; height: 21px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px;
}
.cal-ev { border-radius: 6px; padding: 1.5px 6px; margin-bottom: 3px; font-size: 10.5px; opacity: .92; }
.cal-cell:nth-child(7n), .cal-cell:nth-child(7n-1) { background: transparent; } /* 周末更通透 */

/* ============ 健康模块 ============ */
.weight-chart { width: 100%; height: 110px; }
.kcal-badge { font-size: 11.5px; color: var(--amber); border: 1px solid var(--amber); border-radius: 6px; padding: 0 6px; }
