:root {
  --bg: #f2f1ee;
  --surface: #ffffff;
  --surface-2: #f7f6f3;
  --ink: #16171b;
  --ink-2: #5c5f68;
  --ink-3: #8d9099;
  --line: rgba(22, 23, 27, 0.09);
  --accent: #e4572e;
  --accent-soft: #fdeee8;
  --green: #1f6f5c;
  --gold: #b8892f;
  --shadow: 0 8px 24px rgba(22, 23, 27, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --tabbar-h: 62px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden 必须优先于任何 display 声明，否则弹层会挡住点击 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
em { font-style: normal; }

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  position: relative;
}

/* ---------------- 顶部 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  background: rgba(242, 241, 238, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; margin-right: auto; cursor: pointer; min-width: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, #16171b, #3a3d47);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; letter-spacing: 1px;
}
.brand-text { font-weight: 700; letter-spacing: 0.5px; display: flex; flex-direction: column; line-height: 1.1; }
.brand-text em { font-size: 10px; color: var(--ink-3); font-weight: 500; letter-spacing: 0.5px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-size: 17px; color: var(--ink-2);
  background: rgba(255,255,255,.7);
}
.icon-btn:active { background: #fff; }

/* 顶栏的「返回 / 首页」按钮：全站常驻，做得显眼一点 */
.nav-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 7px 11px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  box-shadow: 0 2px 8px rgba(22,23,27,.06);
  white-space: nowrap;
}
.nav-btn:active { transform: scale(.96); background: var(--surface-2); }
.nav-btn.home { border-color: rgba(228,87,46,.35); color: var(--accent); background: #fff7f3; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

/* ---------------- 通用 ---------------- */
.view { display: none; padding: 14px; animation: fade .22s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.muted { color: var(--ink-3); font-size: 12px; }
.tiny { font-size: 11.5px; }
.block { margin-bottom: 20px; }
.block-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; }
.block-head h2 { font-size: 17px; letter-spacing: 0.3px; margin-right: auto; }
.link { color: var(--accent); font-size: 13px; font-weight: 600; }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.card.tight { padding: 12px; }
.btn {
  border-radius: 999px; padding: 11px 16px; font-weight: 600; font-size: 14px;
  background: var(--surface-2); color: var(--ink); transition: transform .12s ease, opacity .12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary.accent { background: var(--accent); }
.btn.ghost { background: rgba(255,255,255,.75); border: 1px solid var(--line); }
.btn.lg { padding: 14px 18px; font-size: 15px; width: 100%; }
.btn:disabled { opacity: .45; }
.block-btn { width: 100%; margin-top: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2);
}
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.green { background: #e9f3ef; color: var(--green); }
.pill.gold { background: #f8f1e2; color: var(--gold); }

/* ---------------- 首页 hero ---------------- */
.hero {
  background: linear-gradient(155deg, #16171b 0%, #262932 55%, #35303a 100%);
  color: #fff;
  border-radius: 22px;
  padding: 22px 18px 18px;
  box-shadow: 0 14px 34px rgba(22,23,27,.22);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -70px; width: 190px; height: 190px;
  background: radial-gradient(circle at 30% 30%, rgba(228,87,46,.55), transparent 65%);
  border-radius: 50%;
}
.hero-badge {
  display: inline-block; font-size: 11.5px; letter-spacing: .5px;
  background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 999px; margin-bottom: 12px;
}
.hero h1 { font-size: 23px; line-height: 1.34; letter-spacing: .3px; font-weight: 700; }
.hero-sub { margin-top: 10px; font-size: 13px; color: rgba(255,255,255,.72); line-height: 1.6; }
.hero-cta { margin-top: 16px; display: grid; gap: 8px; }
.hero-cta .btn.ghost { background: rgba(255,255,255,.1); color: #fff; border-color: rgba(255,255,255,.2); }
.hero-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.hero-step { text-align: center; font-size: 11px; color: rgba(255,255,255,.68); }
.hero-step b {
  display: grid; place-items: center; width: 22px; height: 22px; margin: 0 auto 4px;
  border-radius: 50%; background: rgba(255,255,255,.14); font-size: 11px; color: #fff;
}

/* ---------------- 快捷入口 ---------------- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 20px; }
.quick {
  background: var(--surface); border-radius: var(--radius-sm); padding: 12px;
  box-shadow: var(--shadow); text-align: left;
}
.quick i { font-size: 18px; }
.quick b { display: block; margin-top: 6px; font-size: 13.5px; }
.quick span { font-size: 11.5px; color: var(--ink-3); }

.qa-list { display: grid; gap: 8px; }
.qa-item {
  background: var(--surface); border-radius: var(--radius-sm); padding: 12px 13px;
  box-shadow: var(--shadow); display: flex; gap: 10px; align-items: flex-start; text-align: left; width: 100%;
}
.qa-item i { font-size: 16px; }
.qa-item b { font-size: 13.5px; font-weight: 600; display: block; }
.qa-item span { font-size: 12px; color: var(--ink-3); }

/* ---------------- 作品卡片 ---------------- */
.feed { display: grid; gap: 12px; }
.post-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-align: left; width: 100%; padding: 0;
}
.post-media { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); position: relative; }
.post-media .half { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #e8e7e3; }
.post-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-media .tag {
  position: absolute; left: 6px; bottom: 6px; font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(4px);
}
.score-float {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  background: rgba(255,255,255,.94); border-radius: 12px; padding: 5px 9px; text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.16);
}
.score-float b { font-size: 17px; display: block; line-height: 1; }
.score-float span { font-size: 9.5px; color: var(--ink-3); }
.post-body { padding: 11px 13px 12px; }
.post-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-3); }
.post-foot { display: flex; align-items: center; gap: 12px; margin-top: 9px; font-size: 12px; color: var(--ink-3); }
.post-foot .grow { margin-left: auto; }

/* ---------------- 广场筛选 ---------------- */
.filter-row { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.segmented { display: flex; background: var(--surface); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.seg { padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.seg.active { background: var(--ink); color: #fff; }
.select {
  appearance: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 12px; font-size: 12.5px; color: var(--ink-2);
}
.load-more { display: grid; place-items: center; margin-top: 12px; }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab { padding: 9px 0 8px; display: grid; place-items: center; gap: 2px; color: var(--ink-3); font-size: 10.5px; }
.tab i { font-size: 18px; font-style: normal; }
.tab.active { color: var(--ink); font-weight: 600; }
.tab.center i {
  background: var(--ink); color: #fff; width: 42px; height: 30px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; margin-top: -4px;
}

/* ---------------- 抽屉 ---------------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(12,13,16,.45);
  display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px);
}
.sheet {
  width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp .26s cubic-bezier(.2,.8,.3,1);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: rgba(0,0,0,.16); margin: 6px auto 10px; }
.sheet-head { display: flex; align-items: center; margin-bottom: 12px; }
.sheet-head h3 { font-size: 17px; margin-right: auto; }

.upload-drop {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1.5px dashed rgba(22,23,27,.18);
  min-height: 210px; display: grid; place-items: center; margin-bottom: 10px;
}
.upload-placeholder { text-align: center; padding: 26px 20px; display: grid; gap: 6px; }
.upload-emoji { font-size: 34px; }
.upload-placeholder b { font-size: 14.5px; }
.upload-placeholder span { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
#uploadPreview { width: 100%; display: block; }
.upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.input {
  width: 100%; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  padding: 10px 12px; font-size: 14px; outline: none;
}
.input:focus { border-color: rgba(228,87,46,.5); }
textarea.input { resize: vertical; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 12px; border-radius: 999px; font-size: 12.5px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.switch-row { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--ink-2); margin: 4px 0 6px; }
.switch-row input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--ink); }

/* ---------------- 加载 ---------------- */
.loading-card {
  margin: auto; width: min(88%, 340px); background: var(--surface);
  border-radius: 20px; padding: 26px 20px; text-align: center; box-shadow: var(--shadow);
}
.loading-card h3 { font-size: 15.5px; margin: 14px 0 12px; }
.spinner {
  width: 44px; height: 44px; margin: 0 auto; border-radius: 50%;
  border: 3px solid rgba(22,23,27,.1); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress { height: 6px; border-radius: 999px; background: rgba(22,23,27,.08); overflow: hidden; margin-bottom: 8px; }
.progress-bar { height: 100%; width: 2%; background: linear-gradient(90deg, var(--accent), #f0a06a); transition: width .5s ease; }

/* ---------------- 结果页 ---------------- */
.compare-card { padding: 0; overflow: hidden; }
.compare-stage {
  position: relative; width: 100%; aspect-ratio: 3 / 4; background: #e9e8e4; overflow: hidden;
  touch-action: none; user-select: none;
}
.compare-stage img, .compare-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.render-status {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-2);
}
.render-status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.render-status .mini-progress { flex: 1 1 90px; height: 4px; border-radius: 999px; background: rgba(22,23,27,.08); overflow: hidden; min-width: 70px; }
.render-status .mini-progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #e0b45f); transition: width .6s ease; }
.live-tag {
  position: absolute; left: 8px; top: 8px; z-index: 4;
  background: rgba(31,111,92,.92); color: #fff; font-size: 10.5px; padding: 3px 8px; border-radius: 999px;
}
.compare-stage .after-layer { position: absolute; inset: 0; }
.compare-handle {
  position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; z-index: 5;
  box-shadow: 0 0 12px rgba(0,0,0,.35);
}
.compare-handle::after {
  content: "⇄"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--ink);
  display: grid; place-items: center; font-size: 15px; box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.compare-labels { position: absolute; inset: auto 0 8px 0; display: flex; justify-content: space-between; padding: 0 10px; z-index: 6; }
.compare-labels span {
  font-size: 10.5px; background: rgba(0,0,0,.5); color: #fff; padding: 3px 8px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.compare-tools { display: flex; gap: 8px; padding: 10px; flex-wrap: wrap; align-items: center; }
.compare-tools .seg { padding: 6px 11px; font-size: 12px; }
.compare-tools .segmented { box-shadow: none; background: var(--surface-2); }
.hair-tabs, .scene-tabs { display: flex; gap: 7px; overflow-x: auto; padding: 4px 10px 10px; scrollbar-width: none; }
.hair-tabs::-webkit-scrollbar, .scene-tabs::-webkit-scrollbar { display: none; }
.hair-tab, .scene-tab {
  flex: 0 0 auto; padding: 8px 12px; border-radius: 12px; background: var(--surface-2);
  font-size: 12.5px; color: var(--ink-2); border: 1px solid transparent; text-align: left;
}
.hair-tab b, .scene-tab b { display: block; font-size: 12.5px; }
.hair-tab span, .scene-tab span { font-size: 10.5px; color: var(--ink-3); }
.hair-tab.active, .scene-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.hair-tab.active span, .scene-tab.active span { color: rgba(255,255,255,.66); }

.score-panel { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.score-big { text-align: center; min-width: 74px; }
.score-big b { font-size: 34px; line-height: 1; letter-spacing: -1px; }
.score-big span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 3px; }
.score-arrow { color: var(--ink-3); font-size: 16px; }
.score-delta { font-size: 13px; font-weight: 700; color: var(--green); }
.grade-badge {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-weight: 700; font-size: 16px;
}
.dim-list { display: grid; gap: 9px; margin-top: 12px; }
.dim-row { display: grid; grid-template-columns: 62px 1fr 64px; gap: 8px; align-items: center; font-size: 12px; }
.dim-row .bar { height: 7px; border-radius: 999px; background: rgba(22,23,27,.07); overflow: hidden; position: relative; }
.dim-row .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: rgba(22,23,27,.22); }
.dim-row .bar u { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: linear-gradient(90deg, var(--green), #3fa07f); }
.dim-row .num { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.dim-row .num b { color: var(--ink); }

.kv-list { display: grid; gap: 8px; }
.kv { display: flex; gap: 8px; font-size: 13px; align-items: flex-start; }
.kv b { flex: 0 0 62px; color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.kv span { flex: 1; }
.issue-list { display: grid; gap: 7px; margin-top: 10px; }
.issue {
  font-size: 13px; padding: 9px 11px; border-radius: 11px; background: #fdf3ef;
  color: #8a3a1f; display: flex; gap: 7px;
}
.issue::before { content: "✱"; font-size: 11px; }

.rec-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px; margin-bottom: 10px; background: var(--surface); box-shadow: var(--shadow); }
.rec-card.top { border-color: rgba(228,87,46,.35); }
.rec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rec-head b { font-size: 15px; margin-right: auto; }
.rec-score { font-size: 18px; font-weight: 700; color: var(--accent); }
.rec-list { display: grid; gap: 6px; margin: 8px 0; }
.rec-list li { font-size: 13px; display: flex; gap: 7px; color: var(--ink-2); }
.rec-list li::before { content: "•"; color: var(--accent); }
.rec-note { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 9px 10px; margin-top: 7px; }
.rec-note b { display: block; font-size: 11.5px; color: var(--ink-3); margin-bottom: 3px; font-weight: 600; }

.outfit-items { display: grid; gap: 9px; margin: 10px 0; }
.outfit-item { display: flex; gap: 9px; font-size: 13px; }
.outfit-item .part {
  flex: 0 0 46px; font-size: 11.5px; color: var(--ink-2); background: var(--surface-2);
  border-radius: 8px; padding: 3px 0; text-align: center; height: fit-content;
}
.outfit-item .body b { font-size: 13px; font-weight: 600; display: block; }
.outfit-item .body span { font-size: 11.5px; color: var(--ink-3); }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.swatch { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-2); }
.swatch i { width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); display: block; }

.season-grid { display: grid; gap: 10px; }
.season-card { border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); }
.season-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.season-head b { font-size: 14px; }
.season-card p { font-size: 12.5px; color: var(--ink-2); }
.season-pieces { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.season-pieces span { font-size: 11px; background: #fff; border-radius: 999px; padding: 3px 8px; color: var(--ink-2); }

.comment-list { display: grid; gap: 10px; }
.comment { display: flex; gap: 9px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px; display: grid; place-items: center;
  color: #fff; font-size: 12px; font-weight: 700;
}
.comment .body { flex: 1; }
.comment .meta { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; color: var(--ink-3); }
.comment .meta b { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.comment p { font-size: 13.5px; margin-top: 2px; }
.comment-form { display: flex; gap: 8px; margin-top: 12px; }
.comment-form .input { flex: 1; }
.action-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.like-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; }
.like-btn.active { background: var(--accent-soft); color: var(--accent); }
.empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 28px 16px; }
.empty i { font-size: 30px; display: block; margin-bottom: 8px; font-style: normal; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 26px); transform: translateX(-50%);
  background: rgba(22,23,27,.92); color: #fff; padding: 10px 16px; border-radius: 999px;
  font-size: 13px; z-index: 90; max-width: 84%; text-align: center; animation: fade .2s ease;
}
.banner {
  background: #fff8ec; border: 1px solid #f0e0c2; color: #7a5a1e; font-size: 12px;
  border-radius: 12px; padding: 9px 11px; margin-bottom: 12px; line-height: 1.5;
}
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.section-title { font-size: 15px; font-weight: 700; margin: 18px 0 8px; display: flex; align-items: center; gap: 7px; }
.section-title small { font-weight: 500; color: var(--ink-3); font-size: 11.5px; }
.profile-card { display: grid; gap: 10px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.profile-stats div b { display: block; font-size: 19px; }
.profile-stats div span { font-size: 11px; color: var(--ink-3); }

@media (min-width: 600px) {
  body { background: #e6e5e1; }
  #app { box-shadow: 0 0 40px rgba(0,0,0,.08); background: var(--bg); }
}

/* ---------------- 未生成效果图时的占位 ---------------- */
.pending-fill {
  display: grid; place-items: center; height: 100%; font-size: 12px; color: var(--ink-3);
  background: repeating-linear-gradient(45deg, #eeeeea, #eeeeea 10px, #e6e6e1 10px, #e6e6e1 20px);
}

/* ---------------- 分步提示 ---------------- */
.step-bar { display: flex; gap: 6px; margin-bottom: 10px; }
.step {
  flex: 1; text-align: center; font-size: 11.5px; padding: 6px 0; border-radius: 999px;
  background: rgba(22,23,27,.05); color: var(--ink-3);
}
.step.on { background: var(--ink); color: #fff; font-weight: 600; }

/* ---------------- 选项卡片 ---------------- */
.option-list { display: grid; gap: 8px; margin-bottom: 6px; }
.option {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--shadow); display: block; width: 100%;
}
.option.on { border-color: var(--accent); background: #fffaf7; }
.option-head { display: flex; align-items: center; gap: 8px; }
.option-head b { font-size: 14.5px; margin-right: auto; }
.option-sub { display: block; font-size: 12.5px; color: var(--ink-3); margin: 4px 0 6px; line-height: 1.5; }

.toggle-card { padding: 0; overflow: hidden; }
.toggle-head {
  width: 100%; text-align: left; padding: 14px; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.toggle-head span { margin-left: auto; color: var(--ink-3); }
#planBody { padding: 0 14px 14px; }

/* ---------------- 生成中 ---------------- */
.gen-card { padding: 0; overflow: hidden; }
.gen-hero { padding: 26px 16px 16px; text-align: center; }
.gen-hero h3 { font-size: 16px; margin: 14px 0 6px; }
.gen-list { border-top: 1px solid var(--line); }
.gen-row {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: 13px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.gen-row:last-child { border-bottom: 0; }
.gen-row b { margin-right: auto; font-weight: 600; }

/* ---------------- 记录卡 ---------------- */
.record-card {
  position: relative; background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 12px; border: 1.5px solid transparent;
}
.record-card.picked { border-color: var(--accent); }
.record-media { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.record-media .half { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #e8e7e3; }
.record-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.record-media .tag {
  position: absolute; left: 6px; bottom: 6px; font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: rgba(0,0,0,.55); color: #fff;
}
.record-body { padding: 10px 48px 11px 12px; }
.record-body .post-meta { margin-bottom: 6px; }
.pick {
  position: absolute; right: 10px; bottom: 12px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--ink-2); font-size: 15px; border: 1px solid var(--line);
}
.pick.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.record-grid { display: grid; gap: 12px; }

/* ---------------- 记录页底部对比栏 ---------------- */
.compare-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  width: min(92%, 520px); z-index: 45;
  background: rgba(22,23,27,.94); color: #fff; border-radius: 999px;
  padding: 9px 10px 9px 16px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.28); backdrop-filter: blur(10px);
}
.compare-bar b { font-size: 15px; }
.compare-bar .link { color: rgba(255,255,255,.7); }
.compare-bar .btn.primary { background: #fff; color: var(--ink); padding: 8px 16px; margin-left: auto; }
.compare-bar .btn.primary:disabled { opacity: .5; }

/* ---------------- 账号 / 会员中心 ---------------- */
.btn.sm { padding: 8px 12px; font-size: 12.5px; }
.auth-seg { margin-bottom: 12px; }
.auth-seg .seg { flex: 1; text-align: center; }

.me-card { display: grid; gap: 14px; }
.me-head { display: flex; align-items: center; gap: 12px; }
.me-avatar {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center;
  font-size: 18px; font-weight: 700; letter-spacing: .5px;
}
.me-avatar.lg { width: 58px; height: 58px; flex: 0 0 58px; font-size: 24px; margin: 0 auto 12px; }
.me-id { flex: 1; display: grid; gap: 2px; min-width: 0; }
.me-id b { font-size: 17px; }
.me-guest { text-align: center; }
.me-guest h2 { font-size: 18px; margin-bottom: 8px; }
.me-guest p { line-height: 1.6; }
.me-seg { margin: 0 0 12px; display: flex; }
.me-seg .seg { flex: 1; text-align: center; padding: 7px 6px; }
.work-card .record-body { padding-right: 12px; }
.work-card .action-row { flex-wrap: wrap; gap: 6px; }

@media (max-width: 380px) {
  .me-seg .seg { font-size: 12px; padding: 7px 4px; }
}

/* ---------------- 积分 / 卡密 ---------------- */
.credit-num { color: var(--accent); }
.credit-card { display: grid; gap: 12px; }
.credit-balance {
  background: linear-gradient(150deg, #16171b, #33313c);
  color: #fff; border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px;
}
.credit-balance span { font-size: 12px; color: rgba(255,255,255,.7); }
.credit-balance b { font-size: 30px; line-height: 1.1; letter-spacing: .5px; }
.credit-balance small { font-size: 11.5px; color: rgba(255,255,255,.66); line-height: 1.5; }
.redeem-row { display: flex; gap: 8px; align-items: center; }
.redeem-row .input { flex: 1; letter-spacing: 1px; text-transform: uppercase; }
.contact-list { display: grid; gap: 8px; margin-bottom: 10px; }
.contact-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.contact-row b { flex: 0 0 46px; color: var(--ink-3); font-weight: 500; font-size: 12.5px; }
.contact-row span { flex: 1; font-weight: 600; word-break: break-all; }
.plan-list { display: grid; gap: 8px; margin-top: 10px; }
.plan {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  background: var(--surface-2); border-radius: 12px; padding: 10px 12px;
}
.plan b { font-size: 13.5px; }
.plan span { color: var(--ink-3); }
.plan em { margin-left: auto; font-style: normal; font-weight: 700; color: var(--accent); }
.credit-logs { display: grid; gap: 2px; }
.credit-log {
  display: flex; align-items: center; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.credit-log:last-child { border-bottom: none; }
.credit-log .cl-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.credit-log .cl-main b { font-size: 13px; font-weight: 600; }
.credit-log .cl-main span { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-log .cl-side { text-align: right; display: grid; gap: 2px; }
.credit-log .cl-side b { font-size: 14px; }
.credit-log .cl-side b.plus { color: var(--green); }
.credit-log .cl-side b.minus { color: var(--accent); }
.credit-log .cl-side span { font-size: 11px; color: var(--ink-3); }

.site-foot {
  text-align: center; font-size: 11.5px; color: var(--ink-3);
  padding: 4px 14px 16px; display: grid; gap: 4px;
}
.site-foot a { color: var(--ink-3); text-decoration: none; }

/* 顶栏按钮在窄屏上收一收，保证「返回 / 首页」都放得下 */
@media (max-width: 430px) {
  .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .brand-text { font-size: 13px; }
  .brand-text em { display: none; }
  .nav-btn { padding: 6px 9px; font-size: 12px; }
  .topbar-actions { gap: 4px; }
}

@media (max-width: 350px) {
  .brand-mark { display: none; }
  .nav-btn { padding: 6px 8px; }
}
