/* ============================================================
   元智医康 多页模板 — 共享样式（整理自 ViMove AI 页面结构）
   模板阶段：中性结构 + CSS 变量，方便后续适配时一键换肤
   适配点：修改 :root 变量即可对齐项目 token 基调
   适老基线（ViMove accessibility 原则）：大字号 / 高对比 / 大触控
   ============================================================ */

:root {
  /* —— 品牌与配色（适配时替换为项目 token） —— */
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #eff6ff;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --muted: #475569;   /* 对比度 ≥4.5:1（适老） */
  --border: #d7e0ea;
  --accent: #10b981;
  --danger: #ef4444;

  /* —— 布局 —— */
  --radius: 14px;
  --radius-sm: 8px;
  --gap: 24px;
  --maxw: 1120px;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, .06);

  /* —— 字阶（适老：正文 ≥18px，辅助 ≥15px） —— */
  --f-h1: 46px;
  --f-h2: 32px;
  --f-h3: 22px;
  --f-body: 18px;
  --f-sm: 15px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
img, video, canvas { max-width: 100%; display: block; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gap); }
section { padding: 72px 0; }

/* —— 顶部导航 —— */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.brand { font-size: 20px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .brand-text { font-family: "Microsoft YaHei", "微软雅黑", sans-serif; font-style: italic; color: #0078d7; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; display: inline-block; vertical-align: -6px; margin-right: 8px; object-fit: cover; }
.nav { display: flex; gap: 12px; }
.nav a { color: var(--muted); font-size: var(--f-body); font-weight: 500; padding: 8px 10px; border-radius: var(--radius-sm); }
.nav a:hover, .nav a.active { color: var(--brand); background: var(--brand-soft); }

/* —— 按钮（触控目标 ≥48px 高） —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-size: var(--f-body);
  font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: all .18s ease; line-height: 1.2;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn-lg { padding: 18px 36px; font-size: 19px; }
/* 顶栏常驻「开始评估」（触控 ≥44px 高） */
.site-header .btn-cta { padding: 12px 20px; font-size: 15px; white-space: nowrap; }

/* —— Hero —— */
.hero { padding: 96px 0 80px; background: linear-gradient(180deg, var(--brand-soft), var(--bg)); text-align: center; }
.hero h1 { font-size: var(--f-h1); line-height: 1.2; font-weight: 800; max-width: 760px; margin: 0 auto 18px; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 auto 32px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-badges { display: flex; gap: 18px; justify-content: center; margin-top: 28px; color: var(--muted); font-size: var(--f-sm); flex-wrap: wrap; }
.hero-badges span { display: inline-flex; align-items: center; gap: 6px; }

/* —— 演示区（Live） —— */
.demo {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; max-width: 720px; margin: 0 auto;
}
.demo-screen {
  aspect-ratio: 16/9; background: #0b1220; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; color: #94a3b8;
  position: relative; overflow: hidden;
}
.demo-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.demo-title { font-weight: 600; }
.demo-counter { font-size: 26px; font-weight: 800; color: var(--brand); }
.progress-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.progress-fill { height: 100%; width: 70%; background: var(--brand); border-radius: 999px; transition: width .3s; }

/* —— 通用区块标题 —— */
.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head h2 { font-size: var(--f-h2); font-weight: 800; margin-bottom: 12px; }
.section-head p { color: var(--muted); }

/* —— 三步 —— */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; position: relative;
}
.step .num {
  width: 44px; height: 44px; border-radius: 50%; background: var(--brand);
  color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.step h3 { font-size: var(--f-h3); margin-bottom: 8px; }
.step p { color: var(--muted); }

/* —— 卖点网格 —— */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: box-shadow .2s;
}
.feature:hover { box-shadow: var(--shadow-sm); }
.feature .ico { width: 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; color: var(--brand); font-size: 20px; }
.feature h3 { font-size: var(--f-h3); margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: var(--f-sm); }

/* —— 病症 / 功能入口卡片 —— */
.conditions { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.cond-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: all .2s;
}
.cond-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.cond-card .tag { font-size: 13px; color: var(--accent); font-weight: 600; }
.cond-card h3 { font-size: 18px; }
.cond-card p { color: var(--muted); font-size: var(--f-sm); flex: 1; }
.cond-card .more { font-weight: 600; font-size: var(--f-sm); }

/* —— CTA 收尾 —— */
.cta-band {
  background: linear-gradient(120deg, var(--brand), var(--brand-strong)); color: #fff;
  border-radius: var(--radius); padding: 56px 40px; text-align: center;
}
.cta-band h2 { font-size: var(--f-h2); margin-bottom: 12px; }
.cta-band p { opacity: .9; margin-bottom: 24px; }
.cta-band .btn-primary { background: #fff; color: var(--brand); }
.cta-band .btn-primary:hover { background: var(--brand-soft); }

/* —— 页脚 —— */
.site-footer { border-top: 1px solid var(--border); padding: 32px 0; color: var(--muted); font-size: var(--f-sm); }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer nav { display: flex; gap: 16px; }
.site-footer .legal-line { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; justify-content: space-between; }
.site-footer .legal-links { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.site-footer .legal-links a { color: var(--muted); }
.site-footer .legal-links a:hover { color: var(--brand); }

/* —— 表单页（账户 / 档案） —— */
.form-shell { max-width: 520px; margin: 48px auto; }
.form-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; box-shadow: var(--shadow-sm);
}
.form-card h2 { font-size: var(--f-h3); margin-bottom: 4px; }
.form-card .sub { color: var(--muted); font-size: var(--f-sm); margin-bottom: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: var(--f-sm); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 13px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--f-body); background: #fff; color: var(--text); font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.switch-tabs { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; margin-bottom: 24px; }
.switch-tabs button {
  flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 999px;
  font-size: var(--f-sm); font-weight: 600; color: var(--muted); cursor: pointer;
}
.switch-tabs button.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

/* —— 测量 / 训练页（Session） —— */
.session-layout { display: grid; grid-template-columns: 1fr 340px; gap: var(--gap); padding: 32px 0; }
.session-main { display: flex; flex-direction: column; gap: 16px; }
.session-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.session-head .meta { color: var(--muted); font-size: var(--f-sm); }
.camera-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.camera-screen { aspect-ratio: 16/9; background: #0b1220; position: relative; display: flex; align-items: center; justify-content: center; color: #94a3b8; }
.camera-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.camera-hint { font-size: var(--f-sm); color: var(--muted); }
.current-exercise { border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; background: var(--surface); }
.current-exercise .label { color: var(--muted); font-size: var(--f-sm); }
.current-exercise .name { font-size: 22px; font-weight: 800; margin: 4px 0 12px; }
.reps-counter { display: flex; align-items: baseline; gap: 6px; }
.reps-counter b { font-size: 42px; color: var(--brand); }
.reps-counter span { color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.status-pill.on { background: var(--brand-soft); color: var(--brand); }
.status-pill.off { background: var(--surface-2); color: var(--muted); }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* —— 右侧程序清单 —— */
.program-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 20px; align-self: start; }
.program-panel h3 { font-size: var(--f-h3); margin-bottom: 14px; }
.program-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.program-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--f-sm);
}
.program-list li.done { opacity: .6; }
.program-list .reps { color: var(--muted); white-space: nowrap; }
.program-list .idx { color: var(--muted); font-weight: 600; }

/* —— 流程步骤条（评估→训练→评估） —— */
.step-progress { display: flex; align-items: center; justify-content: center; gap: 0; margin: 0 auto 16px; max-width: 560px; }
.step-progress .sp { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; flex: 1; }
.step-progress .sp .dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--muted); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; border: 2px solid var(--border); }
.step-progress .sp.active .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-progress .sp.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step-progress .sp .lbl { font-size: 14px; color: var(--muted); }
.step-progress .sp.active .lbl { color: var(--brand); font-weight: 600; }
.step-progress .line { flex: 1; height: 2px; background: var(--border); margin: 0 8px 22px; }
.step-progress .line.filled { background: var(--accent); }

/* —— 测量 / 评估结果面板 —— */
.measure-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 20px 24px; }
.measure-panel h3 { font-size: var(--f-h3); margin-bottom: 12px; }
.measure-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.measure-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.measure-item .k { color: var(--muted); font-size: var(--f-sm); }
.measure-item .v { font-size: 20px; font-weight: 700; }
.hand-toggle { display: flex; gap: 10px; margin-bottom: 14px; }
.hand-toggle button { flex: 1; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-weight: 600; cursor: pointer; font-size: var(--f-sm); }
.hand-toggle button.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* —— 历史记录列表 —— */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 22px; transition: all .2s; cursor: pointer;
}
.history-item:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.history-item .t { font-weight: 600; }
.history-item .s { color: var(--muted); font-size: var(--f-sm); margin-top: 2px; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.badge.hi { background: #d1fae5; color: #047857; }
.badge.mid { background: #fef3c7; color: #b45309; }
.badge.low { background: #fee2e2; color: #b91c1c; }

/* —— 响应式（模板基础断点） —— */
@media (max-width: 900px) {
  .steps, .features, .conditions { grid-template-columns: 1fr; }
  .session-layout { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 56px; }
  .hero h1 { font-size: 30px; }
}
