:root {
  /* ===== 视觉小说风（Visual Novel）设计 Token ===== */
  --vn-dark: #1a202c;
  --vn-slate: #4a5568;
  --vn-light: #f7fafc;
  --vn-indigo: #6366f1;
  --vn-pink: #ec4899;
  --vn-emerald: #10b981;
  --vn-magenta: #d948bb;

  /* 场景渐变（梦幻天空 / 柔光） */
  --scene: linear-gradient(160deg, #e9e3f4 0%, #f3e7f0 38%, #e6eef7 100%);
  --glow-1: rgba(99,102,241,.24);
  --glow-2: rgba(236,72,153,.20);
  --glow-3: rgba(16,185,129,.16);

  /* ADV 对话框：半透明暗色面板 */
  --panel: rgba(26,32,44,.88);
  --panel-solid: #20283a;
  --panel-2: rgba(255,255,255,.06);

  /* 文本（暗面板上的浅色文字） */
  --text: #eef1f7;
  --text-2: #c4ccdb;
  --muted: #93a0b6;

  /* 细边框（禁止粗重边框） */
  --border: rgba(255,255,255,.12);
  --border-2: rgba(255,255,255,.22);

  /* 兼容旧变量（供内联 style / 其他引用） */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99,102,241,.20);
  --primary-soft: rgba(99,102,241,.16);
  --accent: #13b5d6;
  --accent-2: #7c5cf6;
  --tech-line: rgba(129,140,248,.30);
  --warn: #fbbf24;
  --warn-soft: rgba(251,191,36,.16);
  --ok: #34d399;
  --ok-soft: rgba(16,185,129,.18);
  --danger: #f87171;
  --danger-soft: rgba(248,113,113,.18);
  --warm: #fbbf24;
  --train: #818cf8;
  --reco: #34d399;
  --card: var(--panel);
  --card-2: var(--panel-2);
  --bg: #141a26;

  --radius: 14px;
  --shadow: 0 22px 56px rgba(12,16,30,.42);
  --shadow-lg: 0 30px 72px rgba(12,16,30,.5);
  --grad-primary: linear-gradient(135deg,#6366f1,#8b5cf6);
  --grad-brand: linear-gradient(135deg,#7c5cf6,#ec4899);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(900px 520px at 12% 8%, var(--glow-1), transparent 60%),
    radial-gradient(820px 560px at 88% 92%, var(--glow-2), transparent 58%),
    radial-gradient(700px 480px at 70% 30%, var(--glow-3), transparent 60%),
    var(--scene);
  color: var(--text);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}
/* 全局 MEGA 背景水印（视觉小说风保留） */
body::before {
  content: "MEGA";
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 24vw; font-weight: 800; letter-spacing: .08em;
  color: rgba(99,102,241,.14); white-space: nowrap;
  pointer-events: none; user-select: none; z-index: 0;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: "Noto Serif SC", Georgia, "Songti SC", serif; font-weight: 700; }

/* ---------- 门户页（视觉小说场景 + 暗色对话框卡片） ---------- */
.portal {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 520px at 12% 8%, var(--glow-1), transparent 60%),
    radial-gradient(820px 560px at 88% 92%, var(--glow-2), transparent 58%),
    var(--scene);
  padding: 40px 20px; position: relative; z-index: 1;
}
.portal h1 {
  font-size: 44px; letter-spacing: 2px; text-align: center; color: var(--vn-dark);
}
.portal .sub { margin: 12px 0 44px; font-size: 17px; color: var(--vn-slate); }
.portal-cards { display: flex; gap: 26px; flex-wrap: wrap; justify-content: center; }
.portal-card {
  background: var(--panel); color: var(--text); width: 240px; border-radius: 18px;
  padding: 34px 26px; text-align: center; box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .25s, box-shadow .25s; cursor: pointer; position: relative;
}
.portal-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.portal-card .icon {
  font-size: 42px; margin-bottom: 14px; width: 64px; height: 64px; line-height: 64px;
  margin-left: auto; margin-right: auto; border-radius: 16px;
  background: var(--grad-primary); color: #fff; box-shadow: 0 0 16px rgba(99,102,241,.4);
}
.portal-card h3 { font-family: "Noto Serif SC", serif; font-size: 22px; margin-bottom: 8px; color: #fff; }
.portal-card p { color: var(--muted); font-size: 14px; min-height: 42px; }
.portal-card .enter { margin-top: 16px; display: inline-block; color: #c7d2fe; font-weight: 600; }
.portal .footer { margin-top: 48px; font-size: 13px; color: var(--vn-slate); }

/* ---------- 登录页兜底（实际由 login.css 覆盖） ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--scene); padding: 20px;
}

/* ---------- 通用组件 ---------- */
.btn {
  background: var(--grad-primary); color: #fff; border: 1px solid rgba(255,255,255,.25);
  padding: 10px 18px; border-radius: 12px; font-size: 14px; cursor: pointer;
  transition: all .3s ease; font-weight: 600; font-family: inherit;
  box-shadow: 0 6px 16px rgba(99,102,241,.30);
}
.btn:hover { box-shadow: 0 0 20px rgba(99,102,241,.5); transform: translateY(-1px); filter: brightness(1.06); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost, .btn.ghost.light { background: rgba(255,255,255,.08); color: var(--text); border: 1px solid var(--border-2); }
.btn.ghost:hover, .btn.ghost.light:hover { background: rgba(255,255,255,.14); box-shadow: 0 0 16px rgba(255,255,255,.12); }
.btn.gray, .btn.gray.light { background: rgba(255,255,255,.10); color: var(--text-2); border: 1px solid var(--border); box-shadow: none; }
.btn.gray:hover, .btn.gray.light:hover { background: rgba(255,255,255,.16); }
.btn.light { color: var(--text); }
.btn.danger { background: linear-gradient(135deg,#f87171,#ef4444); border-color: rgba(255,255,255,.2); box-shadow: 0 6px 16px rgba(248,113,113,.3); }
.btn.danger:hover { filter: brightness(1.05); box-shadow: 0 0 20px rgba(248,113,113,.4); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; justify-content: flex-start; text-align: left; }
.btn.act-go { background: var(--grad-primary); color: #fff; border: none; box-shadow: 0 4px 12px rgba(99,102,241,.3); padding: 14px 20px; font-size: 16px; font-weight: 800; }
.btn.act-go:hover { filter: brightness(1.05); transform: translateY(-1px); }

.tag { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.info { background: rgba(99,102,241,.20); color: #c7d2fe; }
.tag.sm { padding: 1px 8px; font-size: 11px; }

/* 科技感 SVG 图标 */
.ic { display: inline-block; vertical-align: -0.15em; flex: none; width: 1.05em; height: 1.05em; }

/* ---------- 角色铭牌徽章（VN nameplate） ---------- */
.vn-nameplate {
  display: inline-block; padding: 4px 14px; border-radius: 6px; font-size: 13px; font-weight: 700;
  color: #fff; letter-spacing: .5px; margin-bottom: 14px; box-shadow: 0 4px 12px rgba(0,0,0,.22);
}
.vn-indigo  { background: linear-gradient(135deg,#6366f1,#8b5cf6); }
.vn-pink    { background: linear-gradient(135deg,#ec4899,#d946ef); }
.vn-emerald { background: linear-gradient(135deg,#10b981,#34d399); }
.vn-magenta { background: linear-gradient(135deg,#d948bb,#ec4899); }
.vn-slate   { background: linear-gradient(135deg,#475569,#64748b); }

/* 装饰性边角框线（L 形角标） */
.vn-ornate { position: relative; }
.vn-ornate::before, .vn-ornate::after { content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none; }
.vn-ornate::before { top: 10px; left: 10px; border-left: 2px solid rgba(129,140,248,.5); border-top: 2px solid rgba(129,140,248,.5); }
.vn-ornate::after  { top: 10px; right: 10px; border-right: 2px solid rgba(129,140,248,.5); border-top: 2px solid rgba(129,140,248,.5); }

/* ---------- 后台布局（顶部导航式） ---------- */
.app { display: block; min-height: 100vh; position: relative; z-index: 1; }

.app-header {
  position: sticky; top: 0; z-index: 300;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 28px;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 24px rgba(12,16,30,.30);
}
.app-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--vn-indigo), var(--vn-pink), transparent);
  opacity: .9;
}
@keyframes headerGlow { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.brand { display: flex; align-items: center; gap: 14px; }
.logo-mark {
  width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-family: "Noto Serif SC", serif; font-size: 24px; font-weight: 800; color: #fff;
  background: var(--grad-brand);
  box-shadow: 0 0 0 1px rgba(255,255,255,.5), 0 8px 20px rgba(124,92,246,.4);
  position: relative;
}
.logo-mark::before {
  content: ''; position: absolute; inset: -3px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,92,246,.5), rgba(236,72,153,.25));
  z-index: -1; animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-family: "Noto Serif SC", serif; font-size: 20px; font-weight: 800; letter-spacing: .5px; color: #fff; }
.brand-sub { font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-top: 3px; }

.app-nav { display: flex; gap: 6px; flex: 1; justify-content: center; }
.app-nav a {
  padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2);
  cursor: pointer; transition: .15s; position: relative;
}
.app-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.app-nav a.active { background: rgba(99,102,241,.22); color: #fff; box-shadow: inset 0 0 0 1px rgba(129,140,248,.5); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-user { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.header-user .muted { color: var(--muted); }
.hu-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,.7); animation: dotPulse 2s ease-in-out infinite; }
@keyframes dotPulse { 0%,100% { box-shadow: 0 0 6px rgba(52,211,153,.6); } 50% { box-shadow: 0 0 14px rgba(52,211,153,.95); } }

.main { padding: 26px 32px; max-width: 1240px; margin: 0 auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 12px; }
.topbar h2 { font-family: "Noto Serif SC", serif; font-size: 24px; color: #fff; }

.card {
  background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 20px; border: 1px solid var(--border); color: var(--text);
  position: relative;
}
.card h3 { font-family: "Noto Serif SC", serif; font-size: 17px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #fff; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.stat-card { background: var(--panel); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); color: var(--text); }
.stat-card .num { font-family: "Noto Serif SC", serif; font-size: 30px; font-weight: 700; color: #c7d2fe; }
.stat-card .lbl { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* 表格（暗面板上的浅色文字） */
table { width: 100%; border-collapse: collapse; color: var(--text); }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; background: rgba(255,255,255,.05); }
tr:hover td { background: rgba(255,255,255,.06); }

/* 表单 */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 10px; font-size: 14px; font-family: inherit;
  background: rgba(255,255,255,.07); color: var(--text); transition: all .2s;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--muted); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none; border-color: var(--vn-indigo); box-shadow: 0 0 0 3px rgba(99,102,241,.30);
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }

/* 弹窗（ADV 半透明暗色对话框 + 角标） */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12,16,30,.55); display: none;
  align-items: flex-start; justify-content: center; z-index: 500; padding: 40px 16px; overflow-y: auto;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--panel); border-radius: 16px; width: 100%; max-width: 620px; padding: 26px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); animation: pop .2s; color: var(--text);
  position: relative;
}
.modal.wide { max-width: 860px; }
.modal::before, .modal::after { content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none; }
.modal::before { top: 10px; left: 10px; border-left: 2px solid rgba(129,140,248,.5); border-top: 2px solid rgba(129,140,248,.5); }
.modal::after { top: 10px; right: 10px; border-right: 2px solid rgba(129,140,248,.5); border-top: 2px solid rgba(129,140,248,.5); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal .modal-head h3 { font-family: "Noto Serif SC", serif; font-size: 18px; color: #fff; }
.modal .close { cursor: pointer; font-size: 22px; color: var(--muted); border: none; background: none; }
.modal .close:hover { color: #fff; }
.modal .modal-foot { margin-top: 22px; display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 全屏独立页面（页面系统） ---------- */
.page-panel {
  position: fixed; inset: 0; background: var(--panel-solid); z-index: 400;
  display: none; flex-direction: column; overflow: hidden;
}
.page-panel.show { display: flex; }
/* 整页内的 MEGA 背景水印（浅色，暗面板上可见） */
.page-panel::before {
  content: "MEGA"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-size: 22vw; font-weight: 800; letter-spacing: .08em;
  color: rgba(255,255,255,.05); white-space: nowrap;
  pointer-events: none; user-select: none; z-index: 0;
}
.page-head {
  display: flex; align-items: center; gap: 18px; padding: 16px 28px;
  background: var(--panel-solid); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2;
}
.page-head h2 { font-family: "Noto Serif SC", serif; font-size: 20px; font-weight: 700; color: #fff; }
.page-back { background: rgba(255,255,255,.10); border: 1px solid var(--border-2); padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--text); transition: all .2s; font-family: inherit; }
.page-back:hover { background: rgba(255,255,255,.18); }
.page-body { flex: 1; overflow-y: auto; padding: 24px 28px; position: relative; z-index: 1; }

/* 周标签 */
.wk-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.wk-tab {
  border: 1px solid var(--border); background: rgba(255,255,255,.07); color: var(--text-2);
  padding: 8px 18px; border-radius: 22px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s;
}
.wk-tab:hover { border-color: var(--vn-indigo); color: #fff; }
.wk-tab.active { background: var(--grad-primary); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(99,102,241,.4); }
.wk-wrap { animation: fade .2s; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.week-note { background: var(--warn-soft); border: 1px solid rgba(251,191,36,.3); color: #fcd34d; padding: 10px 14px; border-radius: 10px; margin: 4px 0 16px; font-size: 13px; }
.week-focus { color: #fbbf24; font-size: 14px; font-weight: 600; margin: 0 0 14px; padding-left: 12px; border-left: 3px solid var(--warm); }
.plan-detail-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.plan-detail-head .tag { font-size: 13px; padding: 4px 12px; }

/* 日标签 */
.day-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.day-tab {
  border: 1px solid var(--border); background: rgba(255,255,255,.07); color: var(--text-2);
  padding: 9px 16px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .2s; position: relative;
}
.day-tab:hover { border-color: var(--vn-indigo); color: #fff; }
.day-tab.active { background: var(--vn-indigo); color: #fff; border-color: var(--vn-indigo); font-weight: 700; box-shadow: 0 4px 12px rgba(99,102,241,.4); }
.day-tab.active::after { content: ''; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--vn-indigo); }
.day-panel { animation: fade .2s; }

/* 当日详情 */
.day-detail { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); }
.day-detail-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.day-checkin { margin-left: auto; }
.day-idx { font-family: "Noto Serif SC", serif; font-size: 22px; font-weight: 800; color: var(--warm); }
.day-focus { color: var(--text-2); font-size: 14px; }
.sec-title { font-family: "Noto Serif SC", serif; font-size: 15px; margin-bottom: 12px; color: #fff; display: flex; align-items: center; gap: 7px; }
.sec-title .ic { color: #c7d2fe; }
.phase-block { margin-top: 16px; padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--border); }
.phase-block:first-of-type { margin-top: 18px; }
.phase-block.ph-warmup { border-top: 3px solid var(--warm); }
.phase-block.ph-train { border-top: 3px solid var(--train); }
.phase-block.ph-reco { border-top: 3px solid var(--reco); }
.phase-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 12px; color: #fff; }
.phase-head .ic { width: 18px; height: 18px; }
.ph-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ph-dot.ph-warmup { background: var(--warm); }
.ph-dot.ph-train { background: var(--train); }
.ph-dot.ph-reco { background: var(--reco); }

.ex-list { display: flex; flex-direction: column; gap: 12px; }
.ex-item { display: flex; gap: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 12px; padding: 14px; transition: all .2s; }
.ex-item:hover { background: rgba(255,255,255,.10); box-shadow: var(--shadow); transform: translateY(-1px); }
.ex-item.ph-warmup { border-left: 3px solid var(--warm); }
.ex-item.ph-train { border-left: 3px solid var(--train); }
.ex-item.ph-reco { border-left: 3px solid var(--reco); }
.ex-no { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--grad-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; box-shadow: 0 2px 6px rgba(99,102,241,.3); }
.ex-body { flex: 1; min-width: 0; }
.ex-name { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: #fff; }
.ex-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ex-meta { font-size: 12px; color: #c7d2fe; background: rgba(99,102,241,.16); padding: 3px 9px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.ex-meta .ic { width: 13px; height: 13px; color: #c7d2fe; }
.ex-int { font-size: 12px; color: #fcd34d; background: var(--warn-soft); padding: 3px 9px; border-radius: 6px; }
.ex-line { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-top: 6px; display: flex; gap: 6px; }
.ex-line .ic { flex: 0 0 auto; width: 15px; height: 15px; color: #c7d2fe; margin-top: 2px; }
.ex-notes { font-size: 12px; color: var(--text-2); margin-top: 8px; line-height: 1.6; background: rgba(99,102,241,.12); border-radius: 8px; padding: 8px 10px; border: 1px solid rgba(129,140,248,.3); display: flex; gap: 6px; }
.ex-notes .ic { flex: 0 0 auto; width: 15px; height: 15px; color: #c7d2fe; }
.ex-empty { color: var(--text-2); font-size: 14px; padding: 14px 0; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ex-empty .ic { width: 18px; height: 18px; color: #c7d2fe; }
.diet-block { margin-top: 22px; }
.day-detail .diet { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: 13px; line-height: 1.9; margin-top: 4px; color: var(--text-2); }
.day-detail .diet div { display: flex; gap: 8px; }
.day-detail .diet span { flex: 0 0 64px; color: #c7d2fe; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.day-detail .diet span .ic { width: 15px; height: 15px; color: #c7d2fe; }
.diet-note { color: var(--muted); margin-top: 6px; }
.card.mt { margin-top: 18px; }
.mb0 { margin-bottom: 0; }

/* 已生成运动计划卡片 */
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 18px; background: var(--panel);
  display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s;
}
.plan-card:hover { box-shadow: var(--shadow); transform: translateY(-4px); }
.plan-card .pc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.plan-card .pc-icon { width: 46px; height: 46px; border-radius: 12px; background: rgba(99,102,241,.18); border: 1px solid rgba(129,140,248,.4); display: flex; align-items: center; justify-content: center; font-size: 24px; color: #c7d2fe; }
.plan-card h4 { font-family: "Noto Serif SC", serif; font-size: 16px; margin-bottom: 4px; color: #fff; }
.plan-card .pc-foot { display: flex; gap: 8px; margin-top: 14px; }
@media (max-width: 720px) { .plan-cards { grid-template-columns: 1fr; } }

/* 运动计划管理：一行一份 */
.plan-rows { display: flex; flex-direction: column; gap: 16px; }
.plan-row {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px 44px;
  cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; box-shadow: var(--shadow);
}
.plan-row::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--warm), var(--vn-indigo)); box-shadow: 0 0 12px rgba(99,102,241,.3); }
.plan-row:hover { transform: translateY(-3px); border-color: rgba(129,140,248,.6); box-shadow: var(--shadow-lg); }
.plan-row.done { border-color: rgba(52,211,153,.45); }
.plan-row.done::after { background: linear-gradient(180deg, #34d399, #10b981); box-shadow: 0 0 12px rgba(16,185,129,.4); }
.pr-badge { flex: 0 0 auto; align-self: flex-start; position: relative; z-index: 1; }
.pr-phase { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; min-height: 58px; padding: 0 12px; border-radius: 13px; background: var(--grad-primary); color: #fff; font-size: 16px; font-weight: 800; text-align: center; line-height: 1.25; box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.plan-row.done .pr-phase { background: linear-gradient(135deg, #34d399, #10b981); }
.pr-icon { flex: 0 0 auto; align-self: flex-start; position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(99,102,241,.18); border: 1px solid rgba(129,140,248,.4); color: #c7d2fe; font-size: 22px; }
.pr-icon .ic { width: 24px; height: 24px; }
.pr-main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.pr-title { font-family: "Noto Serif SC", serif; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; color: #fff; }
.pr-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.pr-chip { display: inline-flex; align-items: center; gap: 5px; background: rgba(99,102,241,.16); border: 1px solid rgba(129,140,248,.35); color: #c7d2fe; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.pr-chip .ic { width: 14px; height: 14px; color: #c7d2fe; }
.pr-progress { height: 8px; background: rgba(255,255,255,.12); border-radius: 20px; overflow: hidden; }
.pr-fill { height: 100%; background: linear-gradient(90deg, var(--warm), var(--vn-indigo)); border-radius: 20px; transition: width .4s ease; box-shadow: 0 0 8px rgba(99,102,241,.3); }
.plan-row.done .pr-fill { background: linear-gradient(90deg, #34d399, #10b981); box-shadow: 0 0 8px rgba(16,185,129,.3); }
.pr-progress-label { font-size: 12px; color: var(--text-2); margin-top: 6px; font-weight: 600; }
.pr-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.tag.done-tag { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.pr-done-flag { color: var(--ok); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; }
.pr-manage { position: absolute; left: 16px; bottom: 12px; z-index: 2; }
.pr-manage-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(129,140,248,.4); background: rgba(99,102,241,.16); color: #c7d2fe; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 8px; cursor: pointer; transition: all .15s; font-family: inherit; }
.pr-manage-btn .ic { width: 14px; height: 14px; }
.pr-manage-btn:hover { border-color: var(--vn-indigo); color: #fff; background: var(--vn-indigo); }
.pr-menu { position: absolute; left: 0; bottom: 36px; min-width: 132px; z-index: 20; background: var(--panel-solid); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.pr-menu-item { display: inline-flex; align-items: center; gap: 7px; text-align: left; border: none; background: transparent; padding: 8px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--text-2); transition: all .15s; font-family: inherit; }
.pr-menu-item .ic { width: 15px; height: 15px; }
.pr-menu-item:hover { background: rgba(99,102,241,.16); color: #c7d2fe; }
.pr-menu-item.danger { color: #fca5a5; }
.pr-menu-item.danger:hover { background: var(--danger-soft); color: #fca5a5; }
@media (max-width: 720px) { .plan-row { flex-direction: column; align-items: stretch; } .pr-badge, .pr-icon { align-self: flex-start; } }

/* 测试项目卡片 */
.test-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.test-card { position: relative; background: var(--panel); border: 1px solid var(--border); border-top: 3px solid var(--vn-indigo); border-radius: 14px; padding: 22px; cursor: pointer; transition: all .18s; overflow: hidden; box-shadow: var(--shadow); }
.test-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(129,140,248,.6); }
.tc-icon { width: 56px; height: 56px; border-radius: 14px; background: rgba(99,102,241,.18); border: 1px solid rgba(129,140,248,.4); display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 14px; color: #c7d2fe; }
.tc-icon .ic { width: 30px; height: 30px; }
.test-card h4 { font-family: "Noto Serif SC", serif; font-size: 18px; margin: 0 0 8px; color: #fff; }
.tc-desc { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }
.tc-foot { margin-top: 14px; font-size: 13px; font-weight: 700; color: #c7d2fe; }
.tc-badge { position: absolute; top: 14px; right: 14px; background: var(--ok-soft); color: var(--ok); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }
.hist-list { display: flex; flex-direction: column; gap: 10px; }
.hist-item { display: flex; align-items: center; gap: 12px; justify-content: space-between; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: all .15s; }
.hist-item:hover { border-color: rgba(129,140,248,.6); box-shadow: var(--shadow); }
.hi-main { min-width: 0; }
.hi-time { font-family: "Noto Serif SC", serif; font-weight: 700; font-size: 14px; color: #fff; }
.hi-sum { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* 每日签到 */
.ck-done { display: inline-flex; align-items: center; gap: 6px; background: var(--ok-soft); color: var(--ok); border: 1px solid rgba(16,185,129,.3); padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.btn.ck-btn, .btn.ck-btn:hover { background: var(--grad-primary); color: #fff; border: none; box-shadow: 0 4px 12px rgba(99,102,241,.3); }

/* 计划展示 */
.plan-overview { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 16px; color: var(--text-2); }
.plan-overview b { color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.plan-overview .ic { width: 16px; height: 16px; color: #c7d2fe; }
.card.mt { background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-top: 18px; color: var(--text-2); }
.card.mt b { color: #fff; display: inline-flex; align-items: center; gap: 6px; }
.card.mt .ic { width: 16px; height: 16px; color: #c7d2fe; }
.day-card { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.day-card .day-head { font-weight: 700; color: #c7d2fe; margin-bottom: 10px; display: flex; justify-content: space-between; }
.day-card .diet { background: rgba(255,255,255,.06); border-radius: 10px; padding: 12px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.day-card ul { margin-left: 18px; }
.day-card li { font-size: 14px; margin: 4px 0; }

.empty { text-align: center; color: var(--muted); padding: 40px; }
.hidden { display: none !important; }
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: var(--panel); color: var(--text); padding: 12px 22px; border-radius: 10px; z-index: 999;
  box-shadow: var(--shadow-lg); font-size: 14px; opacity: 0; transition: opacity .2s, top .2s;
  border: 1px solid var(--border); border-left: 4px solid var(--vn-indigo); font-weight: 600;
}
.toast.show { opacity: 1; top: 34px; }
.toast.err { border-left-color: var(--danger); color: #fca5a5; }
.toast.ok { border-left-color: var(--ok); color: #6ee7b7; }

.section { display: none; }
.section.active { display: block; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex.between { justify-content: space-between; }
.flex.col { flex-direction: column; align-items: stretch; }
.flex.gap { gap: 10px; }

/* 会员详情：操作区与测试记录左右布局 */
.member-split { display: flex; gap: 20px; align-items: flex-start; margin-top: 16px; }
.member-side { flex: 0 0 250px; }
.member-main { flex: 1; min-width: 0; }
.member-main .m-tests-scroll { margin-top: 4px; }
.m-tests-scroll { max-height: 224px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.05); padding: 2px 6px; }
.m-tests-scroll table { width: 100%; }
.m-tests-scroll td { padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); }
.m-tests-scroll tr:last-child td { border-bottom: none; }
.m-tests-scroll::-webkit-scrollbar { width: 7px; }
.m-tests-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 8px; }
.m-tests-scroll .empty { padding: 18px; text-align: center; }
.side-title { font-size: 12px; color: var(--muted); font-weight: 700; letter-spacing: 1px; margin-bottom: 12px; }
.act-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 16px 18px; border-radius: 12px; border: none; cursor: pointer; font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 14px; transition: all .16s; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.act-btn .ai { font-size: 26px; line-height: 1; }
.act-btn .as { display: flex; flex-direction: column; gap: 2px; }
.act-btn .as small { font-weight: 500; font-size: 12px; color: rgba(255,255,255,.9); }
.act-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0,0,0,.35); filter: brightness(1.05); }
.act-test { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.act-plan { background: linear-gradient(135deg, #f59e0b, #ec4899); }
.act-manage { background: linear-gradient(135deg, #10b981, #34d399); }
@media (max-width: 720px) { .member-split { flex-direction: column; } .member-side { width: 100%; flex: auto; } }

/* ---------- 会员详情：基本信息框（姓名/按钮/字段合一，紧凑限高） ---------- */
.member-profile { padding: 16px 18px; max-height: 240px; overflow-y: auto; }
.member-profile::-webkit-scrollbar { width: 6px; }
.member-profile::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 8px; }
.mp-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.mh-avatar {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-family: "Noto Serif SC", serif; font-size: 21px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #7c5cf6, #ec4899 58%, #6366f1);
  box-shadow: 0 5px 14px rgba(124,92,246,.4);
}
.mh-info { flex: 1; min-width: 0; }
.mh-name { font-family: "Noto Serif SC", serif; font-size: 20px; font-weight: 800; color: #fff; line-height: 1.2; }
.mh-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mh-tag {
  font-size: 12px; font-weight: 600; color: #c7d2fe;
  padding: 2px 10px; border-radius: 999px;
  background: rgba(124,92,246,.16); border: 1px solid rgba(124,92,246,.35);
}
.mp-fields { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px 18px; }
.mp-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.mp-row.mp-wide { grid-column: span 2; }
.mp-k { flex: 0 0 auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.mp-v { font-size: 14px; color: var(--text); font-weight: 600; line-height: 1.4; word-break: break-word; }
@media (max-width: 720px) {
  .mp-fields { grid-template-columns: repeat(2, 1fr); }
  .mp-row.mp-wide { grid-column: span 2; }
  .mp-top { flex-wrap: wrap; }
}
.mb { margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.6); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .form-grid, .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .app-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 12px 16px; }
  .app-nav { flex-wrap: wrap; }
  .header-actions { width: 100%; flex-wrap: wrap; }
  .main { padding: 18px 16px; }
  .brand-title { font-size: 17px; }
}

/* ---------- 生成计划进度条（ADV 对话框） ---------- */
#plan-progress-mask.modal-mask { align-items: center; z-index: 600; }
.progress-modal {
  background: var(--panel); border-radius: 18px; width: 100%; max-width: 520px; padding: 38px 34px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--border); text-align: center; animation: pop .2s; color: var(--text);
  position: relative;
}
.progress-modal::before, .progress-modal::after { content: ""; position: absolute; width: 16px; height: 16px; pointer-events: none; }
.progress-modal::before { top: 12px; left: 12px; border-left: 2px solid rgba(129,140,248,.5); border-top: 2px solid rgba(129,140,248,.5); }
.progress-modal::after { top: 12px; right: 12px; border-right: 2px solid rgba(129,140,248,.5); border-top: 2px solid rgba(129,140,248,.5); }
.progress-modal .pm-emoji { font-size: 46px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.progress-modal .pm-title { font-family: "Noto Serif SC", serif; font-size: 19px; font-weight: 700; margin: 12px 0 6px; color: #fff; }
.progress-modal .pm-stage { font-size: 14px; color: #c7d2fe; font-weight: 600; min-height: 22px; margin-bottom: 18px; }
.progress-modal .pm-bar { height: 14px; background: rgba(255,255,255,.12); border-radius: 20px; overflow: hidden; position: relative; }
.progress-modal .pm-fill { height: 100%; width: 0%; border-radius: 20px; background: linear-gradient(90deg, #8b5cf6, var(--vn-indigo)); transition: width .5s ease; }
.progress-modal .pm-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.progress-modal .pm-pct { font-size: 13px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.progress-modal .pm-tip { font-size: 12px; color: var(--muted); margin-top: 16px; line-height: 1.6; }
.progress-modal .pm-time { font-size: 13px; color: #c7d2fe; font-weight: 600; margin-top: 10px; }
.progress-modal .pm-stream { height: 76px; box-sizing: border-box; margin: 14px 0 6px; padding: 8px 10px; background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; text-align: left; color: #a5b4fc; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 20px; white-space: pre-wrap; word-break: break-all; }

/* ---------- 生成计划前选择测试数据 ---------- */
.test-sel-wrap { display: flex; flex-direction: column; gap: 18px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.test-sel-group { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: rgba(255,255,255,.05); }
.test-sel-group .tsg-head { font-weight: 700; font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; color: #fff; }
.test-sel-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; background: rgba(255,255,255,.05); transition: all .15s; }
.test-sel-item:last-child { margin-bottom: 0; }
.test-sel-item:hover { border-color: rgba(129,140,248,.6); }
.test-sel-item.sel { border-color: var(--vn-indigo); background: rgba(99,102,241,.18); }
.test-sel-item input { margin-top: 4px; accent-color: var(--vn-indigo); }
.test-sel-item .tsi-main { flex: 1; min-width: 0; }
.test-sel-item .tsi-date { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: #fff; }
.test-sel-item .tsi-data { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }

/* ---------- 测试录入：手动/上传 分段切换（VN 风） ---------- */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: rgba(255,255,255,.07); border: 1px solid var(--border); border-radius: 12px; }
.seg-btn {
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  padding: 8px 18px; border-radius: 9px; font-size: 14px; font-weight: 600; font-family: "Noto Sans SC", sans-serif;
  transition: all .18s;
}
.seg-btn:hover { color: #e2e8f0; }
.seg-btn.active { background: linear-gradient(135deg, #8b5cf6, var(--vn-indigo)); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.4); }

/* 上传体测报告 */
.upload-box {
  position: relative; border: 2px dashed rgba(129,140,248,.5); border-radius: 14px;
  background: rgba(255,255,255,.04); padding: 18px; text-align: center; cursor: pointer;
  transition: all .18s; overflow: hidden; min-height: 120px; display: flex; align-items: center; justify-content: center;
}
.upload-box:hover { border-color: var(--vn-indigo); background: rgba(99,102,241,.1); }
.upload-hint { color: #e2e8f0; font-size: 15px; font-weight: 600; line-height: 1.7; }
.upload-hint .muted { font-size: 12px; font-weight: 400; }
.upload-preview { max-width: 100%; max-height: 260px; border-radius: 10px; box-shadow: var(--shadow); }
.upload-box.has-img { border-style: solid; border-color: var(--vn-indigo); cursor: default; }

/* ---------- 问卷答题（运动目标 / 运动心理测试） ---------- */
.quiz-wrap { min-height: 320px; display: flex; flex-direction: column; }

/* 开场页 */
.quiz-intro { text-align: center; padding: 24px 12px 8px; display: flex; flex-direction: column; align-items: center; }
.quiz-intro-icon { font-size: 56px; line-height: 1; margin-bottom: 14px; filter: drop-shadow(0 6px 16px rgba(99,102,241,.4)); }
.quiz-intro-title { font-size: 24px; margin: 0 0 8px; color: #fff; }
.quiz-intro-desc { color: var(--muted); margin: 0 0 18px; }
.quiz-intro-meta { display: inline-block; padding: 8px 18px; border-radius: 20px; background: rgba(99,102,241,.14); border: 1px solid rgba(129,140,248,.4); color: #e2e8f0; font-size: 14px; margin-bottom: 10px; }
.quiz-intro-meta b { color: #a5b4fc; font-size: 17px; }
.quiz-intro-tip { color: var(--muted); font-size: 13px; margin-bottom: 26px; }

/* 进度条 */
.quiz-progress { margin-bottom: 22px; }
.quiz-progress-bar { height: 8px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.quiz-progress-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #8b5cf6, var(--vn-indigo)); transition: width .35s cubic-bezier(.4,0,.2,1); }
.quiz-progress-text { text-align: right; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* 题目 */
.quiz-question { flex: 1; animation: quizIn .3s ease; }
@keyframes quizIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.quiz-q-num { font-size: 13px; font-weight: 700; color: #a5b4fc; letter-spacing: .5px; margin-bottom: 6px; }
.quiz-q-opt { color: var(--muted); font-weight: 400; margin-left: 6px; }
.quiz-q-title { font-size: 20px; line-height: 1.5; color: #fff; margin: 0 0 20px; }

/* 选项 */
.quiz-opts { display: flex; flex-direction: column; gap: 12px; }
.quiz-opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 15px 18px; border-radius: 14px; border: 1.5px solid var(--border);
  background: rgba(255,255,255,.04); color: #e2e8f0; font-size: 15px; font-family: "Noto Sans SC", sans-serif;
  transition: all .16s;
}
.quiz-opt:hover { border-color: var(--vn-indigo); background: rgba(99,102,241,.1); transform: translateX(3px); }
.quiz-opt-tag {
  flex: 0 0 30px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; background: rgba(255,255,255,.08); color: var(--muted); font-weight: 700; font-size: 14px; transition: all .16s;
}
.quiz-opt-label { flex: 1; }
.quiz-opt-check { opacity: 0; color: #fff; font-weight: 700; transition: opacity .16s; }
.quiz-opt.active { border-color: transparent; background: linear-gradient(135deg, #8b5cf6, var(--vn-indigo)); color: #fff; box-shadow: 0 6px 20px rgba(99,102,241,.4); }
.quiz-opt.active .quiz-opt-tag { background: rgba(255,255,255,.25); color: #fff; }
.quiz-opt.active .quiz-opt-check { opacity: 1; }

/* 底部按钮 */
.quiz-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 26px; }
.quiz-foot .act-go, .quiz-foot #quiz-next { margin-left: auto; }
.btn.line { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn.line:hover { border-color: var(--vn-indigo); color: #e2e8f0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 注意力小游戏（注意力测试） ---------- */
.game-wrap { min-height: 360px; display: flex; flex-direction: column; }
.game-intro { text-align: center; padding: 20px 12px 8px; display: flex; flex-direction: column; align-items: center; }
.game-intro-icon { font-size: 56px; line-height: 1; margin-bottom: 14px; filter: drop-shadow(0 6px 16px rgba(99,102,241,.4)); }
.game-intro-title { font-size: 24px; margin: 0 0 10px; color: #fff; }
.game-intro-desc { color: var(--muted); margin: 0 0 18px; max-width: 520px; line-height: 1.7; text-align: left; }
.game-intro-meta { display: inline-block; padding: 8px 18px; border-radius: 20px; background: rgba(99,102,241,.14); border: 1px solid rgba(129,140,248,.4); color: #e2e8f0; font-size: 14px; margin-bottom: 26px; }
.game-intro-meta b { color: #a5b4fc; font-size: 17px; }

/* 游戏 HUD */
.game-hud { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.game-hud-item { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; }
.gh-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.gh-val { font-size: 22px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }

/* 游戏区 */
.game-area {
  position: relative; flex: 1; min-height: 360px; width: 100%;
  border-radius: 16px; overflow: hidden; cursor: crosshair;
  background:
    radial-gradient(circle at 20% 20%, rgba(99,102,241,.10), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(139,92,246,.12), transparent 50%),
    rgba(15,18,38,.6);
  border: 1px solid var(--border);
  transition: box-shadow .18s, border-color .18s;
}
.game-area.miss-flash { border-color: #ef4444; box-shadow: inset 0 0 0 2px rgba(239,68,68,.5); }
.game-target {
  position: absolute; border: none; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #c4b5fd, var(--vn-indigo) 70%);
  box-shadow: 0 8px 22px rgba(99,102,241,.55), inset 0 -4px 8px rgba(0,0,0,.25);
  animation: targetPop .22s cubic-bezier(.34,1.56,.64,1);
  will-change: transform;
}
.game-target:hover { filter: brightness(1.08); }
.game-target.hit { animation: targetHit .12s ease forwards; }
@keyframes targetPop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes targetHit { to { transform: scale(1.6); opacity: 0; } }

/* 结果页 */
.game-result { text-align: center; padding: 10px 4px; }
.game-result-title { font-size: 22px; color: #fff; margin-bottom: 20px; }
.game-result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gr-card { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 14px; padding: 16px 10px; }
.gr-val { font-size: 26px; font-weight: 800; color: #a5b4fc; font-variant-numeric: tabular-nums; }
.gr-val small { font-size: 13px; color: var(--muted); font-weight: 600; margin-left: 3px; }
.gr-label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.game-result-sub { color: var(--muted); font-size: 13px; margin: 18px 0 0; }

/* ---------- 体态测试：报告内照片展示（当前与历史报告复用） ---------- */
.posture-photos { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 4px; }
.posture-photo { margin: 0; flex: 1 1 200px; max-width: 280px; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.posture-photo img { display: block; width: 100%; height: 240px; object-fit: cover; background: #0b0f17; }
.posture-photo figcaption { padding: 8px 12px; font-size: 13px; color: var(--muted); text-align: center; border-top: 1px solid var(--border); }

/* ---------- 体态测试：四步摄像头采集 ---------- */
.ps-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ps-dot { font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); background: rgba(255,255,255,.04); }
.ps-dot.active { color: #fff; border-color: var(--vn-indigo); background: rgba(99,102,241,.22); }
.ps-dot.done { color: #6ee7b7; border-color: rgba(16,185,129,.4); background: rgba(16,185,129,.14); }
.ps-cam { display: flex; gap: 18px; align-items: stretch; background: #0b0f17; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); padding: 14px; }
.ps-video-col { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; background: #000; border-radius: 10px; overflow: hidden; min-height: 340px; }
.ps-video { width: 100%; max-height: 56vh; object-fit: contain; background: #000; display: block; }
.ps-controls { flex: 0 0 200px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.ps-controls .btn.block { width: 100%; }
.ps-tip { font-size: 12px; line-height: 1.5; margin: 4px 0 0; }

/* 拍摄要求醒目横幅 */
.ps-require {
  background: linear-gradient(135deg, rgba(19,181,214,.18), rgba(124,92,246,.18));
  border: 1px solid rgba(19,181,214,.45);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  box-shadow: inset 0 0 18px rgba(19,181,214,.08);
}
.ps-require-badge {
  display: inline-block;
  font-size: 12px; font-weight: 800; letter-spacing: 3px;
  color: var(--accent);
  padding: 2px 10px; border-radius: 999px;
  background: rgba(19,181,214,.14);
  border: 1px solid rgba(19,181,214,.35);
  margin-bottom: 8px;
}
.ps-require-title {
  font-size: 21px; font-weight: 800; color: #fff; margin-bottom: 6px;
  text-shadow: 0 1px 8px rgba(19,181,214,.35);
}
.ps-require-text {
  font-size: 14px; line-height: 1.55; color: var(--text-2); margin: 0;
}

/* 醒目拍摄按钮 */
.ps-shoot-btn {
  width: 100%;
  padding: 22px 18px;
  font-size: 21px; font-weight: 800; letter-spacing: 1px;
  border-radius: 16px; border: none; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 26px rgba(19,181,214,.45);
  animation: psPulse 2s infinite;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.ps-shoot-btn:hover { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 14px 34px rgba(19,181,214,.6); }
.ps-shoot-btn.is-done {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  animation: none; box-shadow: 0 10px 26px rgba(34,197,94,.4);
}
@keyframes psPulse {
  0%   { box-shadow: 0 0 0 0 rgba(19,181,214,.55); }
  70%  { box-shadow: 0 0 0 16px rgba(19,181,214,0); }
  100% { box-shadow: 0 0 0 0 rgba(19,181,214,0); }
}
@media (max-width: 640px) {
  .ps-cam { flex-direction: column; }
  .ps-controls { flex-basis: auto; flex-direction: row; flex-wrap: wrap; }
  .ps-controls .btn.block { flex: 1 1 140px; }
  .ps-controls .ps-require { flex: 1 1 100%; }
  .ps-controls .ps-shoot-btn { flex: 1 1 100%; font-size: 19px; padding: 18px; }
}
.ps-thumbs { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 4px 0 8px; }
.ps-thumb { margin: 0; flex: 1 1 160px; max-width: 220px; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ps-thumb img { display: block; width: 100%; height: 200px; object-fit: cover; background: #0b0f17; }
.ps-thumb figcaption { padding: 8px 12px; font-size: 13px; color: var(--muted); text-align: center; border-top: 1px solid var(--border); }
.ps-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 16px; }
