:root {
  --ink: #1a1714;
  --ink-soft: #3d3832;
  --paper: #f7f3ea;
  --paper-deep: #efe8da;
  --paper-card: rgba(255, 255, 255, 0.88);
  --cinnabar: #e23b2a;
  --cinnabar-bright: #ff4d3a;
  --cinnabar-soft: rgba(226, 59, 42, 0.12);
  /* 日历模块：偏亮朱砂（避免过暗，也不刺眼） */
  --cal-red: #d45342;
  --cal-red-deep: #b84034;
  --cal-red-mid: #c94a3c;
  --cal-red-soft: rgba(196, 70, 55, 0.12);
  --cal-red-text: #c44738;
  --jade: #0f8a6b;
  --jade-soft: rgba(15, 138, 107, 0.12);
  --gold: #d4a017;
  --gold-soft: rgba(212, 160, 23, 0.18);
  --mist: rgba(26, 23, 20, 0.52);
  --line: rgba(26, 23, 20, 0.12);
  --shadow: rgba(26, 23, 20, 0.14);
  --font-display: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "STSong", serif;
  --font-body: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  --radius: 6px;
  --max: 1120px;
  --header-bg: rgba(255, 255, 255, 0.82);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(900px 520px at 8% -8%, rgba(226, 59, 42, 0.16), transparent 55%),
    radial-gradient(780px 480px at 92% 4%, rgba(15, 138, 107, 0.14), transparent 50%),
    radial-gradient(640px 400px at 50% 100%, rgba(212, 160, 23, 0.1), transparent 55%),
    linear-gradient(168deg, #fffdf8 0%, var(--paper) 42%, #f0ebe0 100%);
  line-height: 1.7;
  overflow-x: hidden;
}

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

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 28px -20px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-seal {
  width: 2.55rem;
  height: 2.55rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--cinnabar);
  color: #fff;
  background: linear-gradient(145deg, var(--cinnabar-bright), var(--cinnabar));
  font-family: var(--font-display);
  font-size: 1.4rem;
  transform: rotate(-6deg);
  border-radius: 4px;
  box-shadow: 0 6px 16px -8px rgba(226, 59, 42, 0.55);
  animation: seal-in 0.8s ease both;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.16em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  flex: 1;
  justify-content: center;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  border-bottom: 2px solid transparent;
  padding-bottom: 0.15rem;
  transition: color 0.2s, border-color 0.2s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--cinnabar);
  border-bottom-color: var(--cinnabar);
}

.nav-toggle {
  display: none;
  background: var(--paper-card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.2rem;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  border-radius: var(--radius);
}

.auth-slot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  margin-left: auto;
}

.auth-user {
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.auth-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  min-height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-panel,
.auth-lock-panel {
  max-width: 26rem;
  margin: 0 auto;
  padding: 1.15rem 1.1rem 1.25rem;
}

.auth-lock-title {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  text-align: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.auth-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  color: var(--mist);
  font: inherit;
  letter-spacing: 0.1em;
  padding: 0.5rem 0.4rem;
  border-radius: var(--radius);
  cursor: pointer;
}

.auth-tab.active {
  color: var(--cinnabar);
  border-color: rgba(226, 59, 42, 0.4);
  background: var(--cinnabar-soft);
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 0.75rem;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--mist);
}

.auth-form input {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius);
}

.auth-msg {
  margin: 0;
  font-size: 0.88rem;
  color: var(--cinnabar);
  letter-spacing: 0.04em;
}

.auth-msg.ok {
  color: var(--jade);
}

.auth-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--mist);
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.auth-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: stretch;
}

.auth-code-row input {
  min-width: 0;
}

.auth-code-row .btn {
  white-space: nowrap;
  padding: 0.45rem 0.7rem;
  font-size: 0.82rem;
}

/* —— 意见反馈 —— */
.feedback-fab-group {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.feedback-fab {
  min-width: 3.4rem;
  min-height: 3.4rem;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--cinnabar-bright), var(--cinnabar));
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  font-weight: 600;
  box-shadow: 0 10px 28px -10px rgba(226, 59, 42, 0.65);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feedback-fab-list {
  background: linear-gradient(145deg, #3d5a4c, #2a4036);
  box-shadow: 0 10px 28px -10px rgba(42, 64, 54, 0.55);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 0.55rem 0.8rem;
  min-height: 2.6rem;
}

.feedback-fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 32px -10px rgba(226, 59, 42, 0.75);
}

.feedback-fab-list:hover {
  box-shadow: 0 14px 32px -10px rgba(42, 64, 54, 0.65);
}

.feedback-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
  align-items: center;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(26, 23, 20, 0.45);
  backdrop-filter: blur(4px);
}

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

.feedback-dialog {
  width: min(100%, 26rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 24px 48px -24px var(--shadow);
  padding: 1rem 1.1rem 1.15rem;
}

.feedback-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.feedback-dialog-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.feedback-close {
  border: none;
  background: transparent;
  color: var(--mist);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}

.feedback-desc {
  margin: 0 0 0.75rem;
  font-size: 0.86rem;
  color: var(--mist);
  letter-spacing: 0.04em;
}

.feedback-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  padding: 0.65rem 0.7rem;
  box-sizing: border-box;
}

.feedback-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.45rem 0 0.75rem;
  min-height: 1.4rem;
}

.feedback-meta #feedback-count {
  font-size: 0.8rem;
  color: var(--mist);
  letter-spacing: 0.04em;
}

.feedback-meta #feedback-count.over {
  color: var(--cinnabar);
}

body.feedback-open {
  overflow: hidden;
}

/* 我的反馈列表 */
.feedback-page {
  animation: rise 0.45s ease both;
  max-width: 42rem;
}

.feedback-page-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.feedback-page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4vw, 1.9rem);
  letter-spacing: 0.12em;
  font-weight: 400;
}

.feedback-page-sub {
  margin: 0 0 1.15rem;
  color: var(--mist);
  font-size: 0.9rem;
}

.feedback-list {
  display: grid;
  gap: 0.9rem;
}

.feedback-item {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1rem 1.05rem;
  box-shadow: 0 10px 28px -22px var(--shadow);
}

.feedback-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.55rem;
}

.feedback-item-time {
  font-size: 0.8rem;
  color: var(--mist);
  letter-spacing: 0.02em;
}

.feedback-status {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--mist);
  background: rgba(255, 255, 255, 0.55);
}

.feedback-status.is-pending {
  color: #8a6a2f;
  border-color: rgba(180, 140, 60, 0.35);
  background: rgba(240, 210, 140, 0.22);
}

.feedback-status.is-processing {
  color: #2f5f8a;
  border-color: rgba(70, 130, 180, 0.35);
  background: rgba(160, 200, 235, 0.22);
}

.feedback-status.is-resolved {
  color: #2a5a3c;
  border-color: rgba(60, 140, 90, 0.35);
  background: rgba(160, 210, 170, 0.25);
}

.feedback-status.is-closed {
  color: var(--mist);
  opacity: 0.9;
}

.feedback-item-content {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.feedback-conversation {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feedback-opener {
  margin-top: 0.15rem;
}

.feedback-thread-divider {
  height: 0;
  margin: 0.35rem 0 0.15rem;
  border: 0;
  border-top: 1px dashed rgba(42, 37, 32, 0.28);
}

.feedback-thread {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0;
}

.feedback-bubble {
  max-width: min(92%, 34rem);
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
}

.feedback-bubble.is-staff {
  align-self: flex-start;
  background: linear-gradient(165deg, rgba(15, 138, 107, 0.1), rgba(15, 138, 107, 0.04));
  border: 1px solid rgba(15, 138, 107, 0.22);
  border-left: 3px solid var(--jade);
  border-radius: 4px 10px 10px 10px;
}

.feedback-bubble.is-me {
  align-self: flex-end;
  background: linear-gradient(165deg, rgba(226, 59, 42, 0.08), rgba(255, 253, 248, 0.9));
  border: 1px solid rgba(226, 59, 42, 0.18);
  border-right: 3px solid var(--cinnabar);
  border-radius: 10px 4px 10px 10px;
}

.feedback-reply-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  font-family: var(--font-display);
}

.feedback-bubble.is-staff .feedback-role {
  color: var(--jade);
}

.feedback-bubble.is-me .feedback-role {
  color: var(--cinnabar);
}

.feedback-bubble-time {
  color: var(--mist);
  letter-spacing: 0;
  font-family: var(--font-body);
  font-size: 0.72rem;
  flex-shrink: 0;
}

.feedback-reply-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.65;
  color: var(--ink);
  font-size: 0.95rem;
}

/* 兼容旧 class，避免别处引用失效 */
.feedback-reply {
  margin-top: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-left: 3px solid var(--cinnabar);
  background: rgba(226, 59, 42, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.feedback-reply-empty {
  margin-top: 0.65rem;
  font-size: 0.84rem;
  color: var(--mist);
}

.feedback-followup {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--line);
}

.feedback-followup-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 0.65rem 0.75rem;
  color: var(--ink);
  resize: vertical;
  font: inherit;
  line-height: 1.5;
}

.feedback-followup-input:focus {
  outline: none;
  border-color: rgba(226, 59, 42, 0.45);
  box-shadow: 0 0 0 3px var(--cinnabar-soft);
}

.feedback-followup .feedback-form-actions {
  margin-top: 0.55rem;
  justify-content: flex-end;
}

.btn.sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

.feedback-empty,
.feedback-loading,
.feedback-error {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--mist);
  background: var(--paper-card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.feedback-error {
  color: var(--cinnabar);
  border-style: solid;
}

.feedback-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

.feedback-pager-info {
  font-size: 0.85rem;
  color: var(--mist);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.75rem 1.5rem 3rem;
  min-height: calc(100vh - 10rem);
}

.boot-fallback {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--mist);
  letter-spacing: 0.08em;
}

.site-footer {
  text-align: center;
  padding: 1.75rem 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--mist);
  background: rgba(255, 255, 255, 0.45);
}

.site-footer .muted {
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* Hero / Home */
.hero {
  min-height: calc(100vh - 7rem);
  display: grid;
  align-content: center;
  gap: 1.25rem;
  padding: 2rem 0 1rem;
  animation: rise 0.9s ease both;
}

.hero.hero-compact {
  min-height: 0;
  padding: 1.5rem 0 0.5rem;
  align-content: start;
  gap: 0.85rem;
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: 0.16em;
  margin: 0;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.hero-lead {
  max-width: 32rem;
  margin: 0;
  font-size: 1.12rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.15rem;
}

.hero-links a {
  color: var(--jade);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  border-bottom: 1px solid rgba(15, 138, 107, 0.35);
  transition: color 0.2s, border-color 0.2s;
}

.hero-links a:hover {
  color: var(--cinnabar);
  border-bottom-color: rgba(226, 59, 42, 0.45);
}

.btn {
  appearance: none;
  border: 1px solid var(--cinnabar);
  background: linear-gradient(165deg, var(--cinnabar-bright), var(--cinnabar));
  color: #fffaf8;
  padding: 0.72rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius);
  box-shadow: 0 8px 20px -12px rgba(226, 59, 42, 0.65);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 12px 24px -12px rgba(226, 59, 42, 0.7);
}

.btn.ghost {
  background: transparent;
  color: var(--cinnabar);
  box-shadow: none;
}

.btn.ghost:hover {
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
  filter: none;
}

.section {
  margin-top: 2.5rem;
  animation: rise 0.7s ease both;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  letter-spacing: 0.12em;
  margin: 0 0 0.35rem;
  color: var(--ink);
}

.section-desc {
  margin: 0 0 1.5rem;
  color: var(--mist);
  max-width: 36rem;
}

.section-calendar {
  margin-top: 1.25rem;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.section-head .section-desc {
  margin-bottom: 1rem;
}

/* Calendar / 黄历风格 */
.section-calendar {
  margin-top: 1.25rem;
}

.almanac {
  border: 1px solid var(--line);
  background: var(--paper-card);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px -24px var(--shadow);
  overflow: hidden;
}

.almanac-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: linear-gradient(165deg, var(--cal-red-mid) 0%, var(--cal-red-deep) 100%);
  color: #f7f0ec;
}

.almanac-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  letter-spacing: 0.12em;
  font-weight: 400;
  min-width: 8rem;
  text-align: center;
}

.icon-btn.light {
  border-color: rgba(247, 240, 236, 0.4);
  color: #f7f0ec;
}

.icon-btn.light:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.almanac-today {
  margin-left: 0.35rem;
  border: none;
  background: #f7f0ec;
  color: var(--cal-red-text);
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 700;
  border-radius: 4px;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.28);
}

.almanac-today:hover {
  background: #fff;
}

.almanac-week {
  padding: 0.55rem 0.4rem 0.2rem;
  background: #fff;
}

.almanac-week .weekend {
  color: var(--cal-red-text);
}

.almanac-grid {
  padding: 0.35rem 0.4rem 0.75rem;
  gap: 0.15rem;
  background: #fff;
}

.day-cell {
  position: relative;
  min-height: 3.6rem;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.3rem 0.2rem;
  cursor: pointer;
  text-align: center;
  font-family: var(--font-body);
  color: var(--ink);
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.day-cell:hover {
  background: var(--cal-red-soft);
}

.day-cell.muted {
  opacity: 0.28;
}

.day-cell.weekend .solar {
  color: var(--cal-red-text);
}

.day-cell.off-day .solar {
  color: var(--cal-red-text);
}

.day-cell.work-day .solar {
  color: var(--ink);
}

.day-badge {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  font-style: normal;
  font-size: 0.58rem;
  line-height: 1;
  padding: 0.12rem 0.18rem;
  border-radius: 2px;
  font-weight: 700;
}

.day-badge.off {
  color: #fff;
  background: var(--cal-red-text, #c0392b);
}

.day-badge.work {
  color: #fff;
  background: #4a5568;
}

.day-cell.today {
  border-color: rgba(154, 52, 40, 0.4);
}

.day-cell.selected {
  border-color: var(--gold);
  background: var(--cal-red-soft);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

.day-cell .solar {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.day-cell .lunar {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.68rem;
  color: var(--mist);
  line-height: 1.2;
}

.day-cell .lunar.fest {
  color: var(--cal-red-text);
}

.almanac-detail {
  padding: 1.15rem 1.25rem 1.4rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #faf6ee 100%);
  box-shadow: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.almanac-lunar-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.6rem);
  letter-spacing: 0.1em;
  line-height: 1.15;
  margin: 0 0 0.25rem;
  color: var(--ink);
}

.almanac-bullets {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.almanac-bullets li {
  position: relative;
  padding-left: 0.95rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.almanac-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--mist);
}

.almanac-bullets li.hot,
.almanac-bullets li.hot a {
  color: var(--cal-red-text);
}

.almanac-bullets li.hot::before {
  background: var(--cal-red);
}

.almanac-bullets a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.almanac-ganz {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  align-items: baseline;
  padding: 0.7rem 0.85rem;
  margin: 0.5rem 0 0.75rem;
  background: var(--cal-red-soft);
  border: 1px solid rgba(154, 52, 40, 0.22);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.almanac-ganz strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.almanac-yiji {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.almanac-yiji .yi,
.almanac-yiji .ji {
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: var(--radius);
}

.almanac-yiji .yi {
  background: var(--jade-soft);
}

.almanac-yiji .ji {
  background: var(--cal-red-soft);
}

.almanac-yiji .ji strong {
  color: var(--cal-red-text);
}

.almanac-yiji p {
  margin: 0;
  line-height: 1.7;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.calendar-shell {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.calendar-panel,
.day-detail,
.panel,
.book-list article,
.result-panel {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px -24px var(--shadow);
  backdrop-filter: blur(8px);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--line);
}

.calendar-toolbar h2 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
  border-radius: var(--radius);
}

.icon-btn:hover {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
  background: var(--cinnabar-soft);
}

.weekday-row,
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.weekday-row {
  padding: 0.6rem 0.5rem 0;
  color: var(--mist);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.day-detail {
  padding: 1.25rem 1.35rem;
}

.day-detail h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.1em;
}

.day-sub {
  margin: 0 0 0.85rem;
  color: var(--mist);
  font-size: 0.9rem;
}

.hour-field {
  margin: 0.85rem 0 1rem;
}

.hour-field select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}

.gz-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  margin: 0.25rem 0 0.35rem;
}

.gz-cell {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  padding: 0.55rem 0.25rem;
  text-align: center;
}

.gz-label {
  display: block;
  font-size: 0.72rem;
  color: var(--mist);
  letter-spacing: 0.1em;
}

.gz-cell strong {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  font-weight: 400;
}

.hour-note {
  margin: 0 0 0.85rem;
}

.meta-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.4rem;
  font-size: 0.92rem;
}

.meta-list span:last-child {
  color: var(--ink-soft);
  text-align: right;
}

.yi-ji {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.yi-ji div {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}

.yi-ji strong {
  display: block;
  margin-bottom: 0.35rem;
  letter-spacing: 0.12em;
}

.yi-ji .yi strong { color: var(--jade); }
.yi-ji .ji strong { color: var(--cinnabar); }

/* Books */
.book-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  margin: 0 0 1.15rem;
}

.book-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.88rem;
  letter-spacing: 0.1em;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.book-tab:hover {
  border-color: var(--gold);
  color: var(--ink);
  background: #fff;
}

.book-tab.active {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
  background: var(--cinnabar-soft);
  box-shadow: 0 0 0 1px var(--gold-soft);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.book-card {
  padding: 1.25rem;
  cursor: pointer;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
  border: 1px solid var(--line);
  background: var(--paper-card);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px -22px var(--shadow);
  text-align: left;
  font-family: var(--font-body);
  color: var(--ink);
  text-decoration: none;
  display: block;
}

.book-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 16px 32px -20px var(--shadow);
}

.book-card .tag,
.book-reader .tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--jade);
  margin-bottom: 0.5rem;
  padding: 0.12rem 0.45rem;
  background: var(--jade-soft);
  border-radius: 4px;
}

.book-reader-meta {
  min-width: 0;
}

.book-reader-meta .tag {
  margin-bottom: 0.25rem;
}

.book-card h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.55rem;
  letter-spacing: 0.08em;
}

.book-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--mist);
}

.book-reader {
  display: none;
  margin-top: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: var(--paper-card);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px -24px var(--shadow);
  animation: rise 0.45s ease both;
}

.book-reader.open {
  display: block;
}

.book-reader header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

.book-reader h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
}

/* 独立阅读页 */
.book-page {
  animation: rise 0.45s ease both;
  padding-bottom: 3rem;
}

.book-page-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem 1.25rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 4.25rem;
  z-index: 5;
  background: rgba(247, 243, 234, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-left: -0.25rem;
  margin-right: -0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  padding-top: 0.45rem;
}

.book-back {
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  font-size: 0.88rem;
}

.book-page-meta {
  min-width: 0;
  flex: 1;
}

.book-page-meta .tag {
  margin-bottom: 0.25rem;
}

.book-page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 5vw, 2.1rem);
  letter-spacing: 0.1em;
  line-height: 1.25;
}

.book-page-sub {
  margin: 0 0 1.15rem;
  color: var(--mist);
  font-size: 0.92rem;
  line-height: 1.55;
}

.book-resume-hint {
  color: var(--jade);
}

.book-page-body {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px -24px var(--shadow);
  padding: 1.15rem 1.25rem 1.75rem;
}

.book-reader-body {
  display: block;
}

.book-reader-body.has-toc {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) 1fr;
  gap: 1rem;
  align-items: start;
}

.book-toc {
  position: sticky;
  top: 5.5rem;
  max-height: min(70vh, 42rem);
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

.book-toc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--line);
}

.book-toc-head strong {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  color: var(--cinnabar);
  font-size: 0.95rem;
}

.book-toc-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mist);
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  cursor: pointer;
  font-family: var(--font-body);
  border-radius: 4px;
}

.book-toc-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
  font-size: 0.82rem;
  line-height: 1.65;
}

.book-toc-list li {
  margin: 0.15rem 0;
}

.book-toc-list a,
.book-toc-entry a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.book-toc-list a:hover,
.book-toc-entry a:hover {
  color: var(--cinnabar);
  border-bottom-color: rgba(226, 59, 42, 0.35);
}

.book-toc.collapsed .book-toc-list {
  display: none;
}

.book-reader .content,
.book-page .content {
  white-space: pre-wrap;
  font-size: 1.05rem;
  line-height: 2;
  color: var(--ink-soft);
  -webkit-overflow-scrolling: touch;
}

.book-page .content {
  max-height: none;
  overflow: visible;
}

.book-reader .content {
  max-height: min(70vh, 42rem);
  overflow: auto;
}

.book-reader .content.is-html,
.book-page .content.is-html {
  white-space: normal;
}

.book-line {
  margin: 0 0 0.35rem;
  line-height: 1.95;
}

.book-toc-label {
  font-family: var(--font-display);
  color: var(--cinnabar);
  letter-spacing: 0.12em;
  margin: 0.75rem 0 0.35rem;
}

.book-chapter {
  margin: 1.25rem 0 0.55rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.08em;
  color: var(--cinnabar);
  /* 顶栏 + 书名 sticky 条，避免跳转后标题被挡住 */
  scroll-margin-top: 8.5rem;
}

.book-chapter.chapter-flash {
  animation: chapter-flash 1.1s ease;
}

@keyframes chapter-flash {
  0%,
  100% {
    background: transparent;
  }
  30% {
    background: rgba(226, 59, 42, 0.12);
  }
}

/* Forms / Paipan */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  padding: 1.25rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

.field label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--mist);
}

.field input,
.field select {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
  border-radius: var(--radius);
}

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.form-hint {
  font-size: 0.85rem;
  color: var(--mist);
}

.bazi-head {
  margin-bottom: 1rem;
}

.bazi-title {
  margin: 0;
  font-size: 1.05rem;
}

.bazi-meta {
  margin: 0.25rem 0 0;
  color: var(--mist);
  font-size: 0.9rem;
}

/* —— 八字专业盘面 —— */
.bz-sheet {
  font-size: 0.9rem;
}

.bz-meta {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  margin-bottom: 0.85rem;
}

.bz-meta-row {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.bz-meta-row:last-child {
  border-bottom: 0;
}

.bz-k {
  color: var(--mist);
  letter-spacing: 0.08em;
}

.bz-kong {
  color: var(--mist);
  margin-left: 0.25rem;
}

.bz-kong em {
  color: var(--cinnabar);
  font-style: normal;
  font-weight: 600;
}

.bz-chart {
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.bz-side-cell,
.bz-row {
  border-bottom: 1px solid var(--line);
  min-height: 2rem;
  display: grid;
  align-items: center;
}

.bz-side-cell {
  padding: 0.35rem 0.25rem;
  text-align: center;
  color: var(--mist);
  font-size: 0.78rem;
  background: rgba(18, 16, 14, 0.04);
  border-right: 1px solid var(--line);
}

.bz-side-cell.tall,
.bz-row.tall {
  min-height: 2.8rem;
}

.bz-side-cell.cang,
.bz-row.cang {
  min-height: 4.2rem;
}

.bz-main .bz-row {
  grid-template-columns: repeat(4, 1fr);
}

.bz-cell {
  text-align: center;
  padding: 0.3rem 0.15rem;
  border-right: 1px solid var(--line);
}

.bz-cell:last-child {
  border-right: 0;
}

.bz-plabel {
  font-size: 0.78rem;
  color: var(--mist);
  letter-spacing: 0.1em;
}

.bz-ss {
  color: #2f5d8c;
  font-size: 0.82rem;
}

.bz-ss.muted {
  color: var(--mist);
}

.bz-gan,
.bz-zhi {
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1.1;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.bz-gan.accent,
.bz-zhi.accent {
  color: var(--cinnabar);
}

.bz-cang {
  display: grid;
  gap: 0.15rem;
  font-size: 0.78rem;
  line-height: 1.25;
}

.bz-cang b {
  margin-right: 0.15rem;
  font-weight: 600;
}

.bz-cang small {
  color: var(--mist);
}

.bz-sub {
  color: var(--jade);
  font-size: 0.8rem;
}

.wx-wood { color: #2f6b3a; }
.wx-fire { color: #e23b2a; }
.wx-earth { color: #8a6a2f; }
.wx-metal { color: #6a6a6a; }
.wx-water { color: #2f5d8c; }

.bz-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-top: 0;
  background: rgba(18, 16, 14, 0.03);
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.bz-shensha {
  border: 1px solid var(--line);
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.75);
}

.bz-ss-row {
  display: grid;
  grid-template-columns: 5rem 1fr;
  border-bottom: 1px solid var(--line);
  min-height: 2.1rem;
}

.bz-ss-row:last-child {
  border-bottom: 0;
}

.bz-ss-label {
  display: grid;
  place-items: center;
  background: rgba(18, 16, 14, 0.06);
  border-right: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--mist);
  letter-spacing: 0.04em;
}

.bz-ss-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0.55rem;
}

.bz-tag {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.85);
}

.bz-tag.kong {
  background: rgba(42, 37, 32, 0.72);
  color: #f4efe6;
  border-color: transparent;
}

.bz-tag.muted {
  color: var(--mist);
  border-style: dashed;
}

.bz-dayun-wrap {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  overflow-x: auto;
}

.bz-dayun-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 16, 14, 0.04);
}

.bz-dayun-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(4.6rem, 1fr));
  min-width: 40rem;
}

.bz-dy-col {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
  text-align: center;
}

.bz-dy-col:last-child {
  border-right: 0;
}

.bz-dy-col:hover,
.bz-dy-col.active {
  background: rgba(226, 59, 42, 0.08);
}

.bz-dy-top {
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 0.1rem;
}

.bz-dy-gz {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.15;
  color: var(--cinnabar);
  letter-spacing: 0.06em;
  margin: 0.15rem 0;
}

.bz-dy-age {
  color: var(--cinnabar);
  font-size: 0.8rem;
  font-weight: 600;
}

.bz-dy-year {
  font-size: 0.75rem;
  color: var(--mist);
}

.bz-dy-years {
  padding: 0.25rem 0;
}

.bz-ln {
  font-size: 0.78rem;
  padding: 0.18rem 0;
  color: var(--ink-soft);
  border-bottom: 1px dashed rgba(42, 37, 32, 0.08);
}

.bz-dy-foot {
  padding: 0.35rem 0.2rem 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--mist);
}

.bazi-form-panel {
  padding: 1rem 1rem 1.15rem;
}

.bz-reverse-panel {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1rem 1.15rem;
}

.bz-reverse-panel .sub-title {
  margin-top: 0.15rem;
}

.bz-reverse-hint {
  margin: 0 0 0.85rem;
  color: var(--mist);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  line-height: 1.55;
}

.bz-reverse-pillars,
.bz-reverse-range {
  display: grid;
  gap: 0.55rem 0.65rem;
  margin-bottom: 0.75rem;
}

.bz-reverse-pillars {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bz-reverse-pillar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.55rem 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.bz-reverse-pillar-label {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-align: center;
  font-weight: 600;
}

.bz-reverse-gz {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.bz-reverse-gz select {
  border-color: rgba(26, 23, 20, 0.16);
  background: rgba(255, 255, 255, 0.92);
}

.bz-reverse-range {
  grid-template-columns: repeat(2, minmax(0, 10rem));
}

.bz-reverse-form label {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--mist);
}

.bz-reverse-form .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;
}

.bz-reverse-form select,
.bz-reverse-form input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  padding: 0.45rem 0.35rem;
  border-radius: var(--radius);
  text-align: center;
}

.bz-reverse-list-head {
  margin: 0.35rem 0 0.55rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.bz-reverse-list {
  display: grid;
  gap: 0.45rem;
  max-height: 16rem;
  overflow-y: auto;
}

.bz-reverse-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.bz-reverse-item strong {
  font-weight: 600;
  letter-spacing: 0.04em;
}

.bz-reverse-item span {
  font-size: 0.78rem;
  color: var(--mist);
}

.bz-reverse-item:hover,
.bz-reverse-item.active {
  border-color: rgba(226, 59, 42, 0.45);
  background: var(--cinnabar-soft);
}

.bz-reverse-empty {
  margin-top: 0.5rem;
  padding: 0.75rem 0.5rem;
}

.wheel-hint {
  margin: 0 0 0.75rem;
  text-align: center;
  color: var(--mist);
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}

.wheel-picker {
  display: grid;
  grid-template-columns: 0.7fr 1.1fr 0.8fr 0.8fr 1.4fr;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.wheel-picker[style*="--wheel-cols:4"],
.wheel-picker.cols-4 {
  grid-template-columns: 1.2fr 0.9fr 0.9fr 1.5fr;
}

.wheel-extra {
  margin: 0.75rem 0 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--line);
}

.wheel-col {
  min-width: 0;
}

.wheel-label {
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--mist);
  margin-bottom: 0.35rem;
}

.wheel-viewport {
  position: relative;
  height: 8.5rem;
  overflow-y: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  touch-action: pan-y;
}

.wheel-viewport::-webkit-scrollbar {
  display: none;
}

.wheel-highlight {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2.5rem;
  transform: translateY(-50%);
  border-top: 1px solid rgba(226, 59, 42, 0.35);
  border-bottom: 1px solid rgba(226, 59, 42, 0.35);
  background: var(--cinnabar-soft);
  pointer-events: none;
  z-index: 1;
}

.wheel-item {
  height: 2.5rem;
  display: grid;
  place-items: center;
  font-size: 0.92rem;
  color: var(--mist);
  cursor: pointer;
  user-select: none;
  transition: color 0.12s ease, opacity 0.12s ease;
}

.wheel-item.selected {
  color: var(--ink);
  font-weight: 600;
}

.wheel-item.pad {
  visibility: hidden;
  pointer-events: none;
}

.wheel-actions {
  padding: 0.35rem 0.25rem 0;
}

.sub-title {
  margin: 1.35rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.1em;
  font-weight: 400;
}

.dayun-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.dayun-cell {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  padding: 0.65rem 0.35rem;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
  display: grid;
  gap: 0.15rem;
  text-align: center;
  border-radius: var(--radius);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.dayun-cell:hover,
.dayun-cell.active {
  border-color: var(--gold);
  background: var(--cinnabar-soft);
  box-shadow: 0 0 0 1px var(--gold-soft);
}

.dy-gz {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.dy-meta,
.dy-age,
.dy-year {
  font-size: 0.75rem;
  color: var(--mist);
}

.liunian-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.liunian-cell {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  padding: 0.55rem 0.3rem;
  text-align: center;
}

.ln-year {
  font-size: 0.78rem;
  color: var(--mist);
}

.ln-gz {
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  margin: 0.15rem 0;
}

.ln-age,
.ln-ss {
  font-size: 0.72rem;
  color: var(--mist);
}

.result-panel {
  margin-top: 1.25rem;
  padding: 1.25rem;
  min-height: 8rem;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  text-align: center;
}

.pillar {
  border: 1px solid var(--line);
  padding: 0.85rem 0.5rem;
  background: rgba(255, 255, 255, 0.75);
}

.pillar .label {
  font-size: 0.8rem;
  color: var(--mist);
  letter-spacing: 0.12em;
}

.pillar .ganzhi {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.12em;
  margin: 0.35rem 0;
}

.pillar .wuxing {
  font-size: 0.8rem;
  color: var(--jade);
}

.palace-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.palace {
  min-height: 6.5rem;
  border: 1px solid var(--line);
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
}

.palace .name {
  color: var(--cinnabar);
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: 0.08em;
}

.palace .stars {
  color: var(--ink-soft);
  line-height: 1.45;
}

/* ========== 紫微斗数盘 ========== */
.zw-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.zw-head {
  text-align: center;
}

.zw-summary {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.zw-sub {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--mist);
}

.zw-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "a b c d"
    "e z z f"
    "g z z h"
    "i j k l";
  gap: 0;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  aspect-ratio: 1;
  max-width: 52rem;
  margin: 0 auto;
  width: 100%;
}

.zw-pos.a { grid-area: a; }
.zw-pos.b { grid-area: b; }
.zw-pos.c { grid-area: c; }
.zw-pos.d { grid-area: d; }
.zw-pos.e { grid-area: e; }
.zw-pos.f { grid-area: f; }
.zw-pos.g { grid-area: g; }
.zw-pos.h { grid-area: h; }
.zw-pos.i { grid-area: i; }
.zw-pos.j { grid-area: j; }
.zw-pos.k { grid-area: k; }
.zw-pos.l { grid-area: l; }
.zw-pos.z { grid-area: z; }

.zw-pos {
  min-height: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.zw-pos > .zw-cell,
.zw-pos > .zw-center {
  flex: 1;
  width: 100%;
}

.zw-pos.d,
.zw-pos.f,
.zw-pos.h,
.zw-pos.l {
  border-right: none;
}

.zw-pos.i,
.zw-pos.j,
.zw-pos.k,
.zw-pos.l {
  border-bottom: none;
}

.zw-cell {
  height: 100%;
  padding: 0.35rem 0.4rem;
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  line-height: 1.35;
  background: rgba(255, 255, 255, 0.5);
}

.zw-cell.is-ming {
  background: rgba(226, 59, 42, 0.06);
}

.zw-cell-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.2rem;
}

.zw-majors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  flex: 1;
  min-width: 0;
}

.zw-softs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.05rem 0.2rem;
  max-width: 42%;
  flex-shrink: 0;
}

.zw-age {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--mist);
  letter-spacing: 0;
  margin-left: 0.15rem;
}

.zw-aux {
  display: flex;
  flex-wrap: wrap;
  gap: 0.08rem 0.28rem;
  margin-top: 0.15rem;
}

.zw-misc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.04rem 0.22rem;
  margin-top: 0.12rem;
  flex: 1;
  align-content: flex-start;
}

.zw-cell-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.2rem;
  margin-top: auto;
  padding-top: 0.15rem;
}

.zw-cs {
  font-size: 0.62rem;
  color: var(--mist);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.zw-foot-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.02rem;
  text-align: right;
}

.zw-ganzhi {
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.zw-ganzhi em {
  font-style: normal;
  font-size: 0.72rem;
  margin-right: 0.05rem;
  opacity: 0.85;
}

.zw-pname {
  color: var(--cinnabar);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.zw-pname i {
  font-style: normal;
  margin-left: 0.15rem;
  font-size: 0.65rem;
  border: 1px solid var(--cinnabar);
  padding: 0 0.15rem;
}

.zw-star {
  white-space: nowrap;
}

.zw-star.major {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--cinnabar);
}

.zw-star.minor {
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.zw-star.soft {
  font-size: 0.62rem;
  color: #2a5f8f;
  font-weight: 500;
}

.zw-star.boshi,
.zw-star.jiangqian {
  font-size: 0.58rem;
  color: var(--ink-soft);
}

.zw-star.lucky {
  color: var(--jade);
}

.zw-star.sha {
  color: #8a3a28;
}

.zw-star.shensha:not(.soft):not(.sha) {
  color: var(--mist);
}

.zw-bright {
  font-style: normal;
  font-size: 0.58rem;
  color: var(--mist);
  margin-left: 0.05rem;
}

.zw-hua {
  font-style: normal;
  font-weight: 700;
  font-size: 0.58rem;
  margin-left: 0.05rem;
}

.zw-star.hua-lu .zw-hua,
.hua-lu i,
span.hua-lu { color: #2f6b3a; }
.zw-star.hua-quan .zw-hua,
.hua-quan i,
span.hua-quan { color: #6b3a8a; }
.zw-star.hua-ke .zw-hua,
.hua-ke i,
span.hua-ke { color: #2f5d8c; }
.zw-star.hua-ji .zw-hua,
.hua-ji i,
span.hua-ji { color: var(--cinnabar); }

.zw-empty-star {
  color: var(--mist);
}

.zw-center {
  height: 100%;
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(226, 59, 42, 0.07), transparent 60%),
    rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
}

.zw-center-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  color: var(--cinnabar);
}

.zw-center-row {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.zw-center-row span {
  color: var(--mist);
}

.zw-center-row strong {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.zw-center-meta {
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.zw-pillars {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.zw-sihua-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.zw-sihua-legend i {
  font-style: normal;
  margin-left: 0.1rem;
  font-size: 0.65rem;
}

.zw-flow {
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 0.4rem;
  align-items: stretch;
  max-width: 52rem;
  margin: 0 auto;
  width: 100%;
}

.zw-flow-label {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  color: var(--cinnabar);
  letter-spacing: 0.1em;
}

.zw-flow-row {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.25rem;
}

.zw-flow-cell {
  border: 1px solid var(--line);
  padding: 0.3rem 0.15rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.7rem;
}

.zw-flow-cell.on {
  background: rgba(15, 138, 107, 0.12);
  border-color: rgba(15, 138, 107, 0.35);
}

.zw-flow-cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.zw-flow-cell em {
  font-style: normal;
  color: var(--mist);
  font-size: 0.62rem;
}

.zw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  justify-content: center;
  align-items: center;
  font-size: 0.78rem;
}

.zw-legend .note-inline {
  color: var(--mist);
  font-size: 0.75rem;
}

.zw-modes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0.15rem 0 0.35rem;
}

.zw-mode-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.88rem;
  letter-spacing: 0.12em;
  padding: 0.45rem 1.05rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.zw-mode-btn:hover {
  border-color: var(--gold);
  color: var(--ink);
  background: #fff;
}

.zw-mode-btn.active {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
  background: var(--cinnabar-soft);
  box-shadow: 0 0 0 1px var(--gold-soft);
}

.zw-fly-info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  font-size: 0.78rem;
  margin: 0.35rem 0 0.15rem;
}

.zw-fly-info i {
  font-style: normal;
  margin: 0 0.1rem;
  font-size: 0.68rem;
}

.zw-cell {
  position: relative;
  cursor: default;
}

.zw-board.mode-feixing .zw-cell,
.zw-board.mode-sanhe .zw-cell {
  cursor: pointer;
}

.zw-cell.hl-from {
  box-shadow: inset 0 0 0 2px var(--cinnabar);
  background: rgba(226, 59, 42, 0.1);
}

.zw-cell.hl-sanhe {
  box-shadow: inset 0 0 0 2px rgba(15, 138, 107, 0.65);
  background: rgba(15, 138, 107, 0.08);
}

.zw-cell.hl-dui {
  box-shadow: inset 0 0 0 2px rgba(47, 93, 140, 0.7);
  background: rgba(47, 93, 140, 0.08);
}

.zw-cell.hl-lu {
  box-shadow: inset 0 0 0 2px #2f6b3a;
  background: rgba(47, 107, 58, 0.1);
}

.zw-cell.hl-quan {
  box-shadow: inset 0 0 0 2px #6b3a8a;
  background: rgba(107, 58, 138, 0.1);
}

.zw-cell.hl-ke {
  box-shadow: inset 0 0 0 2px #2f5d8c;
  background: rgba(47, 93, 140, 0.1);
}

.zw-cell.hl-ji {
  box-shadow: inset 0 0 0 2px var(--cinnabar);
  background: rgba(226, 59, 42, 0.12);
}

.zw-hl-badge {
  position: absolute;
  top: 0.2rem;
  right: 0.25rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.05rem 0.25rem;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.92);
  line-height: 1.2;
}

.zw-star.shensha {
  font-size: 0.64rem;
  opacity: 0.92;
}

.zw-star.em-hua {
  font-weight: 700;
  transform: scale(1.05);
}

.zw-star.dim {
  opacity: 0.45;
}

/* ========== 大六壬课式 ========== */
.lr-sheet {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 40rem;
  margin: 0 auto;
}

.lr-head-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.55rem;
  font-size: 0.95rem;
}

.lr-head-main strong {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.lr-tag {
  font-size: 0.75rem;
  color: var(--jade);
  border: 1px solid rgba(15, 138, 107, 0.35);
  padding: 0.05rem 0.35rem;
}

.lr-head-sub {
  font-size: 0.78rem;
  color: var(--mist);
}

.lr-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  text-align: center;
}

.lr-pillar {
  border: 1px solid var(--line);
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.68);
}

.lr-pillar small {
  display: block;
  color: var(--mist);
  font-size: 0.7rem;
}

.lr-pillar strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
}

.lr-params {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  font-size: 0.82rem;
}

.lr-params b {
  font-family: var(--font-display);
}

.lr-shensha {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.65rem;
  padding: 0.55rem 0.65rem;
  border: 1px dashed rgba(42, 37, 32, 0.28);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.78rem;
}

.lr-nianming {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: baseline;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(226, 59, 42, 0.22);
  background: var(--cinnabar-soft);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.lr-nianming b {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  font-weight: 400;
}

.lr-nianming.muted {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.45);
  color: var(--mist);
}

.lr-center-nian {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--cinnabar);
}

.lr-nian {
  display: inline-block;
  margin-left: 0.15rem;
  font-style: normal;
  font-size: 0.58rem;
  line-height: 1;
  padding: 0.08rem 0.18rem;
  border-radius: 2px;
  vertical-align: middle;
}

.lr-benming {
  color: #fff;
  background: var(--cinnabar);
}

.lr-xingnian {
  color: #fff;
  background: var(--jade);
}

.lr-cell.is-benming {
  box-shadow: inset 0 0 0 1.5px rgba(226, 59, 42, 0.55);
  background: rgba(226, 59, 42, 0.08);
}

.lr-cell.is-xingnian {
  box-shadow: inset 0 0 0 1.5px rgba(15, 138, 107, 0.55);
  background: rgba(15, 138, 107, 0.08);
}

.lr-cell.is-benming.is-xingnian {
  box-shadow: inset 0 0 0 1.5px rgba(212, 160, 23, 0.7);
  background: linear-gradient(135deg, rgba(226, 59, 42, 0.1), rgba(15, 138, 107, 0.1));
}

.lr-leg-note {
  color: var(--mist);
  font-size: 0.72rem;
  margin-left: 0.35rem;
}

.lr-ss b {
  font-family: var(--font-display);
}

.lr-geju {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  font-size: 0.82rem;
  color: var(--mist);
  letter-spacing: 0.08em;
}

.lr-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.lr-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.lr-block-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: var(--cinnabar);
  text-align: center;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--gold-soft);
  background: linear-gradient(90deg, transparent, var(--cinnabar-soft), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
}

.lr-chuan {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  max-width: 26rem;
  margin: 0.1rem auto;
  width: 100%;
}

.lr-chuan-col {
  text-align: center;
  border: 1px solid var(--line);
  padding: 0.4rem 0.2rem;
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.8rem;
}

.lr-chuan-mark {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.68rem;
  display: grid;
  place-items: center;
  color: var(--mist);
}

.lr-chuan-col strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0;
}

.lr-chuan-col strong i {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--mist);
}

.lr-jiang {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.lr-ss-tag {
  color: var(--mist);
  font-size: 0.72rem;
}

.lr-kes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  max-width: 30rem;
  margin: 0.1rem auto;
  width: 100%;
}

.lr-ke-col {
  text-align: center;
  border: 1px solid var(--line);
  padding: 0.35rem 0.15rem;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.lr-ke-char {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
}

.lr-ke-col small {
  color: var(--mist);
  font-size: 0.65rem;
}

.lr-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  grid-template-areas:
    "a b c d"
    "e z z f"
    "g z z h"
    "i j k l";
  gap: 0;
  border: 1px solid var(--line);
  aspect-ratio: 1;
  width: min(100%, 21rem);
  max-width: 21rem;
  margin: 0.15rem auto 0.35rem;
  background: #fffef9;
}

.lr-pos.a { grid-area: a; }
.lr-pos.b { grid-area: b; }
.lr-pos.c { grid-area: c; }
.lr-pos.d { grid-area: d; }
.lr-pos.e { grid-area: e; }
.lr-pos.f { grid-area: f; }
.lr-pos.g { grid-area: g; }
.lr-pos.h { grid-area: h; }
.lr-pos.i { grid-area: i; }
.lr-pos.j { grid-area: j; }
.lr-pos.k { grid-area: k; }
.lr-pos.l { grid-area: l; }
.lr-pos.z { grid-area: z; }

.lr-pos {
  min-height: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.lr-pos > .lr-cell,
.lr-pos > .lr-center {
  flex: 1;
  width: 100%;
}

.lr-pos.d,
.lr-pos.f,
.lr-pos.h,
.lr-pos.l {
  border-right: none;
}

.lr-pos.i,
.lr-pos.j,
.lr-pos.k,
.lr-pos.l {
  border-bottom: none;
}

.lr-cell {
  height: 100%;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  font-size: 0.78rem;
}

.lr-cell-j {
  color: var(--ink-soft);
  font-size: 0.72rem;
  position: relative;
  line-height: 1.2;
}

.lr-mark {
  position: absolute;
  right: -0.85rem;
  top: 0;
  font-style: normal;
  font-size: 0.58rem;
  width: 0.95rem;
  height: 0.95rem;
  border: 1px solid var(--mist);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cinnabar);
}

.lr-cell-tian {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.15;
  opacity: 1;
}

.lr-cell-gz {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  opacity: 0.78;
  line-height: 1.2;
}

.lr-cell-gz strong {
  font-size: 0.78rem;
  font-weight: 400;
}

.lr-kong {
  font-style: normal;
  font-size: 0.65rem;
  color: var(--mist);
  margin-left: 0.05rem;
}

.lr-chuan-gz {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.15;
  gap: 0.02rem;
}

.lr-chuan-gan,
.lr-chuan-zhi {
  display: block;
}

.lr-center {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: rgba(248, 243, 234, 0.85);
  text-align: center;
}

.lr-center-day {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.1em;
}

.lr-center-day strong {
  font-size: 1.5rem;
}

.lr-center-ju {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.lr-center-gui {
  font-size: 0.78rem;
  color: var(--mist);
}

.lr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  justify-content: center;
  font-size: 0.78rem;
}

.lr-legend i {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
  background: currentColor;
}

.lr-question {
  font-size: 0.88rem;
  padding: 0.45rem 0;
  border-top: 1px dashed var(--line);
}

.lr-question span {
  color: var(--mist);
  margin-right: 0.45rem;
}

.hexagram {
  display: grid;
  gap: 0.45rem;
  max-width: 16rem;
  margin: 0 auto 1rem;
}

.yao {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.yao .bars {
  flex: 1;
  display: flex;
  gap: 0.35rem;
  height: 0.7rem;
}

.yao .bar {
  flex: 1;
  background: var(--ink);
}

.yao.yin .bars {
  justify-content: space-between;
}

.yao.yin .bar {
  flex: 0 0 42%;
}

.yao.moving .bar {
  background: var(--cinnabar-bright);
}

.yao .mark {
  width: 1.5rem;
  text-align: center;
  color: var(--cinnabar);
  font-size: 0.85rem;
}

.liuren-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  max-width: 28rem;
}

.liuren-cell {
  border: 1px solid var(--line);
  padding: 0.75rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
  min-height: 4.5rem;
}

.liuren-cell strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.1em;
}

.note {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--mist);
}

.empty-state {
  color: var(--mist);
  text-align: center;
  padding: 2rem 1rem;
}

/* ========== 西洋星盘 ========== */
.xp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 0.15rem;
}

.xp-style-btn {
  appearance: none;
  border: 1px solid rgba(226, 59, 42, 0.45);
  background: rgba(255, 255, 255, 0.88);
  color: var(--cinnabar);
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.xp-style-btn:hover {
  background: var(--cinnabar-soft);
  border-color: var(--cinnabar);
}

.xp-toolbar-meta {
  font-size: 0.84rem;
  color: var(--mist);
  letter-spacing: 0.04em;
}

.xp-type-panel {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.35rem 0 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.xp-type-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.95);
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  padding: 0.55rem 0.35rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
}

.xp-type-btn:hover {
  border-color: rgba(226, 59, 42, 0.4);
  color: var(--cinnabar);
}

.xp-type-btn.active {
  border-color: var(--cinnabar);
  color: var(--cinnabar);
  background: var(--cinnabar-soft);
  box-shadow: inset 0 0 0 1px rgba(226, 59, 42, 0.2);
}

.xp-type-desc {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--mist);
  letter-spacing: 0.04em;
}

.xp-extra {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.xp-fada-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr));
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.xp-fada-cell {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.4rem 0.35rem;
  border: 1px solid var(--line);
  text-align: center;
  font-size: 0.78rem;
  color: var(--mist);
  background: rgba(255, 253, 248, 0.9);
}

.xp-fada-cell strong {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: 0.06em;
  font-weight: 600;
}

.xp-fada-cell.on {
  border-color: rgba(226, 59, 42, 0.5);
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
}

.xp-fada-cell.on strong {
  color: var(--cinnabar);
}

.xp-row-transit td {
  color: var(--mist);
  font-style: italic;
}

.xp-svg.classical .xp-ring-outer {
  stroke: rgba(74, 85, 96, 0.65);
}

.xp-sheet {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 52rem;
  margin: 0 auto;
}

.xp-summary {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.xp-sub {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: var(--mist);
}

.xp-board {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(12rem, 0.8fr);
  gap: 1rem;
  align-items: center;
}

.xp-svg {
  width: 100%;
  max-width: 26rem;
  height: auto;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 10px 28px -18px var(--shadow));
}

.xp-ring-outer {
  fill: rgba(255, 253, 248, 0.96);
  stroke: rgba(226, 59, 42, 0.55);
  stroke-width: 1.6;
}

.xp-ring {
  fill: none;
  stroke: rgba(26, 23, 20, 0.14);
  stroke-width: 1;
}

.xp-ring-inner {
  fill: rgba(247, 243, 234, 0.55);
  stroke: rgba(26, 23, 20, 0.12);
  stroke-width: 1;
}

.xp-sign-wedge {
  stroke: rgba(26, 23, 20, 0.08);
  stroke-width: 0.5;
  opacity: 0.55;
}

.xp-el-火 { fill: rgba(226, 59, 42, 0.14); }
.xp-el-土 { fill: rgba(212, 160, 23, 0.16); }
.xp-el-风 { fill: rgba(15, 138, 107, 0.12); }
.xp-el-水 { fill: rgba(61, 110, 165, 0.14); }

.xp-sign-label {
  font-size: 13px;
  fill: var(--ink-soft);
  pointer-events: none;
}

.xp-house-line {
  stroke: rgba(26, 23, 20, 0.18);
  stroke-width: 1;
}

.xp-house-num {
  font-size: 10px;
  fill: var(--mist);
}

.xp-axis-label {
  font-size: 10px;
  fill: var(--cinnabar);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.xp-asp {
  stroke-width: 1.1;
  opacity: 0.55;
}

.xp-asp-conj { stroke: #e23b2a; }
.xp-asp-opposition { stroke: #c45c26; }
.xp-asp-square { stroke: #a65d3a; stroke-dasharray: 3 2; }
.xp-asp-trine { stroke: #0f8a6b; }
.xp-asp-sextile { stroke: #2a7a8c; stroke-dasharray: 2 2; }

.xp-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.xp-elements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.xp-el-pill {
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

.xp-el-pill.fire { border-color: rgba(226, 59, 42, 0.35); color: #b52f22; }
.xp-el-pill.earth { border-color: rgba(212, 160, 23, 0.4); color: #8a6a12; }
.xp-el-pill.air { border-color: rgba(15, 138, 107, 0.35); color: #0b6b53; }
.xp-el-pill.water { border-color: rgba(61, 110, 165, 0.35); color: #2f5680; }

.xp-key {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.xp-key div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.92rem;
}

.xp-key span {
  color: var(--mist);
}

.xp-key strong {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.xp-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--mist);
  line-height: 1.55;
}

.xp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.xp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.xp-table th,
.xp-table td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.xp-table th {
  font-weight: 600;
  color: var(--ink-soft);
  background: rgba(247, 243, 234, 0.85);
  letter-spacing: 0.06em;
}

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

.xp-glyph {
  display: inline-block;
  min-width: 1.1em;
  font-weight: 700;
}

.xp-block-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.xp-asp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.4rem;
}

.xp-asp-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.45rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.86rem;
}

.xp-asp-item em {
  font-style: normal;
  color: var(--cinnabar);
  letter-spacing: 0.06em;
}

.xp-asp-item small {
  margin-left: auto;
  color: var(--mist);
}

.wheel-extra input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

@keyframes seal-in {
  from {
    opacity: 0;
    transform: rotate(-18deg) scale(0.85);
  }
  to {
    opacity: 1;
    transform: rotate(-6deg) scale(1);
  }
}

@media (max-width: 860px) {
  .site-header {
    position: sticky;
    top: 0;
    padding: 0.75rem 1rem;
    border-radius: 0;
  }

  main {
    padding: 0.35rem 0.85rem 2.5rem;
  }

  .section-title {
    font-size: 1.55rem;
  }

  .xp-board {
    grid-template-columns: 1fr;
  }

  .xp-svg {
    max-width: 22rem;
  }

  .xp-type-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-desc {
    font-size: 0.88rem;
  }

  .panel,
  .result-panel,
  .bazi-form-panel {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .bz-reverse-pillars {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bz-reverse-range {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-panel {
    padding: 0.75rem 0.65rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-shell {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .gz-pillars,
  .pillars,
  .dayun-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .liunian-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .wheel-picker {
    grid-template-columns: 0.65fr 1fr 0.7fr 0.7fr 1.15fr;
    gap: 0.2rem;
  }

  .wheel-picker[style*="--wheel-cols:4"],
  .wheel-picker.cols-4 {
    grid-template-columns: 1fr 0.75fr 0.75fr 1.2fr;
  }

  .wheel-viewport {
    height: 6.8rem;
  }

  .wheel-item {
    font-size: 0.8rem;
    height: 2.25rem;
  }

  .wheel-highlight {
    height: 2.25rem;
  }

  .bz-ss-row {
    grid-template-columns: 4.2rem 1fr;
  }

  .bz-gan,
  .bz-zhi {
    font-size: 1.45rem;
  }

  .bz-meta-row {
    grid-template-columns: 2.6rem 1fr;
  }

  .bz-dayun-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
  }

  .palace-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* —— 紫微盘（平板/手机横屏） —— */
  .zw-sheet {
    gap: 0.65rem;
  }

  .zw-summary {
    font-size: 0.95rem;
  }

  .zw-sub {
    font-size: 0.75rem;
    line-height: 1.45;
  }

  .zw-board {
    aspect-ratio: 1 / 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
  }

  .zw-cell {
    min-height: 0;
    padding: 0.22rem 0.25rem;
    font-size: 0.62rem;
    line-height: 1.25;
  }

  .zw-star.major {
    font-size: 0.68rem;
  }

  .zw-star.minor,
  .zw-star.soft,
  .zw-star.shensha,
  .zw-star.boshi,
  .zw-star.jiangqian {
    font-size: 0.52rem;
  }

  .zw-bright,
  .zw-hua {
    font-size: 0.48rem;
  }

  .zw-softs {
    max-width: 46%;
    gap: 0.02rem 0.12rem;
  }

  .zw-aux,
  .zw-misc {
    margin-top: 0.06rem;
    gap: 0.02rem 0.12rem;
  }

  .zw-cs {
    font-size: 0.5rem;
  }

  .zw-age {
    font-size: 0.55rem;
  }

  .zw-ganzhi {
    font-size: 0.78rem;
  }

  .zw-ganzhi em {
    font-size: 0.58rem;
  }

  .zw-pname {
    font-size: 0.62rem;
  }

  .zw-center {
    min-height: 0;
    padding: 0.4rem 0.35rem;
    font-size: 0.68rem;
    gap: 0.2rem;
  }

  .zw-center-title {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
  }

  .zw-center-meta {
    font-size: 0.62rem;
  }

  .zw-pillars {
    font-size: 0.72rem;
    gap: 0.2rem 0.45rem;
  }

  .zw-sihua-legend {
    font-size: 0.62rem;
    gap: 0.2rem 0.4rem;
  }

  .zw-modes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    width: 100%;
  }

  .zw-mode-btn {
    min-height: 2.5rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
  }

  .zw-fly-info {
    font-size: 0.7rem;
    gap: 0.25rem 0.5rem;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
  }

  .zw-fly-info span {
    flex-shrink: 0;
  }

  .zw-flow {
    grid-template-columns: 2.1rem 1fr;
    gap: 0.3rem;
  }

  .zw-flow-row {
    display: flex;
    overflow-x: auto;
    gap: 0.25rem;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: none;
  }

  .zw-flow-cell {
    flex: 0 0 3.6rem;
    padding: 0.25rem 0.1rem;
  }

  .zw-hl-badge {
    font-size: 0.52rem;
    padding: 0.02rem 0.15rem;
  }

  .zw-legend {
    font-size: 0.72rem;
    gap: 0.35rem 0.55rem;
  }

  /* —— 大六壬 —— */
  .lr-sheet {
    max-width: 100%;
    gap: 0.55rem;
  }

  .lr-head-main {
    font-size: 0.88rem;
    gap: 0.25rem 0.4rem;
  }

  .lr-head-sub {
    font-size: 0.72rem;
    line-height: 1.4;
  }

  .lr-pillars {
    gap: 0.25rem;
  }

  .lr-pillar {
    padding: 0.25rem 0.1rem;
  }

  .lr-pillar strong {
    font-size: 1.15rem;
  }

  .lr-params {
    font-size: 0.75rem;
    gap: 0.25rem 0.55rem;
  }

  .lr-shensha {
    font-size: 0.72rem;
    gap: 0.2rem 0.45rem;
    padding: 0.45rem 0.5rem;
    max-height: 5.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .lr-stack {
    gap: 0.7rem;
  }

  .lr-block-title {
    font-size: 0.88rem;
    letter-spacing: 0.14em;
  }

  .lr-chuan {
    max-width: 100%;
  }

  .lr-chuan-col,
  .lr-ke-col {
    padding: 0.35rem 0.1rem;
    font-size: 0.75rem;
  }

  .lr-chuan-col strong,
  .lr-chuan-gz,
  .lr-ke-char {
    font-size: 1.05rem;
  }

  .lr-kes {
    max-width: 100%;
  }

  .lr-board {
    aspect-ratio: 1 / 1;
    min-height: 0;
    width: min(100%, 18.5rem);
    max-width: 18.5rem;
  }

  .lr-cell {
    min-height: 0;
    padding: 0.25rem 0.15rem;
    font-size: 0.7rem;
  }

  .lr-cell-gz {
    font-size: 0.68rem;
  }

  .lr-cell-gz strong {
    font-size: 0.72rem;
  }

  .lr-cell-tian {
    font-size: 1.15rem;
  }

  .lr-center {
    min-height: 0;
    gap: 0.2rem;
    padding: 0.25rem;
  }

  .lr-center-day {
    font-size: 1.1rem;
  }

  .lr-center-day strong {
    font-size: 1.2rem;
  }

  .lr-center-ju,
  .lr-center-gui {
    font-size: 0.72rem;
  }

  .lr-mark {
    right: -0.55rem;
    width: 0.9rem;
    height: 0.9rem;
    font-size: 0.55rem;
  }

  .book-tabs {
    gap: 0.3rem;
  }

  .book-tab {
    min-height: 2.35rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
  }

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

  .book-page-bar {
    top: 3.85rem;
    gap: 0.55rem;
  }

  .book-page-title {
    font-size: 1.45rem;
  }

  .book-page-body {
    padding: 0.95rem 0.85rem 1.5rem;
  }

  .book-page .content {
    font-size: 1rem;
    line-height: 1.85;
    max-height: none;
    overflow: visible;
  }

  .book-reader .content {
    font-size: 0.92rem;
    line-height: 1.75;
    max-height: none;
    overflow: visible;
  }

  .book-reader-body.has-toc {
    grid-template-columns: 1fr;
  }

  .book-toc {
    position: static;
    max-height: none;
  }

  .book-toc-list {
    columns: 2;
    column-gap: 0.75rem;
  }

  .nav-toggle {
    display: inline-block;
    min-width: 2.6rem;
    min-height: 2.6rem;
  }

  .site-header {
    flex-wrap: wrap;
  }

  .auth-slot {
    order: 2;
    margin-left: 0;
  }

  .nav-toggle {
    order: 3;
    margin-left: auto;
  }

  .site-nav {
    order: 4;
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0.85rem;
    left: 0.85rem;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 16px 36px -20px var(--shadow);
    padding: 0.85rem;
    z-index: 30;
  }

  .site-nav a {
    padding: 0.55rem 0.35rem;
    min-height: 2.5rem;
    display: flex;
    align-items: center;
  }

  .site-nav.open {
    display: flex;
  }

  .hero {
    min-height: auto;
    padding-top: 1.5rem;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .btn {
    min-height: 2.6rem;
  }
}

/* 小屏手机竖屏 */
@media (max-width: 480px) {
  main {
    padding: 0.25rem 0.55rem 2.25rem;
  }

  .brand-text {
    font-size: 1.2rem;
  }

  .wheel-picker {
    grid-template-columns: 0.55fr 0.95fr 0.65fr 0.65fr 1.15fr;
    gap: 0.12rem;
  }

  .wheel-picker.cols-4 {
    grid-template-columns: 0.95fr 0.7fr 0.7fr 1.15fr;
  }

  .wheel-label {
    font-size: 0.7rem;
  }

  .wheel-item {
    font-size: 0.72rem;
    height: 2.1rem;
  }

  .wheel-viewport {
    height: 6.2rem;
  }

  .zw-cell {
    padding: 0.15rem 0.12rem;
    font-size: 0.54rem;
  }

  .zw-star.major {
    font-size: 0.58rem;
  }

  .zw-star.minor,
  .zw-star.soft,
  .zw-star.shensha,
  .zw-star.boshi,
  .zw-star.jiangqian {
    font-size: 0.45rem;
  }

  .zw-aux,
  .zw-misc {
    gap: 0.02rem 0.1rem;
  }

  .zw-majors {
    gap: 0.05rem 0.15rem;
  }

  .zw-cs {
    font-size: 0.45rem;
  }

  .zw-ganzhi {
    font-size: 0.68rem;
  }

  .zw-pname {
    font-size: 0.54rem;
    letter-spacing: 0.02em;
  }

  .zw-pname i {
    font-size: 0.48rem;
    padding: 0 0.08rem;
  }

  .zw-center {
    padding: 0.28rem 0.2rem;
    font-size: 0.58rem;
  }

  .zw-center-title {
    font-size: 0.82rem;
  }

  .zw-center-row {
    gap: 0.25rem;
  }

  .zw-center-meta div:first-child {
    display: none;
  }

  .zw-pillars {
    font-size: 0.62rem;
  }

  .zw-mode-btn {
    min-height: 2.35rem;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
  }

  .zw-flow-cell {
    flex: 0 0 3.2rem;
  }

  .zw-flow-cell strong {
    font-size: 0.85rem;
  }

  .lr-pillar strong {
    font-size: 1rem;
  }

  .lr-cell {
    padding: 0.15rem 0.08rem;
    font-size: 0.62rem;
  }

  .lr-cell-j {
    font-size: 0.58rem;
  }

  .lr-cell-tian {
    font-size: 1.05rem;
  }

  .lr-cell-gz {
    font-size: 0.62rem;
  }

  .lr-cell-gz strong {
    font-size: 0.68rem;
  }

  .lr-cell-tian {
    font-size: 0.58rem;
  }

  .lr-center-day {
    font-size: 0.95rem;
  }

  .lr-center-day strong {
    font-size: 1.05rem;
  }

  .lr-chuan-col strong,
  .lr-chuan-gz,
  .lr-ke-char {
    font-size: 0.95rem;
  }

  .bz-chart {
    font-size: 0.85rem;
  }

  .bz-side {
    min-width: 2.4rem;
  }

  .book-tab {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* 防止盘面横向撑破 */
@supports (width: 100dvw) {
  @media (max-width: 860px) {
    .lr-board {
      width: min(100%, 18.5rem);
      max-width: 18.5rem;
    }
  }
}
