:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-alt: #f7f8fa;
  --border: #e5e8ef;
  --accent: #2f6fed;
  --accent-2: #5b8def;
  --accent-dark: #1d4ed8;
  --accent-rgb: 47, 111, 237;
  --title: #2c3a4f;
  --text: #1a2332;
  --muted: #6b778c;
  --shadow: 0 2px 16px rgba(26, 35, 50, 0.06);
  --chart-bg: #ffffff;
  --chart-text: #1a2332;
  --chart-muted: #6b778c;
  --chart-line: #e5e8ef;
  --scroll-track: rgba(26, 35, 50, 0.05);
  --scroll-thumb: #c5ccd8;
  --scroll-thumb-hover: #2f6fed;
  --scroll-thumb-active: #1d4ed8;
  --wx-mu: #2e8b57;
  --wx-huo: #d64545;
  --wx-tu: #b8860b;
  --wx-jin: #c9a020;
  --wx-shui: #2b6cb0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.stars {
  position: fixed;
  inset: 0;
  background: #ffffff;
  z-index: -1;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.35rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  height: 2rem;
  padding: 0 0.7rem 0 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 237, 0.28);
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.link-back-arrow {
  font-size: 0.95rem;
  line-height: 1;
}

.link-back:hover {
  color: var(--accent-dark);
  border-color: rgba(47, 111, 237, 0.45);
  background: #f7f8fa;
}

.logo {
  margin-left: auto;
  text-align: right;
  min-width: 0;
}

.logo-glow {
  display: inline-flex;
  align-items: center;
  height: 2rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 111, 237, 0.28);
  background: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--title);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.notice-bar.is-quiet {
  display: none;
}
.notice-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem 0.45rem 0.7rem;
  min-height: 2.2rem;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(47, 111, 237, 0.08), rgba(255, 255, 255, 0.98) 28%, #f7f8fa);
  border-bottom: 1px solid rgba(229, 232, 239, 0.95);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  position: relative;
}
.notice-bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #5b8def, #2f6fed 55%, #1d4ed8);
}
.notice-horn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #5b8def, #2f6fed);
  box-shadow: 0 1px 4px rgba(47, 111, 237, 0.28);
  line-height: 0;
}
.notice-horn svg {
  display: block;
  width: 12px;
  height: 12px;
}
.notice-marquee {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.notice-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  width: max-content;
  will-change: transform;
  animation: notice-scroll 12s linear infinite;
}
.notice-text {
  flex: 0 0 auto;
  padding-right: 2.8rem;
  font-size: 0.8rem;
  color: #7a5a36;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  line-height: 1.35;
}
.notice-text em {
  font-style: normal;
  color: #1d4ed8;
  font-weight: 800;
  padding: 0.05rem 0.28rem;
  margin: 0 0.05rem;
  border-radius: 4px;
  background: rgba(47, 111, 237, 0.12);
}
@keyframes notice-scroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 1.25rem 2rem;
  max-width: 100%;
  width: 100%;
  margin: 0 auto;
}

.form-panel {
  align-self: start;
}

.result-panel {
  min-height: 400px;
  min-width: 0;
  background: var(--chart-bg);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.panel h2 {
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  font-weight: 600;
}

.field-row {
  margin-bottom: 1rem;
}

.field-row label {
  display: block;
  font-size: 0.78rem;
  color: var(--chart-muted);
  margin-bottom: 0.4rem;
}

.inline-field-row {
  margin-bottom: 1rem;
}

.inline-field-row > label:first-child {
  font-size: 0.78rem;
  color: var(--chart-muted);
  margin-bottom: 0;
}

.field-row select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  background: var(--panel-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

.field-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

/* —— 出生时辰自定义选择 —— */
.birth-hour-wrap {
  position: relative;
}

.birth-hour-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.birth-hour-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.58rem 0.85rem;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fa 100%);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.birth-hour-trigger::after {
  content: "";
  flex: 0 0 0.55rem;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid rgba(var(--accent-rgb), 0.55);
  border-bottom: 2px solid rgba(var(--accent-rgb), 0.55);
  transform: rotate(45deg) translate(-1px, -2px);
  opacity: 0.85;
}

.birth-hour-trigger:hover,
.birth-hour-trigger[aria-expanded="true"] {
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

.birth-hour-modal {
  position: fixed;
  inset: 0;
  z-index: 10005;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.birth-hour-modal.hidden { display: none; }

.birth-hour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(36, 24, 14, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.birth-hour-panel {
  position: relative;
  width: min(440px, 100%);
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 48% at 50% -8%, rgba(var(--accent-rgb), 0.2), transparent 58%),
    linear-gradient(180deg, var(--panel) 0%, var(--panel-alt) 100%);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 32px rgba(40, 24, 10, 0.18);
  animation: birthHourIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes birthHourIn {
  from { opacity: 0; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}

.birth-hour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
  flex-shrink: 0;
}

.birth-hour-head h3 {
  margin: 0;
  font-size: 1.02rem;
  color: var(--title);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.birth-hour-close {
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.birth-hour-close:hover {
  color: var(--accent-dark);
  background: #fff;
}

.birth-hour-grid {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.75rem 0.85rem calc(1rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.birth-hour-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.7rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fa 100%);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.birth-hour-item:hover,
.birth-hour-item:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent-dark);
}

.birth-hour-item.selected {
  border-color: transparent;
  background: linear-gradient(145deg, var(--accent-2), var(--accent) 55%, var(--accent-dark));
  color: #fffef9;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.28);
}

.birth-hour-item-name {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.birth-hour-item-range {
  font-size: 0.82rem;
  opacity: 0.88;
  font-weight: 500;
}

.birth-hour-item.selected .birth-hour-item-range {
  opacity: 0.95;
}

@media (min-width: 769px) {
  .birth-hour-modal {
    align-items: center;
    padding: 1.25rem;
  }
  .birth-hour-panel {
    border-radius: 16px;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.28);
  }
  @keyframes birthHourIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media (max-width: 768px) {
  .birth-hour-trigger {
    font-size: 16px;
    padding: 0.62rem 0.9rem;
  }
  .birth-hour-item {
    font-size: 1rem;
  }
}

.gender-field {
  margin-bottom: 1rem;
}

.gender-field-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  color: var(--chart-muted);
}

.gender-row {
  display: flex;
  gap: 0.55rem;
}

.gender-pill {
  flex: 1;
  position: relative;
  display: block;
  margin: 0;
  cursor: pointer;
}

.gender-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.gender-pill-text {
  display: block;
  padding: 0.62rem 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: #f7f8fa;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gender-pill:hover .gender-pill-text {
  border-color: rgba(59, 130, 246, 0.28);
  background: #f3f7ff;
}

.gender-pill:has(input:checked) .gender-pill-text {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #2563eb;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.gender-pill:has(input:focus-visible) .gender-pill-text {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  outline-offset: 2px;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.actions .btn.primary {
  flex: 1;
  min-width: 160px;
  width: 100%;
  padding: 0.7rem 1.35rem;
  font-size: 1rem;
  border-radius: 8px;
}

.interpret-actions {
  margin-top: 0.85rem;
  padding: 0.9rem 0.85rem 0.85rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.04);
}

.interpret-actions.hidden {
  display: none !important;
}

.interpret-actions-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.interpret-actions-titles {
  min-width: 0;
}

.interpret-actions-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: 0.01em;
}

.interpret-actions-title::before {
  content: "";
  width: 3px;
  height: 0.95em;
  border-radius: 2px;
  background: #3b82f6;
  flex-shrink: 0;
}

.interpret-actions-hint {
  margin: 0.28rem 0 0;
  font-size: 0.78rem;
  color: #9ca3af;
  line-height: 1.35;
}

.interpret-actions-badge {
  flex-shrink: 0;
  margin-top: 0.1rem;
  font-size: 0.72rem;
  color: #9ca3af;
  white-space: nowrap;
}

/* 选项名称旁的小徽章（如盲派解读「内测」，橙色） */
.interpret-option-tag {
  display: inline-block;
  vertical-align: 2px;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid rgba(234, 138, 22, .5);
  border-radius: 999px;
  background: rgba(245, 158, 11, .1);
  color: #c2660a;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}

.interpret-actions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.interpret-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  margin: 0;
  padding: 0.78rem 0.8rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  background: #f7f8fa;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.interpret-option:hover:not(:disabled) {
  background: #f1f3f6;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 4px rgba(20, 30, 50, 0.05);
}

.interpret-option:active:not(:disabled) {
  background: #ebeff4;
}

.interpret-option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.interpret-option-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.interpret-option--liang .interpret-option-dot {
  background: #3b82f6;
}

.interpret-option--realtime .interpret-option-dot {
  background: #22c55e;
}

.interpret-option--chaozhi .interpret-option-dot {
  background: #f59e0b;
}

/* 盲派选项：描述强制单行（省略号截断），防止换行撑高按钮 */
.interpret-option--mangpai .interpret-option-desc {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.interpret-option-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.interpret-option-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.3;
}

.interpret-option-desc {
  font-size: 0.74rem;
  color: #9ca3af;
  line-height: 1.4;
}

.interpret-option-arrow {
  flex-shrink: 0;
  font-size: 1.25rem;
  line-height: 1;
  color: #c4c9d2;
  font-weight: 400;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.28);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #2f6fed);
  box-shadow: 0 2px 14px rgba(var(--accent-rgb), 0.38);
}

.chart-wrap {
  width: 100%;
}

.chart-card {
  background: var(--chart-bg);
  color: var(--chart-text);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.chart-head {
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid var(--chart-line);
  scroll-margin-top: 0.75rem;
}

.chart-head-top {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
  min-width: 0;
}

.btn-explain {
  flex-shrink: 0;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(var(--accent-rgb), 0.2);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-explain:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #2f6fed);
}

.btn-explain:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-liang {
  border-color: rgba(47, 111, 237, 0.35);
  background: linear-gradient(135deg, #4a7fe0, #2f6fed);
  box-shadow: 0 2px 6px rgba(47, 111, 237, 0.22);
}

.btn-liang:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #2f6fed);
}

.btn-chaozhi {
  border-color: rgba(46, 125, 90, 0.5);
  background: linear-gradient(135deg, #1f7a55, #2e9b6a 55%, #176b49);
  box-shadow: 0 2px 6px rgba(31, 122, 85, 0.28);
}

.btn-chaozhi:hover:not(:disabled) {
  background: linear-gradient(135deg, #176b49, #1f7a55);
}

.btn-realtime {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding: 0.42rem 1rem;
  border: 1px solid rgba(47, 111, 237, 0.4);
  background: linear-gradient(135deg, #5b8def 0%, #2f6fed 45%, #1d4ed8 100%);
  box-shadow:
    0 2px 8px rgba(47, 111, 237, 0.28),
    0 0 0 0 rgba(91, 141, 239, 0.35);
  animation: realtime-breathe 2.4s ease-in-out infinite;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn-realtime-glow {
  position: absolute;
  inset: -40%;
  z-index: 0;
  background: conic-gradient(from 180deg, transparent 0deg, rgba(255, 255, 255, 0.35) 40deg, transparent 80deg);
  opacity: 0.55;
  animation: realtime-spin 3.6s linear infinite;
  pointer-events: none;
}

.btn-realtime-text {
  position: relative;
  z-index: 1;
  display: inline-block;
  letter-spacing: 0.02em;
}

.btn-realtime::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  z-index: 2;
  width: 55%;
  height: 100%;
  background: linear-gradient(105deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: skewX(-18deg);
  animation: realtime-shine 2.8s ease-in-out infinite;
  pointer-events: none;
}

.btn-realtime:hover:not(:disabled) {
  background: linear-gradient(135deg, #6a9af5 0%, #2f6fed 45%, #1d4ed8 100%);
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    0 6px 18px rgba(47, 111, 237, 0.38),
    0 0 22px rgba(91, 141, 239, 0.28);
  animation: none;
}

.btn-realtime:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 2px 8px rgba(47, 111, 237, 0.28);
}

.btn-realtime:disabled {
  animation: none;
}

.btn-realtime:disabled .btn-realtime-glow,
.btn-realtime:disabled::after {
  animation: none;
  opacity: 0.2;
}

@keyframes realtime-breathe {
  0%, 100% {
    box-shadow:
      0 2px 8px rgba(47, 111, 237, 0.26),
      0 0 0 0 rgba(91, 141, 239, 0.28);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 4px 16px rgba(47, 111, 237, 0.38),
      0 0 18px 2px rgba(91, 141, 239, 0.22);
    transform: scale(1.035);
  }
}

@keyframes realtime-shine {
  0%, 55% { left: -120%; }
  80%, 100% { left: 140%; }
}

@keyframes realtime-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .btn-realtime,
  .btn-realtime-glow,
  .btn-realtime::after {
    animation: none;
  }

  .btn-realtime:hover:not(:disabled) {
    transform: none;
  }
}

.btn-explain:disabled {
  opacity: 0.65;
  cursor: wait;
}

.chart-gender {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 1.05rem;
  font-weight: 700;
  color: #222;
  margin: 0;
  min-width: 0;
}

.chart-meta {
  background: #efede8;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.82rem;
  line-height: 1.65;
  color: #555;
}

.chart-meta p + p {
  margin-top: 0.25rem;
}

.chart-extra {
  font-size: 0.78rem;
  color: var(--chart-muted);
}
/* 调候用神 / 喜忌行（与 chart-meta 其它项对齐） */
.yong-box {
  margin: 0.35rem 0 0;
}
.yong-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.65;
}
.yong-row + .yong-row {
  margin-top: 0.25rem;
}
.yong-label {
  flex: 0 0 auto;
  padding: 0.04rem 0.45rem 0.04rem 0;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.yong-label.tiaohou {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
}
.yong-label.xiji {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}
.yong-value {
  font-weight: 700;
  color: var(--title);
}
.yong-source {
  margin-left: auto;
  flex: 0 0 auto;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--chart-muted);
}

.chenggu-section {
  margin: 0 0.75rem 0.65rem;
  padding: 0.75rem 0.85rem;
  background: linear-gradient(135deg, #ffffff 0%, #f7f8fa 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.chenggu-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.chenggu-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 4px;
}

.chenggu-weight {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--title);
  letter-spacing: 0.05em;
}

.chenggu-breakdown {
  margin-top: 0.45rem;
  font-size: 0.75rem;
  color: var(--chart-muted);
}

.chenggu-poem,
.chenggu-detail {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  line-height: 1.75;
  color: var(--chart-text);
  text-align: justify;
}

.chenggu-detail {
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.dayun-curve-section {
  margin: 0 0.75rem 0.85rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fa 100%);
  box-shadow: 0 6px 18px rgba(26, 35, 50, 0.05);
}
.dayun-curve-section[hidden] {
  display: none !important;
}

.dayun-curve-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.72rem 0.85rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(247, 248, 250, 0.98), rgba(255, 255, 255, 0.9));
}

.dayun-curve-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.dayun-curve-title-mark {
  flex: 0 0 auto;
  width: 0.28rem;
  height: 1.05rem;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.dayun-curve-title strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--title);
}

.dayun-curve-legend {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
}

.dayun-curve-section.is-loading {
  min-height: 8rem;
}

.dayun-curve-section.is-idle {
  min-height: 0;
}

.dayun-curve-idle {
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 0.85rem 0.9rem 1.05rem;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, 0.96), transparent 58%),
    linear-gradient(180deg, #ffffff, #f3f6fb);
}

.dayun-curve-idle-art {
  width: min(100%, 320px);
  opacity: 0.95;
}

.dayun-curve-idle-svg {
  display: block;
  width: 100%;
  height: auto;
}

.dayun-curve-idle-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.dayun-curve-idle-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 55%, var(--accent-dark) 100%);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.dayun-curve-idle-btn:hover {
  filter: brightness(1.04);
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.28);
  transform: translateY(-1px);
}
.dayun-curve-idle-btn:active {
  transform: translateY(0);
}

.dayun-curve-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 6rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.dayun-curve-spinner {
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid rgba(var(--accent-rgb), 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dayun-curve-spin 0.8s linear infinite;
}

@keyframes dayun-curve-spin {
  to { transform: rotate(360deg); }
}

.dayun-curve-lg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.32rem 0.7rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.dayun-curve-lg.is-on {
  background: #fff;
  box-shadow: 0 1px 4px rgba(26, 35, 50, 0.08);
}

.dayun-curve-lg.series-wealth.is-on { color: #9a6b08; }
.dayun-curve-lg.series-health.is-on { color: #3d6f4a; }

.dayun-curve-lg:hover {
  background: rgba(255, 255, 255, 0.9);
}

.dayun-curve-lg.is-off {
  opacity: 0.48;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.dayun-curve-lg .lg-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.dayun-curve-lg.series-wealth .lg-dot {
  background: linear-gradient(145deg, #f0c24a, #c99212);
}

.dayun-curve-lg.series-health .lg-dot {
  background: linear-gradient(145deg, #6db07a, #3f8a52);
}

.dayun-curve-lg.is-off .lg-dot {
  filter: grayscale(0.35);
  opacity: 0.7;
}

.dayun-curve-tip {
  margin: 0;
  padding: 0.85rem 1rem 1rem;
  font-size: 0.82rem;
  color: var(--chart-muted);
  line-height: 1.45;
  text-align: center;
}

.dayun-curve-canvas {
  margin: 0.55rem 0.6rem 0.7rem;
  padding: 0.35rem 0.2rem 0.2rem;
  border-radius: 12px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.95), transparent 55%),
    linear-gradient(180deg, #ffffff, #f3f6fb);
  border: 1px solid var(--border);
}

.dayun-curve-svg-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dayun-curve-svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}

.dayun-curve-grid {
  stroke: rgba(47, 111, 237, 0.12);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.dayun-curve-axis {
  fill: #6b778c;
  font-size: 15px;
  font-weight: 700;
}

.dayun-curve-line {
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dayun-curve-line-wealth { stroke: #d4a017; stroke-width: 2.4; }
.dayun-curve-line-health { stroke: #4f9a62; stroke-width: 2.4; }

.dayun-curve-dot {
  fill: #ffffff;
  stroke-width: 2.2;
}
.dayun-curve-dot-wealth { stroke: #d4a017; }
.dayun-curve-dot-health { stroke: #4f9a62; }

.dayun-curve-val {
  font-size: 16px;
  font-weight: 800;
}
.dayun-curve-val-wealth { fill: #a67c00; }
.dayun-curve-val-health { fill: #2f6b3d; }

.dayun-curve-gz {
  fill: var(--title);
  font-size: 16px;
  font-weight: 800;
}

.dayun-curve-age {
	  fill: var(--muted);
	  font-size: 14px;
	  font-weight: 700;
	}

	/* ── 五行能量占比横向柱状图 ── */
  .wuxing-bar-section {
    margin: 0 0.75rem 0.85rem;
    padding: 0.65rem 0.75rem 0.5rem;
    background: var(--panel);
    border-radius: 10px;
    border: 1px solid var(--border);
  }
  .wuxing-bar-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
  }
  .wuxing-bar-title-mark {
    flex: 0 0 auto;
    width: 0.28rem;
    height: 1rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #5b8def, #2f6fed);
  }
  .wuxing-bar-head strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--title);
  }
  /* 标题行右侧的原局按钮 */
  .wuxing-dayun-btn-origin {
    margin-left: auto;
    min-width: 2.8rem;
  }
  .wuxing-bar-body {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }
  .wuxing-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .wuxing-bar-label {
    flex: 0 0 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
  }
  .wuxing-bar-track {
    flex: 1;
    height: 0.7rem;
    background: #f0f1f4;
    border-radius: 999px;
    overflow: hidden;
  }
  .wuxing-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
    min-width: 2px;
  }
  .wuxing-bar-value {
    flex: 0 0 2.8rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-align: right;
  }
  /* 五行能量-大运选择器 */
  .wuxing-dayun-row {
    padding: 0.35rem 0 0.45rem;
    margin: 0 0 0.35rem;
    border-bottom: 1px solid var(--border);
  }
  .wuxing-dayun-scroll {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem 0.4rem;
  }
  .wuxing-dayun-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    min-width: 2.4rem;
    padding: 0.25rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    cursor: pointer;
    font-size: 0.78rem;
    line-height: 1.3;
    transition: all 0.2s ease;
    color: var(--text);
  }
  .wuxing-dayun-btn:hover {
    border-color: #5b8def;
    background: rgba(91, 141, 239, 0.06);
  }
  .wuxing-dayun-btn.active {
    border-color: #5b8def;
    background: #5b8def;
    color: #fff;
    box-shadow: 0 1px 4px rgba(91, 141, 239, 0.35);
  }
  .wuxing-dayun-btn.active .gz-char.xs {
    color: #fff !important;
  }
  .wuxing-dayun-age {
    font-size: 0.6rem;
    opacity: 0.7;
    margin-left: 0.08rem;
  }
  .wuxing-dayun-tag {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0 0.1rem;
  }
  .wuxing-dayun-btn.active .wuxing-dayun-age {
    color: #fff;
    opacity: 0.9;
  }
  .gz-char.xs {
    font-size: 0.78rem;
    padding: 0 0.05rem;
  }

	.chenggu-meta {
  margin-top: 0.6rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.chenggu-meta-row {
  padding: 0.35rem 0;
  font-size: 0.85rem;
  line-height: 1.75;
}

.chenggu-meta-row + .chenggu-meta-row {
  border-top: 1px solid var(--border);
}

.chenggu-meta-inline .chenggu-meta-label {
  color: var(--accent-dark);
  font-weight: 600;
}

.chenggu-meta-inline .chenggu-meta-value {
  color: var(--chart-text);
}

.chenggu-meta-block .chenggu-meta-label {
  color: var(--accent-dark);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.chenggu-meta-block .chenggu-meta-value {
  color: var(--chart-text);
  text-align: justify;
  word-break: break-word;
}

.chenggu-meta-block.chenggu-meta-summary .chenggu-meta-value {
  font-weight: 600;
}

.sizhu-grid {
  padding: 0.35rem 0.5rem 0.75rem;
}

.sz-row {
  display: grid;
  grid-template-columns: 3.2em repeat(4, 1fr);
  align-items: center;
  border-bottom: 1px solid var(--chart-line);
  min-height: 2rem;
}

.sz-row:last-child {
  border-bottom: none;
}

.sz-label {
  font-size: 0.72rem;
  color: var(--chart-muted);
  text-align: center;
  padding: 0.35rem 0.15rem;
}

.sz-cell {
  text-align: center;
  padding: 0.35rem 0.2rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #444;
  word-break: break-word;
}

.sz-header .sz-col-head {
  font-size: 0.78rem;
  font-weight: 600;
  color: #666;
}

.sz-gz-row {
  min-height: 3rem;
}

.sz-gz-row .sz-cell {
  padding: 0.5rem 0.2rem;
}

.gz-char {
  display: inline-block;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}

.gz-char.sm {
  font-size: 1.15rem;
}

.wx-木 { color: var(--wx-mu); }
.wx-火 { color: var(--wx-huo); }
.wx-土 { color: var(--wx-tu); }
.wx-金 { color: var(--wx-jin); }
.wx-水 { color: var(--wx-shui); }

.sz-zhi-row {
  align-items: start;
}

.sz-zhi-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}

.cang-list {
  width: 100%;
  margin-top: 0.15rem;
}

.cang-line {
  font-size: 0.76rem;
  line-height: 1.55;
  color: #666;
  white-space: nowrap;
}

.cang-gan {
  font-weight: 600;
}

.cang-ss {
  color: #888;
}

.sz-shensha-row {
  align-items: start;
}

.sz-shensha-cell {
  text-align: center;
  padding: 0.45rem 0.25rem;
}

.shensha-list {
  width: 100%;
}

.shensha-line {
  font-size: 0.72rem;
  line-height: 1.55;
  color: #555;
}

.dayun-section {
  border-top: 1px solid var(--chart-line);
  padding: 0.75rem 0.65rem 1rem;
}

.dayun-liunian-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  padding: 0.35rem 0.15rem 0.5rem;
  margin: 0 -0.15rem;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(0, 0, 0, 0.02) 100%);
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
}

.dayun-liunian-scroll::-webkit-scrollbar {
  height: 7px;
}

.dayun-liunian-scroll::-webkit-scrollbar-track {
  background: var(--scroll-track);
  border-radius: 999px;
  margin: 0 0.35rem;
}

.dayun-liunian-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #d4cdc3 0%, var(--scroll-thumb) 50%, #b8afa3 100%);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.dayun-liunian-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(90deg, #6aad7d 0%, var(--scroll-thumb-hover) 50%, #4d9160 100%);
  border-color: rgba(255, 255, 255, 0.65);
}

.dayun-liunian-scroll::-webkit-scrollbar-thumb:active {
  background: linear-gradient(90deg, #f0a050 0%, var(--scroll-thumb-active) 50%, #d96a15 100%);
}

.dayun-liunian-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

.dayun-liunian-inner {
  width: max-content;
  min-width: 100%;
}

.dayun-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.45rem;
}

.dayun-badge {
  flex: 0 0 auto;
  margin-top: 0.15rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #5a9e6f;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: nowrap;
}

.dayun-pillars {
  display: flex;
  gap: 0.5rem;
  min-width: min-content;
  padding-bottom: 0.15rem;
}

.dayun-col {
  flex: 0 0 auto;
  min-width: 2.6rem;
  text-align: center;
  cursor: pointer;
  padding: 0.1rem 0.25rem 0.35rem;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease;
}

.dayun-col.active {
  border-bottom-color: #e67e22;
}

.dayun-col:hover {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
}

.dayun-gz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
  margin-bottom: 0.2rem;
}

.dayun-age {
  font-size: 0.68rem;
  color: var(--chart-muted);
}

.liunian-panel {
  margin-top: 0;
}

.liunian-summary {
  font-size: 0.78rem;
  color: #444;
  margin-bottom: 0.35rem;
  line-height: 1.55;
}

.liunian-layout {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: max-content;
  min-width: 100%;
}

.liunian-side {
  flex: 0 0 2.4rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0.1rem 0;
}

.ln-side-label {
  display: block;
  padding: 0.18rem 0.2rem;
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
  color: #fff;
}

.ln-label-liunian {
  background: #5a9e6f;
}

.ln-scroll-line {
  white-space: nowrap;
}

.liunian-layout,
.liunian-body,
.liunian-item,
.liunian-row,
.liunian-sha-row,
.liunian-summary {
  width: max-content;
  min-width: 100%;
}

.liunian-body {
  flex: 1;
  min-width: max-content;
}

.liunian-item {
  margin-bottom: 0.12rem;
}

.liunian-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  padding: 0.14rem 0 0.04rem;
  font-size: 0.78rem;
  line-height: 1.55;
}

.liunian-sha-row {
  padding: 0 0 0.14rem;
  font-size: 0.74rem;
  line-height: 1.5;
}

.dayun-sha-row {
  margin-bottom: 0.45rem;
}

.ln-sha-text {
  color: #999;
  white-space: nowrap;
}

.ln-relations {
  color: #333;
  white-space: nowrap;
}

.ln-gz {
  display: inline-flex;
  align-items: baseline;
  flex-shrink: 0;
  white-space: nowrap;
}

.ln-gz .gz-char.sm {
  font-size: 1rem;
}

.ln-age,
.ln-year {
  color: #333;
  white-space: nowrap;
  flex-shrink: 0;
}

.ln-jx {
  font-weight: 600;
  flex-shrink: 0;
}

.ln-jx-ji {
  color: #e67e22;
}

.ln-jx-xiong {
  color: #5a9e6f;
}

@media (max-width: 480px) {
  .dayun-bar {
    gap: 0.4rem;
  }

  .dayun-badge {
    font-size: 0.72rem;
    padding: 0.1rem 0.35rem;
  }

  .liunian-side {
    flex-basis: 2.1rem;
  }

  .ln-side-label {
    font-size: 0.66rem;
    padding: 0.12rem 0.1rem;
  }

  .liunian-row {
    font-size: 0.72rem;
    gap: 0.25rem 0.4rem;
  }

  .ln-gz .gz-char.sm {
    font-size: 0.92rem;
  }
}

.empty-hint {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--chart-muted);
  line-height: 1.7;
}

.empty-hint .muted {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  color: #aaa;
}

.muted { color: var(--chart-muted); }
.hidden { display: none !important; }

.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  padding: 0.85rem 1.4rem;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border: 1px solid #e6ddd0 !important;
  border-radius: 10px;
  color: #4a3b2f !important;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
  z-index: 10120;
  max-width: min(86vw, 360px);
  box-shadow: 0 12px 32px rgba(40, 28, 16, 0.2);
  pointer-events: none;
}

@media (min-width: 901px) {
  .layout {
    padding: 1rem 1.5rem 2rem;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  }

  .form-panel {
    position: sticky;
    top: 0.75rem;
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .top-bar {
    padding: 0.65rem 0.85rem;
  }

  .logo-glow {
    font-size: 1.05rem;
  }

  .layout {
    padding: 0.65rem 0.75rem 1.25rem;
  }

  .panel {
    padding: 0.85rem;
  }

  .chart-head-top {
    flex-wrap: nowrap;
    align-items: center;
  }

  .chart-gender {
    font-size: 0.95rem;
    width: auto;
    flex: 0 0 auto;
  }

  .interpret-actions {
    padding: 0.8rem 0.75rem 0.75rem;
  }

  .interpret-option {
    padding: 0.72rem 0.72rem;
  }

  .actions .btn.primary {
    min-width: 0;
    padding: 0.65rem 1.1rem;
    font-size: 0.95rem;
  }

  .field-row select {
    font-size: 16px;
  }

  .gz-char {
    font-size: 1.55rem;
  }

  .sz-row {
    grid-template-columns: 2.6em repeat(4, 1fr);
  }

  .sz-shensha-row .sz-cell {
    font-size: 0.68rem;
  }
}

/* 出生日期选择器 — 与本页浅色主题一致 */
.birth-pick-btn {
  background: var(--panel-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
}

.birth-pick-btn.placeholder {
  color: var(--chart-muted);
}

.birth-pick-btn:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.15);
}

.field-label-row .field-label {
  color: var(--chart-muted);
}

.birth-date-block {
  margin-bottom: 1.1rem;
}

body.modal-open {
  overflow: hidden;
}

.ai-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.ai-confirm-modal.hidden {
  display: none;
}

.ai-confirm-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #121826;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.ai-confirm-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.ai-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: max(0.85rem, env(safe-area-inset-top)) 1rem 0.85rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
  background: linear-gradient(180deg, #fff, #f3f6fb);
}

.ai-confirm-header h3 {
  margin: 0;
  font-size: 1.08rem;
  color: var(--title);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ai-confirm-close {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--accent-dark);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.ai-confirm-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.ai-confirm-body {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.1rem 1.4rem;
  background:
    radial-gradient(ellipse 80% 42% at 50% 0%, rgba(var(--accent-rgb), 0.12), transparent 70%),
    radial-gradient(circle at 12% 88%, rgba(47, 111, 237, 0.06), transparent 32%),
    radial-gradient(circle at 88% 78%, rgba(91, 141, 239, 0.08), transparent 30%),
    linear-gradient(180deg, #f7f8fa 0%, #f3f6fb 48%, #eef2f8 100%);
  -webkit-overflow-scrolling: touch;
}

.ai-confirm-stage {
  width: min(420px, 100%);
  margin: 0 auto;
}

.ai-confirm-hero {
  position: relative;
  width: 4.6rem;
  height: 4.6rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
}

.ai-confirm-hero-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: radial-gradient(circle at 35% 30%, #fff 0%, #eaf1fc 55%, #d7e4f8 100%);
  box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.16);
}

.ai-confirm-hero-mark {
  position: relative;
  z-index: 1;
  color: var(--accent-dark);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.ai-confirm-lead {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.65;
  text-align: center;
}

.ai-confirm-list {
  margin: 0;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(26, 35, 50, 0.06);
  overflow: hidden;
}

.ai-confirm-list > div {
  display: grid;
  grid-template-columns: 5.6em 1fr;
  gap: 0.4rem 0.85rem;
  align-items: center;
  padding: 0.78rem 0.95rem;
  border-top: 1px solid rgba(var(--accent-rgb), 0.12);
}

.ai-confirm-list > div:first-child {
  border-top: 0;
}

.ai-confirm-list dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.ai-confirm-list dd {
  margin: 0;
  color: var(--title);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.45;
  word-break: break-word;
}

.ai-confirm-hint {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
}

.ai-confirm-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin: 1.35rem 0 0;
  padding: 0;
  list-style: none;
}

.ai-confirm-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.7rem 0.35rem 0.75rem;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  text-align: center;
}

.ai-confirm-steps li span {
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: #fff;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
}

.ai-confirm-steps li.is-active {
  border-color: rgba(var(--accent-rgb), 0.42);
  background: linear-gradient(180deg, #fff, #eef4fc);
  color: var(--accent-dark);
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.12);
}

.ai-confirm-steps li.is-active span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ai-confirm-actions {
  display: flex;
  justify-content: stretch;
  gap: 0.55rem;
  flex: 0 0 auto;
  padding: 0.9rem 1rem max(0.95rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(var(--accent-rgb), 0.16);
  background: linear-gradient(180deg, #fff, #f3f6fb);
}

.ai-confirm-actions .btn {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
}

.ai-confirm-cancel {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
}

.ai-confirm-cancel:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.ai-confirm-ok {
  border: 1px solid var(--accent);
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 55%, var(--accent-dark));
  box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.28);
}

@media (max-width: 720px) {
  .ai-confirm-body {
    min-height: 0;
    align-items: center;
  }

  .ai-confirm-stage {
    padding-bottom: 0.25rem;
  }

  .ai-confirm-hero {
    width: 5rem;
    height: 5rem;
    margin-bottom: 1.15rem;
  }

  .ai-confirm-lead {
    font-size: 0.95rem;
  }

  .ai-confirm-list > div {
    padding: 0.88rem 1rem;
  }

  .ai-confirm-list dd {
    font-size: 1.02rem;
  }

  .ai-confirm-steps {
    margin-top: 1.55rem;
  }
}

@media (min-width: 721px) {
  .ai-confirm-modal {
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
  }

  .ai-confirm-backdrop {
    background: rgba(26, 20, 16, 0.55);
  }

  .ai-confirm-panel {
    width: min(440px, 100%);
    height: auto;
    max-height: min(88vh, 720px);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(18, 24, 38, 0.28);
  }

  .ai-confirm-header {
    padding: 0.85rem 1rem;
  }

  .ai-confirm-body {
    padding: 1.15rem 1.15rem 1.25rem;
    align-items: stretch;
  }

  .ai-confirm-hero {
    width: 3.8rem;
    height: 3.8rem;
    margin-bottom: 0.85rem;
  }

  .ai-confirm-hero-mark {
    font-size: 1.2rem;
  }

  .ai-confirm-steps {
    margin-top: 1.1rem;
  }

  .ai-confirm-actions {
    justify-content: flex-end;
  }

  .ai-confirm-actions .btn {
    flex: 0 0 auto;
    min-width: 7.5rem;
  }
}

.interpret-modal {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.interpret-modal.hidden {
  display: none;
}

.interpret-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #121826;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.interpret-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.interpret-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: max(0.85rem, env(safe-area-inset-top)) 1rem 0.85rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
  background: linear-gradient(180deg, #fff, #f3f6fb);
  flex-shrink: 0;
}

.interpret-header-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.interpret-header h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--title);
  font-weight: 700;
  line-height: 1.25;
}

.interpret-disclaimer {
  margin: 0;
  color: var(--chart-muted, #6b778c);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.interpret-close {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  color: var(--chart-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.interpret-save-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(var(--accent-rgb, 120 132 190), 0.35);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb, 120 132 190), 0.08), rgba(var(--accent-rgb, 120 132 190), 0.03));
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.interpret-save-pdf-icon {
  width: 0.95rem;
  height: 0.95rem;
  display: block;
}

.interpret-save-pdf:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent-grad, var(--accent));
}

.interpret-save-pdf.is-busy {
  opacity: 0.6;
  pointer-events: none;
}

.interpret-close:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.interpret-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.interpret-minimize {
  min-height: 2rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.interpret-minimize.hidden {
  display: none;
}

.interpret-minimize:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.interpret-mini-dock {
  position: fixed;
  right: max(0.8rem, env(safe-area-inset-right));
  bottom: max(0.9rem, env(safe-area-inset-bottom));
  z-index: 10060;
  width: auto;
  min-width: 10.4rem;
  max-width: 12.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  padding: 0.65rem 0.75rem 0.68rem;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf9, #fff4e8);
  box-shadow: 0 10px 26px rgba(80, 50, 20, 0.2);
  color: var(--title);
  text-align: left;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: inherit;
  animation: interpret-mini-in 0.28s ease;
}

.interpret-mini-close {
  position: absolute;
  top: -0.42rem;
  right: -0.42rem;
  z-index: 2;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 1px solid rgba(80, 50, 20, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #8a8176;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(80, 50, 20, 0.16);
  touch-action: manipulation;
}
.interpret-mini-close:hover,
.interpret-mini-close:focus {
  color: #fff;
  background: #c45c4a;
  border-color: #c45c4a;
  outline: none;
}

.interpret-mini-dock.is-dragging {
  cursor: grabbing;
  box-shadow: 0 14px 30px rgba(80, 50, 20, 0.28);
}

.interpret-mini-dock.hidden {
  display: none;
}

.interpret-mini-dock.is-ready {
  border-color: rgba(46, 139, 87, 0.35);
  background: linear-gradient(180deg, #f7fff9, #eaf8ef);
  animation: interpret-mini-pulse 1.6s ease-in-out infinite;
}

.interpret-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.42rem;
}

.interpret-mini-head strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.interpret-mini-pct {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.interpret-mini-bar {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.14);
  overflow: hidden;
}

.interpret-mini-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--title));
  transition: width 0.12s linear;
}

.interpret-mini-foot {
  color: #8a8176;
  font-size: 0.7rem;
  line-height: 1.35;
  white-space: nowrap;
}

.interpret-mini-dock.is-ready .interpret-mini-foot {
  color: #2e8b57;
  font-weight: 600;
}

.zeri-browse-overlay {
  position: fixed;
  inset: 0;
  z-index: 10055;
  background: var(--bg, #f7f5f0);
}

.zeri-browse-overlay.hidden {
  display: none;
}

.zeri-browse-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

body.browse-overlay-open {
  overflow: hidden;
}

@keyframes interpret-mini-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes interpret-mini-pulse {
  0%, 100% { box-shadow: 0 12px 32px rgba(46, 139, 87, 0.18); }
  50% { box-shadow: 0 14px 36px rgba(46, 139, 87, 0.32); }
}

@media (prefers-reduced-motion: reduce) {
  .interpret-mini-dock,
  .interpret-mini-dock.is-ready {
    animation: none;
  }
}

.interpret-body-shell {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.interpret-body-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.1rem 1.1rem max(1.1rem, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at top right, rgba(var(--accent-rgb), 0.08), transparent 28%),
    linear-gradient(180deg, #f7f8fa, #eef2f8);
  overscroll-behavior: contain;
}

.ai-scroll-latest {
  position: absolute;
  right: 1rem;
  bottom: 1.05rem;
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #5b8def, #2f6fed);
  color: #fff;
  box-shadow:
    0 6px 18px rgba(47, 111, 237, 0.28),
    0 0 0 1px rgba(47, 111, 237, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  font-family: inherit;
  animation: ai-scroll-pulse 1.8s ease-in-out infinite;
}

.interpret-body-shell.has-dayun-more .ai-scroll-latest {
  bottom: 4.6rem;
}

.ai-scroll-latest-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: block;
}

.ai-scroll-latest.hidden {
  display: none;
}

.ai-scroll-latest:hover {
  color: #fff;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow:
    0 8px 20px rgba(47, 111, 237, 0.38),
    0 0 0 1px rgba(47, 111, 237, 0.28);
}

.ai-scroll-latest:active {
  transform: scale(0.94);
}

@keyframes ai-scroll-pulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      0 6px 18px rgba(47, 111, 237, 0.28),
      0 0 0 1px rgba(47, 111, 237, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
  50% {
    transform: translateY(3px);
    box-shadow:
      0 10px 22px rgba(47, 111, 237, 0.36),
      0 0 0 1px rgba(47, 111, 237, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-scroll-latest {
    animation: none;
  }
}

.ai-interpret-output {
  color: var(--chart-text);
  line-height: 1.78;
  font-size: .98rem;
}

.ai-interpret-output.is-streaming::after {
  content: "";
  display: inline-block;
  width: .55rem;
  height: 1.05em;
  margin-left: .15rem;
  vertical-align: text-bottom;
  background: var(--accent);
  border-radius: 1px;
  animation: ai-cursor-blink 1s steps(1) infinite;
}

.dayun-more-wrap {
  margin-top: 1.1rem;
  padding-top: 0.35rem;
}

.dayun-more-bar {
  flex: 0 0 auto;
  margin: 0;
  padding: 0.7rem 1rem max(0.75rem, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(var(--accent-rgb), 0.16);
  background: linear-gradient(180deg, #fffdf9, #f7f0e6);
  box-shadow: 0 -6px 18px rgba(40, 28, 16, 0.06);
  z-index: 2;
}

.dayun-more-panel {
  display: flex;
  justify-content: center;
  padding: 0;
}

.dayun-more-panel.hidden {
  display: none;
}

.dayun-more-btn {
  appearance: none;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background: linear-gradient(180deg, #fffdf9, #fff4e8);
  color: var(--accent-dark);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.78rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 6px 16px rgba(160, 82, 45, 0.1),
    0 0 0 0 rgba(var(--accent-rgb), 0.22);
  width: min(100%, 22rem);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  animation: dayun-more-idle-pulse 2.2s ease-in-out infinite;
}

.dayun-more-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.55) 48%,
    transparent 66%
  );
  transform: translateX(-120%);
  animation: dayun-more-shimmer 2.8s ease-in-out infinite;
  pointer-events: none;
}

.dayun-more-btn-label {
  position: relative;
  z-index: 1;
}

.dayun-more-btn-dots {
  position: relative;
  z-index: 1;
  display: inline-block;
  min-width: 1.15em;
  text-align: left;
}

.dayun-more-btn:hover:not(:disabled) {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: linear-gradient(180deg, #fff9f0, #ffe8d2);
}

.dayun-more-btn:disabled,
.dayun-more-btn.is-loading {
  opacity: 1;
  cursor: wait;
  animation: dayun-more-loading-glow 1.4s ease-in-out infinite;
  border-color: rgba(var(--accent-rgb), 0.55);
  background: linear-gradient(180deg, #fff8ef, #ffe2c4);
}

.dayun-more-btn.is-loading::before {
  animation-duration: 1.2s;
}

.dayun-more-btn.is-loading .dayun-more-btn-dots::after {
  content: "";
  animation: dayun-more-dots 1.2s steps(1, end) infinite;
}

.dayun-more-output {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(var(--accent-rgb), 0.22);
}

@keyframes dayun-more-idle-pulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow:
      0 6px 16px rgba(160, 82, 45, 0.1),
      0 0 0 0 rgba(var(--accent-rgb), 0.18);
  }
  50% {
    transform: translateY(-1px);
    box-shadow:
      0 10px 20px rgba(160, 82, 45, 0.14),
      0 0 0 6px rgba(var(--accent-rgb), 0.08);
  }
}

@keyframes dayun-more-shimmer {
  0%, 35% { transform: translateX(-120%); }
  65%, 100% { transform: translateX(120%); }
}

@keyframes dayun-more-loading-glow {
  0%, 100% {
    box-shadow:
      0 6px 14px rgba(160, 82, 45, 0.1),
      0 0 0 0 rgba(var(--accent-rgb), 0.16);
  }
  50% {
    box-shadow:
      0 8px 18px rgba(160, 82, 45, 0.16),
      0 0 0 7px rgba(var(--accent-rgb), 0.1);
  }
}

@keyframes dayun-more-dots {
  0% { content: ""; }
  20% { content: "."; }
  40% { content: ".."; }
  60% { content: "..."; }
  80% { content: "...."; }
  100% { content: "....."; }
}

@keyframes ai-cursor-blink {
  50% { opacity: 0; }
}

.ai-section-title {
  margin: 1.25rem 0 .7rem;
  padding: .5rem .75rem;
  color: var(--title);
  font-size: 1.08rem;
  border-left: 4px solid var(--accent);
  background: rgba(var(--accent-rgb), .08);
  border-radius: 0 7px 7px 0;
}

.ai-section-title:first-child { margin-top: 0; }

.ai-dayun-title {
  margin: 1.05rem 0 .5rem;
  padding: .35rem 0 .35rem .15rem;
  color: #7d4810;
  font-size: 1.02rem;
  border-bottom: 1px dashed rgba(125, 72, 16, .22);
}

.ai-detail-line,
.ai-detail-stack,
.ai-bullet,
.ai-paragraph {
  margin: .42rem 0;
}

.ai-detail-line {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  padding: .5rem .65rem;
  background: #fff;
  border: 1px solid rgba(var(--accent-rgb), .13);
  border-radius: 7px;
}

.ai-detail-line b {
  flex: 0 0 auto;
  max-width: 6em;
  min-width: 0;
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
}

.ai-detail-line span { color: #45403a; flex: 1 1 auto; min-width: 0; word-break: break-word; }

/* 金句/长标题：上下排布，避免左侧被挤成竖排窄列 */
.ai-detail-stack {
  display: flex;
  flex-direction: column;
  gap: .38rem;
  padding: .65rem .75rem;
  background: #fff;
  border: 1px solid rgba(var(--accent-rgb), .13);
  border-radius: 7px;
}

.ai-detail-stack b {
  display: block;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
}

.ai-detail-stack span {
  display: block;
  color: #45403a;
  line-height: 1.78;
  word-break: break-word;
}

.ai-suggest-card {
  margin: .55rem 0;
  padding: .72rem .8rem;
  background: #fff;
  border: 1px solid rgba(var(--accent-rgb), .16);
  border-radius: 8px;
}

.ai-suggest-head {
  display: flex;
  flex-direction: column;
  gap: .32rem;
}

.ai-suggest-label {
  color: var(--accent);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.ai-suggest-quote {
  margin: 0;
  color: #7d4810;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.55;
  word-break: break-word;
}

.ai-suggest-body {
  margin: .5rem 0 0;
  color: #3f3a34;
  line-height: 1.78;
  word-break: break-word;
}

.ai-bullet { padding-left: .85rem; border-left: 2px solid rgba(var(--accent-rgb), .35); }
.ai-paragraph { color: #3f3a34; }
.ai-spacer { height: .55rem; }
.ai-hr {
  border: 0;
  border-top: 1px solid rgba(var(--accent-rgb), .18);
  margin: .9rem 0;
}

.interp-summary {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #333;
  padding: 0.65rem 0.75rem;
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  margin-bottom: 0.75rem;
}

.interp-hero {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(var(--accent-rgb), .24);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), .12), #fffdf9);
}

.interp-hero > span {
  color: var(--accent-dark);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.interp-hero h4 {
  margin: .28rem 0 .7rem;
  color: var(--title);
  font-size: 1.3rem;
}

.interp-pillars { display: flex; flex-wrap: wrap; gap: .45rem; }
.interp-pillars b { padding: .36rem .58rem; border: 1px solid rgba(var(--accent-rgb), .24); border-radius: 7px; color: var(--accent-dark); background: #fff; font-size: .92rem; }

.interp-nav { display: flex; gap: .42rem; overflow-x: auto; margin: .85rem 0; padding: 0 0 .15rem; scrollbar-width: thin; }
.interp-nav a { flex: 0 0 auto; padding: .36rem .58rem; border: 1px solid var(--border); border-radius: 999px; color: #665d53; background: #fff; font-size: .76rem; text-decoration: none; }
.interp-nav a:hover { border-color: var(--accent); color: var(--accent-dark); }

.interp-section { margin: 0 0 .85rem; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: #fff; scroll-margin-top: 1rem; }
.interp-section > header { display: flex; align-items: center; gap: .62rem; padding: .72rem .86rem; border-bottom: 1px solid var(--border); background: #f7f8fa; }
.interp-section > header span { display: grid; width: 1.7rem; height: 1.7rem; place-items: center; border-radius: 50%; color: #fff; background: var(--accent); font-size: .66rem; font-weight: 700; }
.interp-section > header h4 { margin: 0; color: var(--title); font-size: 1.02rem; }
.interp-section-body { padding: .82rem .9rem .92rem; }
.interp-section-body > p, .interp-dayun-card > p, .interp-dimension-card > p { margin: .34rem 0; color: #4b4741; font-size: .91rem; line-height: 1.8; }
.interp-subtitle { margin: .88rem 0 .42rem; padding-left: .55rem; border-left: 3px solid var(--accent); color: var(--accent-dark); font-size: .92rem; }
.interp-subtitle:first-child { margin-top: 0; }
.interp-bullet { position: relative; padding-left: .9rem; }
.interp-bullet::before { content: ""; position: absolute; top: .72rem; left: .18rem; width: .28rem; height: .28rem; border-radius: 50%; background: var(--accent); }
.interp-labeled-line { display: flex; align-items: flex-start; gap: .5rem; padding: .42rem .48rem; border-radius: 7px; background: #f7f8fa; }
.interp-labeled-line .interp-line-label { flex: 0 0 auto; min-width: 4.4rem; padding: .12rem .38rem; border-radius: 999px; color: #6d5742; background: #eee6d9; font-size: .76rem; line-height: 1.45; text-align: center; }
.interp-labeled-line > span { flex: 1 1 auto; color: #4b4741; }
.interp-labeled-line .interp-label-wealth { color: #1d7558; background: #e3f3ed; }
.interp-labeled-line .interp-label-health { color: #6b548e; background: #eee8f8; }
.interp-labeled-line .interp-label-year { color: #9a6518; background: #fff1d5; }
.interp-labeled-line .interp-label-relation { color: #2d669c; background: #e5f0fb; }
.interp-labeled-line .interp-label-event { color: #a34c3e; background: #fbe9e5; }

.interp-dimension-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.interp-dimension-card, .interp-dayun-card { padding: .72rem .76rem; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.interp-dimension-card h5, .interp-dayun-card h5 { margin: 0 0 .45rem; color: var(--accent-dark); font-size: .94rem; }
.interp-dimension-card p:last-child, .interp-dayun-card p:last-child { margin-bottom: 0; }

.interp-fold-details > summary { display: flex; align-items: center; justify-content: space-between; padding: .82rem .9rem; color: var(--accent-dark); background: #fff; font-size: .9rem; font-weight: 700; cursor: pointer; list-style: none; }
.interp-fold-details > summary::-webkit-details-marker { display: none; }
.interp-fold-details > summary i { font-size: 1.1rem; font-style: normal; transition: transform .2s ease; }
.interp-fold-details[open] > summary { border-bottom: 1px solid #ebe5dc; }
.interp-fold-details[open] > summary i { transform: rotate(180deg); }
.interp-dayun-list { display: grid; gap: .68rem; }
.interp-dayun-card { background: #f7f8fa; }

.interp-loading,
.interp-error {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--chart-muted);
  font-size: 0.9rem;
}

.interp-loading {
  flex: 1 1 auto;
  align-self: stretch;
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  box-sizing: border-box;
}

.interp-loader {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(var(--accent-rgb), 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: interp-spin 0.78s linear infinite;
}

.interp-loading strong {
  color: var(--title);
  font-size: 0.98rem;
  font-weight: 600;
}

.interp-loading p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
}

.interp-loading-chaozhi {
  gap: 0.7rem;
  width: 100%;
  max-width: min(360px, 100%);
  margin: 0 auto;
  justify-items: center;
  text-align: center;
}

.interp-loading-liang {
  justify-content: space-between;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0.15rem 0 0.35rem;
  text-align: left;
  min-height: 100%;
  height: 100%;
  box-sizing: border-box;
}

.liang-thinking-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  max-height: none;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(var(--accent-rgb), 0.16);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(255, 246, 236, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.liang-thinking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.liang-thinking-head strong {
  font-size: 0.86rem;
  color: var(--title);
}

.liang-thinking-status {
  font-size: 0.72rem;
  color: var(--accent-dark);
  white-space: nowrap;
}

.liang-thinking-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #6b5a4a;
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.liang-thinking-body.is-formatted,
.liang-thinking-result-body.is-formatted {
  white-space: normal;
}

.liang-thinking-body:empty::before {
  content: "等待模型开始思考…";
  color: #a89888;
}
.liang-thinking-panel.is-status-only .liang-thinking-body {
  display: grid;
  place-content: center;
  text-align: center;
  min-height: 9.5rem;
}
.liang-thinking-panel.is-status-only .th-hint {
  margin: 0;
  color: #9a8770;
  font-size: 0.88rem;
  line-height: 1.7;
}

.liang-thinking-body .th-p,
.liang-thinking-result-body .th-p {
  margin: 0 0 0.55em;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
.liang-thinking-body .th-h,
.liang-thinking-result-body .th-h {
  margin: 0.7em 0 0.35em;
  font-weight: 700;
  color: inherit;
  font-size: inherit;
  line-height: 1.45;
}
.liang-thinking-body .th-h:first-child,
.liang-thinking-result-body .th-h:first-child { margin-top: 0.15em; }
.liang-thinking-body .th-label,
.liang-thinking-result-body .th-label {
  margin: 0.55em 0 0.18em;
  font-weight: 600;
  color: inherit;
  font-size: inherit;
  opacity: 0.92;
}
.liang-thinking-body .th-ul,
.liang-thinking-result-body .th-ul {
  margin: 0.15em 0 0.55em;
  padding: 0 0 0 1.15em;
  list-style: disc;
}
.liang-thinking-body .th-li,
.liang-thinking-result-body .th-li {
  margin: 0.22em 0;
  padding-left: 0.1em;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}
.liang-thinking-body .th-spacer,
.liang-thinking-result-body .th-spacer { height: 0.35em; }

.liang-progress-panel {
  flex: 0 0 auto;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  text-align: center;
  width: 100%;
  padding-top: 0.15rem;
}

.liang-progress-panel .chaozhi-progress,
.liang-progress-panel .chaozhi-progress-long {
  max-width: none;
  width: 100%;
}

.liang-thinking-result {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem 0.7rem;
  border: 1px solid rgba(var(--accent-rgb), 0.14);
  border-radius: 12px;
  background: rgba(255, 248, 240, 0.85);
}

.liang-thinking-result summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--title);
  list-style: none;
}

.liang-thinking-result summary::-webkit-details-marker { display: none; }
.liang-thinking-result summary::after {
  content: "展开";
  float: right;
  font-weight: 500;
  color: var(--accent-dark);
  font-size: 0.72rem;
}
.liang-thinking-result[open] summary::after { content: "收起"; }

.liang-thinking-result-body {
  margin: 0.55rem 0 0;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  color: #6b5a4a;
  font-size: 0.76rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 220px;
  overflow: auto;
  font-family: inherit;
}

.chaozhi-progress-pct {
  margin: 0.15rem 0 0 !important;
  font-size: 1.15rem !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  text-align: center;
  width: 100%;
}

.chaozhi-progress {
  width: 100%;
  max-width: 280px;
  height: 6px;
  background: rgba(var(--accent-rgb), 0.14);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto;
}

.chaozhi-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--title));
  border-radius: inherit;
  transition: width 0.12s linear;
}

.chaozhi-progress-hint {
  color: var(--chart-muted);
  font-size: 0.78rem !important;
  text-align: center;
  width: 100%;
}

.chaozhi-progress-hint.hidden {
  display: none;
}

.chaozhi-progress-long {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0.65rem 0 0 !important;
  padding: 0.85rem 1rem 0.9rem;
  width: 100%;
  max-width: 280px;
  box-sizing: border-box;
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(255, 244, 232, 0.9));
  box-shadow: 0 8px 20px rgba(160, 82, 45, 0.06);
  text-align: center;
}

.chaozhi-progress-long.hidden {
  display: none;
}

.chaozhi-progress-long.is-wait-done .chaozhi-long-time {
  display: none;
}

.chaozhi-progress-long.is-wait-done .chaozhi-long-label {
  font-size: 0;
  letter-spacing: 0;
}

.chaozhi-progress-long.is-wait-done .chaozhi-long-label::before {
  content: "请稍后";
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-dark);
}

.chaozhi-progress-long.is-wait-done .chaozhi-long-label::after {
  content: "";
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent-dark);
  animation: chaozhi-wait-dots 1.4s steps(1, end) infinite;
}

@keyframes chaozhi-wait-dots {
  0% { content: ""; }
  14% { content: "."; }
  28% { content: ".."; }
  42% { content: "..."; }
  56% { content: "...."; }
  70% { content: "....."; }
  84% { content: "......"; }
  100% { content: "......."; }
}

.chaozhi-progress-long.is-wait-done {
  padding: 0.65rem 0.9rem 0.75rem;
  border-style: dashed;
  background: rgba(var(--accent-rgb), 0.05);
  gap: 0.35rem;
}

.chaozhi-long-label {
  color: #8a8176;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.4;
}

.chaozhi-long-time {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.14rem;
  margin: 0.05rem 0 0.4rem;
  color: var(--accent-dark);
  line-height: 1;
}

.chaozhi-long-time em {
  font-style: normal;
  font-size: 1.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.chaozhi-long-time i {
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.chaozhi-bg-task {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  width: auto;
  min-height: 0;
  margin: 0.15rem 0 0;
  padding: 0.42rem 0.95rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, var(--accent-2), var(--accent) 55%, var(--accent-dark));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.24);
  animation: chaozhi-bg-breathe 2.4s ease-in-out infinite;
}

.chaozhi-bg-task::before {
  content: "";
  position: relative;
  z-index: 1;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.22);
  flex: 0 0 auto;
  animation: chaozhi-bg-dot 1.6s ease-in-out infinite;
}

.chaozhi-bg-task::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    110deg,
    transparent 20%,
    rgba(255, 255, 255, 0.34) 45%,
    transparent 70%
  );
  transform: translateX(-120%);
  animation: chaozhi-bg-shine 2.8s ease-in-out infinite;
  pointer-events: none;
}

.chaozhi-bg-task > * {
  position: relative;
  z-index: 1;
}

.interp-loading-chaozhi > .chaozhi-bg-task {
  width: auto;
  margin-top: 0.65rem;
}

.chaozhi-bg-task:hover {
  filter: brightness(1.04);
  animation-play-state: paused;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.36);
}

.chaozhi-bg-task:hover::after {
  animation-play-state: paused;
}

.chaozhi-bg-task:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(var(--accent-rgb), 0.24);
}

.chaozhi-bg-task.hidden {
  display: none;
}

@keyframes chaozhi-bg-breathe {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.22);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.38);
  }
}

@keyframes chaozhi-bg-dot {
  0%, 100% {
    opacity: 0.7;
    transform: scale(0.9);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28);
  }
}

@keyframes chaozhi-bg-shine {
  0%, 35% { transform: translateX(-120%); }
  60%, 100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  .chaozhi-bg-task,
  .chaozhi-bg-task::before,
  .chaozhi-bg-task::after {
    animation: none;
  }
}

.interp-error {
  color: #c0392b;
}

@keyframes interp-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 768px) {
  .interpret-modal {
    align-items: stretch;
    padding: 0;
  }

  .interpret-panel {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .interpret-header {
    padding: max(0.72rem, env(safe-area-inset-top)) 0.85rem 0.72rem;
  }

  .interpret-header-text .interpret-disclaimer {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .interpret-save-pdf { padding: 0 0.55rem; }
  .interpret-save-pdf > span { display: none; }
  .interpret-save-pdf { width: 2rem; justify-content: center; }

  .interpret-body-wrap { padding: 0.8rem 0.8rem max(0.8rem, env(safe-area-inset-bottom)); }
  .interp-loading.interp-loading-liang {
    padding: 0;
    gap: 0.65rem;
  }
  .liang-thinking-panel {
    padding: 0.65rem 0.7rem;
    border-radius: 12px;
  }
  .interp-hero { padding: .85rem .9rem; }
  .interp-hero h4 { font-size: 1.16rem; }
  .interp-section > header { padding: .68rem .75rem; }
  .interp-section-body { padding: .75rem; }
  .interp-section-body > p, .interp-dayun-card > p, .interp-dimension-card > p { font-size: .88rem; line-height: 1.76; }
  .interp-labeled-line { gap: .42rem; }
  .interp-labeled-line .interp-line-label { min-width: 4.05rem; font-size: .74rem; }
  .interp-dimension-grid { grid-template-columns: 1fr; }
}

body.loader-open {
  overflow: hidden;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

.loader-backdrop {
  position: absolute;
  inset: 0;
  background: var(--bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.loader-core {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 220px;
  margin-bottom: 1.5rem;
}

.orbit {
  position: absolute;
  inset: 0;
  animation: bazi-spin 12s linear infinite;
}

.orbit-inner {
  inset: 28px;
  animation-direction: reverse;
  animation-duration: 18s;
}

.orbit .stem,
.orbit .branch {
  position: absolute;
  left: 50%;
  top: 0;
  transform-origin: 50% 110px;
  font-size: 0.85rem;
  color: var(--accent-2);
  width: 1.2em;
  margin-left: -0.6em;
  text-align: center;
}

.orbit-inner .branch {
  transform-origin: 50% 82px;
  color: var(--title);
  font-size: 0.8rem;
}

.orbit .stem:nth-child(1) { transform: rotate(0deg); }
.orbit .stem:nth-child(2) { transform: rotate(36deg); }
.orbit .stem:nth-child(3) { transform: rotate(72deg); }
.orbit .stem:nth-child(4) { transform: rotate(108deg); }
.orbit .stem:nth-child(5) { transform: rotate(144deg); }
.orbit .stem:nth-child(6) { transform: rotate(180deg); }
.orbit .stem:nth-child(7) { transform: rotate(216deg); }
.orbit .stem:nth-child(8) { transform: rotate(252deg); }
.orbit .stem:nth-child(9) { transform: rotate(288deg); }
.orbit .stem:nth-child(10) { transform: rotate(324deg); }

.orbit-inner .branch:nth-child(1) { transform: rotate(0deg); }
.orbit-inner .branch:nth-child(2) { transform: rotate(30deg); }
.orbit-inner .branch:nth-child(3) { transform: rotate(60deg); }
.orbit-inner .branch:nth-child(4) { transform: rotate(90deg); }
.orbit-inner .branch:nth-child(5) { transform: rotate(120deg); }
.orbit-inner .branch:nth-child(6) { transform: rotate(150deg); }
.orbit-inner .branch:nth-child(7) { transform: rotate(180deg); }
.orbit-inner .branch:nth-child(8) { transform: rotate(210deg); }
.orbit-inner .branch:nth-child(9) { transform: rotate(240deg); }
.orbit-inner .branch:nth-child(10) { transform: rotate(270deg); }
.orbit-inner .branch:nth-child(11) { transform: rotate(300deg); }
.orbit-inner .branch:nth-child(12) { transform: rotate(330deg); }

.loader-center {
  position: absolute;
  inset: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bagua-ring {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(var(--accent-rgb), 0.35);
  border-radius: 50%;
  animation: bazi-pulse 2s ease-in-out infinite;
}

.bagua-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(160, 82, 45, 0.25);
  border-radius: 50%;
}

.loader-icon {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  animation: bazi-glow 1.5s ease-in-out infinite alternate;
  z-index: 1;
}

.scan-line {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: bazi-scan 2.2s ease-in-out infinite;
  top: 50%;
}

.loader-title {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  letter-spacing: 0.35em;
  color: var(--title);
  margin-bottom: 0.5rem;
}

.loader-status {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1.4em;
  text-align: center;
  padding: 0 1rem;
  max-width: min(520px, 92vw);
  line-height: 1.5;
}

.loader-percent {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.loader-progress {
  position: relative;
  z-index: 1;
  width: min(320px, 80vw);
  height: 3px;
  background: rgba(var(--accent-rgb), 0.15);
  border-radius: 2px;
  margin-top: 1rem;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--title));
  border-radius: 2px;
  transition: width 0.4s ease;
}

@keyframes bazi-spin { to { transform: rotate(360deg); } }

@keyframes bazi-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

@keyframes bazi-glow {
  from { filter: none; }
  to { filter: drop-shadow(0 0 10px rgba(47, 111, 237, 0.55)); }
}

@keyframes bazi-scan {
  0%, 100% { transform: translateY(-70px); opacity: 0; }
  15% { opacity: 1; }
  50% { transform: translateY(70px); opacity: 1; }
  85% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .orbit,
  .bagua-ring,
  .loader-icon,
  .scan-line {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .loader-core {
    width: 180px;
    height: 180px;
  }

  .orbit .stem,
  .orbit .branch {
    transform-origin: 50% 90px;
  }

  .orbit-inner .branch {
    transform-origin: 50% 66px;
  }

  .loader-center {
    inset: 44px;
  }

  .loader-icon {
    font-size: 1.65rem;
  }

  .loader-title {
    font-size: 1rem;
    letter-spacing: 0.25em;
  }
}

/* —— 客服浮标 + 排盘导出 —— */
.bazi-cs-fab {
  position: fixed;
  right: max(0.55rem, env(safe-area-inset-right));
  top: 50%;
  left: auto;
  bottom: auto;
  transform: translateY(-50%);
  z-index: 10200;
  /* 可见图标约 3.6rem；外扩 padding 加大可点区域 */
  width: 3.6rem;
  height: 3.6rem;
  padding: 0.55rem;
  box-sizing: content-box;
  border: 0;
  border-radius: 999px;
  /* 极淡底色保证命中测试稳定（全透明在部分 WebView 会点穿） */
  background: rgba(255, 255, 255, 0.02);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.bazi-cs-fab,
.bazi-cs-fab.hidden {
  display: none !important;
}
.bazi-cs-fab.is-dragging,
.bazi-cs-fab.is-placed {
  transform: none;
}
.bazi-cs-fab.is-dragging {
  cursor: grabbing;
}
/* 透明扩大热区，手指更容易点中 */
.bazi-cs-fab::before {
  content: "";
  position: absolute;
  inset: -0.35rem;
  border-radius: 999px;
  z-index: 0;
}
.bazi-cs-fab-glow {
  position: absolute;
  inset: calc(0.55rem + 8%) calc(0.55rem + 6%) calc(0.55rem + 4%);
  border-radius: 999px;
  background: radial-gradient(circle at 50% 40%, rgba(170, 140, 255, 0.55), rgba(100, 80, 220, 0.18) 62%, transparent 75%);
  filter: blur(2px);
  animation: bazi-cs-pulse 2.6s ease-in-out infinite;
  pointer-events: none;
}
.bazi-cs-fab-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 46%;
  border-radius: 999px;
  pointer-events: none;
  -webkit-user-drag: none;
  box-shadow:
    0 10px 22px rgba(90, 70, 180, 0.32),
    0 0 0 2px rgba(255, 255, 255, 0.72);
  background: linear-gradient(160deg, #e8e4ff, #d5d0f5 55%, #c8c2ef);
}
.bazi-cs-fab-label {
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  transform: translateX(-50%);
  z-index: 2;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  background: rgba(72, 48, 140, 0.9);
  color: #f3eeff;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(60, 40, 120, 0.28);
}
@keyframes bazi-cs-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

.bazi-cs-modal {
  position: fixed;
  inset: 0;
  z-index: 10080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.bazi-cs-modal.hidden { display: none; }
.bazi-cs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 28, 16, 0.42);
  backdrop-filter: blur(3px);
}
.bazi-cs-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 20.5rem);
  max-height: min(72vh, 28rem);
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf9 0%, #f7f2ea 100%);
  box-shadow: 0 14px 36px rgba(80, 50, 20, 0.24);
  overflow: hidden;
}
.bazi-cs-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem 0.55rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.16);
  background: linear-gradient(180deg, #fff8ef, #fff3e4);
}
.bazi-cs-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--title);
  font-weight: 700;
}
.bazi-cs-close {
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: #8a8176;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.bazi-cs-close:hover {
  background: #c45c4a;
  color: #fff;
}
.bazi-cs-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.55rem 0.7rem 0.7rem;
  gap: 0.4rem;
}
.bazi-cs-export-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}
.bazi-cs-export-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.2rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f4f7fc);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(47, 111, 237, 0.08);
  white-space: nowrap;
}
.bazi-cs-export-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bazi-cs-export-btn.is-pdf {
  border-color: rgba(47, 111, 237, 0.28);
  color: #1d4ed8;
  background: linear-gradient(180deg, #fff, #eef3fc);
}
.bazi-cs-export-btn:disabled {
  opacity: 0.72;
  cursor: wait;
}
.bazi-cs-export-btn.is-waiting {
  border-style: dashed;
  color: #6b778c;
  background: linear-gradient(180deg, #f7f8fa, #eef2f8);
}
.bazi-cs-export-btn.is-waiting .bazi-cs-export-ico {
  background: rgba(107, 119, 140, 0.14);
}
.bazi-cs-export-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 1.85rem;
  padding: 0.1rem 0.22rem;
  border-radius: 7px;
  background: rgba(var(--accent-rgb), 0.14);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.bazi-cs-export-btn.is-pdf .bazi-cs-export-ico {
  background: rgba(47, 111, 237, 0.12);
}
.bazi-cs-hint {
  margin: 0;
  font-size: 0.68rem;
  color: var(--muted);
}
.bazi-browser-guide {
  flex: 0 0 auto;
  padding: 0.65rem 0.7rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(47, 111, 237, 0.2);
  background: linear-gradient(180deg, #f7f8fa, #eef2f8);
}
.bazi-browser-guide.hidden { display: none !important; }
.bazi-browser-guide-title {
  display: block;
  font-size: 0.84rem;
  color: #2c3a4f;
  font-weight: 700;
}
.bazi-browser-guide-desc {
  margin: 0.35rem 0 0.45rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #7a6550;
}
.bazi-browser-guide-steps {
  margin: 0 0 0.55rem;
  padding-left: 1.15rem;
  font-size: 0.74rem;
  line-height: 1.55;
  color: #5c4a3a;
}
.bazi-browser-guide-steps em {
  font-style: normal;
  color: #1d4ed8;
  font-weight: 700;
}
.bazi-browser-guide-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.4rem;
}
.bazi-browser-guide-btn {
  min-height: 2rem;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
}
.bazi-browser-guide-btn.primary {
  border-color: rgba(47, 111, 237, 0.3);
  background: linear-gradient(180deg, #5b8def, #2f6fed);
  color: #fff;
}
.bazi-browser-guide-dismiss {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.28rem;
  border: 0;
  background: transparent;
  color: #9a8774;
  font-size: 0.72rem;
  cursor: pointer;
}
.bazi-cs-preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 11.5rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  -webkit-overflow-scrolling: touch;
}
.bazi-cs-preview {
  padding: 0.45rem;
  font-size: 0.78rem;
  transform-origin: top left;
}
.bazi-cs-preview .chart-card {
  box-shadow: none;
  border: 0;
  margin: 0;
  font-size: 0.78rem;
}
.bazi-cs-preview .dayun-curve-section,
	.bazi-cs-preview .dayun-curve-idle-btn,
	.bazi-cs-preview #dayunCurveSection,
	.bazi-cs-preview .wuxing-bar-section {
	  display: none !important;
	}
.bazi-export-split {
  margin: 0.85rem 0;
  border: 0;
  border-top: 1px dashed rgba(160, 120, 60, 0.35);
}
.bazi-export-interpret.is-waiting {
  opacity: 0.92;
}
.bazi-export-waiting {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #f7f8fa;
  border: 1px dashed rgba(var(--accent-rgb), 0.35);
  color: #6b778c;
  font-size: 0.86rem;
  line-height: 1.5;
}
.bazi-export-interpret-title {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: #2c3a4f;
}
.bazi-export-interpret .ai-interpret-output,
.bazi-export-interpret .interp-section-body {
  font-size: 16px;
  line-height: 1.65;
  color: #333;
}
/* 导出截图层：放在视口内（盖罩挡住），避免离屏/透明导致中文发糊、缺字 */
.bazi-export-cover {
  position: fixed;
  inset: 0;
  z-index: 10085;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 253, 249, 0.96);
  color: #6b5545;
  font-size: 15px;
  letter-spacing: 0.04em;
  pointer-events: all;
}
/* 导出中：半透明遮罩 + 居中卡片（fixed 覆盖可视层，dvh 适配手机地址栏） */
.bazi-export-busy {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  z-index: 10090;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 24, 34, 0.32);
}
.bazi-export-busy-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(20, 24, 34, 0.2);
  color: #3c3c46;
  font-size: 0.9rem;
}
.bazi-export-busy-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), 0.25);
  border-top-color: var(--accent);
  animation: bazi-busy-spin 0.8s linear infinite;
}
@keyframes bazi-busy-spin {
  to { transform: rotate(360deg); }
}
.bazi-export-capture {
  position: absolute;
  left: 0;
  top: 0;
  width: 720px;
  max-width: 720px;
  height: auto;
  max-height: none;
  overflow: visible;
  padding: 20px;
  background: #fffdf9;
  color: #222;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  z-index: 10084;
  pointer-events: none;
  box-sizing: border-box;
}
.bazi-export-capture *,
.bazi-export-capture *::before,
.bazi-export-capture *::after {
  animation: none !important;
  transition: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  text-shadow: none !important;
  transform: none !important;
}
.bazi-export-capture .dayun-curve-section,
	.bazi-export-capture #dayunCurveSection,
	.bazi-export-capture .wuxing-bar-section {
	  display: none !important;
	}
.bazi-export-capture .gz-char {
  font-size: 40px !important;
  font-weight: 700;
}
.bazi-export-capture .gz-char.sm {
  font-size: 20px !important;
}
.bazi-export-capture .sz-label {
  font-size: 15px !important;
}
.bazi-export-capture .sz-cell {
  font-size: 15px !important;
}
.bazi-export-capture .sz-shensha-cell,
.bazi-export-capture .cang-list {
  font-size: 14px !important;
}
.bazi-export-capture .chart-meta p,
.bazi-export-capture .chenggu-detail,
.bazi-export-capture .chenggu-poem,
.bazi-export-capture .chenggu-breakdown,
.bazi-export-capture .ai-interpret-output,
.bazi-export-capture .bazi-export-interpret,
.bazi-export-capture .bazi-export-interpret p,
.bazi-export-capture .bazi-export-interpret li,
.bazi-export-capture .interp-section-body,
.bazi-export-capture .interp-section-body > p,
.bazi-export-capture .interp-dayun-card > p,
.bazi-export-capture .interp-dimension-card > p,
.bazi-export-capture .interp-bullet,
.bazi-export-capture .interp-labeled-line > span {
  font-size: 16px !important;
  line-height: 1.65 !important;
}
.bazi-export-capture .interp-section > header h4,
.bazi-export-capture .interp-dayun-card h5,
.bazi-export-capture .interp-dimension-card h5,
.bazi-export-capture .bazi-export-interpret-title {
  font-size: 18px !important;
}
/* PDF 排版优化：标题分栏条 + 章节左色条，提升阅读层次 */
.bazi-export-capture .bazi-export-interpret-title {
  margin: 0 0 0.65rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(201, 154, 74, 0.45);
  color: #5b4632;
  font-weight: 700;
}
.bazi-export-capture .interp-section {
  margin-bottom: 0.5rem;
}
.bazi-export-capture .interp-section > header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  border-left: 4px solid rgba(201, 154, 74, 0.65);
  padding: 0.1rem 0 0.1rem 0.55rem;
  margin-bottom: 0.2rem;
}
.bazi-export-capture .interp-section > header span {
  font-size: 14px !important;
  color: #8a7138;
  font-weight: 700;
}
.bazi-export-capture .interp-section > header h4 {
  margin: 0;
  color: #3c3c46;
  font-weight: 700;
}
.bazi-export-capture .interp-labeled-line .interp-line-label {
  font-size: 13px !important;
}
.bazi-export-capture .chart-gender {
  font-size: 28px !important;
}
.bazi-export-capture .chenggu-weight {
  font-size: 26px !important;
}
.bazi-export-capture .bazi-export-interpret.is-dayun-more {
  margin-top: 0;
  padding-top: 0;
}

.bazi-save-mask {
  position: fixed;
  inset: 0;
  z-index: 10090;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: rgba(24, 16, 10, 0.62);
  backdrop-filter: blur(6px);
}
.bazi-save-mask.hidden { display: none; }
.bazi-save-card {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #fffdf9 0%, #faf6ef 100%);
  box-shadow: none;
}
.bazi-save-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  padding: max(0.7rem, env(safe-area-inset-top)) 0.9rem 0.55rem;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.14);
  background: linear-gradient(180deg, #fff8ef, #fff3e4);
}
.bazi-save-kicker {
  margin: 0;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: var(--accent-dark);
  opacity: 0.85;
}
.bazi-save-head h2 {
  margin: 0.15rem 0 0;
  font-size: 1.02rem;
  color: var(--title);
  font-weight: 700;
  line-height: 1.35;
}
.bazi-save-title-hint {
  margin-left: 0.28rem;
  font-size: 0.68em;
  font-weight: 500;
  color: #c45c4a;
}
.bazi-save-x {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  margin-top: 0.1rem;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  color: #8a8176;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.bazi-save-x:hover {
  background: #c45c4a;
  color: #fff;
}
.bazi-save-preview-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  /* 微信长按保存：祖先 overflow:hidden 常导致无法调出「保存图片」 */
  overflow: visible;
  border: 0;
  background: #1c1510;
  box-shadow: none;
}
.bazi-save-preview-scroll {
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 16px 16px,
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px) 0 0 / 16px 16px,
    #2a221a;
}
.bazi-save-preview {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  object-fit: contain;
  margin: 0 auto;
  background: #fffdf9;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
}
.bazi-save-hold-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #f5c518;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  opacity: 1;
  transition: opacity 0.35s ease;
}
.bazi-save-hold-hint.is-faded { opacity: 0; }
.bazi-save-hold-rings {
  position: absolute;
  inset: 0;
}
.bazi-save-hold-rings i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 2px solid rgba(245, 197, 24, 0.9);
  animation: bazi-save-hold-ring 1.8s ease-out infinite;
}
.bazi-save-hold-rings i:nth-child(2) { animation-delay: 0.45s; }
.bazi-save-hold-rings i:nth-child(3) { animation-delay: 0.9s; }
@keyframes bazi-save-hold-ring {
  0% { transform: scale(0.55); opacity: 0.85; }
  100% { transform: scale(2.2); opacity: 0; }
}
.bazi-save-hold-hand {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
}
.bazi-save-foot-hint {
  flex: 0 0 auto;
  margin: 0 1rem 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
}
.bazi-save-actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(var(--accent-rgb), 0.12);
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.92), #f6efe6);
}
.bazi-save-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.7rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 650;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.bazi-save-btn.ghost {
  border-color: rgba(80, 50, 20, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: #6e6256;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.bazi-save-btn.ghost:hover {
  background: #fff;
  color: #4d4339;
}
.bazi-save-btn.primary {
  border-color: rgba(47, 111, 237, 0.28);
  background: linear-gradient(180deg, #5b8def 0%, #2f6fed 55%, #1d4ed8 100%);
  color: #fff;
  box-shadow:
    0 8px 18px rgba(47, 111, 237, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.bazi-save-btn.primary:hover {
  filter: brightness(1.03);
}
.bazi-save-btn:active {
  transform: scale(0.98);
}
.bazi-save-btn-ico {
  display: inline-flex;
  width: 1.15rem;
  height: 1.15rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.85rem;
  line-height: 1;
}
.bazi-save-btn.hidden { display: none !important; }
.bazi-save-actions:has(.bazi-save-btn.primary.hidden) {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .bazi-save-mask {
    align-items: center;
    padding: 1rem;
  }
  .bazi-save-card {
    width: min(100%, 42rem);
    height: min(92vh, 860px);
    max-height: min(92vh, 860px);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(40, 24, 12, 0.35);
  }
  .bazi-save-preview-wrap {
    margin: 0.65rem 0.75rem 0;
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-rgb), 0.16);
  }
  .bazi-cs-panel {
    width: min(100%, 22rem);
    max-height: min(70vh, 30rem);
  }
}


/* ============================================================
   浅冰蓝主题（参考设计图）v155
   背景/顶栏/卡片/表单控件/主按钮/解读方式卡
   ============================================================ */
:root {
  --bg: #e9f3fc;
}

.stars {
  background:
    radial-gradient(58rem 30rem at 85% -8%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(46rem 26rem at -12% 22%, rgba(255, 255, 255, 0.6), transparent 55%),
    radial-gradient(40rem 22rem at 108% 78%, rgba(206, 228, 251, 0.8), transparent 60%),
    linear-gradient(168deg, #d7e9fb 0%, #f0f7fe 48%, #d8e9fb 100%);
}

.top-bar {
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.panel {
  border: 0;
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(47, 111, 237, 0.1);
}

.panel h2 {
  color: #1e3a6e;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.field-row label,
.gender-field-label,
.field-label {
  color: #37465e;
  font-weight: 600;
  font-size: 0.85rem;
}

.birth-date-block .birth-pick-btn,
.birth-pick-row .birth-pick-btn {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  border-color: #cddcf5;
}

/* 阳历 / 阴历 / 四柱 胶囊 radio */
.calendar-toggle-row {
  gap: 0.5rem;
  flex-wrap: wrap;
}
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.26rem 0.7rem 0.26rem 0.45rem;
  border: 1.5px solid #cddcf5;
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.88rem;
  color: #37465e;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.radio-label input {
  width: 1.05em;
  height: 1.05em;
  margin: 0;
  accent-color: #2f6fed;
  flex-shrink: 0;
}
.radio-label:has(input:checked) {
  border-color: #2f6fed;
  background: #eaf3ff;
  color: #2563eb;
}
.radio-label input:checked + span {
  color: #2563eb;
  font-weight: 600;
}

/* 性别胶囊 */
.gender-pill-text {
  border-radius: 12px;
  padding: 0.68rem 0.75rem;
  background: #f4f6fa;
  border-color: #e3e9f2;
}
.gender-pill:has(input:checked) .gender-pill-text {
  border-color: #2f6fed;
  background: #eaf3ff;
  color: #2563eb;
}

/* 出生时辰触发按钮 */
.birth-hour-trigger {
  background: linear-gradient(180deg, #ffffff 0%, #f2f7ff 100%);
  border-color: #cddcf5;
  border-radius: 12px;
}

/* 主按钮：深蓝渐变 */
.btn.primary {
  background: linear-gradient(135deg, #4a8cf5 0%, #2f6fed 52%, #2456d6 100%);
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.32);
  border-radius: 12px;
  font-weight: 700;
}
.actions .btn.primary {
  padding: 0.8rem 1.35rem;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
}
.btn.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #3d7ef2 0%, #2456d6 100%);
}

/* 解读方式卡 */
.interpret-actions {
  border-color: #e3edf8;
  border-radius: 14px;
  background: #fbfdff;
}
.interpret-option {
  border-color: #e3edf8;
  border-radius: 12px;
  background: #f7faff;
}
.interpret-option:hover:not(:disabled) {
  background: #eef5ff;
  border-color: #cddcf5;
}

/* 解读方式选项图标（SVG 描边）v156 */
.interpret-option-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  color: #2f6fed;
}
.interpret-option-ico svg {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
}

/* 顶栏标题去胶囊化：融入冰蓝背景 v157 */
.logo-glow {
  border-color: transparent;
  background: transparent;
  padding: 0 0.25rem;
  color: #1e3a6e;
  font-size: 1.02rem;
  letter-spacing: 0.14em;
}

/* ===== 解读确认弹窗 + 解读内容弹窗 主题（参考设计图）v158 ===== */

/* —— 确认出生信息：明亮蓝渐变全屏 —— */
.ai-confirm-header {
  background: #fff;
  border-bottom: 1px solid #e8eef8;
}
.ai-confirm-header h3 {
  color: #16325c;
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.ai-confirm-close {
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid #d8e4f6;
  background: #fff;
  color: #2f6fed;
  font-weight: 600;
}
.ai-confirm-body {
  background:
    radial-gradient(130% 55% at 50% 0%, rgba(255, 255, 255, 0.3), transparent 58%),
    linear-gradient(178deg, #6ea9f9 0%, #85b7fa 36%, #9dc6fb 64%, #c3dcfc 100%);
}
.ai-confirm-hero {
  width: 6.6rem;
  height: 6.6rem;
  margin-bottom: 1.15rem;
}
.ai-confirm-hero-ring {
  border: 0;
  background: radial-gradient(circle at 38% 30%, #ffffff 0%, #f4f9ff 58%, #dfeafc 100%);
  box-shadow: 0 16px 36px rgba(17, 60, 128, 0.3);
}
.ai-confirm-hero-mark {
  color: #2f6fed;
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: 0;
}
.ai-confirm-lead {
  color: #12325e;
  font-size: 0.95rem;
  font-weight: 700;
}
.ai-confirm-list {
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(15, 48, 104, 0.2);
}
.ai-confirm-list > div {
  padding: 0.92rem 1.05rem;
  border-top: 1px solid #eef2fa;
}
.ai-confirm-list dt {
  color: #8b98ae;
  font-size: 0.82rem;
}
.ai-confirm-list dd {
  color: #16325c;
  font-size: 1.06rem;
  font-weight: 700;
}
.ai-confirm-hint {
  color: #1c4277;
  font-size: 0.8rem;
  font-weight: 600;
}
.ai-confirm-steps li {
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  color: #5d6f8a;
  font-size: 0.78rem;
  box-shadow: 0 10px 24px rgba(15, 48, 104, 0.14);
}
.ai-confirm-steps li span {
  width: 1.9rem;
  height: 1.9rem;
  border: 1.5px solid #c9d8ef;
  background: #fff;
  color: #2f6fed;
  font-size: 0.85rem;
}
.ai-confirm-steps li.is-active {
  border: 0;
  background: #fff;
  color: #2f6fed;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(15, 48, 104, 0.2);
}
.ai-confirm-steps li.is-active span {
  border-color: #2f6fed;
  background: #2f6fed;
  color: #fff;
}
.ai-confirm-actions {
  border-top: 0;
  background: linear-gradient(180deg, rgba(169, 203, 251, 0) 0%, rgba(150, 190, 250, 0.55) 100%);
}
.ai-confirm-cancel {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: #fff;
  color: #16325c;
  border-radius: 12px;
  font-weight: 600;
}
.ai-confirm-actions .btn.primary {
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  box-shadow: 0 12px 26px rgba(13, 55, 128, 0.38);
}

/* —— 解读内容：白顶栏 + 冰蓝底 + 竖条章节标题 + 白卡正文 —— */
.interpret-header {
  background: #fff;
  border-bottom: 1px solid #e8eef8;
}
.interpret-header h3 {
  color: #16325c;
  font-weight: 800;
}
.interpret-disclaimer {
  color: #7d8aa0;
}
.interpret-close {
  width: 2.15rem;
  height: 2.15rem;
  border: 1px solid #d8e4f6;
  background: #fff;
  color: #2f6fed;
  font-weight: 600;
}
.interpret-body-shell {
  background:
    radial-gradient(58rem 30rem at 85% -8%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(46rem 26rem at -12% 22%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(168deg, #d7e9fb 0%, #f0f7fe 48%, #d8e9fb 100%);
}
.interpret-body-wrap {
  background: transparent;
}
.interp-hero {
  border: 1px solid #d8e6f9;
  border-radius: 16px;
  background: linear-gradient(135deg, #eaf3fe 0%, #ffffff 70%);
  box-shadow: 0 8px 22px rgba(47, 111, 237, 0.08);
}
.interp-hero > span {
  color: #2f6fed;
}
.interp-hero h4 {
  color: #16325c;
  font-weight: 800;
}
.interp-nav a {
  border-color: #d8e6f9;
  color: #3d5787;
}
.interp-section {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.interp-section > header {
  position: relative;
  margin: 0 0 0.75rem;
  padding: 0.72rem 0.9rem 0.72rem 1.1rem;
  border: 0;
  border-radius: 10px 14px 14px 10px;
  background: linear-gradient(90deg, #d9e9fc 0%, rgba(217, 233, 252, 0.25) 78%, rgba(217, 233, 252, 0) 100%);
  overflow: hidden;
}
.interp-section > header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 0.32rem;
  border-radius: 0 4px 4px 0;
  background: #2f6fed;
}
.interp-section > header span {
  display: none;
}
.interp-section > header h4 {
  color: #16325c;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}
.interp-section-body {
  padding: 0.1rem 0.05rem 0.3rem;
}
.interp-section-body > p,
.interp-section-body > .interp-para {
  margin: 0 0 0.7rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #d8e6f9;
  border-radius: 14px;
  background: #fff;
  color: #243b5e;
  font-size: 0.93rem;
  line-height: 2;
  box-shadow: 0 6px 18px rgba(47, 111, 237, 0.06);
}
.interp-section-body > p:last-child {
  margin-bottom: 0.2rem;
}
.interp-para-label {
  color: #2f6fed;
  font-weight: 800;
  margin-right: 0.55rem;
  border-bottom: 3px solid rgba(47, 111, 237, 0.16);
  padding-bottom: 0.08em;
}
.interp-subtitle {
  margin: 0.4rem 0 0.6rem;
  padding: 0.5rem 0.8rem 0.5rem 0.85rem;
  border: 1px solid #d8e6f9;
  border-left: 3px solid #2f6fed;
  border-radius: 10px;
  background: linear-gradient(90deg, #eaf3fe, rgba(234, 243, 254, 0));
  color: #16325c;
  font-size: 0.95rem;
  font-weight: 800;
}
.interp-bullet {
  padding: 0.85rem 0.95rem 0.85rem 1.35rem;
}
.interp-bullet::before {
  top: 1.18rem;
  left: 0.72rem;
  background: #2f6fed;
}
.interp-labeled-line {
  border: 1px solid #d8e6f9;
  background: #fff;
}
.interp-dimension-card,
.interp-dayun-card {
  border: 1px solid #d8e6f9;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(47, 111, 237, 0.06);
}
.interp-dimension-card h5,
.interp-dayun-card h5 {
  color: #16325c;
  font-weight: 800;
}
.interp-fold-details > summary {
  border-bottom: 1px solid #e3edf8;
}
.interp-fold-details[open] > summary {
  border-bottom: 1px solid #e3edf8;
}

/* ===== 顶栏布局对齐测名起名页 v160 ===== */
.top-bar {
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 16px 10px;
}
.link-back {
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  gap: 5px;
  color: rgba(44, 62, 93, 0.8);
  font-size: 15px;
  font-weight: 400;
}
.link-back:hover {
  border-color: transparent;
  background: transparent;
  color: #2456d6;
}
.logo-title {
  flex: 1;
  margin: 0;
  margin-right: 76px;
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  color: #2c3e5d;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(47, 124, 232, 0.3);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 768px) {
  .top-bar {
    padding: 12px 12px 8px;
  }
  .logo-title {
    font-size: 19px;
    margin-right: 68px;
  }
}
