[hidden] { display: none !important; }

:root {
  --bg-deep: #081210;
  --bg-pine: #0f1f1b;
  --bg-card: rgba(16, 30, 27, 0.76);
  --bg-card-strong: rgba(19, 36, 32, 0.92);
  --border-subtle: rgba(232, 184, 109, 0.16);
  --border-gold: rgba(232, 184, 109, 0.38);

  --gold: #e8b86d;
  --gold-bright: #f6d79d;
  --gold-muted: #b8945e;
  --wax-red: #9f2a36;
  --wax-red-bright: #be3543;
  --wax-red-dark: #6f1a23;

  --text-primary: #f4efe6;
  --text-secondary: #c2cbc5;
  --text-muted: #8b9a92;

  --paper-cream: #f7f0e2;
  --paper-ink: #2b241d;
  --paper-ink-soft: #64584c;

  --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', Georgia, serif;
  --font-display: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-card: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 240, 210, 0.08);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: var(--font-serif);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(34, 72, 60, 0.45), transparent 65%),
    radial-gradient(900px 600px at 90% 25%, rgba(159, 42, 54, 0.14), transparent 60%),
    radial-gradient(800px 600px at 10% 80%, rgba(232, 184, 109, 0.1), transparent 60%),
    linear-gradient(180deg, #07100e 0%, #0b1815 48%, #07100f 100%);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  line-height: 1.7;
}

/* 飘雪画布与氛围层 */
#snowCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.ambient-glow--top {
  width: 460px;
  height: 460px;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(232, 184, 109, 0.22), transparent 70%);
}

.ambient-glow--bottom {
  width: 520px;
  height: 520px;
  bottom: -220px;
  right: -120px;
  background: radial-gradient(circle, rgba(159, 42, 54, 0.2), transparent 70%);
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page-shell {
  position: relative;
  z-index: 3;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}

/* 顶部栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand__seal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--wax-red-bright), var(--wax-red-dark));
  border: 1px solid rgba(246, 215, 157, 0.35);
  color: var(--gold-bright);
  font-size: 18px;
  box-shadow: 0 8px 20px rgba(159, 42, 54, 0.4);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
}

.brand__sub {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--gold-muted);
  margin-top: 2px;
}

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

.icon-pill,
.ghost-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 248, 236, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.icon-pill:hover,
.ghost-pill:hover {
  border-color: var(--border-gold);
  color: var(--gold-bright);
  background: rgba(232, 184, 109, 0.08);
}

.icon-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  transition: opacity 0.25s;
}

.icon-pill[aria-pressed='false'] .icon-pill__dot {
  opacity: 0.25;
  box-shadow: none;
}

/* Hero */
.hero {
  text-align: center;
  padding: 18px 0 34px;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 18px;
}

.eyebrow-line {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hero__title {
  margin: 0;
  font-size: clamp(30px, 5.6vw, 52px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}

.hero__title em {
  font-style: normal;
  color: var(--gold-bright);
  position: relative;
  display: inline-block;
}

.hero__title em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.65;
}

.hero__lead {
  max-width: 620px;
  margin: 18px auto 30px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.85;
}

.hero__lead strong {
  color: var(--gold-bright);
  font-weight: 600;
}

/* 倒计时面板 */
.countdown-panel {
  max-width: 560px;
  margin: 0 auto 30px;
  padding: 18px 22px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(22, 41, 36, 0.72), rgba(13, 25, 22, 0.85));
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
}

.countdown-panel__header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--gold-muted);
  margin-bottom: 12px;
}

.lantern-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(232, 184, 109, 0.9);
  animation: lanternPulse 2.6s ease-in-out infinite;
}

@keyframes lanternPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.15); }
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.countdown-cell {
  min-width: 66px;
  padding: 8px 6px;
  border-radius: 12px;
  background: rgba(7, 15, 13, 0.55);
  border: 1px solid rgba(232, 184, 109, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-cell__num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--gold-bright);
  letter-spacing: 0.04em;
}

.countdown-cell__unit {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.countdown-sep {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--gold-muted);
  opacity: 0.65;
}

.stats-strip {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(232, 184, 109, 0.1);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.stats-strip strong {
  color: var(--gold);
  font-weight: 600;
}

/* 顶部模式切换 */
.mode-tabs {
  display: inline-flex;
  padding: 5px;
  border-radius: 999px;
  background: rgba(11, 22, 19, 0.85);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-serif);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.mode-tab:hover {
  color: var(--text-primary);
}

.mode-tab.is-active {
  background: linear-gradient(135deg, rgba(232, 184, 109, 0.22), rgba(159, 42, 54, 0.28));
  color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px rgba(232, 184, 109, 0.4), 0 6px 18px rgba(0, 0, 0, 0.3);
}

/* 视图切换容器 */
.panel-stage {
  display: none;
  animation: fadeSlideUp 0.5s var(--ease-out);
}

.panel-stage.is-visible {
  display: block;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 通用卡片 */
.composer-card,
.receipt-card,
.lookup-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.composer-card + .composer-card {
  margin-top: 22px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 22px;
}

.section-heading__step {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-bright);
  background: rgba(232, 184, 109, 0.12);
  border: 1px solid var(--border-gold);
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.section-heading p {
  margin: 4px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
}

/* 身份标识输入区 */
.identity-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}

.identity-box {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(8, 17, 15, 0.62);
  border: 1px solid rgba(232, 184, 109, 0.13);
}

.identity-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.identity-tag {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.08);
  color: var(--text-primary);
}

.identity-tag--gold {
  background: rgba(232, 184, 109, 0.16);
  color: var(--gold-bright);
}

.identity-hint {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
}

.identity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clue-item {
  padding: 12px;
  border-radius: 12px;
  background: rgba(14, 27, 24, 0.72);
  border: 1px solid rgba(232, 184, 109, 0.14);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clue-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.clue-item__index {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--gold-muted);
  letter-spacing: 0.06em;
}

.clue-remove-btn {
  border: none;
  background: transparent;
  color: #e69aa1;
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.clue-remove-btn:hover {
  background: rgba(159, 42, 54, 0.2);
}

.type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.type-pill {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.type-pill:hover {
  border-color: var(--border-gold);
}

.type-pill.is-selected {
  background: rgba(232, 184, 109, 0.18);
  border-color: var(--gold);
  color: var(--gold-bright);
  font-weight: 600;
}

.clue-dual-inputs {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 8px;
}

.clue-note {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
}

.add-clue-btn {
  margin-top: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(232, 184, 109, 0.34);
  background: rgba(232, 184, 109, 0.04);
  color: var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.add-clue-btn:hover:not(:disabled) {
  background: rgba(232, 184, 109, 0.12);
  border-color: var(--gold);
}

.add-clue-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.add-clue-btn__count {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold-muted);
}

/* 一人一信设备提醒横幅 */
.device-limit-banner {
  margin-bottom: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(44, 36, 22, 0.82), rgba(18, 33, 29, 0.88));
  border: 1px solid rgba(232, 184, 109, 0.42);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
}

.device-limit-banner[hidden] {
  display: none;
}

.device-limit-banner strong {
  display: block;
  font-size: 15px;
  color: var(--gold-bright);
  margin-bottom: 3px;
}

.device-limit-banner span {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* 默契问题护盾设置 */
.guard-setup,
.edit-guard-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(8, 17, 15, 0.6);
  border: 1px solid rgba(232, 184, 109, 0.2);
}

.edit-guard-box {
  margin-top: 4px;
  padding: 14px;
}

.guard-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.guard-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.guard-toggle__box {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--border-gold);
  background: rgba(7, 15, 13, 0.8);
  display: grid;
  place-items: center;
  transition: all 0.2s;
}

.guard-toggle input:checked + .guard-toggle__box {
  background: var(--gold);
  border-color: var(--gold);
}

.guard-toggle input:checked + .guard-toggle__box::after {
  content: '✓';
  color: #1c140a;
  font-size: 13px;
  font-weight: 700;
}

.guard-toggle__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guard-toggle__text strong {
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--gold-bright);
}

.guard-toggle__text span {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

.guard-fields {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.guard-fields[hidden],
.edit-row[hidden] {
  display: none;
}

/* 平安夜默契问题答题卡 */
.guard-challenge {
  margin-top: 24px;
  padding: 26px 24px;
  border-radius: var(--radius-md);
  background: linear-gradient(155deg, rgba(24, 42, 36, 0.9), rgba(11, 22, 19, 0.94));
  border: 1px solid rgba(232, 184, 109, 0.45);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.48);
  text-align: center;
}

.guard-challenge__badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(232, 184, 109, 0.14);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 12px;
  margin-bottom: 10px;
}

.guard-challenge h4 {
  margin: 0;
  font-size: 19px;
}

.guard-challenge__question {
  margin: 16px auto 20px;
  max-width: 520px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(7, 15, 13, 0.65);
  border: 1px dashed rgba(232, 184, 109, 0.32);
  font-size: 17px;
  color: var(--gold-bright);
  line-height: 1.7;
}

.guard-challenge__form {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
}

.guard-challenge__form input {
  flex: 1;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid rgba(232, 184, 109, 0.3);
  background: rgba(5, 11, 10, 0.78);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.guard-challenge__form input:focus {
  border-color: var(--gold);
}

.guard-challenge__meta {
  margin: 12px 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

.verified-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(45, 138, 94, 0.18);
  border: 1px solid rgba(59, 170, 116, 0.45);
  color: #206b48;
  font-size: 11px;
  font-weight: 600;
}

.stationery--aurora .verified-pill {
  color: #8ee2b6;
  background: rgba(56, 148, 104, 0.22);
}

.identity-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gold);
  opacity: 0.7;
}

.identity-bridge__line {
  width: 1px;
  height: 36px;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
}

.field-wrap input,
.field-wrap textarea,
.lookup-input-row input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(232, 184, 109, 0.2);
  background: rgba(5, 11, 10, 0.72);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field-wrap input:focus,
.field-wrap textarea:focus,
.lookup-input-row input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 184, 109, 0.14);
}

/* 信纸主题选择器 */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 17, 15, 0.55);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
}

.theme-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-gold);
}

.theme-card.is-selected {
  border-color: var(--gold);
  background: rgba(232, 184, 109, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.theme-card__swatch {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.theme-card__swatch--pine {
  background: linear-gradient(90deg, #1b4332, #d8b26e);
}

.theme-card__swatch--hearth {
  background: linear-gradient(90deg, #7f1d28, #e4b483);
}

.theme-card__swatch--aurora {
  background: linear-gradient(90deg, #1a2a4a, #8ecae6, #d9c5a0);
}

.theme-card__name {
  font-size: 14px;
  font-weight: 600;
}

.theme-card__desc {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
}

/* 复古信笺纸张 */
.stationery {
  position: relative;
  border-radius: var(--radius-md);
  padding: 26px 28px 22px;
  color: var(--paper-ink);
  transition: background 0.35s, border-color 0.35s, color 0.35s;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
}

.stationery--pine {
  background:
    radial-gradient(circle at 95% 8%, rgba(45, 92, 74, 0.13), transparent 42%),
    linear-gradient(180deg, #f8f2e6 0%, #efe6d4 100%);
  border: 1px solid rgba(196, 158, 97, 0.55);
}

.stationery--hearth {
  background:
    radial-gradient(circle at 92% 10%, rgba(159, 42, 54, 0.12), transparent 45%),
    linear-gradient(180deg, #fbf1e7 0%, #f1e0d0 100%);
  border: 1px solid rgba(173, 92, 82, 0.45);
}

.stationery--aurora {
  background:
    radial-gradient(circle at 88% 8%, rgba(74, 128, 168, 0.18), transparent 45%),
    linear-gradient(180deg, #132033 0%, #0d1726 100%);
  border: 1px solid rgba(174, 206, 232, 0.34);
  color: #edf3f8;
}

.stationery__ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.24em;
  opacity: 0.55;
  margin-bottom: 18px;
}

.stationery__salutation {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 14px;
}

.stationery__salutation input,
.stationery__signoff input {
  flex: 1;
  min-width: 140px;
  border: none;
  border-bottom: 1px dashed currentColor;
  background: transparent;
  color: inherit;
  font-family: var(--font-serif);
  font-size: 16px;
  padding: 4px 4px;
  outline: none;
  opacity: 0.9;
}

.stationery__salutation input::placeholder,
.stationery__signoff input::placeholder,
.stationery__body textarea::placeholder {
  color: currentColor;
  opacity: 0.42;
}

.stationery__body textarea {
  width: 100%;
  border: none;
  background: transparent;
  color: inherit;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 2;
  resize: vertical;
  min-height: 170px;
  outline: none;
  background-image: linear-gradient(transparent 31px, rgba(140, 120, 95, 0.18) 32px);
  background-size: 100% 32px;
}

.stationery--aurora .stationery__body textarea {
  background-image: linear-gradient(transparent 31px, rgba(174, 206, 232, 0.14) 32px);
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 12px 0 18px;
  padding-top: 10px;
  border-top: 1px solid rgba(140, 120, 95, 0.16);
}

.prompt-chips__title {
  font-family: var(--font-sans);
  font-size: 11px;
  opacity: 0.65;
}

.prompt-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  opacity: 0.68;
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
}

.prompt-chip:hover {
  opacity: 1;
  transform: translateY(-1px);
}

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

.char-counter {
  font-family: var(--font-sans);
  font-size: 12px;
  opacity: 0.6;
}

.stationery__signoff {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  min-width: 240px;
}

/* 按钮体系 */
.submit-bar {
  margin-top: 24px;
  text-align: center;
}

.wax-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 34px;
  border-radius: 999px;
  border: 1px solid rgba(246, 215, 157, 0.45);
  background: linear-gradient(135deg, var(--wax-red-bright), var(--wax-red-dark));
  color: #fff6e9;
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(159, 42, 54, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), filter 0.25s;
}

.wax-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(190, 53, 67, 0.56);
  filter: brightness(1.06);
}

.wax-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wax-button__seal {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(246, 215, 157, 0.18);
  color: var(--gold-bright);
  font-size: 14px;
}

.submit-note {
  margin: 12px 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

.gold-btn,
.outline-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
}

.gold-btn {
  border: 1px solid rgba(246, 215, 157, 0.55);
  background: linear-gradient(135deg, #e8b86d, #c99247);
  color: #1c140a;
  box-shadow: 0 8px 22px rgba(232, 184, 109, 0.25);
}

.gold-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.gold-btn--full,
.outline-btn--full {
  width: 100%;
}

.outline-btn {
  border: 1px solid var(--border-gold);
  background: rgba(232, 184, 109, 0.06);
  color: var(--gold-bright);
}

.outline-btn:hover {
  background: rgba(232, 184, 109, 0.14);
}

.danger-btn {
  border: 1px solid rgba(220, 88, 98, 0.45);
  background: rgba(159, 42, 54, 0.16);
  color: #f4a4ab;
}

.danger-btn:hover {
  background: rgba(159, 42, 54, 0.3);
}

.text-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
}

.text-link:hover {
  color: var(--gold-bright);
}

/* 错误提示 */
.form-feedback {
  margin-top: 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: #f59fa6;
  min-height: 20px;
}

/* 回执 & 海报工作室 */
.receipt-card {
  text-align: center;
}

.receipt-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 32% 30%, var(--wax-red-bright), var(--wax-red-dark));
  border: 2px solid rgba(246, 215, 157, 0.5);
  box-shadow: 0 12px 30px rgba(159, 42, 54, 0.45);
  font-size: 26px;
  color: var(--gold-bright);
}

.receipt-badge.is-matched {
  background: radial-gradient(circle at 35% 30%, #ffe6ad, #c58833);
  color: #291806;
  box-shadow: 0 0 36px rgba(232, 184, 109, 0.65);
}

.receipt-title {
  margin: 0;
  font-size: 26px;
}

.receipt-desc {
  max-width: 540px;
  margin: 10px auto 22px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
}

.claim-vault {
  max-width: 520px;
  margin: 0 auto 30px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(7, 15, 13, 0.72);
  border: 1px solid var(--border-gold);
}

.claim-vault__label {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gold-muted);
  margin-bottom: 8px;
}

.claim-vault__code {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  margin-bottom: 16px;
  user-select: all;
}

.claim-vault__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.poster-studio {
  text-align: left;
  padding-top: 26px;
  border-top: 1px solid rgba(232, 184, 109, 0.15);
}

.poster-studio__intro h3 {
  margin: 0;
  font-size: 19px;
  color: var(--gold-bright);
}

.poster-studio__intro p {
  margin: 6px 0 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
}

.poster-studio__layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 24px;
  align-items: start;
}

.poster-preview-frame {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.5);
  background: #081210;
}

.poster-preview-frame canvas {
  display: block;
  width: 100%;
  height: auto;
}

.poster-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.poster-control-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.poster-quote-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.poster-quote-btn {
  text-align: left;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 15, 13, 0.52);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.55;
  cursor: pointer;
  transition: all 0.2s;
}

.poster-quote-btn.is-selected {
  border-color: var(--gold);
  background: rgba(232, 184, 109, 0.14);
  color: var(--text-primary);
}

.poster-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.receipt-footer {
  margin-top: 26px;
}

/* 查询区 */
.lookup-input-row {
  display: flex;
  gap: 10px;
}

.lookup-input-row input {
  flex: 1;
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.saved-codes {
  margin-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 12px;
}

.saved-codes__label {
  color: var(--text-muted);
}

.saved-codes__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.saved-code-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: rgba(232, 184, 109, 0.08);
  color: var(--gold-bright);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.saved-codes__clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
}

/* 状态横幅与星灯 */
.lookup-result {
  margin-top: 24px;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px;
  border-radius: var(--radius-md);
  background: rgba(7, 15, 13, 0.68);
  border: 1px solid var(--border-subtle);
}

.status-banner.is-matched {
  background: linear-gradient(135deg, rgba(44, 38, 22, 0.8), rgba(20, 36, 30, 0.82));
  border-color: rgba(232, 184, 109, 0.55);
  box-shadow: 0 0 36px rgba(232, 184, 109, 0.15);
}

.lantern-stage {
  position: relative;
  width: 68px;
  height: 44px;
  flex-shrink: 0;
}

.star-lamp {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  transform: translateY(-50%);
  transition: all 0.7s var(--ease-out);
}

.star-lamp--left {
  left: 8px;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(232, 184, 109, 0.85);
}

.star-lamp--right {
  right: 8px;
  background: rgba(180, 195, 188, 0.25);
  border: 1px dashed rgba(232, 184, 109, 0.35);
}

.status-banner.is-matched .star-lamp--left {
  left: 18px;
  background: #ffe9b5;
  box-shadow: 0 0 26px rgba(255, 224, 150, 1);
}

.status-banner.is-matched .star-lamp--right {
  right: 18px;
  border: none;
  background: #f5b971;
  box-shadow: 0 0 26px rgba(245, 185, 113, 1);
}

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.07);
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.status-banner__content h3 {
  margin: 0;
  font-size: 19px;
}

.status-banner__content p {
  margin: 5px 0 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
}

/* 开发模式预览条 */
.demo-preview-bar {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(232, 184, 109, 0.1);
  border: 1px dashed var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.demo-preview-bar strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--gold-bright);
}

.demo-preview-bar span {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
}

/* 火漆拆封信封 */
.envelope-ritual {
  margin-top: 24px;
  text-align: center;
}

.wax-envelope {
  position: relative;
  max-width: 460px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(160deg, #1b312b, #0e1d19);
  border: 1px solid rgba(232, 184, 109, 0.45);
  box-shadow: 0 26px 56px rgba(0, 0, 0, 0.55);
  padding: 36px 24px 30px;
}

.wax-envelope__flap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 76px;
  background: linear-gradient(180deg, rgba(232, 184, 109, 0.12), transparent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  pointer-events: none;
}

.wax-envelope__tag {
  margin: 0 0 8px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.wax-envelope h4 {
  margin: 0 0 24px;
  font-size: 21px;
}

.wax-seal-trigger {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2px solid rgba(246, 215, 157, 0.65);
  background: radial-gradient(circle at 32% 30%, #cf3b49, #771822);
  color: #fff3dd;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  box-shadow: 0 0 0 8px rgba(159, 42, 54, 0.22), 0 14px 32px rgba(0, 0, 0, 0.5);
  animation: sealBreathe 2.2s ease-in-out infinite;
  transition: transform 0.25s;
}

.wax-seal-trigger:hover {
  transform: scale(1.08);
}

@keyframes sealBreathe {
  0%, 100% { box-shadow: 0 0 0 8px rgba(159, 42, 54, 0.22), 0 14px 32px rgba(0, 0, 0, 0.5); }
  50% { box-shadow: 0 0 0 15px rgba(232, 184, 109, 0.2), 0 16px 36px rgba(190, 53, 67, 0.55); }
}

.wax-envelope__tip {
  margin: 18px 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

/* 拆封后的双向信件 */
.unlocked-letters {
  margin-top: 26px;
  animation: fadeSlideUp 0.6s var(--ease-out);
}

.unlocked-header {
  text-align: center;
  margin-bottom: 20px;
}

.unlocked-header__badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.unlocked-header h3 {
  margin: 0;
  font-size: 24px;
}

.dual-letter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.letter-display {
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.42);
}

.letter-display__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 11px;
  opacity: 0.68;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(140, 120, 95, 0.22);
}

.letter-display__salutation {
  font-size: 17px;
  font-weight: 600;
}

.letter-display__content {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15.5px;
  line-height: 1.95;
  flex: 1;
}

.letter-display__signoff {
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  margin-top: 6px;
}

.unlocked-actions {
  margin-top: 20px;
  text-align: center;
}

/* 我的信件只读与编辑 */
.my-letter-panel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(232, 184, 109, 0.14);
}

.my-letter-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.my-letter-panel__head h4 {
  margin: 0;
  font-size: 17px;
}

.my-letter-panel__head p {
  margin: 3px 0 0;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

.my-letter-panel__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stationery--readonly .stationery__salutation-ro {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.stationery--readonly .stationery__content-ro {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15.5px;
  line-height: 1.95;
}

.stationery--readonly .stationery__signoff-ro {
  text-align: right;
  margin-top: 16px;
  font-size: 15px;
  font-weight: 600;
}

.edit-letter-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(7, 15, 13, 0.56);
  border: 1px solid var(--border-subtle);
}

.edit-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.edit-theme-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-theme-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
}

.mini-theme-btn.is-selected {
  border-color: var(--gold);
  background: rgba(232, 184, 109, 0.16);
  color: var(--gold-bright);
}

.edit-actions {
  display: flex;
  gap: 10px;
}

/* 页脚与署名 */
.site-footer {
  margin-top: 52px;
  text-align: center;
  font-family: var(--font-sans);
}

.footer-principles {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.footer-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(194, 203, 197, 0.58);
}

.footer-ornament__line {
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 184, 109, 0.35), transparent);
}

.footer-ornament__sep {
  color: rgba(232, 184, 109, 0.45);
  font-size: 10px;
}

.deerflow-mark {
  color: rgba(232, 184, 109, 0.58);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.25s, opacity 0.25s;
}

.deerflow-mark:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 9, 8, 0.78);
  backdrop-filter: blur(8px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-sheet {
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  background: #10201c;
  border: 1px solid var(--border-gold);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
  padding: 24px 26px;
}

.modal-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-sheet__header h3 {
  margin: 0;
  font-size: 19px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.trust-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(232, 184, 109, 0.12);
}

.trust-item__icon {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--gold);
  font-weight: 600;
}

.trust-item h4 {
  margin: 0 0 4px;
  font-size: 15px;
}

.trust-item p {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 50;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(18, 34, 30, 0.96);
  border: 1px solid var(--border-gold);
  color: var(--gold-bright);
  font-family: var(--font-sans);
  font-size: 13px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
}

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

/* 响应式 */
@media (max-width: 780px) {
  .page-shell {
    padding: 14px 14px 44px;
  }

  .composer-card,
  .receipt-card,
  .lookup-card {
    padding: 20px 16px;
    border-radius: 20px;
  }

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

  .identity-bridge {
    flex-direction: row;
    padding: 2px 0;
  }

  .identity-bridge__line {
    width: 44px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
  }

  .theme-picker,
  .dual-letter-grid,
  .edit-row,
  .clue-dual-inputs,
  .guard-fields {
    grid-template-columns: 1fr;
  }

  .guard-challenge__form {
    flex-direction: column;
  }

  .poster-studio__layout {
    grid-template-columns: 1fr;
  }

  .poster-preview-frame {
    max-width: 300px;
    margin: 0 auto;
  }

  .stationery {
    padding: 20px 16px 18px;
  }

  .lookup-input-row {
    flex-direction: column;
  }

  .status-banner {
    flex-direction: column;
    text-align: center;
  }

  .desktop-br {
    display: none;
  }

  .countdown-cell {
    min-width: 58px;
  }

  .countdown-cell__num {
    font-size: 26px;
  }
}

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