:root {
  --paper: #f3eee2;
  --card: #f8f4e9;
  --white: #fffdf7;
  --ink: #17342e;
  --muted: #5f6b64;
  --faint: #8a9188;
  --accent: #b63a2b;
  --line: rgba(23, 52, 46, .14);
  --shadow: 0 1px 0 rgba(23, 52, 46, .04), 0 24px 50px -36px rgba(23, 52, 46, .5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

@font-face {
  font-family: "Poster Noto Sans SC";
  src: url("../fonts/poster-noto-sub.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: block;
}

.topbar { height: 6px; background: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

header.site-head { padding-top: 44px; padding-bottom: 30px; }
.head-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin: 0;
  color: var(--muted); font-size: 15px; letter-spacing: .08em;
}
.eyebrow::before { content: ""; width: 8px; height: 22px; background: var(--accent); border-radius: 2px; }

h1 {
  margin: 10px 0 0; font-size: clamp(32px, 6vw, 64px);
  line-height: 1.14; letter-spacing: .01em; text-wrap: balance;
}
h1 .dot { color: var(--faint); font-weight: 400; padding: 0 .12em; }

.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 14.5px;
  padding: 7px 12px; border-radius: 999px; border: 1px solid transparent;
}
.nav a:hover { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, .4); }
.nav a.active { color: var(--ink); border-color: var(--line); background: rgba(255, 255, 255, .55); }

.lede { max-width: 760px; margin: 20px 0 0; color: var(--muted); font-size: 17px; }
.credit { margin: 14px 0 0; color: var(--faint); font-size: 14.5px; }
.credit a { color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(23, 52, 46, .25); }
.credit a:hover { color: var(--accent); border-color: currentColor; }

main { padding-bottom: 20px; }

/* ---------- 生成器 ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 28px 22px; box-shadow: var(--shadow);
}
.gen-form {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr) auto;
  gap: 18px; align-items: end;
}
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; letter-spacing: .05em; color: var(--muted); }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid rgba(23, 52, 46, .2);
  border-radius: 10px; background: var(--white); color: var(--ink);
  font: inherit; font-size: 17px; line-height: 1.4;
}
.field input:focus { outline: 2px solid rgba(182, 58, 43, .35); outline-offset: 1px; border-color: rgba(182, 58, 43, .5); }
.time-row { display: flex; align-items: center; gap: 8px; }
.time-row input { width: 108px; }
.unit { color: var(--muted); font-size: 15px; }
.hint { color: var(--faint); font-size: 12.5px; line-height: 1.5; }

.btn-primary {
  border: 0; border-radius: 10px; background: var(--ink); color: #f6f1e5;
  padding: 13px 24px; font: inherit; font-size: 16px; font-weight: 500;
  letter-spacing: .03em; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, transform .15s ease;
}
.btn-primary:hover { background: #22463e; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-primary.loading { position: relative; padding-right: 44px; }
.btn-primary.loading::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 16px; height: 16px;
  margin-top: -8px; border-radius: 50%;
  border: 2px solid rgba(246, 241, 229, .35); border-top-color: #f6f1e5;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status { min-height: 1.6em; margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.status.error { color: var(--accent); }
.status.ok { color: var(--ink); }

.disclaimer {
  margin: 14px 0 0; padding: 10px 14px; border-left: 3px solid rgba(182, 58, 43, .55);
  background: rgba(182, 58, 43, .05); border-radius: 0 8px 8px 0;
  color: var(--muted); font-size: 13px; line-height: 1.65;
}

/* ---------- 结果 ---------- */
.result { margin-top: 30px; }
.result[hidden] { display: none; }
.result-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; margin-bottom: 14px; flex-wrap: wrap;
}
.result-head h2 { margin: 0; font-size: 26px; line-height: 1.25; }
.result-meta { margin: 6px 0 0; color: var(--faint); font-size: 13.5px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--ink);
  background: var(--ink); color: #f6f1e5; text-decoration: none; font: inherit; font-size: 14.5px;
  cursor: pointer; letter-spacing: .02em;
}
.btn:hover { opacity: .9; }
.btn.ghost { background: transparent; color: var(--ink); border-color: rgba(23, 52, 46, .32); }
.btn.ghost:hover { border-color: var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }

.poster-frame {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 10px; box-shadow: var(--shadow);
}
.poster-frame canvas { display: block; width: 100%; height: auto; border-radius: 8px; }

/* ---------- 示例 ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 54px 0 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 30px; line-height: 1.2; }
.section-head p { margin: 0; color: var(--faint); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 26px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.shot { display: block; background: #efe9db; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 1800/2210; object-fit: cover; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { margin: 0; font-size: 24px; line-height: 1.2; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px 3px 8px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--muted);
  background: rgba(255, 255, 255, .35);
}
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.stats { margin: 0; color: var(--muted); font-size: 14px; }
.stats b { color: var(--ink); font-weight: 600; }
.card .actions { margin-top: auto; }
.card .btn { padding: 8px 14px; font-size: 13.5px; }

/* ---------- 赞赏入口 ---------- */
.support-band {
  margin: 46px 0 10px; padding: 24px 28px; border-radius: 18px;
  background: var(--ink); color: #f6f1e5;
  display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.support-band h2 { margin: 0; font-size: 24px; }
.support-band p { margin: 6px 0 0; color: rgba(246, 241, 229, .72); font-size: 14px; }
.support-band .btn { background: var(--accent); border-color: var(--accent); color: #fff7ee; }
.support-band .btn:hover { opacity: .92; }

/* ---------- 赞赏页 ---------- */
.support-page { max-width: 720px; margin: 10px auto 30px; }
.support-panel { text-align: center; padding: 40px 32px 34px; }
.support-panel h1 { font-size: clamp(32px, 5vw, 44px); }
.support-panel .intro { margin: 16px auto 6px; max-width: 520px; color: var(--muted); font-size: 16px; }
.qr-card {
  display: inline-block; margin: 26px auto 12px; padding: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
}
.qr-card img { display: block; width: min(320px, 68vw); height: auto; border-radius: 8px; }
.qr-note { margin: 10px 0 0; font-size: 15px; color: var(--ink); }
.qr-fine { margin: 6px 0 0; font-size: 12.5px; color: var(--faint); }
.back-row { margin-top: 24px; }

footer.site-foot {
  border-top: 1px solid rgba(23, 52, 46, .12); margin-top: 26px;
  padding: 22px 0 46px; color: var(--faint); font-size: 13px;
}
footer.site-foot p { margin: 0 0 4px; }
footer.site-foot .row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .gen-form { grid-template-columns: 1fr 1fr; }
  .btn-primary { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  header.site-head { padding-top: 34px; }
  .panel { padding: 20px 18px 18px; }
  .gen-form { grid-template-columns: 1fr; }
  .result-head h2 { font-size: 22px; }
  .result-head .actions { width: 100%; }
  .result-head .actions .btn { flex: 1; text-align: center; }
  .section-head h2 { font-size: 25px; }
}
