:root {
  --paper: #f3ede1;
  --paper-deep: #ede4d5;
  --cream: #fbf7ee;
  --cream-bright: #fffdf8;
  --ink: #211c16;
  --ink-soft: #4c4236;
  --muted: #6a5e4e;
  --faint: #75685a;
  --line: #d9cbb5;
  --line-strong: #c9b89e;
  --accent: #a93b2b;
  --accent-dark: #872b1e;
  --accent-soft: rgba(169, 59, 43, 0.09);
  --gold: #825e2c;
  --green: #476b53;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow-soft: 0 18px 50px rgba(80, 58, 30, 0.07);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 12px 35px rgba(80, 58, 30, 0.055);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 620px at 84% -8%, rgba(176, 138, 79, 0.15), transparent 62%),
    radial-gradient(900px 560px at -8% 28%, rgba(169, 59, 43, 0.065), transparent 62%),
    repeating-linear-gradient(0deg, rgba(92, 70, 38, 0.018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 5px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  color: #fff;
  background: rgba(169, 59, 43, 0.82);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 34px 34px;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-seal {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #faf3e5;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 40%),
    var(--accent);
  border-radius: 4px;
  border: 1px solid rgba(92, 29, 20, 0.35);
  box-shadow: 0 4px 12px rgba(121, 45, 32, 0.16), inset 0 0 0 2px rgba(255, 244, 225, 0.16);
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
  letter-spacing: -0.08em;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.brand-sub {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.header-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.header-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(162, 124, 70, 0.12);
}

main {
  flex: 1;
}

/* Typography bits */
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.intro {
  padding: clamp(44px, 7vw, 82px) 0 0;
  max-width: 820px;
}

.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.intro h1 em {
  position: relative;
  color: var(--accent);
  font-style: normal;
  white-space: nowrap;
}

.intro h1 em::after {
  content: "";
  position: absolute;
  left: 1%;
  right: -1%;
  bottom: 0.08em;
  height: 0.11em;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(169, 59, 43, 0.07), rgba(169, 59, 43, 0.38), rgba(169, 59, 43, 0.03));
  transform: rotate(-0.6deg);
}

.lede {
  max-width: 660px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.95;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.btn-primary {
  color: #fffaf1;
  background: linear-gradient(180deg, #b04434, var(--accent));
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(151, 52, 39, 0.17);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #a53e2f, var(--accent-dark));
  border-color: var(--accent-dark);
}

.btn-primary:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  color: var(--ink-soft);
  background: rgba(255, 253, 247, 0.5);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--cream-bright);
}

.btn-small {
  min-height: 36px;
  padding: 7px 13px;
  font-size: 12px;
}

/* Input desk */
.compose {
  padding-bottom: 22px;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: clamp(30px, 4.5vw, 46px);
}

.input-card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 252, 245, 0.76);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(2px);
}

.input-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 22px;
  width: 38px;
  height: 2px;
  background: var(--accent);
  opacity: 0.8;
}

.input-card-wide {
  grid-column: 1 / -1;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.card-head label {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.count {
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.count.is-over {
  color: var(--accent);
  font-weight: 700;
}

.hint {
  margin: 7px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

textarea {
  display: block;
  width: 100%;
  min-height: 218px;
  padding: 16px 17px;
  color: var(--ink);
  background: var(--cream-bright);
  border: 1px solid #e1d5c2;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.82;
  resize: vertical;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input-card-wide textarea {
  min-height: 254px;
}

textarea::placeholder {
  color: #b3a795;
}

textarea:hover {
  border-color: var(--line-strong);
}

textarea:focus {
  outline: none;
  border-color: rgba(169, 59, 43, 0.7);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fffefa;
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.privacy-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.lock-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(71, 107, 83, 0.11);
}

.submit-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.total-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.total-count.is-over {
  color: var(--accent);
  font-weight: 600;
}

.shortcut-hint {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 11px;
  text-align: right;
}

.form-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 12px;
  text-align: right;
}

/* Loading / center panels */
.center-panel {
  width: min(540px, 100%);
  margin: clamp(62px, 10vh, 110px) auto 0;
  padding: clamp(34px, 5vw, 54px);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 252, 246, 0.8);
  box-shadow: var(--shadow-soft);
}

.center-panel h2 {
  margin: 4px 0 12px;
  font-family: var(--serif);
  font-size: clamp(25px, 3.3vw, 34px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.center-panel p {
  max-width: 420px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.ink-spinner {
  width: 54px;
  height: 54px;
  margin: 0 auto 20px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.ink-spinner span {
  display: block;
  width: 5px;
  border-radius: 999px;
  background: var(--accent);
  animation: ink-bars 1.2s ease-in-out infinite;
}

.ink-spinner span:nth-child(1) {
  height: 15px;
  animation-delay: -0.24s;
}

.ink-spinner span:nth-child(2) {
  height: 30px;
  animation-delay: -0.12s;
}

.ink-spinner span:nth-child(3) {
  height: 21px;
}

@keyframes ink-bars {
  0%, 100% { transform: scaleY(0.55); opacity: 0.45; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* Access gate */
.gate-panel {
  width: min(520px, 100%);
  margin: clamp(50px, 9vh, 96px) auto 0;
  padding: clamp(34px, 5vw, 56px);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 252, 246, 0.84);
  box-shadow: var(--shadow-soft);
}

.gate-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(169, 59, 43, 0.35);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 27px;
  background: rgba(169, 59, 43, 0.04);
}

.gate-panel h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.5vw, 35px);
  font-weight: 600;
}

.gate-lede {
  max-width: 370px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.gate-form {
  display: flex;
  gap: 10px;
  max-width: 390px;
  margin: 0 auto;
}

.gate-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--cream-bright);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  outline: none;
}

.gate-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gate-panel .form-error {
  text-align: center;
  margin-top: 12px;
}

/* Progress */
.progress-panel {
  width: min(680px, 100%);
  margin: clamp(48px, 8vh, 90px) auto 0;
  padding: clamp(38px, 6vw, 64px);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background:
    radial-gradient(440px 260px at 50% 0%, rgba(169, 59, 43, 0.045), transparent 70%),
    rgba(255, 252, 246, 0.82);
  box-shadow: var(--shadow-soft);
}

.ink-bloom {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
}

.ink-core {
  width: 50px;
  height: 50px;
  border-radius: 48% 52% 55% 45% / 50% 44% 56% 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.16), transparent 45%),
    radial-gradient(circle at 50% 50%, #3b332a 0 34%, #17130f 72%);
  box-shadow: 0 8px 24px rgba(28, 22, 17, 0.22);
  animation: ink-breathe 3.4s ease-in-out infinite;
}

.ink-ring {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(169, 59, 43, 0.36);
  border-radius: 50%;
  animation: ink-ripple 3.4s ease-out infinite;
}

@keyframes ink-breathe {
  0%, 100% { transform: scale(0.96) rotate(-2deg); }
  50% { transform: scale(1.04) rotate(2deg); }
}

@keyframes ink-ripple {
  0% { transform: scale(0.62); opacity: 0.8; }
  75%, 100% { transform: scale(1.25); opacity: 0; }
}

.progress-panel h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.8vw, 38px);
  font-weight: 600;
}

.progress-panel > p {
  max-width: 470px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.progress-track {
  position: relative;
  width: min(290px, 75%);
  height: 2px;
  margin: 30px auto 16px;
  overflow: hidden;
  background: rgba(125, 112, 96, 0.16);
}

.progress-track span {
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: progress-slide 1.9s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(340%); }
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.progress-meta #jobRef {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.progress-note {
  margin-top: 26px !important;
  color: var(--faint) !important;
  font-size: 11px !important;
}

/* Result */
.result-shell {
  width: min(920px, 100%);
  margin: clamp(34px, 5vw, 54px) auto 0;
}

.result-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-toolbar h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 38px);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manuscript {
  position: relative;
  margin-top: 24px;
  padding: clamp(30px, 6vw, 66px);
  color: #262019;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 150px),
    var(--cream-bright);
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 24px 60px rgba(80, 58, 30, 0.075);
  font-family: var(--serif);
  font-size: clamp(17px, 1.55vw, 19px);
  line-height: 2.08;
  letter-spacing: 0.015em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.manuscript::before {
  content: "";
  position: absolute;
  top: 0;
  left: clamp(30px, 6vw, 66px);
  width: 56px;
  height: 2px;
  background: var(--accent);
  opacity: 0.75;
}

.char-count {
  margin: 12px 2px 0;
  color: var(--faint);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.inputs-review {
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.inputs-review summary {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  width: fit-content;
}

.inputs-review summary:hover {
  color: var(--accent);
}

.review-grid {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.review-block {
  padding: 16px 18px;
  background: rgba(255, 252, 245, 0.6);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.review-block h3 {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.review-block pre {
  max-height: 260px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.8;
}

/* Failure */
.failure-panel {
  border-color: rgba(169, 59, 43, 0.2);
}

.job-ref {
  color: var(--faint) !important;
  font-family: var(--mono);
  font-size: 10px !important;
  letter-spacing: 0.05em;
}

.failure-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Footer */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 54px;
  padding-top: 22px;
  border-top: 1px solid rgba(217, 203, 181, 0.7);
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.footer-sep {
  opacity: 0.6;
}

/* Toast */
.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 28px;
  max-width: min(90vw, 420px);
  padding: 11px 18px;
  color: #fdf8ee;
  background: rgba(33, 28, 22, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  box-shadow: 0 12px 30px rgba(20, 15, 10, 0.22);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: rgba(126, 39, 28, 0.96);
}

/* Responsive */
@media (max-width: 860px) {
  .page-shell {
    padding: 0 22px 28px;
  }

  .site-header {
    min-height: 80px;
  }

  .header-note {
    display: none;
  }

  .input-grid {
    grid-template-columns: 1fr;
  }

  .input-card-wide {
    grid-column: auto;
  }

  .compose-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .submit-row {
    width: 100%;
    justify-content: space-between;
  }

  .shortcut-hint {
    text-align: left;
  }

  .result-toolbar {
    align-items: flex-start;
  }

  .toolbar-actions {
    width: 100%;
  }

  .toast {
    bottom: 18px;
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding: 0 16px 24px;
  }

  .brand-seal {
    width: 41px;
    height: 41px;
    font-size: 22px;
  }

  .brand-name {
    font-size: 21px;
  }

  .brand-sub {
    font-size: 9px;
    letter-spacing: 0.13em;
  }

  .intro {
    padding-top: 38px;
  }

  .intro h1 {
    font-size: 31px;
    line-height: 1.38;
  }

  .intro h1 em {
    white-space: normal;
  }

  .lede {
    font-size: 13px;
  }

  .input-card {
    padding: 18px;
  }

  .input-card::before {
    left: 18px;
  }

  textarea {
    min-height: 190px;
    padding: 14px;
    font-size: 13px;
  }

  .input-card-wide textarea {
    min-height: 220px;
  }

  .submit-row {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
  }

  .submit-row .btn {
    width: 100%;
  }

  .total-count {
    text-align: center;
  }

  .form-error {
    text-align: left;
  }

  .gate-form {
    flex-direction: column;
  }

  .gate-form .btn {
    width: 100%;
  }

  .manuscript {
    padding: 26px 20px;
    font-size: 17px;
    line-height: 1.98;
  }

  .manuscript::before {
    left: 20px;
  }

  .progress-meta {
    flex-direction: column;
    gap: 6px;
  }

  .progress-meta #jobRef {
    padding-left: 0;
    border-left: 0;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar-actions .btn:last-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .site-footer,
  .result-toolbar,
  .char-count,
  .inputs-review,
  .toast {
    display: none !important;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .result-shell {
    margin: 0;
    width: 100%;
  }

  .manuscript {
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
    font-size: 12pt;
    line-height: 1.9;
  }

  .manuscript::before {
    display: none;
  }
}


/* ============================================================
 * 设计统一层：表单 / 卡片 / 表格 / 动效
 * ============================================================ */

:root {
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ring: 0 0 0 3px var(--accent-soft);
}

html {
  scroll-behavior: smooth;
}

body {
  background-attachment: fixed;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(146, 122, 88, 0.32);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(146, 122, 88, 0.5);
  background-clip: padding-box;
}

/* 顶栏：滚动时保持可见 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0 4px;
  background: linear-gradient(180deg, rgba(243, 237, 225, 0.94), rgba(243, 237, 225, 0.82));
  backdrop-filter: blur(12px) saturate(1.1);
  transition: box-shadow 220ms var(--ease), border-color 220ms var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line-strong);
  box-shadow: 0 12px 28px -22px rgba(70, 48, 20, 0.55);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ---------- 表单原子 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  text-align: left;
}

.field-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.field-hint {
  margin: 8px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.7;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--cream-bright);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  outline: none;
  font-family: var(--sans);
  font-size: 13.5px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
}

.field input:hover,
.field select:hover {
  border-color: var(--gold);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.field-with-action {
  position: relative;
  display: block;
}

.field-with-action input {
  padding-right: 62px;
}

.field-action {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  min-height: 32px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}

.field-action:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.field-inline {
  flex: 1;
  min-width: 160px;
}

.field-inline select {
  min-height: 42px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.btn.is-busy {
  pointer-events: none;
}

.divider {
  position: relative;
  margin: 22px 0 18px;
  text-align: center;
}

.divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.divider span {
  position: relative;
  padding: 0 12px;
  color: var(--faint);
  background: rgba(255, 252, 246, 0.94);
  font-size: 10px;
  letter-spacing: 0.2em;
}

/* ---------- 登录 / 绑定 ---------- */

.auth-panel,
.bind-panel {
  width: min(560px, 100%);
  padding: clamp(30px, 4.4vw, 46px);
  text-align: left;
}

.auth-panel h2,
.bind-panel h2 {
  font-size: clamp(24px, 3vw, 30px);
}

.auth-card {
  display: flex;
  flex-direction: column;
}

.auth-seal {
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid rgba(169, 59, 43, 0.32);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 25px;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.9), rgba(169, 59, 43, 0.06));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.55);
}

.auth-panel .gate-lede,
.bind-panel .gate-lede {
  max-width: none;
  margin: 0 0 24px;
  text-align: left;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--paper-deep);
  border-radius: var(--radius-pill);
}

.auth-tab {
  padding: 9px 0;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  transition: color 160ms var(--ease), background-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.auth-tab:hover {
  color: var(--ink-soft);
}

.auth-tab.is-active {
  color: #fffaf1;
  background: linear-gradient(180deg, #b04434, var(--accent));
  box-shadow: 0 6px 16px -8px rgba(151, 52, 39, 0.7);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-panel .form-error,
.bind-panel .form-error {
  min-height: 18px;
  margin: 12px 0 0;
  text-align: left;
}

.wechat-login-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.wechat-login-box:empty,
.wechat-login-qr:empty {
  display: none;
}

.wechat-login-status {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
  text-align: center;
}

.steps {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.steps li span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--muted);
  background: var(--paper-deep);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 10.5px;
}

.steps li.is-active {
  color: var(--ink);
  border-color: rgba(169, 59, 43, 0.3);
  background: var(--accent-soft);
}

.steps li.is-active span {
  color: #fffaf1;
  background: var(--accent);
}

.bind-qr-box {
  display: flex;
  justify-content: center;
  min-height: 40px;
  margin-bottom: 14px;
}

.bind-status {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
  text-align: center;
}

.bind-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.qr-image {
  display: block;
  width: 208px;
  height: 208px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  image-rendering: pixelated;
}

/* ---------- 账户弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 27, 17, 0.42);
  backdrop-filter: blur(4px);
  animation: fade-in 200ms var(--ease);
}

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(780px, 100%);
  max-height: min(88vh, 860px);
  overflow: hidden;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px -30px rgba(52, 36, 16, 0.45);
  animation: sheet-in 240ms var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes sheet-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-head-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.modal-head h2 {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.modal-seal {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--accent);
  border: 1px solid rgba(169, 59, 43, 0.3);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 19px;
  background: rgba(169, 59, 43, 0.05);
}

.icon-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 14px;
  transition: all 150ms var(--ease);
}

.icon-close:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(169, 59, 43, 0.2);
}

.account-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(169, 59, 43, 0.07), transparent 60%),
    linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(247, 241, 231, 0.75));
  border-bottom: 1px solid var(--line);
}

.hero-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero-label {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

.hero-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.hero-value {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.hero-unit {
  color: var(--gold);
  font-size: 13px;
}

.hero-hint {
  color: var(--muted);
  font-size: 11.5px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.hero-chip {
  padding: 5px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 11px;
  white-space: nowrap;
}

.hero-chip.is-good {
  color: var(--green);
  border-color: rgba(71, 107, 83, 0.32);
  background: rgba(71, 107, 83, 0.08);
}

.account-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 24px 0;
  border-bottom: 1px solid var(--line);
}

.account-tab {
  position: relative;
  padding: 10px 4px 12px;
  margin-right: 22px;
  color: var(--muted);
  background: transparent;
  border: none;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  transition: color 160ms var(--ease);
}

.account-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background-color 180ms var(--ease);
}

.account-tab:hover {
  color: var(--ink-soft);
}

.account-tab.is-active {
  color: var(--ink);
  font-weight: 600;
}

.account-tab.is-active::after {
  background: var(--accent);
}

.account-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 28px;
}

.account-section-title {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.account-body section > .account-section-title:not(:first-child) {
  margin-top: 26px;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
  text-align: left;
  background: var(--cream-bright);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.plan-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

.plan-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.plan-badge {
  position: absolute;
  top: -9px;
  right: 12px;
  padding: 2px 9px;
  color: #fffaf1;
  background: linear-gradient(180deg, #b04434, var(--accent));
  border-radius: var(--radius-pill);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.plan-name {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
}

.plan-price {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
}

.plan-points {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11.5px;
}

.plan-desc {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.plan-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 26px;
  color: var(--faint);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.pay-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pay-qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 20px;
  background: var(--cream-bright);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  animation: fade-in 220ms var(--ease);
}

.pay-qr-title {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  text-align: center;
}

.pay-qr-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.redeem-row,
.password-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.redeem-row input,
.password-row input {
  flex: 1;
  min-width: 170px;
  min-height: 42px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--cream-bright);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  outline: none;
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

.redeem-row input:focus,
.password-row input:focus {
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.table-wrap {
  overflow: auto;
  max-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream-bright);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11.5px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--paper-deep);
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(217, 203, 181, 0.55);
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background: rgba(237, 228, 213, 0.28);
}

.data-table tbody tr:hover {
  background: rgba(169, 59, 43, 0.045);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.table-empty {
  padding: 26px 12px !important;
  color: var(--faint);
  text-align: center;
}

.account-security {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--cream-bright);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-size: 12.5px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
  .page-shell {
    padding: 0 18px 26px;
  }

  .site-header {
    min-height: 76px;
    gap: 12px;
  }

  .brand-sub {
    display: none;
  }

  .header-note {
    display: none;
  }

  .account-name {
    max-width: 84px;
  }

  .modal {
    padding: 0;
    place-items: end stretch;
  }

  .modal-card {
    width: 100%;
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .account-hero {
    padding: 16px 18px;
  }

  .hero-value {
    font-size: 30px;
  }

  .hero-side {
    align-items: flex-start;
  }

  .account-tabs {
    padding: 8px 18px 0;
  }

  .account-tab {
    margin-right: 16px;
    font-size: 12px;
  }

  .account-body {
    padding: 16px 18px 24px;
  }

  .modal-head {
    padding: 14px 18px;
  }

  .qr-image {
    width: 176px;
    height: 176px;
  }

  .steps li {
    font-size: 11px;
    padding: 8px 10px;
  }

  .redeem-row input,
  .password-row input {
    min-width: 100%;
  }

  .pay-row .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 顶栏账号区 ---------- */

.account-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 14px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), background-color 160ms var(--ease);
}

.account-chip:hover {
  border-color: var(--gold);
  background: var(--cream-bright);
  box-shadow: var(--shadow-card);
}

.account-name {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.account-points {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding-left: 10px;
  color: var(--gold);
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10.5px;
}

.account-points strong {
  font-size: 13px;
  font-weight: 600;
}

/* ---------- 创作台微调 ---------- */

.input-card {
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease), transform 200ms var(--ease);
}

.input-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-card);
}

.input-card:focus-within {
  border-color: rgba(169, 59, 43, 0.42);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-card);
}

.compose-footer {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 20px;
  padding: 14px 0 10px;
  background: linear-gradient(180deg, rgba(243, 237, 225, 0), rgba(243, 237, 225, 0.92) 34%, rgba(243, 237, 225, 0.98));
  backdrop-filter: blur(6px);
}

.total-count {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  transition: color 160ms var(--ease);
}

.total-count.is-over {
  color: var(--accent);
  font-weight: 600;
}

.form-error {
  min-height: 18px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1.7;
}

.toast {
  border-radius: var(--radius-md);
  box-shadow: 0 18px 44px -20px rgba(52, 36, 16, 0.55);
}

@media (max-width: 720px) {
  .compose-footer {
    padding: 12px 0 8px;
  }

  .submit-row {
    width: 100%;
    justify-content: space-between;
  }

  .account-chip {
    padding: 6px 10px;
    gap: 6px;
  }

  .account-points {
    padding-left: 6px;
  }
}


.billing-note {
  color: var(--gold);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}

.billing-note.is-warn {
  color: var(--accent);
  font-weight: 600;
}

.submit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}


/* ---------- 微信短码（未认证号 / 不用扫码） ---------- */

.wechat-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 20px;
  background: var(--cream-bright);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  text-align: center;
}

.wechat-code-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.wechat-code-value {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
  user-select: all;
}

.wechat-code-tip {
  color: var(--faint);
  font-size: 11px;
  line-height: 1.7;
}

/* ---------- 每日签到 ---------- */

.checkin-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(162, 124, 70, 0.12), transparent 60%),
    var(--cream-bright);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}

.checkin-card.is-done {
  background: rgba(71, 107, 83, 0.06);
  border-color: rgba(71, 107, 83, 0.28);
}

.checkin-card.is-locked {
  background: rgba(169, 59, 43, 0.05);
  border-color: rgba(169, 59, 43, 0.24);
}

.checkin-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.checkin-head strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
}

.checkin-sub {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.checkin-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.checkin-tip {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- 关注公众号引导 ---------- */

.follow-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 16px;
  background: var(--cream-bright);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
}

.follow-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.follow-card .qr-image {
  width: 160px;
  height: 160px;
}

.follow-name {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}
