:root {
  --bg0: #eef1ec;
  --bg1: #f7f5ef;
  --ink: #1c2420;
  --ink-soft: #3a463f;
  --muted: #7d8a82;
  --line: rgba(60, 72, 64, 0.12);
  --panel: rgba(255, 252, 247, 0.92);
  --panel-solid: #fffcf7;
  --accent: #3f6b54;
  --accent-deep: #2a4d3c;
  --accent-rgb: 63, 107, 84;
  --seal: #8b3a32;
  --shadow: 0 10px 28px rgba(40, 52, 44, 0.08);
  --radius: 18px;
  --display: "STSong", "Songti SC", "Noto Serif SC", "SimSun", serif;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg0);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  position: relative;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(139, 58, 50, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(63, 107, 84, 0.12), transparent 50%),
    linear-gradient(180deg, #f4f1ea 0%, #e9eee8 48%, #e7ebe4 100%);
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(60, 72, 64, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(60, 72, 64, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: max(0.7rem, env(safe-area-inset-top)) 1rem 0.7rem;
  background: var(--panel-solid);
  border-bottom: 1px solid var(--line);
}
.link-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 2rem;
  padding: 0 0.75rem 0 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(63, 107, 84, 0.22);
  background: #fff;
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 650;
  transition: background 0.2s ease, transform 0.15s ease;
}
.link-back:hover { background: #f3f8f4; }
.link-back:active { transform: scale(0.98); }
.logo-title {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--ink);
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.1rem 1rem 2.8rem;
}

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 1rem;
  padding: 1.35rem 1.2rem 1.25rem;
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(135deg, rgba(255, 252, 247, 0.96), rgba(244, 247, 242, 0.9));
  border: 1px solid rgba(63, 107, 84, 0.1);
  box-shadow: var(--shadow);
  animation: heroIn 0.55s ease both;
}
.hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--seal), var(--accent));
}
.hero-brand {
  margin: 0 0 0.4rem;
  font-family: var(--display);
  font-size: clamp(1.8rem, 5vw, 2.35rem);
  letter-spacing: 0.34em;
  color: var(--ink);
  animation: fadeUp 0.55s 0.08s ease both;
}
.hero-lead {
  margin: 0;
  max-width: 28em;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
  animation: fadeUp 0.55s 0.16s ease both;
}

.form-panel {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.05rem 1.1rem;
  box-shadow: 0 6px 18px rgba(40, 52, 44, 0.05);
  backdrop-filter: blur(6px);
}
.card-title {
  margin: 0 0 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-deep);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.card-title::before {
  content: "";
  width: 3px;
  height: 1em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  flex: 0 0 auto;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.settings-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem 0.5rem;
  min-width: 0;
}
.settings-label {
  flex: 0 0 4.85rem;
  white-space: nowrap;
  color: var(--ink-soft);
}
.settings-segs {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.setting-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  width: 100%;
}
.seg-wide { width: 100%; }
.seg-item {
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.seg-item input { position: absolute; opacity: 0; pointer-events: none; }
.seg-item span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 2.5rem;
  text-align: center;
  white-space: nowrap;
  padding: 0.48rem 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.seg-item span:hover { border-color: rgba(63, 107, 84, 0.28); color: var(--ink-soft); }
.seg-item input:checked + span {
  border-color: transparent;
  background: linear-gradient(135deg, #3f6b54, #2f5744);
  color: #fff;
  box-shadow: 0 6px 14px rgba(47, 87, 68, 0.22);
}
.seg-item input:checked + span:active { transform: scale(0.98); }

.card-fold > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  margin: 0;
}
.card-fold > summary::-webkit-details-marker { display: none; }
.card-fold > summary.card-title { margin-bottom: 0; width: 100%; }
.card-fold > summary::after {
  content: "展开";
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0;
}
.card-fold[open] > summary::after { content: "收起"; }
.card-fold[open] > summary.card-title { margin-bottom: 0.85rem; }
.fold-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.15rem;
  border-top: 1px dashed rgba(60, 72, 64, 0.12);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.field-hint {
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.field-row { display: flex; flex-direction: column; gap: 0.4rem; }
.field label,
.field-label {
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.card-settings .settings-label {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.field-hero-input { margin-bottom: 0.75rem; }
.field-hero-input input {
  min-height: 2.7rem;
  font-size: 1rem;
  font-weight: 650;
}
.field-ritual {
  margin: 0.85rem 0;
  padding: 0.75rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(63, 107, 84, 0.07), rgba(63, 107, 84, 0.03));
  border: 1px solid rgba(63, 107, 84, 0.12);
}
.field-ritual .birth-pick-btn {
  background: #fff;
  border-color: rgba(63, 107, 84, 0.18);
  font-weight: 650;
}

.field input,
.field select,
.field textarea,
.birth-pick-btn {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.45rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(60, 72, 64, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea {
  min-height: 4.2rem;
  resize: vertical;
  line-height: 1.55;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.birth-pick-btn:focus {
  outline: none;
  border-color: rgba(63, 107, 84, 0.45);
  box-shadow: 0 0 0 3px rgba(63, 107, 84, 0.12);
}
.birth-pick-btn {
  text-align: left;
  cursor: pointer;
}
.birth-pick-btn.placeholder {
  color: var(--muted);
  font-weight: 500;
}

.field.is-invalid label,
.field-ritual.is-invalid label {
  color: var(--seal);
  font-weight: 800;
}
.field-ritual.is-invalid {
  border-color: rgba(139, 58, 50, 0.4);
  background: rgba(139, 58, 50, 0.06);
  box-shadow: 0 0 0 3px rgba(139, 58, 50, 0.1);
}
.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea,
.field-ritual.is-invalid .birth-pick-btn {
  border-color: rgba(139, 58, 50, 0.58) !important;
  background: rgba(139, 58, 50, 0.05) !important;
  box-shadow: 0 0 0 3px rgba(139, 58, 50, 0.14) !important;
}
.field.is-invalid input:focus,
.field.is-invalid select:focus,
.field.is-invalid textarea:focus,
.field-ritual.is-invalid .birth-pick-btn:focus {
  border-color: rgba(139, 58, 50, 0.68) !important;
  box-shadow: 0 0 0 3px rgba(139, 58, 50, 0.18) !important;
}

.offering-field { gap: 0.45rem; }

.offering-block {
  border-radius: 14px;
  border: 1px solid rgba(60, 72, 64, 0.12);
  background: rgba(255, 252, 247, 0.72);
  overflow: hidden;
}

.offering-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  padding: 0.65rem;
}
@media (min-width: 640px) {
  .offering-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.offering-card {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(60, 72, 64, 0.1);
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.offering-card:hover {
  border-color: rgba(63, 107, 84, 0.22);
}
.offering-card:has(input:checked) {
  border-color: rgba(63, 107, 84, 0.3);
  background: rgba(63, 107, 84, 0.07);
}
.offering-card input {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.12rem 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.offering-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.offering-name {
  font-size: 0.82rem;
  font-weight: 750;
  color: var(--ink-soft);
  line-height: 1.35;
}
.offering-hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.offering-card:has(input:checked) .offering-name {
  color: var(--accent-deep);
}

.offering-selected {
  padding: 0.58rem 0.65rem 0.62rem;
  border-top: 1px dashed rgba(60, 72, 64, 0.14);
  background: rgba(248, 246, 240, 0.72);
}
.offering-selected-label {
  display: block;
  margin-bottom: 0.38rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.offering-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 1.55rem;
  align-items: center;
}
.offering-tags.is-empty::before {
  content: "暂未选择祭品";
  font-size: 0.78rem;
  color: var(--muted);
}
.offering-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0.2rem 0.28rem 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(60, 72, 64, 0.14);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  color: var(--ink-soft);
  line-height: 1.2;
}
.offering-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.offering-tag-remove {
  appearance: none;
  border: 0;
  background: transparent;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.offering-tag-remove:hover {
  color: var(--seal);
  background: rgba(139, 58, 50, 0.08);
}

.actions {
  display: flex;
  gap: 0.65rem;
  padding: 0.35rem 0 0;
  margin-top: 0.15rem;
}
.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.82rem 1.05rem;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 750;
  cursor: pointer;
  background: #fff;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  flex: 1;
  border: 0;
  color: #fff;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #4a7a60, #2f5744);
  box-shadow: 0 10px 22px rgba(47, 87, 68, 0.28);
}
.btn.primary:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn.secondary {
  border-color: rgba(63, 107, 84, 0.28);
  color: var(--accent-deep);
  background: rgba(255, 252, 247, 0.95);
}
.btn.secondary:disabled { opacity: 0.45; cursor: not-allowed; }

.result-panel {
  margin-top: 1.1rem;
  padding: 1.1rem 1.05rem 1.2rem;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(248, 245, 238, 0.96));
  border: 1px solid rgba(60, 72, 64, 0.1);
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease both;
}
.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px dashed rgba(60, 72, 64, 0.14);
}
.result-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-deep);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.result-head h3::before {
  content: "";
  width: 3px;
  height: 1em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  flex: 0 0 auto;
}
.result-actions { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.result-actions .btn {
  min-height: 2.15rem;
  padding: 0.48rem 0.82rem;
  font-size: 0.82rem;
  border-radius: 11px;
}
.result-actions .btn.secondary {
  border-color: rgba(63, 107, 84, 0.28);
  color: var(--accent-deep);
  background: rgba(255, 252, 247, 0.95);
}
.result-actions .btn.secondary:hover:not(:disabled) {
  background: #f3f8f4;
  border-color: rgba(63, 107, 84, 0.38);
}
.result-actions .btn.secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gen-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.95rem 1rem;
  border-radius: 12px;
  background: rgba(63, 107, 84, 0.08);
  color: var(--accent-deep);
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.gen-loading .gen-msg {
  color: var(--accent-deep);
}
.gen-loading .gen-dots {
  display: inline-flex;
  gap: 0;
  font-weight: 800;
  letter-spacing: 0.2em;
}
.gen-loading .gen-dots span {
  animation: genDotBounce 1.2s ease-in-out infinite;
}
.gen-loading .gen-dots span:nth-child(2) { animation-delay: 0.15s; }
.gen-loading .gen-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes genDotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-0.25rem); opacity: 1; }
}

.jiwen-paper {
  position: relative;
  margin-top: 0.15rem;
  padding: 1.25rem 1.05rem 1.35rem;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fcfaf2 0%, #f6f1e6 100%);
  border: 1px solid rgba(139, 58, 50, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.72),
    0 8px 24px rgba(40, 52, 44, 0.06);
}
.jiwen-paper::before,
.jiwen-paper::after {
  content: "";
  position: absolute;
  top: 1rem;
  bottom: 1rem;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(139, 58, 50, 0.18) 12%,
    rgba(139, 58, 50, 0.18) 88%,
    transparent
  );
  pointer-events: none;
}
.jiwen-paper::before { left: 0.72rem; }
.jiwen-paper::after { right: 0.72rem; }

.jiwen-paper-head {
  position: relative;
  width: fit-content;
  margin: 0 auto 0.95rem;
  padding-bottom: 0.45rem;
  font-family: var(--display);
  font-size: clamp(1.25rem, 4.5vw, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  color: var(--ink);
  border-bottom: 2px solid rgba(28, 36, 32, 0.82);
}

.jiwen-output {
  position: relative;
  white-space: normal;
  font-family: var(--display);
  font-size: 1.02rem;
  line-height: 2;
  letter-spacing: 0.05em;
  color: var(--ink);
  padding: 0.35rem 0.55rem 0.15rem;
  border-radius: 0;
  background:
    repeating-linear-gradient(
      transparent,
      transparent calc(2em - 1px),
      rgba(60, 72, 64, 0.07) calc(2em - 1px),
      rgba(60, 72, 64, 0.07) 2em
    );
}
.jiwen-output:empty { min-height: 6rem; }
.jiwen-intro {
  margin: 0 0 0.95rem;
  text-align: justify;
  text-align-last: center;
  font-size: 0.96rem;
  line-height: 1.95;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.jiwen-verse-line {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0.08em 0;
  line-height: 2;
  text-align: center;
}
.jiwen-clause {
  display: inline-block;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.jiwen-clause-sep {
  display: inline-block;
  padding: 0 0.02em;
  letter-spacing: 0;
}
.jiwen-verse-line--lead {
  display: block;
  margin-top: 0.35rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.06em;
}
.jiwen-verse-line--single {
  display: block;
  letter-spacing: 0.06em;
}
@media (max-width: 480px) {
  .jiwen-clause { white-space: normal; }
  .jiwen-verse-line { row-gap: 0.12em; }
}

.disclaimer {
  margin: 1.15rem 0 0;
  text-align: center;
  font-size: 0.74rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.2rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(28, 36, 32, 0.92);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 650;
}

/* —— 农历祭日选择弹窗（祭文主题） —— */
.jiwen-page .birth-picker-modal {
  --accent: #3f6b54;
  --accent-2: #4a7a60;
  --accent-dark: #2a4d3c;
  --accent-rgb: 63, 107, 84;
  --title: #2a4d3c;
  --panel: #fffcf7;
  --panel-alt: #f3f7f2;
  --text: #1c2420;
  --muted: #7d8a82;
}

.jiwen-page .birth-picker-backdrop {
  background: rgba(22, 28, 24, 0.48);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.jiwen-page .birth-picker-panel {
  position: relative;
  border-color: rgba(63, 107, 84, 0.2);
  background:
    radial-gradient(ellipse 85% 42% at 50% -6%, rgba(63, 107, 84, 0.14), transparent 58%),
    radial-gradient(ellipse 60% 30% at 100% 0%, rgba(139, 58, 50, 0.06), transparent 50%),
    linear-gradient(180deg, #fffcf7 0%, #f4f7f2 100%);
  box-shadow:
    0 -10px 36px rgba(28, 36, 32, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset;
}

.jiwen-page .birth-picker-panel::before {
  content: "";
  position: absolute;
  top: 0.42rem;
  left: 50%;
  transform: translateX(-50%);
  width: 2.35rem;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(60, 72, 64, 0.18);
  pointer-events: none;
  z-index: 2;
}

.jiwen-page .birth-picker-head {
  padding-top: 0.95rem;
  border-bottom-color: rgba(63, 107, 84, 0.12);
}

.jiwen-page .birth-picker-title-wrap #birthPickerTitle {
  font-family: var(--display);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.jiwen-page .birth-picker-calendar {
  border-color: rgba(139, 58, 50, 0.22);
  background: rgba(139, 58, 50, 0.08);
  color: var(--seal);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.jiwen-page .birth-picker-back,
.jiwen-page .birth-picker-close {
  border: 1px solid rgba(63, 107, 84, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  box-shadow: 0 2px 8px rgba(40, 52, 44, 0.06);
}

.jiwen-page .birth-picker-back:hover,
.jiwen-page .birth-picker-close:hover {
  color: var(--accent-deep);
  border-color: rgba(63, 107, 84, 0.28);
  background: #fff;
}

.jiwen-page .birth-picker-grid {
  padding-top: 0.65rem;
  scrollbar-color: rgba(63, 107, 84, 0.35) transparent;
}

.jiwen-page .birth-picker-grid::-webkit-scrollbar-thumb {
  background: rgba(63, 107, 84, 0.35);
}

.jiwen-page .birth-picker-decade {
  color: var(--accent-deep);
  border-left-color: var(--seal);
  background: linear-gradient(90deg, rgba(63, 107, 84, 0.12), transparent 88%);
  letter-spacing: 0.12em;
}

.jiwen-page .birth-picker-item {
  border-color: rgba(63, 107, 84, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}

.jiwen-page .birth-picker-item:hover,
.jiwen-page .birth-picker-item:focus {
  border-color: rgba(63, 107, 84, 0.38);
  background: rgba(63, 107, 84, 0.08);
  color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(63, 107, 84, 0.1);
}

.jiwen-page .birth-picker-item.selected {
  background: linear-gradient(145deg, #4a7a60 0%, #3f6b54 52%, #2f5744 100%);
  box-shadow: 0 4px 14px rgba(47, 87, 68, 0.28);
}

.jiwen-page .birth-picker-loading {
  font-family: var(--display);
  letter-spacing: 0.06em;
}

.jiwen-page .toast {
  padding: 0.62rem 1.05rem;
  border: 1px solid rgba(63, 107, 84, 0.22);
  background: rgba(28, 36, 32, 0.94);
  box-shadow: 0 8px 24px rgba(28, 36, 32, 0.22);
  letter-spacing: 0.04em;
}

@media (min-width: 769px) {
  .jiwen-page .birth-picker-panel::before {
    display: none;
  }

  .jiwen-page .birth-picker-head {
    padding-top: 0.75rem;
  }

  .jiwen-page .birth-picker-panel {
    width: min(420px, calc(100% - 2rem));
    border-radius: calc(var(--radius) + 2px);
    border-bottom: 1px solid rgba(63, 107, 84, 0.2);
  }
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .hero-brand,
  .hero-lead,
  .result-panel { animation: none; }
}
