/* 人情账 · 请柬红金视觉
   喜帖红底、烫金字、双喜纹样、竖排礼簿、烫金边框 */

:root {
  --red-deep: #6E1B18;
  --red: #9E2B25;
  --red-soft: #A9362F;
  --gold: #D4AF37;
  --gold-bright: #F0D27A;
  --gold-dim: #A98A3C;
  --cream: #F7EAD3;
  --cream-soft: #E8D6B8;
  --ink: #3A1411;
  --serif: "Songti SC", "STSong", "SimSun", "FangSong", "Noto Serif SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { background: var(--red-deep); }

body {
  margin: 0;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.9;
  background:
    radial-gradient(circle at 12% 8%, rgba(212, 175, 55, 0.10), transparent 32%),
    radial-gradient(circle at 88% 72%, rgba(212, 175, 55, 0.08), transparent 36%),
    repeating-linear-gradient(45deg, transparent 0 26px, rgba(212, 175, 55, 0.035) 26px 27px),
    repeating-linear-gradient(-45deg, transparent 0 26px, rgba(212, 175, 55, 0.035) 26px 27px),
    var(--red-deep);
}

/* 双喜水印与四角烫金 */
.seal-frame { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.seal-frame .watermark {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%);
  font-family: var(--serif); font-size: min(62vw, 720px); line-height: 1;
  color: rgba(212, 175, 55, 0.045); user-select: none;
}
.corner { position: absolute; width: 46px; height: 46px; opacity: 0.7; }
.corner::before, .corner::after { content: ''; position: absolute; background: var(--gold); }
.corner::before { width: 46px; height: 1px; }
.corner::after { width: 1px; height: 46px; }
.corner.tl { top: 16px; left: 16px; }
.corner.tr { top: 16px; right: 16px; transform: scaleX(-1); }
.corner.bl { bottom: 16px; left: 16px; transform: scaleY(-1); }
.corner.br { bottom: 16px; right: 16px; transform: scale(-1, -1); }

main {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 34px 20px 96px;
}

/* ---------- 抬头 ---------- */
.intro { text-align: center; padding: 26px 0 12px; position: relative; }
.eyebrow {
  margin: 0 0 18px; font: 11px/1 var(--sans);
  letter-spacing: 0.42em; color: var(--gold-bright); text-transform: uppercase;
}
.title-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.double-seal {
  flex: none; width: 62px; height: 62px; border-radius: 50%;
  border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2), transparent 70%);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.14), inset 0 0 12px rgba(212, 175, 55, 0.2);
}
.double-seal span {
  font-family: var(--serif); font-size: 34px; line-height: 1;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.intro h1 {
  margin: 0; font-family: var(--serif); font-size: clamp(42px, 8vw, 60px);
  line-height: 1.1; letter-spacing: 0.22em; text-indent: 0.22em; font-weight: 700;
  background: linear-gradient(180deg, #FFF0C4 0%, var(--gold) 55%, var(--gold-dim) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { margin: 4px 0 0; font-family: var(--serif); font-size: 14px; letter-spacing: 0.16em; color: var(--gold-bright); }
.lede { margin: 24px auto 0; max-width: 640px; color: var(--cream-soft); font-size: 14px; }
.intro::after {
  content: ''; display: block; width: 180px; height: 18px; margin: 22px auto 0;
  background:
    linear-gradient(var(--gold), var(--gold)) center / 100% 1px no-repeat,
    radial-gradient(circle 3px at 50% 50%, var(--gold), transparent 95%) center / 8px 8px no-repeat;
  opacity: 0.8;
}

/* ---------- 礼簿表单 ---------- */
.ledger-sheet {
  margin-top: 36px; padding: 30px 28px 26px; position: relative;
  background: linear-gradient(180deg, rgba(158, 43, 37, 0.96), rgba(110, 27, 24, 0.96));
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.10), inset 0 0 30px rgba(0, 0, 0, 0.12);
}
.ledger-sheet::before {
  content: ''; position: absolute; inset: 7px; border: 1px solid rgba(212, 175, 55, 0.42);
  pointer-events: none;
}
.group { padding: 14px 0 10px; position: relative; }
.index {
  margin: 0 0 12px; font-family: var(--serif); font-size: 16px; letter-spacing: 0.14em;
  display: flex; align-items: center; gap: 10px; color: var(--gold-bright);
}
.index .num {
  flex: none; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold); border-radius: 50%; font-size: 13px; color: var(--gold);
}
.hint { margin: -4px 0 12px; font-size: 12px; color: var(--cream-soft); line-height: 1.8; }
.hint b { color: var(--gold-bright); font-weight: 600; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.line { display: flex; align-items: baseline; gap: 10px; position: relative; }
.line.full { grid-column: 1 / -1; }
.line > span { flex: none; font-size: 13px; color: var(--gold-bright); min-width: 5em; letter-spacing: 0.08em; }
.line input {
  flex: 1; min-width: 0; border: none; border-bottom: 1px solid rgba(212, 175, 55, 0.55);
  background: transparent; padding: 6px 2px; font: 15px/1.6 var(--sans);
  color: var(--cream); outline: none;
}
.line input::placeholder { color: rgba(247, 234, 211, 0.4); }
.line input:focus { border-bottom-color: var(--gold-bright); }
.line em { font-style: normal; font-size: 11px; color: var(--gold-dim); flex: none; }
.line.area { display: block; }
.line.area textarea {
  width: 100%; min-height: 120px; resize: vertical; padding: 12px 14px;
  border: 1px solid rgba(212, 175, 55, 0.5); background: rgba(70, 16, 14, 0.4);
  color: var(--cream); font: 14px/1.9 var(--sans); outline: none; letter-spacing: 0.02em;
}
.line.area textarea:focus { border-color: var(--gold-bright); }
.line.area textarea::placeholder { color: rgba(247, 234, 211, 0.38); }

.actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
button, a.ghost { font-family: var(--sans); cursor: pointer; }
.solid {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--ink); border: 1px solid var(--gold-bright); padding: 12px 26px;
  font-size: 14px; letter-spacing: 0.1em; font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.solid:hover { filter: brightness(1.08); }
.solid:disabled { opacity: 0.5; cursor: wait; }
.ghost {
  background: transparent; color: var(--gold-bright); border: 1px solid var(--gold);
  padding: 12px 22px; font-size: 14px; letter-spacing: 0.1em;
  text-decoration: none; display: inline-block;
}
.ghost:hover { background: rgba(212, 175, 55, 0.12); }
.note { font-size: 12px; color: var(--gold-dim); margin-top: 22px; letter-spacing: 0.03em; }

/* ---------- 核账 ---------- */
.section-head { margin-top: 54px; text-align: center; }
.section-head.tight { margin-top: 46px; text-align: left; }
.section-head h2 { font-family: var(--serif); font-size: 24px; letter-spacing: 0.14em; margin: 0 0 8px; color: var(--gold-bright); }
.section-head .lede { margin-top: 6px; }

.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 26px;
  background: var(--gold-dim); border: 1px solid var(--gold);
}
.stat { background: rgba(110, 27, 24, 0.94); padding: 18px 16px 14px; position: relative; text-align: center; }
.stat::before, .stat::after {
  content: ''; position: absolute; left: 10px; right: 10px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.55), transparent);
}
.stat::before { top: 8px; } .stat::after { bottom: 8px; }
.stat b { display: block; font: 700 27px/1.3 var(--serif); color: var(--gold-bright); margin: 6px 0 2px; overflow-wrap: anywhere; }
.stat small { font: 12px/1 var(--sans); color: var(--gold-dim); margin-left: 3px; }
.stat span { font-size: 12px; color: var(--cream-soft); letter-spacing: 0.08em; }
.stat.warn b { color: #FFD9A0; }

.grade-row { display: flex; gap: 26px; align-items: center; margin-top: 28px; }
.grade {
  flex: none; width: 96px; height: 96px; border-radius: 50%; border: 2px solid var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22), rgba(110, 27, 24, 0.6));
  box-shadow: 0 0 0 5px rgba(212, 175, 55, 0.1), inset 0 0 14px rgba(212, 175, 55, 0.18);
}
.grade span { font: 700 38px/1 var(--serif); color: var(--gold-bright); }
.grade em { font-style: normal; font-size: 10px; color: var(--gold-bright); letter-spacing: 0.2em; }
.notes { margin: 0; padding: 0; list-style: none; color: var(--cream-soft); font-size: 13px; flex: 1; }
.notes li { padding-left: 18px; position: relative; margin-bottom: 7px; line-height: 1.7; }
.notes li::before { content: '囍'; position: absolute; left: 0; top: 0; font-size: 10px; color: var(--gold); }

.table-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--gold-dim); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-family: var(--serif); font-size: 13px; letter-spacing: 0.12em;
  color: var(--gold-bright); border-bottom: 1px solid var(--gold); padding: 10px;
  white-space: nowrap; background: rgba(212, 175, 55, 0.1);
}
td { border-bottom: 1px dashed rgba(212, 175, 55, 0.3); padding: 10px; vertical-align: top; }
td.id { font: 11px/1.9 var(--sans); color: var(--gold); white-space: nowrap; }
td.num { font-family: var(--serif); color: var(--gold-bright); white-space: nowrap; }

/* ---------- 礼簿正文 ---------- */
.case-bar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  margin-top: 40px; padding-bottom: 12px; border-bottom: 1px solid var(--gold); flex-wrap: wrap;
}
.code { font: 12px/1.6 var(--sans); color: var(--gold-dim); }
.state { font: 11px/1 var(--sans); letter-spacing: 0.16em; padding: 5px 12px; border: 1px solid var(--gold); color: var(--gold-bright); }
.state.paid { border-color: var(--gold-bright); }

.report-head { margin-top: 30px; text-align: center; }
.report-head h2 { font-family: var(--serif); font-size: 28px; letter-spacing: 0.16em; margin: 0 0 10px; color: var(--gold-bright); }
.report-head > p { margin: 0 auto; max-width: 640px; color: var(--cream-soft); }
.report-meta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font: 11px/1.8 var(--sans); color: var(--gold-dim); margin-top: 14px; }
.report-meta span { border: 1px solid rgba(212, 175, 55, 0.4); padding: 2px 9px; }

.chapter { margin-top: 34px; position: relative; padding-left: 30px; }
.chapter::before {
  content: ''; position: absolute; left: 8px; top: 14px; bottom: -18px;
  border-left: 1px solid rgba(212, 175, 55, 0.4);
}
.chapter:last-of-type::before { bottom: auto; height: 100%; }
.chapter::after {
  content: '囍'; position: absolute; left: 0; top: 4px; width: 17px; height: 17px;
  font-size: 10px; line-height: 17px; text-align: center; color: var(--gold);
  border: 1px solid var(--gold); border-radius: 50%;
}
.chapter h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 18px; letter-spacing: 0.1em; color: var(--gold-bright); }
.chapter h3 small { font: 12px/1 var(--sans); color: var(--gold); margin-right: 10px; }
.chapter p { margin: 0; max-width: 640px; }
.fact-refs { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.fact-refs span { font: 10px/1 var(--sans); letter-spacing: 0.1em; border: 1px solid rgba(212, 175, 55, 0.4); padding: 4px 9px; color: var(--gold); }

.block-title {
  margin: 44px 0 14px; font-family: var(--serif); font-size: 16px; letter-spacing: 0.16em;
  color: var(--gold-bright); display: flex; align-items: center; gap: 10px;
}
.block-title::before { content: '囍'; font-size: 11px; border: 1px solid var(--gold); border-radius: 50%; width: 18px; height: 18px; line-height: 18px; text-align: center; flex: none; }
.block-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212, 175, 55, 0.5), transparent); }

.qa {
  margin: 0 0 18px; border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(110, 27, 24, 0.5); padding: 14px 18px;
}
.qa .claim { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--cream); }
.qa .exposure { margin: 5px 0 8px; font-size: 12px; color: var(--gold-bright); }
.qa .exposure::before { content: '※ '; }
.qa .reply { margin: 0; font-size: 13px; color: var(--cream-soft); max-width: 640px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: flex; gap: 16px; align-items: baseline; padding: 0 0 16px 26px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 9px; bottom: -2px; border-left: 1px solid rgba(212, 175, 55, 0.4); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ''; position: absolute; left: 2px; top: 8px; width: 9px; height: 9px; border: 1px solid var(--gold); background: var(--red); border-radius: 50%; }
.timeline .when { flex: none; font-family: var(--serif); font-size: 13px; color: var(--gold-bright); min-width: 5em; }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; justify-content: space-between; gap: 14px; padding: 9px 2px 9px 24px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.3); font-size: 13px; position: relative;
}
.checklist li::before { content: '□'; position: absolute; left: 4px; color: var(--gold); }
.checklist li span { font-family: var(--serif); font-size: 12px; color: var(--gold-bright); flex: none; }

/* ---------- 支付 ---------- */
.paywall { border: 1px solid var(--gold); background: rgba(110, 27, 24, 0.6); padding: 24px 26px; margin-top: 26px; position: relative; }
.paywall::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(212, 175, 55, 0.35); pointer-events: none; }
.paywall h3 { margin: 0 0 6px; font-family: var(--serif); letter-spacing: 0.14em; color: var(--gold-bright); }
.paywall p { font-size: 13px; color: var(--cream-soft); }
.price-line {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 13px 0; border-top: 1px dashed rgba(212, 175, 55, 0.3); flex-wrap: wrap;
}
.price-line b { font: 700 20px/1 var(--serif); color: var(--gold-bright); }
.price-line small { font: 12px/1 var(--sans); color: var(--gold-dim); }
.price-line div { display: flex; align-items: center; gap: 16px; }
.pay-links { margin-top: 40px; }
.pay-links a { color: var(--gold-bright); font-size: 13px; }

.order-box, .result-box { margin-top: 30px; border-top: 1px solid var(--gold); padding-top: 18px; font-size: 13px; color: var(--cream-soft); }
.order-box b { font-family: var(--serif); color: var(--gold-bright); }

.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: var(--red-deep); color: var(--cream); border: 1px solid var(--gold);
  padding: 11px 22px; font-size: 13px; max-width: min(86vw, 520px); z-index: 9;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
  .fields { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grade-row { flex-direction: column; align-items: flex-start; }
  .title-row { gap: 12px; }
  .double-seal { width: 50px; height: 50px; }
  .double-seal span { font-size: 27px; }
}
