:root {
  --bg: #0e1411;
  --card: #151d18;
  --card2: #1a241e;
  --ink: #f2efe9;
  --muted: #8b9992;
  --line: #26332b;
  --accent: #d3a45c;
  --green: #2e7d4f;
  --warn: #c2703c;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 760px; margin: 0 auto; padding: 22px 18px 64px; }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.topbar img { height: 30px; width: auto; }
.topbar .name { font-size: 15px; letter-spacing: .04em; }
.topbar .spacer { flex: 1; }
.topbar .back { font-size: 13px; color: var(--muted); }
h1 { font-size: 24px; margin: 0 0 8px; letter-spacing: .01em; }
p.lede { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
.drop {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
  background: var(--card);
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--card2); }
.drop b { color: var(--ink); font-weight: 600; }
.drop .hint { font-size: 12.5px; margin-top: 6px; }
.thumbs { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.thumb { position: relative; width: 120px; height: 90px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 13px; line-height: 1;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--ink); color: #14201a;
}
.btn[disabled] { opacity: .45; cursor: default; }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); font-weight: 500; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-top: 20px; }
.score { display: flex; align-items: baseline; gap: 10px; }
.score .n { font-size: 44px; font-weight: 700; letter-spacing: -.02em; }
.score .u { color: var(--muted); font-size: 13px; }
.kind { color: var(--accent); font-size: 13px; margin-top: 2px; }
.bars { margin-top: 18px; display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 76px 1fr 38px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.bar .track { height: 6px; border-radius: 999px; background: #0b120e; overflow: hidden; }
.bar .track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #6b8f79, var(--accent)); }
.bar .v { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.issues { margin: 16px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.issues li { margin: 4px 0; }
.verdict { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); font-size: 13.5px; }
.verdict b { color: var(--accent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
input[type=text], textarea {
  width: 100%; padding: 11px 13px; font: inherit; color: var(--ink);
  background: #0f1613; border: 1px solid var(--line); border-radius: 10px;
}
textarea { min-height: 64px; resize: vertical; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer;
}
.chip.on { border-color: var(--accent); color: var(--accent); background: rgba(211,164,92,.08); }
/* 动作模板分组 */
.tg-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.tg-group { margin-top: 14px; }
.tg-name { font-size: 11.5px; letter-spacing: .12em; color: #6f7c75; }
.tg-group .chips { margin-top: 8px; }
.tg-custom { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.chip-custom { border-style: dashed; }
#customBox { margin-top: 10px; }
.progress { margin-top: 16px; font-size: 13px; color: var(--muted); }
.progress .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: .35 } 50% { opacity: 1 } }
video { width: 100%; border-radius: 14px; display: block; background: #000; }
.err { margin-top: 14px; color: var(--warn); font-size: 13px; }
.note { margin-top: 26px; color: #6f7c75; font-size: 12px; line-height: 1.7; }
.reco {
  margin: 0 0 18px;
  padding: 12px 15px;
  border: 1px solid rgba(211, 164, 92, .35);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: rgba(211, 164, 92, .07);
  font-size: 13px;
  line-height: 1.75;
  color: #cfd8d2;
}
.reco b { color: var(--accent); }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
@media (max-width: 560px) { h1 { font-size: 20px; } .wrap { padding: 18px 14px 56px; } }

/* ===== 进度条（2026-11-29）===== */
.prog { margin-top: 14px; }
.prog-bar { height: 8px; border-radius: 999px; background: #0b120e; overflow: hidden; border: 1px solid var(--line); }
.prog-bar i { display: block; height: 100%; width: 2%; border-radius: 999px;
  background: linear-gradient(90deg, #6b8f79, var(--accent)); transition: width .6s ease; }
.prog-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.prog-meta #progMeta { font-variant-numeric: tabular-nums; }

/* ===== H5 底部导航（工具页）===== */
.t-nav { display: none; }
@media (max-width: 860px) {
  .t-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--bg); border-top: 1px solid var(--line);
  }
  .t-nav a:not(.t-logo) {
    flex: 1 1 0; height: 44px; line-height: 42px; text-align: center;
    border: 1px solid var(--line); border-radius: 12px;
    color: var(--ink); text-decoration: none; font-size: 14px;
  }
  .t-nav a.on { background: var(--accent); border-color: var(--accent); color: #14201a; font-weight: 600; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* ===== H5：底部导航已足够，隐藏顶部 logo/回首页 行（2026-11-29）===== */
@media (max-width: 860px) {
  .topbar { display: none; }
  .wrap { padding-top: 16px; }
  .wrap > h1:first-child { margin-top: 0; }
}

/* 底部导航左侧 logo（回首页） */
.t-nav .t-logo {
  flex: 0 0 auto; width: 46px; height: 44px; display: flex;
  align-items: center; justify-content: center; text-decoration: none;
}
.t-nav .t-logo img { height: 28px; width: auto; display: block; }

/* ===== H5：动作模板每组压成一行（2026-11-29）===== */
@media (max-width: 860px) {
  .tg-group .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
  }
  .tg-group .chips::-webkit-scrollbar { display: none; }
  .tg-group .chip {
    padding: 7px 10px;
    font-size: 12.5px;
    white-space: nowrap;
    flex: 0 0 auto;
  }
}
/* ===== 上传框里的「+」（2026-11-29）===== */
.drop-plus {
  display: block;
  width: 46px;
  height: 46px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 1px solid rgba(211, 164, 92, .45);
  background: rgba(211, 164, 92, .10);
  color: var(--accent);
  font-size: 30px;
  font-weight: 300;
  line-height: 44px;
  text-align: center;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.drop:hover .drop-plus, .drop.over .drop-plus {
  border-color: var(--accent);
  background: rgba(211, 164, 92, .18);
  transform: scale(1.04);
}
/* 结果卡标题 */
.result-title { margin: 0 0 12px; font-size: 16px; color: var(--ink); letter-spacing: .01em; }
/* ===== 百变魔法：前后对比滑块（2026-11-29）===== */
.ba { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #0b120e; touch-action: pan-y; }
.ba > img, .ba-top > img { display: block; width: 100%; height: auto; }
.ba-top { position: absolute; inset: 0 auto 0 0; width: 50%; overflow: hidden; }
.ba-top > img { position: absolute; inset: 0 auto 0 0; height: 100%; width: auto; max-width: none; }
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: rgba(255,255,255,.9);
  box-shadow: 0 0 10px rgba(0,0,0,.45); pointer-events: none; }
.ba-handle::after { content: ''; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px;
  margin: -17px 0 0 -17px; border-radius: 50%; background: rgba(255,255,255,.92);
  box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
#targetBox { margin-top: 10px; }
#targetBox input { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; }
/* ===== 时光隧道：双上传（2026-11-29）===== */
.pair { display: grid; gap: 12px; margin-top: 14px; }
@media (min-width: 640px) { .pair { grid-template-columns: 1fr 1fr; } }
.pair-item { display: flex; flex-direction: column; gap: 8px; }
.pair-label { font-size: 13px; color: var(--ink); font-weight: 600; }
.pair-label span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.drop-sm { padding: 18px 12px; }
.drop-sm b { font-size: 13.5px; }
.drop-sm .drop-plus { width: 38px; height: 38px; font-size: 24px; line-height: 36px; margin-bottom: 6px; }
.age-line { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.age-line input { width: 64px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; text-align: center; }
/* ===== 百变魔法：Tab（2026-11-29）===== */
.tabs { display:flex; gap:8px; margin:14px 0 0; }
.tab { flex:1 1 0; height:42px; border-radius:12px; border:1px solid var(--line);
  background:transparent; color:var(--muted); font:inherit; font-size:14px; cursor:pointer; }
.tab.is-on { background:var(--accent); border-color:var(--accent); color:#14201a; font-weight:600; }
#resultVideo { width:100%; border-radius:12px; background:#000; display:block; }
/* 时光隧道主题语 */
.tagline { margin: 6px 0 14px; font-size: 14px; letter-spacing: .08em; color: var(--accent); }
/* 百变魔法：附属工具入口 */
.sub-tools { display:grid; gap:8px; margin:14px 0 0; }
@media (min-width:640px) { .sub-tools { grid-template-columns: 1fr 1fr; } }
.sub-tool { display:block; padding:12px 14px; border:1px solid var(--line); border-radius:12px;
  text-decoration:none; color:var(--ink); background:var(--card); }
.sub-tool b { display:block; font-size:13.5px; }
.sub-tool span { display:block; margin-top:3px; font-size:11.5px; color:var(--muted); }
.sub-tool:hover { border-color: var(--accent); }


.btn-block { display: flex; width: 100%; }

/* ===== 时光隧道（2026-11-30 重写）===== */
.tun-upload { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 14px; }
.tun-drop { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 34px 18px; border: 1px dashed var(--line); border-radius: 13px;
  text-align: center; cursor: pointer; }
.tun-drop:hover, .tun-drop.over { border-color: rgba(211,164,92,.55); }
.tun-drop-ico { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted); margin-bottom: 6px; }
.tun-drop-ico svg { width: 20px; height: 20px; display: block; }
.tun-drop-t { font-size: 15px; color: var(--ink); font-weight: 600; }
.tun-drop-h { font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.tun-drop-h b { color: var(--accent); font-weight: 600; }
.tun-drop-h2 { font-size: 11.5px; color: var(--muted); line-height: 1.7; opacity: .85; }

.tun-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tun-row[hidden] { display: none !important; }
.tun-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.tun-thumb { position: relative; width: 96px; height: 96px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); }
.tun-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tun-thumb-n { position: absolute; left: 6px; bottom: 6px; font-size: 11px; padding: 1px 7px;
  border-radius: 999px; background: rgba(10,14,12,.7); color: #f2efe9; }
.tun-thumb-del { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(10,14,12,.72); color: #f2efe9; font-size: 14px; line-height: 1; cursor: pointer; }
.tun-tile { width: 96px; height: 96px; border-radius: 12px; border: 1px dashed var(--line);
  background: transparent; color: var(--muted); font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tun-tile:hover { border-color: var(--accent); color: var(--accent); }
.tun-tile-plus { font-size: 22px; line-height: 1; }
.tun-tile-t { font-size: 12px; }

.tun-ages { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.tun-ages[hidden] { display: none !important; }
.tun-ages-label { font-size: 12.5px; color: var(--muted); }
.tun-ages-inputs { display: flex; gap: 10px; flex-wrap: wrap; }
.tun-age { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.tun-age input { width: 62px; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 13px; text-align: center; }

.tun-sheet { position: fixed; inset: 0; z-index: 400; }
.tun-sheet[hidden] { display: none !important; }
.tun-sheet-mask { position: absolute; inset: 0; background: rgba(8,11,9,.72); }
.tun-sheet-panel { position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  background: var(--card); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); }
.tun-sheet-title { margin: 0 0 12px; font-size: 14px; color: var(--muted); text-align: center; }
.tun-sheet-x { position: absolute; right: 12px; top: 10px; width: 32px; height: 32px; border: 0;
  border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.tun-sheet-opt { display: block; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font: inherit; cursor: pointer; }
.tun-sheet-opt b { display: block; font-size: 15px; margin-bottom: 3px; }
.tun-sheet-opt span { font-size: 12px; color: var(--muted); }
.tun-sheet-opt:hover { border-color: var(--accent); }

/* PC：宽一点、两栏更舒展 */
@media (min-width: 900px) {
  .wrap { max-width: 760px; }
  .tun-drop { padding: 48px 24px; }
  .tun-tile, .tun-thumb { width: 112px; height: 112px; }
}

/* 时光隧道：PC 左右两栏 */
.tun-layout { display: block; }
@media (min-width: 900px) { .wrap { max-width: 720px; } }
@media (min-width: 900px) {  }

/* 时光隧道主按钮尺寸（禁用样式统一由 ui.css 控制） */
.tun-main .btn-block { height: 50px; font-size: 15px; }

/* PC：左表单 + 右「你的照片」 */
@media (min-width: 900px) {
  .wrap { max-width: 1040px; }
  .tun-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
  .tun-main { min-width: 0; }
}
.tun-side { display: none; }
@media (min-width: 900px) { .tun-side { display: block; } }
.tun-side-t { margin: 0 0 12px; font-size: 12.5px; letter-spacing: .1em; color: var(--muted); }
.tun-side-body { display: grid; gap: 10px; }
.tun-side-empty { margin: 0; padding: 40px 16px; text-align: center; font-size: 12.5px; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 12px; }
.tun-side-ph { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.tun-side-ph img { width: 100%; display: block; aspect-ratio: 4 / 3; object-fit: cover; }
.tun-side-ph span { position: absolute; left: 8px; bottom: 8px; font-size: 11.5px; padding: 2px 9px;
  border-radius: 999px; background: rgba(10,14,12,.7); color: #f2efe9; }

/* H5：选框别太高 */
@media (max-width: 860px) {
  .tun-drop { padding: 26px 16px; }
  .tun-drop-ico { width: 38px; height: 38px; }
}

/* 上传中提示 + PC 隐藏框内缩略图（避免与右侧重复） */
.tun-busy { display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 28px 16px; font-size: 13px; color: var(--accent); }
.tun-busy[hidden] { display: none !important; }
.tun-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(211,164,92,.28);
  border-top-color: var(--accent); animation: tunSpin .8s linear infinite; }
@keyframes tunSpin { to { transform: rotate(360deg); } }

@media (min-width: 900px) {
  .tun-thumbs { display: none; }
}

/* 文件输入视觉隐藏但可被 click() 触发 */
.tun-file {
  position: absolute !important;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}
.tun-drop { cursor: pointer; }
