/* 非首页组件 —— 令牌 / base / 顶栏 / 页脚见 site.css（本页之前加载）。
   组件颜色走令牌（--brand 已在 site.css 中别名到青色），旧蓝色引用自动变青。 */

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 20px 32px; }
main.narrow { max-width: 380px; }

/* 卡片 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* 计算页两栏 */
.layout { display: grid; grid-template-columns: 1fr; gap: 20px; }

.figure { display: block; max-width: 100%; height: auto; margin: 0 0 14px; }

/* 专家模式画面（复刻旧 App fragment_expert.xml）：左栏 3 张人体示意图 + 右栏 11 行 */
.expert-screen { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.figures { background: var(--teal-050); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 10px; }
.figures .figure { display: block; width: 100%; height: auto; margin: 0; }

.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-label { flex: none; width: 120px; height: auto; }
.step {
  flex: none; padding: 0; border: 0; background: none; line-height: 0; cursor: pointer;
}
.step img { display: block; width: 26px; height: auto; }
.step:hover img { opacity: .8; }
.row input { width: 84px; text-align: center; }
.radio-group { display: flex; gap: 18px; }
.radio-group label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.radio-group input { width: auto; }

.calc {
  margin-top: 8px; padding: 11px 20px;
  border: 0; border-radius: var(--r-pill);
  background: linear-gradient(100deg, var(--coral), var(--coral-d)); color: #fff;
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  box-shadow: 0 14px 30px rgba(255, 107, 107, .38);
}
.calc:hover { transform: translateY(-2px); }
.calc:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* 结果画面（复刻旧 App activity_result.xml）：车架几何图 + 青底标题 + 结果表 */
.result-card .frame { display: block; width: 100%; height: auto; }
.result-head { margin: 12px 0 0; padding: 7px 10px; background: linear-gradient(100deg, var(--teal), var(--teal-l)); color: #fff; font-weight: 600; }
.expert-screen, .result-card { max-width: 720px; margin-left: auto; margin-right: auto; }

@media (max-width: 720px) {
  .expert-screen { grid-template-columns: 1fr; }
  .figures { max-width: 240px; margin: 0 auto; }
}

/* 表单行 */
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.field label { color: var(--muted); }
.unit { white-space: nowrap; color: var(--muted); }
input {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  width: 110px;
}
input:focus, select:focus, .row input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(78, 205, 196, .28); }
select {
  font: inherit;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
}

/* 专家模式输入 */
.expert { border: 1px dashed var(--line); border-radius: var(--r-md); padding: 8px 12px 12px; margin: 12px 0 0; }
.expert legend { color: var(--muted); font-size: 13px; padding: 0 6px; }
.expert-result { margin-top: 12px; border-top: 1px dashed var(--line); }

.primary {
  margin-top: 12px;
  padding: 10px 22px;
  border: 0; border-radius: var(--r-pill);
  background: linear-gradient(100deg, var(--coral), var(--coral-d)); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 14px 30px rgba(255, 107, 107, .34);
  transition: transform .12s ease, box-shadow .12s ease;
}
.primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px rgba(255, 107, 107, .42); }
.primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* 结果表 */
.result { width: 100%; border-collapse: collapse; }
.result th, .result td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.result th { font-weight: 500; color: var(--muted); }
.result td { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }

.similar { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); }
.similar-title { color: var(--teal-d); margin-bottom: 6px; }
.similar summary { cursor: pointer; }   /* 推荐页折叠块标题可点开 */

/* 车型推荐：高亮「依据的最近一次 fitting 记录」 */
.rec-latest { margin: 0 0 12px; padding: 10px 12px; background: var(--teal-050); border: 1px solid var(--teal-100); border-left: 3px solid var(--teal); border-radius: var(--r-md); font-size: 13px; }
.rec-latest-title { color: var(--teal-d); font-weight: 600; margin-bottom: 4px; }
.rec-latest-meta { color: var(--body); font-variant-numeric: tabular-nums; }

.notice { margin-top: 14px; padding: 10px 12px; background: #fff8e6; border: 1px solid #f2d98a; border-radius: var(--r-md); color: #7a5b12; font-size: 13px; }

/* 保存区 */
.save { margin-top: 20px; }
.hint { color: var(--muted); font-size: 13px; }
.datatype { display: flex; gap: 10px; margin: 10px 0; }
.toggle {
  padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: #fff; font: inherit; cursor: pointer;
  transition: background .16s ease, border-color .16s ease;
}
.toggle:hover { border-color: var(--teal-l); background: var(--teal-050); }
.toggle.active { border-color: var(--teal); color: var(--teal-d); background: var(--teal-050); font-weight: 600; }
.mods { margin: 10px 0; }
.save-msg { margin-left: 12px; font-size: 13px; }
.save-msg.ok { color: var(--teal-d); }
.save-msg.err, .err { color: var(--err); }

/* 后台表格 */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.grid { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.grid th, .grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
.grid th { background: var(--teal-050); color: var(--teal-d); font-weight: 600; text-align: right; }
.grid tbody tr:hover { background: var(--teal-050); }

.pager { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.pager a { color: var(--teal-d); text-decoration: none; }

/* 历史线 */
.timeline { position: relative; margin: 8px 0 0 8px; padding-left: 26px; border-left: 2px solid var(--line); }
.timeline-item { position: relative; padding: 0 0 26px 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -35px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: linear-gradient(135deg, var(--teal), var(--coral)); box-shadow: 0 0 0 4px var(--bg);
}
.timeline-year { color: var(--teal-d); font-weight: 700; font-size: 13px; letter-spacing: .5px; }
.timeline-item h2 { margin: 2px 0 6px; }
.timeline-item p { margin: 0 0 10px; color: var(--muted); }
.timeline-item .tech { font-size: 12px; color: var(--muted); }
.timeline-item a.preview { display: inline-block; margin-top: 4px; padding: 7px 16px; border-radius: var(--r-pill);
  background: linear-gradient(100deg, var(--teal), var(--teal-d)); color: #fff; text-decoration: none; font-weight: 600;
  box-shadow: var(--shadow-sm); }
.timeline-item a.preview:hover { transform: translateY(-1px); }

/* 手机版：拍照 + 拖框定比例 */
.photo-pick {
  display: inline-block; margin: 4px 0 2px; padding: 10px 18px;
  border-radius: var(--r-pill); background: linear-gradient(100deg, var(--coral), var(--coral-d)); color: #fff;
  font-weight: 600; cursor: pointer; box-shadow: 0 14px 30px rgba(255, 107, 107, .32);
}
.photo-pick:hover { transform: translateY(-1px); }
.photo-stage {
  position: relative; margin-top: 12px; overflow: hidden;
  line-height: 0;
  -webkit-user-select: none; user-select: none;
}
.photo-stage img { display: block; width: 100%; height: auto; }
.crop-box {
  position: absolute; border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(15, 19, 25, .55);
  cursor: move; touch-action: none;
}
.crop-h {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2px solid var(--teal-d); border-radius: 50%; background: #fff;
  touch-action: none;
}
.crop-h[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.crop-h[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.crop-h[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.crop-h[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.photo-help { margin-top: 10px; }
.photo-help summary { cursor: pointer; color: var(--teal-d); }
.photo-help img { display: block; width: 100%; height: auto; margin-top: 8px; border-radius: var(--r-md); }

/* 大模型：主视图 + 侧视图两张照片 + 左/右视频（本地预览） */
.model-card h3 { margin: 18px 0 8px; }
.model-card .views { display: flex; gap: 12px; flex-wrap: wrap; }
.model-card .view { flex: 1 1 0; min-width: 160px; }
.view-preview {
  margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #f7fbfb;
}
.view-preview img, .view-preview video { display: block; width: 100%; height: 150px; object-fit: cover; }
.model-card .actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
@media (max-width: 560px) { .model-card .view { flex-basis: 100%; } }

/* 大模型区与下方「手机估算（古典）」之间留一行间距（h2 默认 margin-top:0，贴太近） */
.section-gap { margin-top: 24px; }
