:root {
  --paper: #f6f1e8;
  --card: #fffdf9;
  --ink: #2f2820;
  --ink-2: #6b5e4e;
  --ink-3: #9a8c79;
  --line: #e6dccd;
  --wood: #7a5c3e;
  --wood-2: #5e4630;
  --dai: #3f5a5a;
  --gold: #b08d57;
  --danger: #a4493d;
  --ok: #4c7a54;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 24px rgba(60, 40, 20, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1814; --card: #24201b; --ink: #efe7da; --ink-2: #c3b6a3; --ink-3: #8f8372;
    --line: #3a332a; --wood: #c49a6c; --wood-2: #d9b48a; --dai: #8fb3b0; --gold: #d2b07a;
    --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.65 -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
.serif { font-family: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", serif; }
a { color: var(--dai); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 64px; }
header.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 720px; margin: 0 auto; padding: 16px;
}
.brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; color: var(--ink); }
.brand b { font-size: 18px; letter-spacing: .08em; }
.brand span { font-size: 13px; color: var(--ink-3); }
nav.tabs { display: flex; gap: 4px; }
nav.tabs a {
  text-decoration: none; color: var(--ink-2); font-size: 14px; padding: 6px 12px; border-radius: 999px;
}
nav.tabs a.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.hero { padding: 28px 0 12px; }
.hero h1 { font-size: 30px; line-height: 1.3; margin: 0 0 8px; letter-spacing: .04em; font-weight: 600; }
.hero p { margin: 0; color: var(--ink-2); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
textarea, input, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; outline: none;
}
textarea:focus, input:focus { border-color: var(--wood); }
textarea { resize: vertical; min-height: 96px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip {
  border: 1px dashed var(--line); background: transparent; color: var(--ink-2);
  font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
}
.chip:hover { border-color: var(--wood); color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; border: 0; border-radius: 12px; padding: 12px 18px; cursor: pointer;
  background: var(--wood); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--wood-2); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--wood); }
.btn.block { width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 140px; }
.muted { color: var(--ink-3); font-size: 13px; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 1em; }

/* 进度 */
.progress { text-align: center; padding: 40px 16px; }
.steps { list-style: none; padding: 0; margin: 24px auto 0; max-width: 320px; text-align: left; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 8px 0; color: var(--ink-3); }
.steps li .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li.now { color: var(--ink); font-weight: 600; }
.steps li.now .dot { border-color: var(--wood); border-top-color: transparent; animation: spin 1s linear infinite; }
.steps li.ok { color: var(--ink-2); }
.steps li.ok .dot { background: var(--wood); border-color: var(--wood); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .steps li.now .dot { animation: none; } }

/* 进度条：一支从左往右燃尽的线香（左边是香灰，交界处是火星和一缕烟） */
.burn { max-width: 340px; margin: 18px auto 4px; padding-top: 40px; }
.burn-track { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(180deg, #8d6142, #6b4630); }
.burn-ash { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px 0 0 4px;
  background: repeating-linear-gradient(90deg, #d9d2c6 0 6px, #cbc3b5 6px 9px); transition: width .5s linear; }
.burn-ember { position: absolute; top: 50%; left: 0; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, #ffe3a3 0 25%, #ff8a3d 55%, rgba(255, 110, 40, 0) 72%);
  box-shadow: 0 0 10px 3px rgba(255, 120, 40, .45); transition: left .5s linear; animation: glow 1.8s ease-in-out infinite; }
.burn-ember i { position: absolute; left: 2px; bottom: 8px; width: 7px; height: 30px; border-radius: 50%;
  background: linear-gradient(to top, rgba(150, 150, 160, .55), rgba(150, 150, 160, 0)); filter: blur(2px);
  opacity: 0; animation: rise 3.2s ease-out infinite; }
.burn-ember i + i { animation-delay: 1.6s; }
.burn-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@keyframes glow { 50% { box-shadow: 0 0 14px 5px rgba(255, 120, 40, .6); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(0) scaleX(1); } 25% { opacity: .8; }
  100% { opacity: 0; transform: translate(8px, -38px) scaleX(1.9); } }
.tip { min-height: 2.8em; max-width: 360px; margin: 18px auto 0; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.tip.in { animation: fadein .6s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
.preview { max-width: 420px; margin: 20px auto 0; text-align: left; }
.preview h3 { font-size: 24px; margin: 6px 0 2px; letter-spacing: .06em; }
.preview ul { margin: 8px 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.preview #pvStory { margin: 8px 0; line-height: 1.7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .burn-ash { background: repeating-linear-gradient(90deg, #6f685e 0 6px, #5f594f 6px 9px); } }
@media (prefers-reduced-motion: reduce) { .burn-ember, .burn-ember i, .tip.in { animation: none; } .burn-ember i { opacity: .4; } }

/* 结果 */
.result h2 { font-size: 28px; margin: 4px 0 2px; letter-spacing: .06em; font-weight: 600; }
.result .theme { color: var(--ink-2); margin: 0 0 12px; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.shot { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: var(--line); aspect-ratio: 1; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.shot figcaption {
  position: absolute; left: 8px; bottom: 8px; font-size: 12px; color: #fff;
  background: rgba(30, 22, 14, .55); padding: 2px 8px; border-radius: 999px;
}
.shot .tag {
  position: absolute; right: 8px; top: 8px; font-size: 11px; color: #fff;
  background: rgba(30, 22, 14, .45); padding: 1px 6px; border-radius: 6px;
}
@media (max-width: 480px) { .gallery { grid-template-columns: 1fr; } }
.gallery.single { grid-template-columns: 1fr; }
.gallery.single .shot { aspect-ratio: 3 / 2; }
dl.spec { margin: 4px 0 12px; }
dl.spec dt { color: var(--ink-3); font-size: 13px; letter-spacing: .12em; }
dl.spec dd { margin: 6px 0 0; line-height: 1.8; }
dl.spec dd + dt { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
ul.acc li + li { margin-top: 4px; }
ul.acc { margin: 0; padding-left: 1.1em; }
.price { font-size: 20px; font-weight: 600; color: var(--wood); }
.tips { border-left: 3px solid var(--gold); background: var(--paper); padding: 10px 12px; border-radius: 0 10px 10px 0; margin: 12px 0; }
.tips b { color: var(--gold); }
.warn { font-size: 13px; color: var(--ink-2); background: var(--paper); border-radius: 10px; padding: 8px 12px; }
.versions { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
.versions a { font-size: 12px; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.versions a.on { background: var(--wood); border-color: var(--wood); color: #fff; }
.panel { margin-top: 12px; display: none; }
.panel.open { display: block; }
.panel label { display: block; font-size: 14px; color: var(--ink-2); margin: 10px 0 4px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); margin: 10px 0; }
.check input { width: auto; margin-top: 4px; }

/* 共创墙 */
.wall { columns: 2 150px; column-gap: 12px; margin-top: 16px; }
.wall .item { break-inside: avoid; margin: 0 0 12px; padding: 0; overflow: hidden; }
.wall .item img { width: 100%; display: block; aspect-ratio: 18 / 25; object-fit: cover; object-position: 0% 50%; cursor: pointer; background: var(--line); }
.wall .item img.full { object-position: 50% 50%; }
.wall .meta b { cursor: pointer; }
.wall .meta { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wall .meta b { display: block; }
.like { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); white-space: nowrap; }
.like.on { color: var(--danger); border-color: var(--danger); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 13px; padding: 4px 12px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.seg button.on { background: var(--wood); color: #fff; }

.lightbox { position: fixed; inset: 0; background: rgba(20, 15, 10, .88); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
footer { text-align: center; color: var(--ink-3); font-size: 12px; padding: 24px 16px; }
.mockbar { background: #e9dcc3; color: #5e4630; text-align: center; font-size: 13px; padding: 6px 16px; }

/* 分享海报 */
.poster-mask { position: fixed; inset: 0; background: rgba(20, 15, 10, .82); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 30; }
.poster-mask[hidden] { display: none; }
.poster-box { width: min(420px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.poster-hint { margin: 0; color: #f6f1e8; font-size: 14px; text-align: center; }
.poster-box img { display: block; max-width: 100%; max-height: calc(100vh - 150px); border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); -webkit-touch-callout: default; }
.poster-box img[hidden] { display: none; }
.poster-actions { justify-content: center; width: 100%; }
.poster-actions .btn { flex: 1 1 0; text-align: center; }
.poster-actions .ghost { color: #f6f1e8; border-color: rgba(246, 241, 232, .5); }
.poster-actions [hidden] { display: none; }
/* 首页作品条 */
.showcase { margin-top: 32px; }
.sc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sc-head h2 { font-size: 20px; font-weight: 600; margin: 0; letter-spacing: .04em; }
.sc-head a { font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.sc-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: 16px; padding: 12px 16px 6px; margin: 0 -16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sc-row::-webkit-scrollbar { display: none; }
.sc-item { flex: 0 0 148px; scroll-snap-align: start; text-decoration: none; color: inherit; }
.sc-img { display: block; width: 100%; aspect-ratio: 18 / 25; object-fit: cover; object-position: 0% 50%; border-radius: 12px; background: var(--line); }
.sc-img.full { object-position: 50% 50%; }
.sc-item b { display: block; margin-top: 8px; font-size: 15px; font-weight: 600; }
.sc-item span { font-size: 12px; color: var(--ink-3); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }ul.acc .spec-note { display: block; font-size: 13px; color: var(--ink-3); line-height: 1.6; margin-top: 2px; }
