
:root{
  --bg:#f2f5f8;--card:#fff;--text:#14212b;--muted:#6d7b87;--line:#dfe6eb;
  --brand:#17324d;--brand2:#2f6f74;--good:#1f8a5b;--warn:#b66b18;--bad:#bd3d3a;
  --shadow:0 8px 24px rgba(25,45,65,.08);--radius:18px;
}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--text)}
body{padding-bottom:calc(78px + env(safe-area-inset-bottom))}
button,input,select,textarea{font:inherit}button{cursor:pointer}
.topbar{position:sticky;top:0;z-index:20;background:rgba(242,245,248,.94);backdrop-filter:blur(16px);padding:calc(12px + env(safe-area-inset-top)) 16px 10px;border-bottom:1px solid rgba(223,230,235,.75)}
.brandline{display:flex;align-items:center;gap:10px}.logo{width:38px;height:38px;border-radius:12px;background:var(--brand);color:white;display:grid;place-items:center;font-weight:800}.brandline h1{font-size:20px;margin:0}.subtitle{font-size:12px;color:var(--muted);margin-top:2px}
main{max-width:760px;margin:auto;padding:14px}.page-title{display:flex;justify-content:space-between;align-items:end;margin:4px 2px 14px}.page-title h2{font-size:24px;margin:0}.page-title small{color:var(--muted)}
.card{background:var(--card);border:1px solid rgba(223,230,235,.85);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px;margin-bottom:12px}
.hero{background:linear-gradient(135deg,var(--brand),#315b76);color:#fff}.hero .muted{color:rgba(255,255,255,.75)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metric{padding:14px;background:var(--card);border-radius:16px;border:1px solid var(--line)}.metric b{font-size:21px;display:block;margin-top:5px}.metric span{font-size:12px;color:var(--muted)}
.row{display:flex;align-items:center;justify-content:space-between;gap:12px}.stack{display:flex;flex-direction:column;gap:8px}.muted{color:var(--muted)}.tiny{font-size:12px}.small{font-size:14px}
.badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;font-size:12px;background:#e9eef2;color:var(--brand);margin-right:5px}.badge.good{background:#e3f4ec;color:var(--good)}.badge.warn{background:#fff0dd;color:var(--warn)}.badge.bad{background:#fde8e6;color:var(--bad)}
.exercise-card{display:grid;grid-template-columns:44px 1fr auto;gap:12px;align-items:center}.exercise-icon{width:44px;height:44px;border-radius:14px;background:#e8eef3;display:grid;place-items:center;font-size:21px}.exercise-card h3{font-size:16px;margin:0 0 4px}.chev{font-size:22px;color:#9aa7b2}
.progressbar{height:9px;border-radius:999px;background:#e8edf1;overflow:hidden}.progressbar>div{height:100%;background:var(--good);border-radius:999px}
.btn{border:0;border-radius:13px;padding:11px 14px;background:var(--brand);color:#fff;font-weight:650}.btn.secondary{background:#e8eef3;color:var(--brand)}.btn.danger{background:#fde8e6;color:var(--bad)}.btn.ghost{background:transparent;color:var(--brand);border:1px solid var(--line)}.btn.block{width:100%}.btn:disabled{opacity:.45}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}.field label{font-size:13px;color:var(--muted)}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:12px;background:#fff;padding:11px 12px;color:var(--text)}textarea{min-height:80px;resize:vertical}
.segment{display:flex;gap:7px;overflow:auto;padding-bottom:4px}.segment button{white-space:nowrap;border:0;background:#e8eef3;color:var(--brand);padding:8px 12px;border-radius:999px}.segment button.active{background:var(--brand);color:#fff}
.bottomnav{position:fixed;bottom:0;left:0;right:0;z-index:30;height:calc(68px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:rgba(255,255,255,.96);backdrop-filter:blur(18px);border-top:1px solid var(--line);display:flex;justify-content:center}
.bottomnav .inner{width:min(760px,100%);display:grid;grid-template-columns:repeat(5,1fr)}.navbtn{border:0;background:transparent;color:#7c8994;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:11px}.navbtn span:first-child{font-size:21px}.navbtn.active{color:var(--brand);font-weight:700}
.modal-backdrop{position:fixed;inset:0;background:rgba(12,24,34,.52);z-index:100;display:none;align-items:flex-end;justify-content:center}.modal-backdrop.show{display:flex}.modal{width:min(760px,100%);max-height:92vh;overflow:auto;background:var(--bg);border-radius:24px 24px 0 0;padding:16px 14px calc(22px + env(safe-area-inset-bottom))}.modal-head{position:sticky;top:-16px;background:rgba(242,245,248,.96);backdrop-filter:blur(12px);display:flex;justify-content:space-between;align-items:center;padding:12px 2px;z-index:2}.modal-head h2{margin:0;font-size:20px}.close{border:0;background:#e1e7eb;width:34px;height:34px;border-radius:50%;font-size:20px}
.setrow{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;gap:9px;align-items:center;margin:10px 0;padding:10px 0;border-bottom:1px solid var(--line)}.setrow:last-child{border-bottom:0}.setnum{font-weight:700;text-align:center;font-size:13px}.record-fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:8px}.record-field{display:flex;flex-direction:column;gap:5px;min-width:0}.record-field span,.record-complete span{font-size:11px;color:var(--muted)}.record-field input,.record-field select{min-width:0;padding:9px 8px}.record-complete{display:flex;flex-direction:column;align-items:center;gap:7px}.record-complete .check{margin:0}.record-head{align-items:flex-start}.record-head span{text-align:right;line-height:1.4}.check{width:24px;height:24px}
.notice{padding:12px;border-radius:14px;background:#edf4f8;border-left:4px solid var(--brand2);font-size:13px;line-height:1.55}.notice.warn{background:#fff3e3;border-color:var(--warn)}.notice.bad{background:#fdecea;border-color:var(--bad)}
.table-wrap{overflow:auto}.simple-table{width:100%;border-collapse:collapse;font-size:13px}.simple-table th,.simple-table td{border-bottom:1px solid var(--line);padding:10px 8px;text-align:left;vertical-align:top}.simple-table th{color:var(--muted);font-weight:600}
canvas{width:100%;height:220px;background:#fff;border-radius:14px;touch-action:manipulation}
.search{position:sticky;top:77px;z-index:10;background:var(--bg);padding:3px 0 10px}
details{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px;margin-bottom:9px}summary{font-weight:700}
.kpi-big{font-size:36px;font-weight:800;line-height:1}.divider{height:1px;background:var(--line);margin:13px 0}
.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);z-index:200;background:#14212b;color:#fff;padding:11px 15px;border-radius:999px;opacity:0;pointer-events:none;transition:.2s}.toast.show{opacity:1}
@media(min-width:650px){.grid.three{grid-template-columns:repeat(3,1fr)}.modal{border-radius:24px;margin-bottom:20px}.modal-backdrop{align-items:center}.setrow{grid-template-columns:54px minmax(0,1fr) 54px}}

.badge.video{background:var(--accent-soft);color:var(--brand2);vertical-align:middle}
.video-links{margin:0 0 12px}.video-links>.row{padding:0 2px 9px}.video-grid{display:grid;gap:9px}.video-link-wrap{min-width:0}.video-link-wrap.direct-lite{border-radius:14px;background:linear-gradient(135deg,rgba(37,244,238,.08),rgba(254,44,85,.08))}.video-fallback{display:block;margin:-3px 12px 0;padding:8px 10px 9px;text-align:right;color:var(--brand2);font-size:12px;text-decoration:none;border:1px solid var(--line);border-top:0;border-radius:0 0 12px 12px;background:var(--card)}
.video-link{display:grid;grid-template-columns:12px 1fr auto;gap:10px;align-items:center;text-decoration:none;color:var(--text);background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px;transition:transform .15s,border-color .15s}
.video-link:active{transform:scale(.985)}.video-link small,.video-link em{display:block}.video-link small{font-size:13px;color:var(--muted);margin-top:3px;line-height:1.35}.video-link em{font-size:11px;color:var(--brand2);font-style:normal;margin-top:5px}.video-link strong{font-size:12px;color:var(--brand2);white-space:nowrap}.platform-dot{width:10px;height:10px;border-radius:50%;background:var(--brand2)}.video-link.youtube .platform-dot{background:var(--video-youtube)}.video-link.bilibili .platform-dot{background:var(--video-bilibili)}.video-link.douyin .platform-dot{background:#151515;box-shadow:2px 0 0 #25f4ee,-2px 0 0 #fe2c55}.douyin-hint{margin:8px 3px 0;line-height:1.5}
html[data-effective-theme="dark"] .video-link.douyin .platform-dot{background:#fff}
@media(max-width:430px){.setrow{grid-template-columns:42px minmax(0,1fr) 42px;gap:6px}.record-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.record-head{flex-direction:column;align-items:flex-start}.record-head span{text-align:left}}
:root,html[data-theme="light"]{
 --bg:#f2f5f8;--card:#fff;--text:#14212b;--muted:#6d7b87;--line:#dfe6eb;
 --brand:#17324d;--brand2:#2f6f74;--good:#1f8a5b;--warn:#b66b18;--bad:#bd3d3a;
 --shadow:0 8px 24px rgba(25,45,65,.08);--accent-soft:#e8f1f2;--video-youtube:#d33;--video-bilibili:#de7b9c;
 color-scheme:light;
}
html[data-theme="dark"]{
 --bg:#101820;--card:#17222c;--text:#eef3f6;--muted:#9aa8b4;--line:#2b3945;
 --brand:#6da6c6;--brand2:#79b7ad;--good:#68c998;--warn:#e2a858;--bad:#ef8985;
 --shadow:none;--accent-soft:#20363b;--video-youtube:#ff7068;--video-bilibili:#ff9bbb;
 color-scheme:dark;
}
html[data-theme="dark"] .topbar,html[data-theme="dark"] .modal-head{background:rgba(16,24,32,.94)}
html[data-theme="dark"] .bottomnav{background:rgba(23,34,44,.96)}
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea,html[data-theme="dark"] canvas{background:#17222c;color:var(--text)}
html[data-theme="dark"] .metric,html[data-theme="dark"] .card,html[data-theme="dark"] details{background:var(--card)}
html[data-theme="dark"] .btn.secondary,html[data-theme="dark"] .segment button,html[data-theme="dark"] .exercise-icon{background:#263642;color:#dce9ef}
html[data-theme="dark"] .hero{background:linear-gradient(135deg,#264c66,#28605f)}
@media(prefers-color-scheme:dark){
 html:not([data-theme]){
  --bg:#101820;--card:#17222c;--text:#eef3f6;--muted:#9aa8b4;--line:#2b3945;
  --brand:#6da6c6;--brand2:#79b7ad;--good:#68c998;--warn:#e2a858;--bad:#ef8985;
  --shadow:none;--accent-soft:#20363b;--video-youtube:#ff7068;--video-bilibili:#ff9bbb;color-scheme:dark;
 }
 html:not([data-theme]) .topbar,html:not([data-theme]) .modal-head{background:rgba(16,24,32,.94)}
 html:not([data-theme]) .bottomnav{background:rgba(23,34,44,.96)}
 html:not([data-theme]) input,html:not([data-theme]) select,html:not([data-theme]) textarea,html:not([data-theme]) canvas{background:#17222c;color:var(--text)}
 html:not([data-theme]) .metric,html:not([data-theme]) .card,html:not([data-theme]) details{background:var(--card)}
 html:not([data-theme]) .btn.secondary,html:not([data-theme]) .segment button,html:not([data-theme]) .exercise-icon{background:#263642;color:#dce9ef}
 html:not([data-theme]) .hero{background:linear-gradient(135deg,#264c66,#28605f)}
}

.nutrition-stage-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:12px;padding:12px;border-radius:14px;background:var(--accent-soft)}
.nutrition-stage-head b{display:block;margin-top:7px;font-size:18px}
.simple-table tr.current-stage td{background:var(--accent-soft);font-weight:700}
@media(max-width:480px){.nutrition-stage-head{align-items:flex-start;flex-direction:column}.simple-table{font-size:12px}}

.nutrition-reference{margin-top:12px}.nutrition-reference img{display:block;width:100%;height:auto;margin-top:10px;border-radius:12px;border:1px solid var(--line);background:var(--card)}

.source-group{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:17px 3px 8px;padding-bottom:6px;border-bottom:1px solid var(--line)}
.source-group span{font-weight:750;color:var(--brand)}.source-group small{font-size:11px;color:var(--muted);text-align:right}
.framework-card .row>div{display:flex;flex-direction:column;gap:6px}.framework-days{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}
.framework-days div{border:1px solid var(--line);border-radius:13px;padding:10px;background:var(--accent-soft);display:flex;flex-direction:column;gap:4px}
.framework-days strong{color:var(--brand)}.framework-days span{font-size:12px;color:var(--muted)}
.reference-image-link{display:block;text-decoration:none;color:var(--text);margin:12px 0}.reference-image-link img{display:block;width:100%;height:auto;max-height:64vh;object-fit:contain;background:#090b0d;border-radius:14px;border:1px solid var(--line)}.reference-image-link span{display:block;text-align:center;font-size:12px;color:var(--brand2);margin-top:7px}
@media(max-width:460px){.framework-days{grid-template-columns:1fr}.framework-card .row{align-items:flex-start}.framework-card .row .btn{flex:none}}

.body-filter-wrap{display:flex;gap:7px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:none}.body-filter-wrap::-webkit-scrollbar{display:none}.body-filter{white-space:nowrap;border:1px solid var(--line);background:var(--card);color:var(--text);border-radius:999px;padding:8px 11px}.body-filter small{color:var(--muted)}.body-filter.active{background:var(--brand);color:#fff;border-color:var(--brand)}.body-filter.active small{color:rgba(255,255,255,.75)}
.library-part{margin-bottom:18px}.library-part-head{display:flex;align-items:center;gap:10px;margin:8px 3px 10px}.library-part-head h3{margin:0;font-size:20px}.library-part-head small{color:var(--muted)}.body-part-icon{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:var(--accent-soft);font-size:22px;color:var(--brand)}
.movement-subhead{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin:14px 3px 7px;padding-bottom:6px;border-bottom:1px solid var(--line)}.movement-subhead b{color:var(--brand)}.movement-subhead span{font-size:11px;color:var(--muted);text-align:right}.library-exercise{margin-bottom:8px}.taxonomy-card p{margin:9px 0}.reference-gallery{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}.reference-gallery a{text-decoration:none;color:var(--text);border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--card)}.reference-gallery img{display:block;width:100%;height:220px;object-fit:contain;background:#080a0c}.reference-gallery span{display:block;padding:9px;font-size:12px;color:var(--muted)}
@media(max-width:480px){.reference-gallery{grid-template-columns:1fr}.reference-gallery img{height:auto;max-height:62vh}}

.cardio-quick{font-size:11px;color:var(--brand2);margin-top:5px;line-height:1.35}.cardio-prescription{border-left:4px solid var(--brand2)}.cardio-rx-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}.cardio-rx-grid>div{background:var(--accent-soft);border-radius:12px;padding:10px}.cardio-rx-grid span{display:block;font-size:11px;color:var(--muted);margin-bottom:4px}.cardio-rx-grid b{font-size:14px}.date-stepper{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 10px}.ocr-candidates{display:grid;gap:8px;margin:10px 0}.ocr-row{display:grid;grid-template-columns:34px minmax(130px,1fr) minmax(90px,.8fr) auto;gap:7px;align-items:center;padding:9px;border:1px solid var(--line);border-radius:12px;background:var(--card)}.ocr-row input[type=date],.ocr-row input[type=number]{min-width:0}.ocr-raw{white-space:pre-wrap;overflow-wrap:anywhere;background:var(--accent-soft);border-radius:10px;padding:10px;font-size:12px;max-height:260px;overflow:auto}.good-text{color:var(--good)}.warn-text{color:var(--warn)}
.set-adjust-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}.set-adjust-actions .btn{flex:0 0 auto}.chart-range{display:flex;gap:7px;flex-wrap:wrap;margin:0 0 10px}.chart-range button{border:0;border-radius:999px;padding:7px 12px;background:var(--accent-soft);color:var(--brand2);font-size:12px}.chart-range button.active{background:var(--brand);color:#fff}.chart-wrap{position:relative}.chart-point{min-height:20px;margin-top:8px;color:var(--brand2);font-size:12px}.recent-weight-card>.row{align-items:center}
.routine-card{border-left:4px solid var(--good)}.routine-move-list{display:grid;gap:9px;margin:12px 0}.routine-move{display:grid;grid-template-columns:32px minmax(0,1fr);gap:10px;align-items:start;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--accent-soft)}.routine-move>span{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--brand);color:#fff;font-weight:800}.routine-move b,.routine-move small{display:block}.routine-move small{margin-top:3px;color:var(--brand2);font-weight:700}.routine-move p{margin:5px 0 0;font-size:12px;line-height:1.55;color:var(--muted)}
@media(max-width:430px){.ocr-row{grid-template-columns:30px 1fr 92px}.ocr-row>span{grid-column:2/4}.cardio-rx-grid{grid-template-columns:1fr 1fr}}

.predinner-card{border-left:5px solid var(--good)}.predinner-card strong{font-size:19px}
.schedule-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}.schedule-strip div{padding:10px;border-radius:13px;background:var(--accent-soft);display:flex;flex-direction:column;gap:4px}.schedule-strip small{color:var(--muted)}.schedule-strip span{font-size:12px;color:var(--brand2)}
.formula-stack{display:flex;flex-direction:column;gap:7px;margin:12px 0}.formula-stack>div{display:grid;grid-template-columns:45px 1fr auto;gap:8px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:9px;background:var(--card)}.formula-stack code{font-weight:800;color:var(--brand2)}.formula-stack span{font-size:12px;line-height:1.45}.formula-stack b{font-size:13px;white-space:nowrap}
.schedule-timeline{display:grid;gap:8px;margin:12px 0}.schedule-timeline>div{display:grid;grid-template-columns:76px 1fr;gap:3px 10px;padding:10px 12px;border-left:3px solid var(--line);background:var(--card);border-radius:0 12px 12px 0}.schedule-timeline>div.active{border-left-color:var(--good);background:var(--accent-soft)}.schedule-timeline time{grid-row:1/3;font-weight:800;color:var(--brand)}.schedule-timeline span{font-size:12px;color:var(--muted)}
@media(max-width:480px){.schedule-strip{grid-template-columns:1fr}.formula-stack>div{grid-template-columns:38px 1fr}.formula-stack b{grid-column:2}}

.rest-diet-card{border-left:5px solid var(--brand2)}
.macro-line{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.macro-line span{background:var(--accent-soft);border-radius:999px;padding:6px 10px;font-size:12px;font-weight:700}
.meal-mini{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin-top:10px}.meal-mini div{border:1px solid var(--line);border-radius:11px;padding:8px;display:flex;flex-direction:column;gap:3px}.meal-mini b{font-size:12px}.meal-mini span{font-size:11px;color:var(--muted)}
.macro-hero{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}.macro-hero div{padding:10px;border-radius:12px;background:var(--accent-soft);display:flex;flex-direction:column;gap:3px}.macro-hero span{font-size:11px;color:var(--muted)}.macro-hero b{font-size:17px;color:var(--brand)}
@media(max-width:500px){.meal-mini{grid-template-columns:repeat(2,1fr)}.macro-hero{grid-template-columns:repeat(2,1fr)}}

.source-candidate-card{border-left:4px solid var(--brand2)}
.source-candidate-card .row strong{font-size:11px;color:var(--muted);text-align:right}
.source-candidate-card p{line-height:1.55;margin:9px 0}
.source-candidate-card .selected-plan{background:var(--accent-soft);border-radius:11px;padding:9px;color:var(--brand)}


/* =========================================================
   V6.11 夜间模式高对比可读性
   data-effective-theme 同时覆盖“手动深色”和“跟随系统深色”
   ========================================================= */
html[data-effective-theme="dark"]{
  --bg:#0b1117;
  --card:#151f29;
  --text:#f6f8fa;
  --muted:#bdc8d1;
  --line:#40515f;
  --brand:#91d2f5;
  --brand2:#96ddcf;
  --good:#86e2b4;
  --warn:#ffca75;
  --bad:#ff9e99;
  --shadow:0 10px 28px rgba(0,0,0,.24);
  --accent-soft:#223440;
  --action:#286f98;
  --input-bg:#0f171e;
  --notice:#173140;
  --notice-warn:#3a2b16;
  --notice-bad:#3b2023;
  --video-youtube:#ff827b;
  --video-bilibili:#ff9fbd;
  color-scheme:dark;
}

html[data-effective-theme="dark"],
html[data-effective-theme="dark"] body{
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

html[data-effective-theme="dark"] body{font-weight:410}

html[data-effective-theme="dark"] h1,
html[data-effective-theme="dark"] h2,
html[data-effective-theme="dark"] h3,
html[data-effective-theme="dark"] b,
html[data-effective-theme="dark"] strong,
html[data-effective-theme="dark"] summary{color:#fff}

html[data-effective-theme="dark"] .muted,
html[data-effective-theme="dark"] .subtitle,
html[data-effective-theme="dark"] .page-title small,
html[data-effective-theme="dark"] .metric span,
html[data-effective-theme="dark"] .tiny.muted,
html[data-effective-theme="dark"] .small.muted,
html[data-effective-theme="dark"] .video-link small,
html[data-effective-theme="dark"] .framework-days span,
html[data-effective-theme="dark"] .library-part-head small,
html[data-effective-theme="dark"] .movement-subhead span,
html[data-effective-theme="dark"] .source-group small,
html[data-effective-theme="dark"] .source-candidate-card .row strong,
html[data-effective-theme="dark"] .reference-gallery span{
  color:var(--muted)!important;
  opacity:1;
}

html[data-effective-theme="dark"] .tiny{font-size:12.5px;line-height:1.5}
html[data-effective-theme="dark"] .small{line-height:1.55}

/* 导航、弹窗 */
html[data-effective-theme="dark"] .topbar{
  background:rgba(11,17,23,.97);
  border-bottom-color:var(--line);
}
html[data-effective-theme="dark"] .bottomnav{
  background:rgba(18,28,37,.98);
  border-top-color:var(--line);
}
html[data-effective-theme="dark"] .modal{background:var(--bg)}
html[data-effective-theme="dark"] .modal-head{
  background:rgba(11,17,23,.98);
  border-bottom:1px solid var(--line);
}
html[data-effective-theme="dark"] .search{background:var(--bg)}
html[data-effective-theme="dark"] .navbtn{color:#b8c4cd}
html[data-effective-theme="dark"] .navbtn.active{color:var(--brand)}
html[data-effective-theme="dark"] .close{
  background:#2b3b48;
  color:#fff;
  border:1px solid #536574;
}

/* 卡片与表格 */
html[data-effective-theme="dark"] .card,
html[data-effective-theme="dark"] details,
html[data-effective-theme="dark"] .metric,
html[data-effective-theme="dark"] .video-link,
html[data-effective-theme="dark"] .body-filter,
html[data-effective-theme="dark"] .ocr-row,
html[data-effective-theme="dark"] .reference-gallery a{
  background:var(--card);
  border-color:var(--line);
  color:var(--text);
}
html[data-effective-theme="dark"] .card,
html[data-effective-theme="dark"] details{box-shadow:var(--shadow)}
html[data-effective-theme="dark"] .simple-table th,
html[data-effective-theme="dark"] .simple-table td{border-bottom-color:var(--line)}
html[data-effective-theme="dark"] .simple-table th{color:#d0d8de}
html[data-effective-theme="dark"] .simple-table td{color:var(--text)}
html[data-effective-theme="dark"] .simple-table tr.current-stage td{background:#243945}
html[data-effective-theme="dark"] summary::marker{color:var(--brand)}

/* 输入和日期字段 */
html[data-effective-theme="dark"] input,
html[data-effective-theme="dark"] select,
html[data-effective-theme="dark"] textarea{
  background:var(--input-bg);
  color:#fff;
  border-color:#536675;
  caret-color:var(--brand);
}
html[data-effective-theme="dark"] input::placeholder,
html[data-effective-theme="dark"] textarea::placeholder{
  color:#9aabb7;
  opacity:1;
}
html[data-effective-theme="dark"] input:focus,
html[data-effective-theme="dark"] select:focus,
html[data-effective-theme="dark"] textarea:focus{
  outline:3px solid rgba(145,210,245,.24);
  border-color:var(--brand);
}
html[data-effective-theme="dark"] select option{
  background:var(--card);
  color:var(--text);
}
html[data-effective-theme="dark"] .field label{color:#cbd4db}

/* 按钮 */
html[data-effective-theme="dark"] .btn,
html[data-effective-theme="dark"] .segment button.active,
html[data-effective-theme="dark"] .body-filter.active,
html[data-effective-theme="dark"] .logo{
  background:var(--action);
  color:#fff;
}
html[data-effective-theme="dark"] .btn.secondary,
html[data-effective-theme="dark"] .segment button,
html[data-effective-theme="dark"] .exercise-icon{
  background:#293b49;
  color:#eef8fd;
  border-color:#4b5e6d;
}
html[data-effective-theme="dark"] .btn.ghost{
  background:transparent;
  color:var(--brand);
  border-color:#5a7182;
}
html[data-effective-theme="dark"] .btn.danger{
  background:#51282c;
  color:#ffd8d5;
  border:1px solid #7d4145;
}
html[data-effective-theme="dark"] .btn:disabled{opacity:.62;color:#c0c9cf}

/* 标签 */
html[data-effective-theme="dark"] .badge{
  background:#293b49;
  color:#e4f2fa;
  border:1px solid #475d6d;
}
html[data-effective-theme="dark"] .badge.good{
  background:#17392c;
  color:#9aebc0;
  border-color:#2b6a50;
}
html[data-effective-theme="dark"] .badge.warn{
  background:#3b2d17;
  color:#ffd28a;
  border-color:#76562a;
}
html[data-effective-theme="dark"] .badge.bad{
  background:#422327;
  color:#ffb0ab;
  border-color:#7b4146;
}
html[data-effective-theme="dark"] .badge.video{
  background:#243944;
  color:#a8e4da;
  border-color:#3d625f;
}

/* 提示框 */
html[data-effective-theme="dark"] .notice{
  background:var(--notice);
  color:#f4f8fa;
  border-left-color:#74c9e3;
  border-top:1px solid #31566a;
  border-right:1px solid #31566a;
  border-bottom:1px solid #31566a;
}
html[data-effective-theme="dark"] .notice.warn{
  background:var(--notice-warn);
  color:#fff1d4;
  border-color:#9a6d31;
}
html[data-effective-theme="dark"] .notice.bad{
  background:var(--notice-bad);
  color:#ffe0de;
  border-color:#a65358;
}
html[data-effective-theme="dark"] .notice.good{
  background:#16372b;
  color:#d9f8e8;
  border-color:#3a7d60;
}
html[data-effective-theme="dark"] .good-text{color:#9aebc0}
html[data-effective-theme="dark"] .warn-text{color:#ffd28a}

/* 辅助区域 */
html[data-effective-theme="dark"] .progressbar{
  background:#2c3b47;
  box-shadow:inset 0 0 0 1px #445663;
}
html[data-effective-theme="dark"] canvas{
  background:var(--card);
  border:1px solid var(--line);
}
html[data-effective-theme="dark"] .nutrition-stage-head,
html[data-effective-theme="dark"] .framework-days div,
html[data-effective-theme="dark"] .cardio-rx-grid>div,
html[data-effective-theme="dark"] .ocr-raw,
html[data-effective-theme="dark"] .schedule-strip div,
html[data-effective-theme="dark"] .macro-line span,
html[data-effective-theme="dark"] .macro-hero div,
html[data-effective-theme="dark"] .source-candidate-card .selected-plan,
html[data-effective-theme="dark"] .body-part-icon{
  background:var(--accent-soft);
  color:var(--text);
}
html[data-effective-theme="dark"] .body-part-icon{color:var(--brand)}
html[data-effective-theme="dark"] .chev{color:#b0bfca}
html[data-effective-theme="dark"] .hero{
  background:linear-gradient(135deg,#245f80,#235e59);
  color:#fff;
}
html[data-effective-theme="dark"] .hero .muted{color:#e2edf3!important}
html[data-effective-theme="dark"] .toast{
  background:#263946;
  color:#fff;
  border:1px solid #526877;
  box-shadow:0 8px 24px rgba(0,0,0,.35);
}

/* 链接与键盘焦点 */
html[data-effective-theme="dark"] a{color:var(--brand)}
html[data-effective-theme="dark"] .video-link strong,
html[data-effective-theme="dark"] .video-link em,
html[data-effective-theme="dark"] .cardio-quick,
html[data-effective-theme="dark"] .reference-image-link span{color:var(--brand2)}
html[data-effective-theme="dark"] .video-link:focus-visible,
html[data-effective-theme="dark"] .btn:focus-visible,
html[data-effective-theme="dark"] button:focus-visible,
html[data-effective-theme="dark"] a:focus-visible{
  outline:3px solid rgba(145,210,245,.45);
  outline-offset:2px;
}

@supports (-webkit-touch-callout:none){
  html[data-effective-theme="dark"]{-webkit-text-size-adjust:100%}
}


/* V6.12 连续3天体重阶段确认 */
.stage-confirm-card{border-left:5px solid var(--warn)}
.stage-confirm-card .row>div{display:flex;flex-direction:column;align-items:flex-start;gap:7px}
.stage-confirm-card .row>strong{font-size:20px;color:var(--brand)}
.stage-dots{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0 10px}
.stage-dots span{height:10px;border-radius:999px;background:var(--line)}
.stage-dots span.active{background:var(--good);box-shadow:0 0 0 2px color-mix(in srgb,var(--good) 24%,transparent)}
.stage-days{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.stage-day{display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:999px;padding:7px 10px;background:var(--accent-soft);font-size:12px}
.stage-day b{font-size:12px}
.stage-day.good{border-color:var(--good)}
.stage-metric-label{font-size:15px!important;line-height:1.25}
html[data-effective-theme="dark"] .stage-confirm-card{border-left-color:var(--warn)}
html[data-effective-theme="dark"] .stage-dots span{background:#40515f}
html[data-effective-theme="dark"] .stage-dots span.active{background:var(--good)}
html[data-effective-theme="dark"] .stage-day{background:#223440;color:var(--text)}


/* V6.13 休息日有氧免打卡与任选一项完成 */
.rest-day-rule{border-left-width:5px}
.waived-cardio{opacity:.88;border-style:dashed!important}
.waived-cardio .exercise-icon{filter:saturate(.75)}
.waived-note{margin-top:6px;color:var(--warn);font-weight:650;line-height:1.4}
html[data-effective-theme="dark"] .waived-cardio{background:#121b23;border-color:#536675!important}
html[data-effective-theme="dark"] .waived-note{color:#ffd28a}


/* V6.14 计划模块每日完成统计 */
.plan-week-stats{overflow:hidden}
.plan-week-stats .row p{margin:4px 0 0}
.plan-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:14px 0}
.plan-stat-grid .metric{min-width:0;padding:11px 9px}
.plan-stat-grid .metric b{font-size:18px}
.plan-day-status-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px}
.plan-day-status{
 appearance:none;
 min-width:0;
 padding:10px 7px;
 border:1px solid var(--line);
 border-radius:14px;
 background:var(--card);
 color:var(--text);
 text-align:left;
 cursor:pointer;
 box-shadow:none;
}
.plan-day-status.selected{outline:2px solid var(--brand);outline-offset:1px}
.plan-day-status.is-today{border-color:var(--brand)}
.plan-day-status.complete{background:color-mix(in srgb,var(--good) 12%,var(--card));border-color:color-mix(in srgb,var(--good) 55%,var(--line))}
.plan-day-status.missed{background:color-mix(in srgb,var(--bad) 8%,var(--card));border-color:color-mix(in srgb,var(--bad) 40%,var(--line))}
.plan-day-status.today{background:color-mix(in srgb,var(--brand) 10%,var(--card))}
.plan-day-status.future{opacity:.82}
.plan-day-top{display:flex;align-items:center;justify-content:space-between;gap:4px}
.plan-day-top b{font-size:14px}
.plan-day-top span{font-size:10px;color:var(--muted);white-space:nowrap}
.plan-day-status>strong{display:block;margin:8px 0 7px;font-size:13px;white-space:nowrap}
.plan-day-status.complete>strong{color:var(--good)}
.plan-day-status.missed>strong{color:var(--bad)}
.plan-day-status.today>strong{color:var(--brand)}
.plan-day-status small{display:block;margin-top:7px;color:var(--muted);font-size:9.5px;line-height:1.35;min-height:26px}
.plan-day-progress{height:6px;border-radius:99px;background:var(--line);overflow:hidden}
.plan-day-progress i{display:block;height:100%;border-radius:inherit;background:var(--brand)}
.plan-day-status.complete .plan-day-progress i{background:var(--good)}
.plan-day-status.missed .plan-day-progress i{background:var(--bad)}
.plan-stats-footnote{margin-top:12px}
.plan-selected-day-head{
 display:flex;
 align-items:center;
 justify-content:space-between;
 gap:12px;
 margin:14px 2px 10px;
}
.plan-selected-day-head>div{display:flex;flex-direction:column;gap:3px}
.plan-selected-day-head>div span{font-size:12px;color:var(--muted)}
#weekdaySeg button{position:relative}
#weekdaySeg button small{
 display:block;
 margin-top:2px;
 font-size:9px;
 line-height:1;
 color:inherit;
 opacity:.88;
}

html[data-effective-theme="dark"] .plan-day-status{
 background:var(--card);
 color:var(--text);
}
html[data-effective-theme="dark"] .plan-day-status.complete{
 background:#17372b;
 border-color:#3a7d60;
}
html[data-effective-theme="dark"] .plan-day-status.missed{
 background:#382125;
 border-color:#7b4146;
}
html[data-effective-theme="dark"] .plan-day-status.today{
 background:#173140;
 border-color:#4b819c;
}
html[data-effective-theme="dark"] .plan-day-progress{background:#40515f}

@media(max-width:620px){
 .plan-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .plan-day-status-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 .plan-day-status:nth-child(n+5){grid-column:span 1}
}
@media(max-width:380px){
 .plan-day-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}


/* V6.16 自然周酸痛自动调度 */
.readiness-card,.auto-adjust-card{border-color:color-mix(in srgb,var(--brand) 42%,var(--line))}
.readiness-actions{display:grid;grid-template-columns:1fr 1.25fr;gap:10px;margin-top:12px}
.adjustment-rows{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:14px 0 8px}
.adjustment-rows>div{padding:10px;border:1px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--card) 88%,var(--bg));display:flex;flex-direction:column;gap:4px}
.adjustment-rows b{font-size:12px;color:var(--muted)}
.adjustment-rows span{font-size:12px}
.adjustment-rows strong{font-size:13px;color:var(--brand2)}
.exercise-card .badge{vertical-align:middle}

/* V6.27 dynamic cards */
.workout-card{padding:0;overflow:hidden;border:1px solid var(--line)}
.workout-card.is-complete{border-color:color-mix(in srgb,var(--good) 42%,var(--line));background:color-mix(in srgb,var(--good) 4%,var(--card))}
.workout-summary{width:100%;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:12px;align-items:center;padding:15px;border:0;background:transparent;color:var(--text);text-align:left}
.workout-summary h3{font-size:16px;margin:0 0 4px}.workout-summary .chev{min-width:24px;text-align:center}
.workout-details{border-top:1px solid var(--line);padding:14px 15px 16px;background:color-mix(in srgb,var(--card) 92%,var(--bg))}
.workout-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-bottom:10px}
.workout-detail-grid>div,.coach-grid>div{border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--card)}
.workout-detail-grid span,.coach-grid span{display:block;color:var(--muted);font-size:11px;margin-bottom:3px}.workout-detail-grid b,.coach-grid b{font-size:13px;line-height:1.35}
.collapsible-card{padding:0;overflow:hidden}.collapse-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 16px;border:0;background:transparent;color:var(--text);text-align:left}
.collapse-toggle span{min-width:0}.collapse-toggle b{display:block;font-size:15px}.collapse-toggle small{display:block;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.collapse-toggle i{font-style:normal;font-size:12px;color:var(--brand2);flex:none}
.collapse-body{padding:0 16px 16px}.collapsible-card.is-collapsed .collapse-toggle{padding-bottom:14px}.collapsible-card .notice{margin-top:0}
.coach-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.coach-action{margin-top:10px;border-radius:13px;padding:12px;background:var(--accent-soft)}.coach-action p{margin:5px 0}.coach-action small{color:var(--muted);line-height:1.45}
.weekly-summary p{margin:7px 0}.knowledge-chips{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.knowledge-chips span{font-size:10px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:4px 7px;background:var(--card)}
@media(max-width:520px){.workout-detail-grid,.coach-grid{grid-template-columns:1fr}.workout-summary{grid-template-columns:40px minmax(0,1fr) 22px;padding:13px}.workout-details{padding:12px 13px 14px}}
html[data-effective-theme="dark"] .auto-adjust-card,html[data-effective-theme="dark"] .readiness-card{border-color:#4b819c}
html[data-effective-theme="dark"] .adjustment-rows>div{background:#14222d;border-color:#40515f}
@media(max-width:520px){
 .readiness-actions{grid-template-columns:1fr}
 .adjustment-rows{grid-template-columns:1fr}
 .auto-adjust-card>.row{align-items:flex-start;flex-direction:column}
 .auto-adjust-card>.row .btn{width:100%}
}


/* V6.17 每日泡沫轴放松计划 */
.foam-plan-card{
  margin:12px 0;
  border:1px solid color-mix(in srgb,var(--brand2) 38%,var(--line));
  background:linear-gradient(145deg,color-mix(in srgb,var(--panel) 94%,var(--brand2) 6%),var(--panel));
}
.foam-plan-card.gentle-mode{
  border-color:color-mix(in srgb,#d89427 58%,var(--line));
}
.foam-card-head>div{
  display:grid;
  gap:7px;
}
.foam-card-head>div>b{
  font-size:16px;
  line-height:1.35;
}
.foam-summary{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:12px 0;
}
.foam-summary span{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:5px 9px;
  border-radius:999px;
  border:1px solid var(--line);
  background:var(--panel2);
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}
.foam-gentle-note{
  margin:10px 0 12px;
}
.foam-move-list{
  display:grid;
  gap:9px;
}
.foam-move{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  gap:9px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:color-mix(in srgb,var(--panel2) 76%,transparent);
}
.foam-step{
  width:32px;
  height:32px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:color-mix(in srgb,var(--brand2) 16%,var(--panel));
  color:var(--brand2);
  font-weight:900;
}
.foam-move-main{
  min-width:0;
}
.foam-move-title{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.foam-move-title>b{
  font-size:14px;
  line-height:1.35;
}
.foam-move-title>span{
  flex:0 0 auto;
  font-size:12px;
  font-weight:800;
  color:var(--brand2);
  padding:2px 7px;
  border-radius:999px;
  background:color-mix(in srgb,var(--brand2) 11%,transparent);
}
.foam-move p{
  margin:6px 0 0;
  font-size:12px;
  line-height:1.55;
  color:var(--text);
}
.foam-move small{
  display:block;
  margin-top:5px;
  color:var(--muted);
  line-height:1.5;
}
.foam-safety{
  margin-top:10px;
}
.foam-complete-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:10px;
  margin-top:12px;
}
.foam-complete-btn{
  white-space:nowrap;
}
.foam-prescription-modal{
  margin-top:10px;
}
@media(max-width:560px){
  .foam-complete-row{
    grid-template-columns:1fr;
  }
  .foam-complete-btn{
    width:100%;
  }
  .foam-move-title{
    display:grid;
  }
  .foam-move-title>span{
    justify-self:start;
  }
}


/* V6.18 跨周顺延 */
.cross-week-card,
.cross-week-source-card{
  border-color:color-mix(in srgb,#d89427 62%,var(--line));
  background:linear-gradient(145deg,color-mix(in srgb,var(--panel) 91%,#d89427 9%),var(--panel));
}
.cross-week-card .adjustment-rows strong,
.cross-week-source-card .adjustment-rows strong{
  color:#d89427;
}
.cross-week-card p,
.cross-week-source-card p{
  line-height:1.65;
}

/* V6.25 力量训练日酸痛确认 */
.readiness-confirmed{
  border-color:color-mix(in srgb,var(--good) 54%,var(--line));
  background:linear-gradient(145deg,color-mix(in srgb,var(--panel) 93%,var(--good) 7%),var(--panel));
}
.readiness-fade-out{
  pointer-events:none;
  animation:readinessFadeOut 420ms cubic-bezier(.4,0,.2,1) forwards;
}
@keyframes readinessFadeOut{
  0%{opacity:1;transform:translateY(0) scale(1);filter:none}
  55%{opacity:.5;transform:translateY(-4px) scale(.99);filter:saturate(.72)}
  100%{opacity:0;transform:translateY(-10px) scale(.97);filter:blur(2px) saturate(.35)}
}
@media(prefers-reduced-motion:reduce){.readiness-fade-out{animation-duration:1ms}}
.strength-readiness-prompt{
  text-align:center;
  padding:4px 2px 2px;
}
.strength-readiness-prompt h2{
  margin:14px auto 10px;
  max-width:430px;
  font-size:24px;
  line-height:1.35;
}
.strength-readiness-prompt>p{
  max-width:480px;
  margin:0 auto 16px;
  line-height:1.7;
}
.readiness-symbol{
  display:grid;
  place-items:center;
  width:54px;
  height:54px;
  margin:0 auto 12px;
  border-radius:18px;
  color:#fff;
  font-size:28px;
  font-weight:900;
  background:linear-gradient(145deg,var(--brand),var(--brand2));
  box-shadow:0 12px 30px color-mix(in srgb,var(--brand) 28%,transparent);
}
.readiness-choice-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:20px 0 14px;
}
@media(max-width:560px){
  .readiness-choice-grid{grid-template-columns:1fr}
  .strength-readiness-prompt h2{font-size:21px}
}
