/* ============================================================================
   RunnerCoach — 视觉系统
   ----------------------------------------------------------------------------
   设计方向：深色优先 · 玻璃拟态 · 渐变强调 · 大留白
   · 近黑背景（#08090c）+ 极淡径向光晕，营造纵深而不是死黑
   · 玻璃层：半透明 + 背景模糊 + 内侧高光 1px 发丝边
   · 品牌渐变 #4D6BFE → #8B5CF6，只用在关键数字、进度、主按钮
   · 训练强度用独立色相编码，一眼能看出「今天该多累」
   · 中文优先排版：行高宽松、字重梯度清晰、数字用等宽字形
   ========================================================================== */

:root {
  /* ---------- 品牌 ---------- */
  --brand: #4d6bfe;
  --brand-2: #8b5cf6;
  --brand-3: #22d3ee;
  --brand-hover: #6080ff;
  --grad-brand: linear-gradient(135deg, #4d6bfe 0%, #7c5cff 55%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(77,107,254,.18), rgba(168,85,247,.10));
  --grad-text: linear-gradient(120deg, #f2f4ff 10%, #a9b8ff 55%, #c4a9ff 95%);

  /* ---------- 语义 ---------- */
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .14);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .14);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, .14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, .14);

  /* ---------- 训练强度色（独立于语义色） ---------- */
  --z-rest: #64748b;
  --z-recovery: #2dd4bf;
  --z-easy: #34d399;
  --z-long: #38bdf8;
  --z-steady: #818cf8;
  --z-quality: #fbbf24;
  --z-interval: #fb7185;
  --z-race: #a78bfa;

  /* ---------- 层 ---------- */
  --bg: #08090c;
  --bg-2: #0b0d12;
  --surface: rgba(22, 25, 34, .66);
  --surface-2: rgba(30, 34, 45, .55);
  --surface-3: rgba(38, 43, 56, .5);
  --surface-solid: #12141b;
  --surface-hover: rgba(255, 255, 255, .045);
  --glass-blur: 18px;

  /* ---------- 文字 ---------- */
  --text: #eef1f8;
  --text-2: #a6adc0;
  --text-3: #6f768a;
  --text-4: #4a5062;

  /* ---------- 线 ---------- */
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --line-strong: rgba(255, 255, 255, .20);

  /* ---------- 阴影 ---------- */
  --sh-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --sh: 0 8px 28px rgba(0, 0, 0, .5), 0 1px 0 rgba(255,255,255,.04) inset;
  --sh-lg: 0 24px 64px rgba(0, 0, 0, .66), 0 1px 0 rgba(255,255,255,.05) inset;
  --sh-brand: 0 8px 32px rgba(77, 107, 254, .30);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --radius-lg: 22px;
  --nav-w: 244px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI",
          "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

/* ============================ 浅色主题 ============================ */
[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, .86);
  --surface-2: rgba(248, 249, 253, .9);
  --surface-3: rgba(242, 244, 250, .9);
  --surface-solid: #ffffff;
  --surface-hover: rgba(15, 23, 42, .035);

  --text: #0d1220;
  --text-2: #4a5266;
  --text-3: #7d859b;
  --text-4: #a8afc2;

  --line: rgba(15, 23, 42, .08);
  --line-2: rgba(15, 23, 42, .14);
  --line-strong: rgba(15, 23, 42, .22);

  --sh-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --sh: 0 6px 24px rgba(15, 23, 42, .08), 0 1px 0 rgba(255,255,255,.9) inset;
  --sh-lg: 0 20px 56px rgba(15, 23, 42, .16);
  --sh-brand: 0 8px 28px rgba(77, 107, 254, .24);
  --grad-text: linear-gradient(120deg, #131a2e 10%, #3550e0 60%, #7c3aed 95%);
}

/* ============================ 基础 ============================ */
* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 背景光晕：极淡的两团径向渐变，制造纵深 */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 620px at 12% -8%, rgba(77, 107, 254, .16), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(168, 85, 247, .11), transparent 58%),
    radial-gradient(700px 700px at 60% 110%, rgba(34, 211, 238, .06), transparent 60%);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(1100px 620px at 10% -10%, rgba(77, 107, 254, .10), transparent 60%),
    radial-gradient(900px 560px at 92% 2%, rgba(168, 85, 247, .07), transparent 58%);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4 { margin: 0 0 .6rem; line-height: 1.35; font-weight: 640; letter-spacing: -.015em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.0625rem; }
h3 { font-size: .9375rem; }
p { margin: 0 0 .8rem; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.15rem 0; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-3); padding: .14em .42em; border-radius: 6px; }
::selection { background: rgba(77, 107, 254, .34); }

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

/* ============================ 布局 ============================ */
#app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--nav-w); flex: 0 0 var(--nav-w);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: .85rem .7rem;
  background: linear-gradient(180deg, rgba(18,21,29,.86), rgba(11,13,18,.72));
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border-right: 1px solid var(--line);
}
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(248,249,253,.78));
}

.brand { display: flex; gap: .7rem; align-items: center; padding: .5rem .55rem 1.15rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: var(--grad-brand);
  color: #fff; font-size: 17px; font-weight: 700;
  box-shadow: var(--sh-brand);
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 55%);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: .9375rem; font-weight: 640; letter-spacing: -.01em; }
.brand-text span {
  font-size: .625rem; color: var(--text-3); letter-spacing: .16em; text-transform: uppercase; font-weight: 600;
}

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; padding: 0 .15rem; }
.nav-label {
  font-size: .625rem; color: var(--text-4); letter-spacing: .14em; text-transform: uppercase;
  font-weight: 700; padding: .9rem .55rem .35rem;
}
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .65rem; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-2);
  cursor: pointer; text-align: left; width: 100%;
  font-size: .875rem; font-weight: 500;
  transition: background .16s, color .16s, transform .16s;
  position: relative;
}
.nav-item .ni {
  width: 20px; text-align: center; font-size: .95rem; opacity: .8;
  transition: opacity .16s, transform .16s;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item:hover .ni { opacity: 1; transform: scale(1.08); }
.nav-item.active {
  background: var(--grad-soft);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(77,107,254,.28) inset;
}
[data-theme="light"] .nav-item.active { color: #2438b8; }
.nav-item.active .ni { opacity: 1; }
.nav-item.active::before {
  content: ''; position: absolute; left: -0.7rem; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0;
  background: var(--grad-brand);
}

.sidebar-foot { margin-top: auto; padding: .85rem .55rem .25rem; border-top: 1px solid var(--line); }
.sync-status { font-size: .75rem; color: var(--text-2); display: flex; align-items: center; gap: .4rem; margin-bottom: .2rem; }
.sync-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); flex: 0 0 6px;
}
.sync-status.online::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.tiny { font-size: .6875rem; color: var(--text-4); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: .75rem;
  padding: .8rem 1.75rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-weight: 640; font-size: 1rem; letter-spacing: -.01em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .55rem; }
.content { padding: 1.75rem 1.75rem 6rem; max-width: 1160px; width: 100%; }

.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .32rem .72rem; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: .7813rem; font-weight: 550; color: var(--text-2);
  backdrop-filter: blur(8px); white-space: nowrap;
}
.pill.warn { border-color: rgba(251,191,36,.36); background: var(--warn-soft); color: var(--warn); }
.pill.race { border-color: rgba(167,139,250,.36); background: var(--violet-soft); color: var(--violet); }

/* ============================ 玻璃卡 ============================ */
.card {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.45rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--sh);
}
/* 顶部发丝高光，让玻璃层有「厚度」 */
.card::before {
  content: ''; position: absolute; left: 14px; right: 14px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  pointer-events: none;
}
[data-theme="light"] .card::before { background: linear-gradient(90deg, transparent, rgba(15,23,42,.06), transparent); }

.card.plain { background: transparent; border: none; box-shadow: none; padding: 0; backdrop-filter: none; }
.card.plain::before { display: none; }
.card.accent { border-color: rgba(77,107,254,.30); box-shadow: var(--sh), 0 0 44px rgba(77,107,254,.10); }

.card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h1, .card-head h2, .card-head h3 { margin: 0; }
.card-head .spacer { margin-left: auto; }
.card-sub { font-size: .8125rem; color: var(--text-3); margin: -.6rem 0 1rem; }

.grid { display: grid; gap: 1.1rem; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid.four { grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.right { text-align: right; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: .6rem; }
.mt { margin-top: 1rem; } .mb { margin-bottom: 1rem; }
.small { font-size: .8125rem; } .xsmall { font-size: .75rem; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  cursor: pointer; font-size: .8438rem; font-weight: 550; white-space: nowrap;
  transition: background .16s, border-color .16s, transform .12s, box-shadow .16s;
  backdrop-filter: blur(8px);
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--grad-brand); border-color: transparent; color: #fff;
  box-shadow: var(--sh-brand); font-weight: 600;
}
.btn.primary:hover { box-shadow: 0 10px 38px rgba(77,107,254,.42); filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.danger { color: var(--danger); border-color: rgba(248,113,113,.3); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.small { padding: .34rem .68rem; font-size: .7813rem; }
.btn.tiny { padding: .22rem .5rem; font-size: .7188rem; border-radius: 7px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2); font-size: .95rem;
  transition: background .16s, color .16s, transform .16s, border-color .16s;
  backdrop-filter: blur(8px);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }

/* ============================ 表单 ============================ */
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .95rem; }
.field > label { font-size: .8125rem; color: var(--text-2); font-weight: 550; }
.field .hint { font-size: .7188rem; color: var(--text-3); line-height: 1.6; }
input[type=text], input[type=number], input[type=date], input[type=time],
input[type=search], select, textarea {
  width: 100%; padding: .55rem .75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  transition: border-color .16s, box-shadow .16s, background .16s;
  backdrop-filter: blur(8px);
}
input::placeholder, textarea::placeholder { color: var(--text-4); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(77,107,254,.18);
  background: var(--surface-3);
}
select option { background: var(--surface-solid); color: var(--text); }
textarea { resize: vertical; min-height: 76px; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.checkline { display: flex; align-items: center; gap: .5rem; font-size: .8438rem; color: var(--text-2); cursor: pointer; }
.checkline input { accent-color: var(--brand); width: 16px; height: 16px; }

.daypick { display: flex; gap: .4rem; flex-wrap: wrap; }
.daypick button {
  min-width: 48px; padding: .38rem .55rem; border-radius: var(--radius-xs);
  font-size: .7813rem; font-weight: 550;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; transition: all .16s;
}
.daypick button:hover { border-color: var(--line-strong); color: var(--text); }
.daypick button.on {
  background: var(--grad-brand); border-color: transparent; color: #fff;
  box-shadow: 0 4px 16px rgba(77,107,254,.34);
}

/* ============================ 徽章 ============================ */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .16rem .5rem; border-radius: 7px;
  font-size: .7188rem; font-weight: 600; letter-spacing: .01em;
  background: var(--surface-3); color: var(--text-2);
  border: 1px solid var(--line);
}
.badge.easy, .badge.E { background: var(--ok-soft); color: var(--ok); border-color: rgba(52,211,153,.24); }
.badge.long, .badge.M { background: var(--info-soft); color: var(--info); border-color: rgba(56,189,248,.24); }
.badge.quality, .badge.T { background: var(--warn-soft); color: var(--warn); border-color: rgba(251,191,36,.24); }
.badge.race, .badge.I { background: var(--violet-soft); color: var(--violet); border-color: rgba(167,139,250,.24); }
.badge.rest { background: transparent; color: var(--text-3); border-color: var(--line); }
.badge.done { background: var(--ok-soft); color: var(--ok); border-color: rgba(52,211,153,.24); }
.badge.adj { background: var(--warn-soft); color: var(--warn); border-color: rgba(251,191,36,.24); }

/* ============================ 统计块 ============================ */
.stat {
  position: relative; overflow: hidden;
  padding: 1rem 1.05rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
}
.stat .k { font-size: .7188rem; color: var(--text-3); margin-bottom: .3rem; font-weight: 550; letter-spacing: .02em; }
.stat .v {
  font-size: 1.5rem; font-weight: 700; line-height: 1.15; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat .v small { font-size: .75rem; font-weight: 500; margin-left: .2rem; -webkit-text-fill-color: var(--text-3); }
.stat .d { font-size: .75rem; color: var(--text-3); margin-top: .25rem; }
.stat.hero .v { font-size: 1.9rem; }

/* ============================ 首页主视觉 ============================ */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.7rem;
  margin-bottom: 1.1rem;
  background:
    radial-gradient(760px 340px at 88% -30%, rgba(139,92,246,.24), transparent 62%),
    radial-gradient(620px 320px at 4% 110%, rgba(77,107,254,.22), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-lg);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}
.hero::before {
  content: ''; position: absolute; left: 20px; right: 20px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
}
.hero-grid { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; position: relative; }
.hero-main { flex: 1; min-width: 250px; }
.hero-eyebrow {
  font-size: .6875rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); font-weight: 700; margin-bottom: .4rem;
}
.hero-title {
  font-size: 1.9rem; font-weight: 720; letter-spacing: -.035em; line-height: 1.18; margin-bottom: .5rem;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { font-size: .875rem; color: var(--text-2); line-height: 1.65; }
.hero-sub b { color: var(--text); font-weight: 620; }
.hero-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.1rem; }
.hero-stat .hs-k { font-size: .6875rem; color: var(--text-3); letter-spacing: .04em; }
.hero-stat .hs-v {
  font-size: 1.15rem; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}

/* 进度环 */
.ring { position: relative; width: 104px; height: 104px; flex: 0 0 104px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .ring-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05;
}
.ring .ring-val {
  font-size: 1.5rem; font-weight: 720; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ring .ring-lbl { font-size: .625rem; color: var(--text-3); letter-spacing: .06em; margin-top: .15rem; }
.ring.sm { width: 72px; height: 72px; flex: 0 0 72px; }
.ring.sm .ring-val { font-size: 1.05rem; }

/* ============================ 日程卡 ============================ */
.day-list { display: flex; flex-direction: column; gap: .6rem; }
.day-card {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 104px 1fr auto; gap: 1rem; align-items: center;
  padding: 1rem 1.1rem 1rem 1.3rem;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2);
  transition: border-color .18s, transform .18s, box-shadow .18s, background .18s;
}
.day-card:hover {
  border-color: var(--line-2); transform: translateX(3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
}
.day-card.today {
  border-color: rgba(77,107,254,.45);
  background: linear-gradient(100deg, rgba(77,107,254,.14), rgba(139,92,246,.07) 55%, transparent);
  box-shadow: 0 0 0 1px rgba(77,107,254,.16), 0 10px 34px rgba(77,107,254,.16);
}
.day-card.is-rest { background: transparent; opacity: .72; }
.day-card.is-rest:hover { opacity: 1; transform: none; box-shadow: none; }
.day-card.is-rest .dc-title { color: var(--text-3); font-weight: 500; }
.day-card.is-done { border-color: rgba(52,211,153,.3); background: linear-gradient(100deg, rgba(52,211,153,.10), transparent 70%); }
.day-card.is-race {
  border-color: rgba(167,139,250,.5);
  background: linear-gradient(100deg, rgba(167,139,250,.18), rgba(139,92,246,.06) 60%, transparent);
  box-shadow: 0 10px 34px rgba(167,139,250,.16);
}

.zone-bar-left {
  position: absolute; left: 0; top: 14px; bottom: 14px; width: 3.5px; border-radius: 0 4px 4px 0;
}
.zone-bar-left.rest { background: var(--z-rest); opacity: .5; }
.zone-bar-left.recovery { background: var(--z-recovery); }
.zone-bar-left.easy { background: var(--z-easy); }
.zone-bar-left.long { background: var(--z-long); }
.zone-bar-left.steady { background: var(--z-steady); }
.zone-bar-left.quality { background: var(--z-quality); }
.zone-bar-left.interval { background: var(--z-interval); }
.zone-bar-left.race { background: var(--z-race); }
.zone-bar-left.done { background: var(--z-easy); }

.dc-when { display: flex; flex-direction: column; gap: .15rem; }
.dc-date { font-size: .875rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.dc-wd { font-size: .7188rem; color: var(--text-3); }
.dc-body { min-width: 0; }
.dc-title { font-size: .975rem; font-weight: 640; margin-bottom: .2rem; letter-spacing: -.01em; }
.dc-detail { font-size: .8125rem; color: var(--text-2); line-height: 1.65; }
/* 降级备选方案（状态欠佳时的退路），淡色弱提示，不喧宾夺主 */
.dc-alternate {
  margin-top: .4rem;
  font-size: .75rem;
  color: var(--text-3);
  line-height: 1.55;
  border-left: 2px solid var(--line-2);
  padding-left: .5rem;
}
.dc-metrics { display: flex; gap: 1.3rem; flex-wrap: wrap; margin-top: .6rem; }
.dc-metrics > div { display: flex; flex-direction: column; gap: .05rem; }
.dc-metrics .mk { font-size: .6563rem; color: var(--text-4); letter-spacing: .05em; text-transform: uppercase; font-weight: 600; }
.dc-metrics .mv { font-size: .875rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.dc-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }

/* ============================ 变化说明 ============================ */
.change-note {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .8438rem; line-height: 1.7; margin-bottom: .6rem;
  transition: border-color .16s;
}
.change-note:hover { border-color: var(--line-2); }
.change-note .cn-icon { flex: 0 0 auto; font-size: .95rem; line-height: 1.5; }
.change-note b { color: var(--text); font-weight: 650; }
.change-note.warn { background: var(--warn-soft); border-color: rgba(251,191,36,.22); }
.change-note.bad { background: var(--danger-soft); border-color: rgba(248,113,113,.22); }
.change-note.good { background: var(--ok-soft); border-color: rgba(52,211,153,.22); }
.change-note.info { background: rgba(77,107,254,.09); border-color: rgba(77,107,254,.22); }

/* ============================ 阶段框架 ============================ */
.framework { display: flex; gap: .55rem; margin-top: .4rem; }
.fw-phase {
  flex: 1; min-width: 0; position: relative; overflow: hidden;
  padding: .75rem .8rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: transform .18s, border-color .18s;
}
.fw-phase:hover { transform: translateY(-2px); border-color: var(--line-2); }
.fw-phase.done { opacity: .5; }
.fw-phase.current {
  border-color: rgba(77,107,254,.45);
  background: linear-gradient(150deg, rgba(77,107,254,.16), rgba(139,92,246,.07));
  box-shadow: 0 6px 22px rgba(77,107,254,.16);
}
.fp-name { font-size: .8125rem; font-weight: 640; margin-bottom: .15rem; }
.fw-phase.current .fp-name { color: #fff; }
[data-theme="light"] .fw-phase.current .fp-name { color: #2438b8; }
.fp-meta { font-size: .6875rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.fp-bar { height: 3px; border-radius: 3px; background: var(--line); margin-top: .55rem; overflow: hidden; }
.fp-bar i { display: block; height: 100%; border-radius: 3px; background: var(--grad-brand); transition: width .5s ease; }

/* ============================ 图表 ============================ */
.bars { display: flex; align-items: flex-end; gap: 5px; height: 104px; margin-top: .6rem; }
.bars .bar {
  flex: 1; min-height: 3px; border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--brand) 0%, rgba(139,92,246,.55) 100%);
  transition: filter .16s, transform .16s;
  position: relative;
}
.bars .bar:hover { filter: brightness(1.25); transform: scaleY(1.03); transform-origin: bottom; }
.bars .bar.empty { background: var(--line); }
.bar-labels { display: flex; gap: 5px; margin-top: .4rem; }
.bar-labels span { flex: 1; text-align: center; font-size: .625rem; color: var(--text-4); font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 1rem; font-size: .75rem; color: var(--text-2); margin-top: .6rem; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; }

/* 强度分布条 */
.zone-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; margin: .5rem 0 .4rem; background: var(--line); }
.zone-bar i { display: block; height: 100%; transition: width .5s ease; }
.zone-bar i.easy { background: var(--z-easy); }
.zone-bar i.long { background: var(--z-long); }
.zone-bar i.quality { background: var(--z-quality); }

/* ============================ Readiness ============================ */
.readiness-item {
  display: flex; align-items: center; gap: .7rem; padding: .45rem 0;
  border-bottom: 1px solid var(--line);
}
.readiness-item:last-child { border-bottom: none; }
.readiness-item .ri-key { font-size: .7813rem; color: var(--text-3); width: 4.5rem; flex: 0 0 4.5rem; }
.readiness-item .ri-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.readiness-item .ri-bar i { display: block; height: 100%; border-radius: 999px; transition: width .5s ease; }
.readiness-item .ri-val { font-size: .7813rem; font-weight: 650; width: 2.6rem; text-align: right; font-variant-numeric: tabular-nums; }
.readiness-item .ri-detail { font-size: .7188rem; color: var(--text-4); }

/* ============================ 聊天 ============================ */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 420px; }
.chat-log { flex: 1; overflow-y: auto; padding: .4rem 0 1rem; display: flex; flex-direction: column; gap: 1rem; }
.msg { display: flex; gap: .7rem; animation: fadeUp .22s ease; }
.msg .avatar {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 10px;
  display: grid; place-items: center; font-size: .875rem; font-weight: 700;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .avatar { background: var(--grad-brand); color: #fff; box-shadow: 0 4px 14px rgba(77,107,254,.3); }
.msg.bot .avatar { background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); }
.bubble {
  max-width: min(740px, 86%); padding: .85rem 1.05rem;
  border-radius: var(--radius); font-size: .875rem; line-height: 1.75;
  background: var(--surface-2); border: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.msg.user .bubble {
  background: linear-gradient(135deg, rgba(77,107,254,.20), rgba(139,92,246,.13));
  border-color: rgba(77,107,254,.28);
}
.bubble h2, .bubble h3 { font-size: .9375rem; margin: .2rem 0 .5rem; }
.bubble ul, .bubble ol { margin: .4rem 0 .6rem; padding-left: 1.25rem; }
.bubble li { margin-bottom: .25rem; }
.bubble code { background: var(--surface-3); }
.bubble .cite { margin-top: .7rem; padding-top: .6rem; border-top: 1px solid var(--line); font-size: .7188rem; color: var(--text-3); }
.chat-input { display: flex; gap: .6rem; align-items: flex-end; padding-top: .85rem; border-top: 1px solid var(--line); }
.chat-input textarea { min-height: 46px; max-height: 180px; }
.suggest { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .7rem; }
.suggest button {
  padding: .34rem .75rem; border-radius: 999px; font-size: .75rem; font-weight: 500;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2);
  cursor: pointer; transition: all .16s;
}
.suggest button:hover {
  border-color: rgba(77,107,254,.45); color: var(--text); background: var(--grad-soft);
  transform: translateY(-1px);
}

/* ============================ 学习成果 ============================ */
.learn-list { display: flex; flex-direction: column; }
.learn-row {
  display: grid; grid-template-columns: 8rem 1fr; gap: .2rem .9rem;
  padding: .6rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.learn-row:last-child { border-bottom: none; }
.lr-key { font-size: .75rem; color: var(--text-3); }
.lr-val { font-size: .875rem; font-weight: 650; letter-spacing: -.01em; }
.lr-detail { grid-column: 2; font-size: .75rem; color: var(--text-2); }

.learn-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .85rem; }
.learn-metric {
  padding: 1rem 1.05rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: transform .18s, border-color .18s;
}
.learn-metric:hover { transform: translateY(-2px); border-color: var(--line-2); }
.lm-key { font-size: .75rem; color: var(--text-3); margin-bottom: .35rem; }
.lm-val { font-size: 1.05rem; font-weight: 680; margin-bottom: .35rem; letter-spacing: -.015em; }
.lm-detail { font-size: .75rem; color: var(--text-2); line-height: 1.65; }

/* ============================ 表格 ============================ */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
table { width: 100%; border-collapse: collapse; font-size: .8438rem; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th {
  background: var(--surface-3); color: var(--text-3); font-weight: 650;
  font-size: .7188rem; letter-spacing: .04em; text-transform: uppercase;
}
tbody tr { transition: background .14s; }
tbody tr:hover { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: .8125rem; }

/* ============================ 提示 ============================ */
.notice {
  border-radius: var(--radius-sm); padding: .8rem 1rem; font-size: .8438rem;
  border: 1px solid var(--line); background: var(--surface-2); margin-bottom: .7rem;
  line-height: 1.7;
}
.notice.warn { background: var(--warn-soft); border-color: rgba(251,191,36,.22); }
.notice.bad { background: var(--danger-soft); border-color: rgba(248,113,113,.22); }
.notice.good { background: var(--ok-soft); border-color: rgba(52,211,153,.22); }
.notice.info { background: rgba(77,107,254,.09); border-color: rgba(77,107,254,.22); }

.empty { text-align: center; padding: 3.5rem 1rem; color: var(--text-3); }
.empty .big { font-size: 2.5rem; margin-bottom: .7rem; opacity: .8; }

/* ============================ Toast / Modal ============================ */
.toast-wrap { position: fixed; right: 1.5rem; bottom: 1.5rem; z-index: 300; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  padding: .75rem 1.05rem; border-radius: var(--radius-sm); max-width: 380px;
  font-size: .8438rem; line-height: 1.65; color: var(--text);
  background: var(--surface-solid); border: 1px solid var(--line-2);
  box-shadow: var(--sh-lg);
  animation: slideUp .26s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-back {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1.25rem;
  background: rgba(4, 5, 8, .68);
  backdrop-filter: blur(6px);
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(660px, 100%); max-height: 86vh; overflow: auto;
  padding: 1.5rem 1.65rem; border-radius: var(--radius-lg);
  background: var(--surface-solid); border: 1px solid var(--line-2);
  box-shadow: var(--sh-lg);
  animation: popIn .24s cubic-bezier(.16,1,.3,1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.modal-head h2 { margin: 0; }

/* ============================ 导入 ============================ */
.dropzone {
  padding: 2rem 1rem; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  background: var(--surface-2); transition: all .18s;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--brand); background: rgba(77,107,254,.09);
  transform: scale(1.005);
}
.dropzone .big { font-size: 2rem; margin-bottom: .5rem; }
.filelist { display: flex; flex-direction: column; gap: .45rem; margin-top: .9rem; }
.fileitem {
  display: flex; gap: .7rem; align-items: center; font-size: .8125rem;
  padding: .6rem .8rem; border-radius: var(--radius-xs);
  background: var(--surface-2); border: 1px solid var(--line);
}
.fi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

details {
  padding: .7rem .9rem; margin-bottom: .6rem;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line);
}
details summary { cursor: pointer; font-size: .8438rem; font-weight: 600; color: var(--text-2); }
details summary:hover { color: var(--text); }
details[open] summary { margin-bottom: .7rem; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; font-size: .8438rem; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ============================ 训练强度图例 ============================ */
.zone-legend { display: flex; gap: .9rem; flex-wrap: wrap; font-size: .7188rem; color: var(--text-3); }
.zone-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.zone-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* ============================ 每周目标表 ============================ */
.week-table { display: flex; flex-direction: column; gap: 2px; }
.wk-row {
  display: grid;
  grid-template-columns: 3rem 6rem 5.5rem 6.5rem 5.5rem 1fr;
  gap: .75rem; align-items: center;
  padding: .55rem .7rem; border-radius: var(--radius-xs);
  font-size: .8125rem;
  transition: background .14s;
}
.wk-row:hover { background: var(--surface-hover); }
.wk-row.done { opacity: .5; }
.wk-row.current {
  background: linear-gradient(100deg, rgba(77,107,254,.14), transparent 80%);
  box-shadow: 0 0 0 1px rgba(77,107,254,.26) inset;
}
.wk-idx {
  font-family: var(--mono); font-size: .75rem; color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.wk-row.current .wk-idx { color: var(--brand); font-weight: 700; }
.wk-vol b, .wk-lr b, .wk-q b { font-variant-numeric: tabular-nums; font-weight: 650; }
.wk-bar { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.wk-bar i { display: block; height: 100%; border-radius: 3px; background: var(--grad-brand); transition: width .5s ease; }

@media (max-width: 980px) {
  .wk-row { grid-template-columns: 2.6rem 1fr auto; gap: .5rem; }
  .wk-lr, .wk-q, .wk-bar { display: none; }
}

/* ============================ 响应式 ============================ */
.only-mobile { display: none !important; }
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(4,5,8,.6); backdrop-filter: blur(3px);
}
.drawer-backdrop.show { display: block; animation: fadeIn .18s ease; }

@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 100; height: 100vh;
    transform: translateX(-102%); transition: transform .26s cubic-bezier(.16,1,.3,1);
    box-shadow: var(--sh-lg);
    background: var(--surface-solid);
  }
  .sidebar.open { transform: none; }
  .only-mobile { display: grid !important; }
  .content { padding: 1.1rem 1rem 5rem; }
  .topbar { padding: .7rem 1rem; }
  .hero { padding: 1.25rem 1.15rem; }
  .hero-title { font-size: 1.55rem; }
  .day-card { grid-template-columns: 1fr; gap: .6rem; padding: 1rem; }
  .dc-actions { flex-direction: row; align-items: center; }
  .framework { flex-wrap: wrap; }
  .fw-phase { flex: 1 1 44%; }
  .chat-wrap { height: calc(100vh - 260px); }
  .bubble { max-width: 100%; }
  .learn-row { grid-template-columns: 1fr; }
  .lr-detail { grid-column: 1; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 逐个入场的微动效 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.content > * { animation: fadeUp .3s cubic-bezier(.16,1,.3,1) both; }
.content > *:nth-child(2) { animation-delay: .04s; }
.content > *:nth-child(3) { animation-delay: .08s; }
.content > *:nth-child(4) { animation-delay: .12s; }
.content > *:nth-child(5) { animation-delay: .16s; }
.content > *:nth-child(6) { animation-delay: .2s; }

/* ============================ 滑块（RPE / 疲劳） ============================ */
.slider-field { margin-bottom: 1rem; }
.slider-head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .35rem; }
.slider-head label { font-size: .8125rem; color: var(--text-2); font-weight: 550; }
.slider-head .slider-val {
  margin-left: auto; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.slider-scale { display: flex; justify-content: space-between; font-size: .6563rem; color: var(--text-4); margin-top: .25rem; }
input[type=range] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 999px;
  background: var(--line); outline: none; padding: 0; border: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; border-radius: 50%; cursor: pointer;
  background: var(--grad-brand); border: 2px solid var(--surface-solid);
  box-shadow: 0 2px 10px rgba(77,107,254,.5);
  transition: transform .14s;
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
  background: #5b78ff; border: 2px solid var(--surface-solid);
}

/* ============================ 规格模块卡片 ============================ */
.spec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .85rem; }
.spec-cell {
  padding: .9rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.spec-cell .sc-k { font-size: .6875rem; color: var(--text-3); letter-spacing: .04em; margin-bottom: .35rem; font-weight: 600; }
.spec-cell .sc-v {
  font-size: 1.35rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; line-height: 1.2;
}
.spec-cell .sc-d { font-size: .7188rem; color: var(--text-2); margin-top: .3rem; line-height: 1.6; }
.spec-cell .conf-bar { height: 4px; border-radius: 999px; background: var(--line); margin-top: .5rem; overflow: hidden; }
.spec-cell .conf-bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); }

/* 决策追溯 */
.decision-box {
  border-radius: var(--radius-sm); padding: .9rem 1.05rem;
  background: linear-gradient(135deg, rgba(77,107,254,.12), rgba(139,92,246,.06));
  border: 1px solid rgba(77,107,254,.26);
}
.decision-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.decision-tag {
  font-size: .6875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .18rem .5rem; border-radius: 6px;
  background: var(--grad-brand); color: #fff;
}
.decision-list { margin: .35rem 0 0; padding-left: 1.15rem; font-size: .8125rem; color: var(--text-2); line-height: 1.7; }
.decision-list li { margin-bottom: .2rem; }

/* 目标评估 */
.target-status {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .75rem; border-radius: 999px; font-size: .7813rem; font-weight: 650;
}
.target-status.SUPPORTED { background: var(--ok-soft); color: var(--ok); }
.target-status.CHALLENGING { background: var(--warn-soft); color: var(--warn); }
.target-status.INSUFFICIENT_DATA { background: var(--surface-3); color: var(--text-3); }


/* 备案号 footer */
.site-footer {
  text-align: center;
  padding: 0.8rem 1rem;
  font-size: 0.78rem;
  color: var(--text-3, #888);
  border-top: 1px solid var(--line-2, #e5e5e5);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
