@import url('https://fonts.googleapis.com/css2?family=Marcellus&family=Manrope:wght@400;500;700;800&family=Noto+Serif+SC:wght@400;500;700&display=swap');

:root {
  --bg: #f6efe4;
  --bg-soft: rgba(255, 250, 243, 0.9);
  --card: rgba(255, 252, 247, 0.92);
  --ink: #21180f;
  --muted: #6f6254;
  --line: rgba(103, 74, 44, 0.14);
  --brand: #9c6b2d;
  --brand-strong: #7b4f1b;
  --brand-soft: rgba(156, 107, 45, 0.12);
  --hero-a: #1b140d;
  --hero-b: #352112;
  --gold: #e5c27f;
  --shadow: 0 24px 60px rgba(52, 33, 18, 0.12);
  --wood: #18844d;
  --fire: #cb4b36;
  --earth: #9c6b2d;
  --metal: #6a7688;
  --water: #2d6fbe;
}
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 228, 188, 0.78), transparent 28%),
    radial-gradient(circle at 85% 12%, rgba(173, 121, 67, 0.12), transparent 25%),
    linear-gradient(180deg, #f8f1e8 0%, #f4ecdf 100%);
  font-family: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.24) 30%, transparent 60%),
    radial-gradient(circle at 30% 10%, rgba(255, 255, 255, 0.4), transparent 24%);
  opacity: 0.45;
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 80px;
}

.hero {
  display: flex;
  align-items: center;
  min-height: clamp(220px, 34vw, 380px);
  padding: clamp(30px, 6vw, 72px);
  border-radius: 30px;
  color: #fff6ea;
  background-color: var(--hero-a);
  background-image:
    linear-gradient(90deg, rgba(27, 20, 13, 0.96) 0%, rgba(27, 20, 13, 0.78) 52%, rgba(27, 20, 13, 0.92) 100%),
    url('/images/jingshi_logo.png'),
    radial-gradient(circle at 80% 20%, rgba(229, 194, 127, 0.14), transparent 26%),
    linear-gradient(135deg, var(--hero-a), var(--hero-b));
  background-position: center, center, 80% 20%, center;
  background-size: cover, cover, auto, cover;
  background-repeat: no-repeat;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero-account-link {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(229, 194, 127, 0.32);
  border-radius: 999px;
  background: rgba(255, 244, 225, 0.12);
  color: #fff4e1;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
}

.hero-account-link:hover,
.hero-account-link:focus-visible {
  border-color: rgba(229, 194, 127, 0.54);
  background: rgba(255, 244, 225, 0.18);
  outline: none;
}

.hero-account-link[hidden] {
  display: none !important;
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto -10% -42% auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(229, 194, 127, 0.18), transparent 70%);
  z-index: 0;
}

.hero-copy {
  position: relative;
  max-width: min(820px, 100%);
  z-index: 1;
}

.section-kicker,
.info-label,
.note-title {
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-head h2,
.result-header h2 {
  margin: 0;
  font-family: 'Marcellus', 'Noto Serif SC', serif;
  font-weight: 400;
}

.hero-text,
.info-item p,
.result-subtitle,
.note-card p {
  color: rgba(255, 244, 225, 0.84);
  line-height: 1.7;
}

.hero-text {
  margin: 0;
  max-width: 36em;
  font-size: clamp(1.22rem, 2.15vw, 2rem);
  font-weight: 500;
  line-height: 1.72;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.38);
}

.hero-text-emphasis {
  font-family: SimHei, 'Microsoft YaHei', 'PingFang SC', sans-serif;
  font-weight: 800;
  color: #fff4e1;
}

.summary-badge,
.status-pill {
  border-radius: 999px;
  border: 1px solid rgba(229, 194, 127, 0.24);
  background: rgba(255, 244, 225, 0.08);
}

.layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 28px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.form-card,
.info-card,
.chart-card,
.note-card {
  padding: 28px;
}

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

.section-head.compact {
  margin-bottom: 12px;
}

.section-kicker {
  margin: 0 0 8px;
  font-size: 0.74rem;
  color: var(--brand);
}

.section-head h2 {
  font-size: 1.8rem;
}

.status-pill {
  padding: 10px 14px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.status-pill.ready {
  color: var(--brand-strong);
  background: rgba(229, 194, 127, 0.2);
}

.status-pill.offline {
  color: #9b4a41;
  background: rgba(214, 105, 82, 0.1);
  border-color: rgba(214, 105, 82, 0.2);
}

.chart-form {
  margin-top: 24px;
}

.form-grid,
.advanced-grid,
.metrics-grid,
.result-notes {
  display: grid;
  gap: 16px;
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.advanced-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.field-wide {
  grid-column: 1 / -1;
}

.field span {
  font-size: 0.95rem;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(103, 74, 44, 0.14);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.95);
  color: var(--ink);
  padding: 14px 16px;
  font: inherit;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(156, 107, 45, 0.5);
  box-shadow: 0 0 0 4px rgba(156, 107, 45, 0.08);
  transform: translateY(-1px);
}

.has-birth-date-picker .birth-date-native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.date-select-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 0.9fr));
  gap: 10px;
}

.date-select-grid[hidden] {
  display: none !important;
}

.date-select-grid input {
  min-height: 52px;
  padding: 12px 10px;
  text-align: center;
}

.field-hint,
.metric-card small {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 8px);
  z-index: 20;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 24px 48px rgba(52, 33, 18, 0.15);
}

.suggestion-button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 12px 14px;
  cursor: pointer;
}

.suggestion-button:hover,
.suggestion-button:focus-visible {
  background: var(--brand-soft);
  outline: none;
}

.suggestion-title {
  display: block;
  font-weight: 700;
}

.suggestion-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.advanced-box {
  margin: 18px 0 0;
  padding: 18px 20px 22px;
  border-radius: 20px;
  background: rgba(156, 107, 45, 0.06);
  border: 1px dashed rgba(156, 107, 45, 0.26);
}

.advanced-box summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--brand-strong);
}

.primary-button {
  margin-top: 20px;
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  background: linear-gradient(135deg, #9c6b2d, #7b4f1b);
  color: #fff8ef;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.secondary-button {
  margin-top: 14px;
  border: 1px solid rgba(33, 24, 15, 0.12);
  border-radius: 999px;
  padding: 13px 18px;
  background: rgba(255, 252, 247, 0.86);
  color: var(--brand-strong);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.primary-button:hover,
.primary-button:focus-visible,
.secondary-button:hover,
.secondary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(123, 79, 27, 0.24);
  outline: none;
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: rgba(156, 107, 45, 0.34);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

.message-card {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 16px;
}

.message-card.error {
  color: #8a3024;
  background: rgba(214, 105, 82, 0.12);
  border: 1px solid rgba(214, 105, 82, 0.24);
}

.message-card.info {
  color: #246055;
  background: rgba(36, 136, 118, 0.1);
  border: 1px solid rgba(36, 136, 118, 0.22);
}

.auth-card {
  padding: 24px;
}

.auth-section {
  margin-top: 24px;
}

.auth-form {
  display: grid;
  grid-template-columns: minmax(0, 520px);
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
}

.auth-form .primary-button,
.auth-form .secondary-button {
  margin-top: 0;
}

.auth-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.auth-mode-button {
  padding: 9px 14px;
  border: 1px solid rgba(156, 107, 45, 0.22);
  border-radius: 999px;
  color: #72542f;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.auth-mode-button.is-active {
  color: #fff;
  border-color: #8a5c23;
  background: #8a5c23;
}

.auth-security-hint {
  max-width: 640px;
  margin-top: 14px;
}

.auth-recovery-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(36, 136, 118, 0.3);
  border-radius: 16px;
  background: rgba(36, 136, 118, 0.08);
}

.auth-recovery-card h3,
.auth-recovery-card p {
  margin: 8px 0;
}

.auth-recovery-card code {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 14px 0;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  border-radius: 10px;
  color: #1f4e46;
  background: #fff;
  font-size: clamp(15px, 3vw, 20px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-signed-in {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
}

.auth-signed-in-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.auth-signed-in-actions .secondary-button {
  margin-top: 0;
}

.auth-signed-in[hidden],
.auth-signed-out[hidden],
.auth-form[hidden],
.auth-recovery-card[hidden],
[data-chat-conversation][hidden] {
  display: none !important;
}

.account-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
}

.account-hero h1,
.account-empty h2,
.account-report-card h2 {
  margin: 0;
  font-family: 'Marcellus', 'Noto Serif SC', serif;
  font-weight: 400;
  color: #27170a;
}

.account-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.account-quota {
  display: grid;
  place-items: center;
  min-width: 160px;
  min-height: 120px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(36, 136, 118, 0.18);
  background: rgba(36, 136, 118, 0.08);
  text-align: center;
}

.account-quota strong {
  display: block;
  font-size: 2rem;
  color: #246055;
}

.account-quota span {
  color: var(--muted);
  font-weight: 700;
}

.account-actions {
  display: flex;
  justify-content: flex-end;
  margin: 18px 0;
}

.account-actions .secondary-button {
  margin-top: 0;
}

.account-empty {
  padding: 28px;
}

.account-empty .primary-button {
  display: inline-flex;
  text-decoration: none;
}

.account-chat-panel {
  display: grid;
  gap: clamp(22px, 3vw, 32px);
  max-width: min(100%, 1120px);
  margin-inline: auto;
  margin-bottom: clamp(28px, 4vw, 46px);
  padding: clamp(28px, 4vw, 44px);
  overflow: hidden;
}

.account-chat-panel .section-head {
  gap: 22px;
  align-items: flex-start;
}

.account-chat-panel .section-head.compact {
  margin-bottom: 0;
}

.account-chat-panel .section-head > div {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.account-chat-panel .section-kicker {
  margin-bottom: 0;
}

.account-chat-panel .section-head h2 {
  max-width: 13em;
  font-size: clamp(1.9rem, 3vw, 2.55rem);
  line-height: 1.22;
}

.account-chat-panel .status-pill {
  flex: 0 0 auto;
  padding: 11px 17px;
  margin-top: 2px;
}

.account-chat-form {
  display: grid;
  gap: 18px;
}

.account-chat-form .field {
  gap: 12px;
}

.account-chat-form .field span {
  font-size: 1rem;
}

.account-chat-form textarea {
  min-height: 154px;
  padding: 20px 22px;
  border-radius: 22px;
  line-height: 1.85;
}

.account-chat-mention-hint {
  max-width: 68em;
  margin: 0;
  line-height: 1.75;
}

.account-chat-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 2px 0 4px;
}

.account-chat-selected .field-hint {
  margin: 0;
}

.account-chat-chip {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: min(100%, 430px);
  min-width: min(100%, 300px);
  padding: 12px 14px;
  border: 1px solid rgba(156, 107, 45, 0.24);
  border-radius: 22px;
  background: rgba(156, 107, 45, 0.11);
}

.account-chat-chip strong,
.account-chat-chip em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-chat-chip strong {
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.3;
  white-space: nowrap;
}

.account-chat-chip em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.account-chat-chip button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: rgba(36, 24, 14, 0.1);
  color: var(--ink);
  cursor: pointer;
}

.account-chat-suggest {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.account-chat-suggest[hidden] {
  display: none !important;
}

.account-chat-suggestion {
  display: grid;
  gap: 6px;
  width: 100%;
  min-height: 74px;
  padding: 14px 16px;
  border: 1px solid rgba(156, 107, 45, 0.18);
  border-radius: 16px;
  background: rgba(255, 250, 243, 0.9);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.account-chat-suggestion:hover,
.account-chat-suggestion:focus-visible {
  border-color: rgba(156, 107, 45, 0.46);
  background: rgba(156, 107, 45, 0.12);
  outline: none;
}

.account-chat-suggestion strong,
.account-chat-suggestion span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-chat-suggestion strong {
  color: var(--ink);
  font-size: 1rem;
}

.account-chat-suggestion span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.account-chat-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.account-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.account-chat-actions .primary-button,
.account-chat-actions .secondary-button {
  min-height: 48px;
  margin-top: 0;
  padding-inline: 26px;
}

.account-chat-panel .account-chat-messages {
  width: min(100%, 980px);
  margin: 4px auto 0;
  gap: 18px;
}

.account-chat-panel .account-chat-messages .chat-turn {
  gap: 14px;
}

.account-chat-panel .account-chat-messages .chat-message {
  padding: 18px 22px;
  border-radius: 20px;
  line-height: 1.85;
}

.account-chat-panel .account-chat-messages .chat-message.user {
  max-width: min(760px, 90%);
}

.account-chat-panel .account-chat-messages .chat-message.assistant {
  max-width: min(860px, 100%);
}

@media (max-width: 720px) {
  .account-chat-panel {
    padding: 22px;
    border-radius: 22px;
  }

  .account-chat-panel .section-head {
    display: grid;
  }

  .account-chat-panel .status-pill {
    justify-self: start;
  }

  .account-chat-selected,
  .account-chat-suggest,
  .account-chat-action-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .account-chat-chip {
    min-width: 0;
    width: 100%;
  }

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

  .account-chat-actions .primary-button,
  .account-chat-actions .secondary-button {
    width: 100%;
  }
}

.account-report-grid {
  display: grid;
  gap: 18px;
}

.account-report-card {
  padding: 24px;
}

.account-report-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.account-report-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.account-report-meta div {
  padding: 12px 14px;
  border: 1px solid rgba(103, 74, 44, 0.1);
  border-radius: 14px;
  background: rgba(255, 248, 238, 0.76);
}

.account-report-meta dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-report-meta dd {
  margin: 0;
  font-weight: 800;
  color: var(--ink);
}

.account-report-form .primary-button {
  margin-top: 4px;
}

.account-report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.account-report-actions .primary-button,
.account-report-actions .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 0;
  text-align: center;
  text-decoration: none;
}

.account-report-form {
  margin: 0;
}

.report-document-shell {
  width: min(980px, calc(100vw - 32px));
}

.report-document-card {
  padding: clamp(22px, 4vw, 42px);
}

.report-document-head,
.report-document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.report-document-head h1,
.report-document-card h1 {
  margin: 0;
  font-family: 'Marcellus', 'Noto Serif SC', serif;
  font-weight: 400;
  color: #27170a;
}

.report-document-head .secondary-button,
.report-document-actions .primary-button,
.report-document-actions .secondary-button {
  margin-top: 0;
  text-decoration: none;
}

.report-document-output {
  margin-top: 0;
}

.info-stack {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.info-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 248, 238, 0.85);
  border: 1px solid rgba(103, 74, 44, 0.08);
}

.info-label,
.note-title {
  margin: 0 0 6px;
  font-size: 0.72rem;
  color: var(--brand);
}

.info-item p {
  margin: 0;
  color: var(--muted);
}

.result-section {
  margin-top: 28px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.result-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.result-subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.summary-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.summary-badge {
  min-width: 160px;
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 252, 247, 0.72);
}

.summary-badge span,
.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.summary-badge strong,
.metric-card strong {
  display: block;
  margin-top: 8px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}

.metric-card {
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.metric-card strong {
  font-size: 1.12rem;
}

.metric-card.highlighted {
  background: linear-gradient(135deg, rgba(156, 107, 45, 0.14), rgba(229, 194, 127, 0.2));
}

.chart-card {
  margin-top: 20px;
}

.result-tabs {
  margin-top: 20px;
  padding: 28px;
}

.result-tab-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
}

.result-tab-header h2 {
  margin: 0;
  font-family: 'Marcellus', 'Noto Serif SC', serif;
  font-size: 1.8rem;
  font-weight: 400;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-button {
  border: 1px solid rgba(103, 74, 44, 0.12);
  border-radius: 999px;
  padding: 11px 16px;
  background: rgba(255, 252, 247, 0.7);
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease,
    color 160ms ease, box-shadow 160ms ease;
}

.tab-button:hover,
.tab-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(156, 107, 45, 0.3);
}

.tab-button.is-active {
  color: #fff8ef;
  background: linear-gradient(135deg, #9c6b2d, #7b4f1b);
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(123, 79, 27, 0.18);
}

.tab-panel {
  margin-top: 24px;
}

.tab-panel[hidden] {
  display: none !important;
}

.panel-summary-badges {
  margin-top: 18px;
  justify-content: flex-start;
}

.ziwei-summary-grid,
.ziwei-grid {
  display: grid;
  gap: 16px;
}

.ziwei-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.ziwei-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.ziwei-analysis-card {
  margin-top: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(229, 194, 127, 0.18), transparent 28%),
    rgba(255, 250, 243, 0.94);
}

.report-result-section .ziwei-analysis-card {
  margin-top: 0;
}

.report-brief {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.report-brief span {
  border: 1px solid rgba(36, 136, 118, 0.16);
  border-radius: 999px;
  background: rgba(36, 136, 118, 0.08);
  color: #246055;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.analysis-intro {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.ziwei-analysis-form {
  margin-top: 18px;
}

.analysis-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.analysis-action-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}

.analysis-action-row .field-hint {
  max-width: 52ch;
}

.analysis-loading {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(156, 107, 45, 0.16);
  background: rgba(255, 248, 238, 0.92);
}

.analysis-loading[hidden] {
  display: none !important;
}

.analysis-spinner {
  display: inline-flex;
  gap: 6px;
}

.analysis-spinner span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9c6b2d, #d7ac63);
  animation: analysisPulse 1s ease-in-out infinite;
}

.analysis-spinner span:nth-child(2) {
  animation-delay: 0.15s;
}

.analysis-spinner span:nth-child(3) {
  animation-delay: 0.3s;
}

.analysis-loading-title,
.analysis-loading-text {
  margin: 0;
}

.analysis-loading-title {
  font-family: 'Marcellus', 'Noto Serif SC', serif;
  font-size: 1.15rem;
}

.analysis-loading-text {
  margin-top: 8px;
  color: var(--muted);
  /* 预留两行高度，轮播提示语长短变化时不改变布局 */
  min-height: 3.3em;
}

.analysis-output {
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid rgba(103, 74, 44, 0.12);
  color: var(--ink);
  line-height: 1.86;
  overflow-wrap: anywhere;
}

.analysis-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}

.analysis-export-actions[hidden] {
  display: none !important;
}

.analysis-export-actions .primary-button,
.analysis-export-actions .secondary-button {
  margin-top: 0;
}

.analysis-purchase-button {
  box-shadow: 0 12px 24px rgba(36, 120, 87, 0.18);
}

.analysis-purchase-hint {
  flex: 1 1 260px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.analysis-purchase-hint[hidden] {
  display: none !important;
}

.analysis-share-panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(103, 74, 44, 0.12);
  background: rgba(255, 252, 247, 0.9);
}

.analysis-share-panel[hidden] {
  display: none !important;
}

.analysis-share-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.analysis-share-head h3 {
  margin: 4px 0 0;
  font-family: 'Marcellus', 'Noto Serif SC', serif;
  font-size: 1.28rem;
  font-weight: 400;
  color: #27170a;
}

.analysis-share-head .secondary-button {
  margin-top: 0;
}

.analysis-share-preview-wrap {
  max-height: 520px;
  margin-top: 16px;
  overflow: auto;
  border: 1px solid rgba(103, 74, 44, 0.12);
  background: #fffaf2;
}

.analysis-share-preview-wrap[hidden] {
  display: none !important;
}

.analysis-share-preview {
  display: block;
  width: min(100%, 430px);
  height: auto;
  margin: 0 auto;
}

.analysis-share-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.share-platform-button {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 88px;
  padding: 12px 10px 10px;
  border: 1px solid rgba(103, 74, 44, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(247, 239, 226, 0.86));
  color: #332315;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(52, 33, 18, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.share-platform-button:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 136, 118, 0.28);
  box-shadow: 0 16px 30px rgba(52, 33, 18, 0.13);
}

.share-platform-button:focus-visible {
  outline: 3px solid rgba(36, 136, 118, 0.24);
  outline-offset: 2px;
}

.share-platform-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.share-platform-logo {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.1), 0 8px 16px rgba(52, 33, 18, 0.12);
}

.share-platform-logo svg {
  width: 25px;
  height: 25px;
}

.share-platform-logo path,
.share-platform-logo circle {
  fill: currentColor;
}

.share-platform-wechat .share-platform-logo circle {
  fill: #07c160;
}

.share-platform-label {
  max-width: 100%;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.share-platform-wechat .share-platform-logo {
  background: #07c160;
}

.share-platform-x .share-platform-logo {
  background: #101010;
}

.share-platform-facebook .share-platform-logo {
  background: #1877f2;
}

.share-platform-copy .share-platform-logo {
  background: #8d6a37;
}

.analysis-share-status {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.analysis-share-status[hidden] {
  display: none !important;
}

.analysis-output[hidden] {
  display: none !important;
}

.analysis-output h1,
.analysis-output h2,
.analysis-output h3,
.analysis-output h4 {
  font-family: 'Marcellus', 'Noto Serif SC', serif;
  font-weight: 400;
  line-height: 1.2;
  color: #27170a;
}

.analysis-output h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.analysis-output h2 {
  margin: 34px 0 14px;
  font-size: 1.7rem;
}

.analysis-output h3 {
  margin: 26px 0 12px;
  font-size: 1.28rem;
}

.analysis-output p,
.analysis-output ul,
.analysis-output ol,
.analysis-output blockquote,
.analysis-output pre {
  margin: 0 0 16px;
}

.analysis-output ul,
.analysis-output ol {
  padding-left: 22px;
}

.analysis-output li + li {
  margin-top: 8px;
}

.analysis-output blockquote {
  padding: 14px 16px;
  border-left: 3px solid rgba(156, 107, 45, 0.38);
  background: rgba(156, 107, 45, 0.06);
  color: var(--muted);
}

.analysis-output table {
  display: block;
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  overflow-x: auto;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.82);
}

.analysis-output th,
.analysis-output td {
  padding: 14px 12px;
  border: 1px solid rgba(103, 74, 44, 0.08);
  text-align: left;
  vertical-align: top;
}

.analysis-output th {
  background: rgba(156, 107, 45, 0.08);
  color: var(--brand-strong);
}

.analysis-output pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(33, 24, 15, 0.06);
}

.analysis-stream-preview {
  /* 流式输出期间保持固定高度，页面布局零变化；内容在容器内部滚动 */
  height: min(70vh, 720px);
  overflow-y: auto;
  overflow-anchor: none;
  scrollbar-gutter: stable;
  font-family: 'Noto Serif SC', 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.82;
}

/* 服务端未提供渲染 HTML 时的纯文本回退 */
.analysis-stream-preview.is-plain {
  white-space: pre-wrap;
}

.analysis-stream-preview + .report-lock-panel {
  margin-top: 18px;
}

.analysis-output a {
  color: var(--brand-strong);
}

.analysis-output strong {
  color: #ecd08e;
  font-weight: 700;
}

.analysis-output > ol {
  display: grid;
  gap: 16px;
  padding-left: 0;
  list-style: none;
  counter-reset: analysis-section;
}

.analysis-output > ol > li {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 20px 22px 20px 58px;
  border: 1px solid rgba(213, 174, 103, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(213, 174, 103, 0.045), transparent 34%),
    rgba(5, 10, 16, 0.5);
  counter-increment: analysis-section;
}

.analysis-output > ol > li::before {
  content: counter(analysis-section, decimal-leading-zero);
  position: absolute;
  top: 21px;
  left: 18px;
  color: rgba(236, 208, 142, 0.72);
  font-family: 'Marcellus', serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.analysis-output > ol > li br {
  display: block;
  content: '';
  margin-top: 9px;
}

.analysis-output > ol > li > p:last-child,
.analysis-output > ol > li > ul:last-child,
.analysis-output > ol > li > ol:last-child {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .analysis-output {
    font-size: 0.96rem;
    line-height: 1.78;
  }

  .analysis-output > ol {
    gap: 12px;
  }

  .analysis-output > ol > li {
    padding: 17px 16px 17px 46px;
  }

  .analysis-output > ol > li::before {
    top: 18px;
    left: 14px;
  }
}

.report-lock-panel {
  position: relative;
  margin: 28px 0 10px;
  min-height: 520px;
  border: 1px solid rgba(103, 74, 44, 0.14);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 252, 247, 0.9);
}

.report-lock-panel-compact {
  min-height: 0;
  border: 0;
  overflow: visible;
  background: transparent;
}

.report-lock-preview {
  position: relative;
  box-sizing: border-box;
  min-height: 520px;
  max-height: 560px;
  padding: 10px 22px 180px;
  filter: blur(3px);
  opacity: 0.66;
  pointer-events: none;
  user-select: none;
}

.report-lock-fade {
  position: absolute;
  inset: 35% 0 0;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0), rgba(255, 252, 247, 0.96) 58%);
}

.report-lock-overlay {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 22px;
  padding: 22px;
  border: 1px solid rgba(36, 136, 118, 0.18);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 18px 42px rgba(52, 33, 18, 0.14);
}

.report-lock-panel-compact .report-lock-overlay {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
}

.report-lock-overlay h2,
.analysis-payment-panel h3 {
  margin: 0 0 10px;
  font-family: 'Marcellus', 'Noto Serif SC', serif;
  font-weight: 400;
}

.locked-chapter-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.locked-chapter-list li {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(36, 136, 118, 0.14);
  border-radius: 12px;
  background: rgba(36, 136, 118, 0.08);
  color: #246055;
  font-size: 0.92rem;
}

.report-unlock-benefits {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.report-unlock-benefits li {
  position: relative;
  margin: 0;
  padding-left: 26px;
  font-size: 0.96rem;
  line-height: 1.6;
}

.report-unlock-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: #248876;
  font-weight: 700;
}

.report-unlock-cta {
  margin-top: 18px;
  width: 100%;
}

.analysis-chat {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid rgba(103, 74, 44, 0.12);
}

.analysis-chat[hidden] {
  display: none !important;
}


/* Related report comparison in chat */
.analysis-related-reports {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(103, 74, 44, 0.12);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.72);
}

.analysis-related-reports[hidden] {
  display: none !important;
}

.analysis-related-reports-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.analysis-related-reports h3,
.analysis-related-reports p {
  margin: 0;
}

.analysis-related-report-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.analysis-related-report-chip {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  max-width: min(100%, 340px);
  padding: 8px 10px;
  border: 1px solid rgba(156, 107, 45, 0.24);
  border-radius: 999px;
  background: rgba(156, 107, 45, 0.11);
}

.analysis-related-report-chip strong,
.analysis-related-report-chip em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-related-report-chip strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.analysis-related-report-chip em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.analysis-related-report-chip button {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: rgba(36, 24, 14, 0.1);
  color: var(--ink);
  cursor: pointer;
}

.analysis-related-report-suggest {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.analysis-related-report-suggest[hidden] {
  display: none !important;
}

.analysis-related-report-suggestion {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid rgba(156, 107, 45, 0.18);
  border-radius: 12px;
  background: rgba(255, 250, 243, 0.9);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.analysis-related-report-suggestion:hover,
.analysis-related-report-suggestion:focus-visible {
  border-color: rgba(156, 107, 45, 0.46);
  background: rgba(156, 107, 45, 0.12);
  outline: none;
}

.analysis-related-report-suggestion strong,
.analysis-related-report-suggestion span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.analysis-related-report-suggestion strong {
  color: var(--ink);
  font-size: 0.94rem;
}

.analysis-related-report-suggestion span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .analysis-related-reports-head {
    display: grid;
  }

  .analysis-related-report-suggest {
    grid-template-columns: 1fr;
  }
}

.analysis-payment-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: stretch;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(36, 136, 118, 0.18);
  border-radius: 16px;
  background: rgba(36, 136, 118, 0.08);
}

.analysis-payment-panel[hidden] {
  display: none !important;
}

.analysis-payment-panel p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.65;
}

.analysis-payment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.analysis-payment-actions[hidden],
.analysis-redeem-form[hidden] {
  display: none !important;
}

.analysis-payment-actions .primary-button,
.analysis-payment-actions .secondary-button {
  margin-top: 0;
}

.mock-payment-button {
  border-color: rgba(203, 75, 54, 0.24);
  color: #8a3024;
  background: rgba(214, 105, 82, 0.08);
}

.analysis-redeem-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.analysis-redeem-form .field {
  margin: 0;
}

.analysis-redeem-form .secondary-button {
  min-height: 52px;
  margin-top: 0;
}

@media (max-width: 760px) {
  .report-lock-overlay {
    left: 14px;
    right: 14px;
    bottom: 14px;
    padding: 16px;
  }

  .analysis-payment-actions {
    justify-content: stretch;
  }

  .analysis-payment-actions .primary-button,
  .analysis-payment-actions .secondary-button,
  .analysis-redeem-form .secondary-button {
    width: 100%;
  }

  .analysis-redeem-form {
    grid-template-columns: 1fr;
  }
}

.analysis-chat-messages {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.chat-turn {
  display: grid;
  gap: 10px;
}

.chat-message {
  max-width: min(780px, 100%);
  padding: 14px 16px;
  border: 1px solid rgba(103, 74, 44, 0.12);
  border-radius: 18px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.chat-message.user {
  justify-self: end;
  background: rgba(156, 107, 45, 0.11);
}

.chat-message.assistant {
  justify-self: start;
  background: rgba(255, 252, 247, 0.84);
}

.chat-message p,
.chat-message ul,
.chat-message ol {
  margin: 0 0 10px;
}

.chat-message p:last-child,
.chat-message ul:last-child,
.chat-message ol:last-child {
  margin-bottom: 0;
}

.analysis-chat-form {
  margin-top: 16px;
}

.analysis-chat-action-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 12px;
}

.analysis-chat-action-row .primary-button {
  margin-top: 0;
}

@keyframes analysisPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.38;
  }

  50% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.ziwei-palace {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(103, 74, 44, 0.08);
  background: rgba(255, 249, 241, 0.82);
}

.ziwei-palace-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.ziwei-palace-head h3 {
  margin: 0;
  font-family: 'Noto Serif SC', serif;
  font-size: 1.2rem;
}

.ziwei-palace-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.palace-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.palace-flags span,
.star-chip {
  border-radius: 999px;
  font-size: 0.8rem;
}

.palace-flags span {
  padding: 7px 10px;
  background: rgba(156, 107, 45, 0.14);
  color: var(--brand-strong);
}

.ziwei-row-title {
  margin: 16px 0 10px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
}

.star-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.star-chip {
  padding: 7px 10px;
  background: rgba(33, 24, 15, 0.06);
  color: var(--ink);
}

.star-chip.major {
  background: rgba(156, 107, 45, 0.14);
}

.star-chip.muted {
  color: var(--muted);
}

.ziwei-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.table-wrap {
  overflow-x: auto;
}

.chart-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.chart-table th,
.chart-table td {
  border-bottom: 1px solid rgba(103, 74, 44, 0.08);
  padding: 14px 12px;
  text-align: center;
}

.chart-table thead th {
  color: var(--brand-strong);
  font-weight: 800;
}

.chart-table tbody td:first-child,
.chart-table thead th:first-child {
  text-align: left;
  width: 120px;
}

.ganzhi-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.gan,
.zhi {
  font-family: 'Noto Serif SC', serif;
  font-size: 2rem;
  font-weight: 700;
}

.ganzhi-cell em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.86rem;
}

.stack-cell {
  line-height: 1.7;
}

.wood {
  color: var(--wood);
}

.fire {
  color: var(--fire);
}

.earth {
  color: var(--earth);
}

.metal {
  color: var(--metal);
}

.water {
  color: var(--water);
}

.result-notes {
  grid-template-columns: 0.8fr 1.2fr;
  margin-top: 20px;
}

.note-card p {
  margin: 0;
  color: var(--muted);
}

.note-card p + p {
  margin-top: 10px;
}

code {
  font-family: 'JetBrains Mono', 'SFMono-Regular', monospace;
  padding: 0.12rem 0.36rem;
  border-radius: 0.5rem;
  background: rgba(33, 24, 15, 0.06);
}

@media (max-width: 1040px) {
  .layout-grid,
  .result-header,
  .result-tab-header,
  .metrics-grid,
  .result-notes,
  .ziwei-summary-grid,
  .ziwei-grid {
    grid-template-columns: 1fr;
  }

  .result-header,
  .result-tab-header {
    display: grid;
  }

  .summary-badges {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 16px;
  }

  .hero,
  .form-card,
  .info-card,
  .result-tabs,
  .chart-card,
  .note-card {
    padding: 20px;
  }

  .form-grid,
  .advanced-grid,
  .analysis-form-grid {
    grid-template-columns: 1fr;
  }

  .analysis-export-actions {
    align-items: stretch;
  }

  .analysis-export-actions .primary-button,
  .analysis-export-actions .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .analysis-purchase-hint {
    flex-basis: 100%;
  }

  .birth-date-field {
    gap: 12px;
  }

  .date-select-grid {
    grid-template-columns: 1.18fr 0.9fr 0.9fr;
    gap: 8px;
  }

  .date-select-grid input {
    min-height: 54px;
    padding-inline: 6px;
    font-size: 1rem;
  }

  .hero {
    min-height: 230px;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-account-link {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 18px;
  }

  .hero-text {
    max-width: 100%;
    font-size: clamp(1.08rem, 5.1vw, 1.42rem);
  }

  .status-pill {
    white-space: normal;
  }

  .analysis-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .analysis-export-actions,
  .analysis-share-actions,
  .analysis-share-head {
    flex-direction: column;
    align-items: stretch;
  }

  .analysis-share-head .secondary-button {
    text-align: center;
  }

  .analysis-chat-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-form,
  .auth-signed-in {
    grid-template-columns: 1fr;
    display: grid;
    align-items: stretch;
  }

  .auth-signed-in-actions,
  .account-actions,
  .account-report-head {
    justify-content: stretch;
  }

  .account-report-head {
    flex-direction: column;
  }

  .account-report-actions,
  .report-document-head,
  .report-document-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-signed-in-actions .secondary-button,
  .account-actions .secondary-button,
  .account-report-actions .primary-button,
  .account-report-actions .secondary-button,
  .account-report-form .primary-button,
  .report-document-head .secondary-button,
  .report-document-actions .primary-button,
  .report-document-actions .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .account-hero {
    grid-template-columns: 1fr;
  }

  .account-quota {
    min-width: 0;
  }
}

/* Hero celestial image update */
.hero {
  align-items: flex-end;
  justify-content: center;
  min-height: clamp(300px, 48vw, 560px);
  background-image:
    linear-gradient(180deg, rgba(2, 7, 10, 0.12) 0%, rgba(2, 7, 10, 0.06) 42%, rgba(2, 7, 10, 0.76) 100%),
    linear-gradient(90deg, rgba(2, 7, 10, 0.58) 0%, rgba(2, 7, 10, 0.08) 50%, rgba(2, 7, 10, 0.58) 100%),
    url('/images/hero-celestial-bg.png'),
    linear-gradient(135deg, #061017, #201205);
  background-position: center, center, center 48%, center;
  background-size: cover, cover, cover, cover;
  isolation: isolate;
}

.hero::after {
  inset: 0;
  width: auto;
  height: auto;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 53%, rgba(243, 179, 70, 0.25), transparent 18%),
    linear-gradient(180deg, rgba(2, 7, 10, 0) 0%, rgba(2, 7, 10, 0.28) 100%);
  pointer-events: none;
  z-index: 0;
}

.hero-brand {
  position: absolute;
  top: 41%;
  left: 50%;
  z-index: 1;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.hero-brand-main {
  font-family: 'Noto Serif SC', SimSun, serif;
  font-size: clamp(4.8rem, 12vw, 9rem);
  font-weight: 700;
  line-height: 0.95;
  color: #ffe8ad;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 20px rgba(243, 179, 70, 0.42),
    0 12px 34px rgba(0, 0, 0, 0.62);
}

.hero-brand-sub {
  margin-top: 0.5rem;
  color: rgba(255, 229, 174, 0.9);
  font-family: 'Marcellus', serif;
  font-size: clamp(0.95rem, 2vw, 1.35rem);
  letter-spacing: 0.58em;
  text-indent: 0.58em;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.62);
}

.hero-copy {
  z-index: 2;
  width: min(860px, 100%);
  max-width: 100%;
  margin: clamp(180px, 26vw, 300px) auto 0;
  text-align: center;
}

.hero-text {
  margin: 0 auto;
  max-width: 38em;
}

.hero-account-link {
  z-index: 3;
}

@media (max-width: 720px) {
  .hero {
    min-height: 420px;
    align-items: flex-end;
    justify-content: flex-end;
    background-position: center, center, center center, center;
  }

  .hero-brand {
    top: 38%;
    width: 100%;
    padding-inline: 18px;
  }

  .hero-brand-main {
    font-size: clamp(3.4rem, 19vw, 5.8rem);
    letter-spacing: 0.06em;
  }

  .hero-brand-sub {
    font-size: 0.78rem;
    letter-spacing: 0.42em;
    text-indent: 0.42em;
  }

  .hero-copy {
    margin-top: 230px;
    text-align: left;
  }
}

/* Hero celestial mobile account link fix */
@media (max-width: 720px) {
  .hero-account-link {
    position: absolute;
    top: 18px;
    right: 18px;
    margin-bottom: 0;
  }
}

/* Homepage support contact note */
.support-note {
  margin-top: 28px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(11, 17, 26, 0.78);
  color: var(--muted);
  text-align: center;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.support-note p {
  margin: 0;
  line-height: 1.7;
}

.support-note a {
  color: var(--brand-strong);
  font-weight: 800;
  text-decoration: none;
}

.support-note a:hover,
.support-note a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
  outline: none;
}

@media (max-width: 720px) {
  .support-note {
    margin-top: 20px;
    padding: 14px 16px;
    text-align: left;
  }
}

/* ─────────────────────────────────────────────────────────────
   Jing Shi Night System · 深色科技玄学视觉体系
   ───────────────────────────────────────────────────────────── */

:root {
  color-scheme: dark;
  --bg: #05080d;
  --bg-soft: rgba(11, 17, 26, 0.9);
  --card: rgba(11, 16, 24, 0.88);
  --ink: #f2eee6;
  --muted: #969daa;
  --line: rgba(213, 174, 103, 0.14);
  --brand: #d5a95e;
  --brand-strong: #f0cf8c;
  --brand-soft: rgba(213, 169, 94, 0.1);
  --hero-a: #05080d;
  --hero-b: #0c1521;
  --gold: #e9c77f;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.38);
  --cyan: #69b6c8;
  --cyan-soft: rgba(105, 182, 200, 0.1);
  --danger: #f08b79;
  --success: #75c6ad;
  --wood: #67bd91;
  --fire: #ed846f;
  --earth: #d5a95e;
  --metal: #aeb8c7;
  --water: #70a7dc;
}

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

body {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -18%, rgba(58, 104, 134, 0.2), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(201, 151, 69, 0.09), transparent 23%),
    radial-gradient(circle at 8% 52%, rgba(59, 123, 145, 0.08), transparent 28%),
    linear-gradient(180deg, #070b11 0%, #05080d 46%, #080b10 100%);
  font-family: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

body::before {
  z-index: -2;
  background-image:
    linear-gradient(rgba(126, 157, 180, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(126, 157, 180, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.8;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 82%);
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(238, 211, 158, 0.8) 0 0.7px, transparent 0.9px),
    radial-gradient(circle, rgba(130, 183, 204, 0.6) 0 0.6px, transparent 0.8px);
  background-position: 0 0, 36px 42px;
  background-size: 83px 97px, 131px 149px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 18%, #000 0, transparent 68%);
  mask-image: radial-gradient(ellipse at 50% 18%, #000 0, transparent 68%);
}

::selection {
  color: #090b0e;
  background: var(--gold);
}

.page-shell {
  width: min(1240px, calc(100vw - 40px));
  padding: 22px 0 96px;
}

.hero {
  display: block;
  min-height: clamp(520px, 57vw, 680px);
  padding: clamp(30px, 5.2vw, 68px);
  border: 1px solid rgba(229, 193, 123, 0.18);
  border-radius: 34px;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(5, 9, 15, 0.98) 0%, rgba(7, 13, 21, 0.93) 48%, rgba(7, 13, 20, 0.75) 100%),
    radial-gradient(circle at 75% 48%, rgba(207, 157, 75, 0.16), transparent 31%),
    linear-gradient(145deg, #07101a, #04070c);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.58), inset 0 1px rgba(255, 255, 255, 0.035);
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 49.85%, rgba(218, 180, 109, 0.07) 50%, transparent 50.15%),
    linear-gradient(transparent 49.85%, rgba(218, 180, 109, 0.055) 50%, transparent 50.15%);
  background-size: 96px 96px;
  opacity: 0.5;
  -webkit-mask-image: radial-gradient(circle at 76% 52%, #000, transparent 48%);
  mask-image: radial-gradient(circle at 76% 52%, #000, transparent 48%);
}

.hero::after {
  inset: auto -6% -28% auto;
  width: min(46vw, 560px);
  height: min(46vw, 560px);
  background: radial-gradient(circle, rgba(220, 174, 91, 0.11), transparent 68%);
  filter: blur(12px);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  min-height: clamp(450px, 48vw, 550px);
}

.hero-copy {
  max-width: 640px;
  margin: 0;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  color: var(--brand-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.hero-eyebrow span {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  box-shadow: 0 0 12px var(--brand);
}

.hero-title {
  margin: 0;
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: clamp(3.25rem, 6.2vw, 6.2rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.hero-title span,
.hero-title strong {
  display: block;
}

.hero-title strong {
  margin-top: 8px;
  color: transparent;
  background: linear-gradient(105deg, #fff9eb 4%, #f0d291 43%, #b9823f 94%);
  -webkit-background-clip: text;
  background-clip: text;
  font-weight: 500;
  filter: drop-shadow(0 8px 28px rgba(203, 151, 71, 0.15));
}

.hero-text {
  max-width: 31em;
  margin: 28px 0 0;
  color: #aab0ba;
  font-size: clamp(1rem, 1.45vw, 1.18rem);
  font-weight: 400;
  line-height: 1.9;
  text-shadow: none;
}

.hero-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.hero-capabilities span {
  position: relative;
  padding: 8px 12px 8px 24px;
  border: 1px solid rgba(126, 161, 184, 0.12);
  border-radius: 999px;
  color: #abb6c3;
  background: rgba(12, 21, 31, 0.72);
  font-size: 0.78rem;
}

.hero-capabilities span::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 9px rgba(233, 199, 127, 0.75);
  transform: translateY(-50%);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-width: 210px;
  margin-top: 34px;
  padding: 15px 18px 15px 22px;
  border: 1px solid rgba(241, 207, 141, 0.38);
  border-radius: 6px;
  color: #17120b;
  background: linear-gradient(115deg, #f2d99f 0%, #c79449 100%);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 38px rgba(181, 126, 51, 0.19), inset 0 1px rgba(255, 255, 255, 0.55);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.hero-cta span {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(16, 12, 7, 0.24);
  border-radius: 50%;
}

.hero-cta:hover,
.hero-cta:focus-visible {
  outline: none;
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 20px 50px rgba(181, 126, 51, 0.28), inset 0 1px rgba(255, 255, 255, 0.6);
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 460px;
}

.hero-visual::before {
  content: '';
  position: absolute;
  width: min(33vw, 420px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(233, 199, 127, 0.17), rgba(178, 120, 46, 0.04) 43%, transparent 67%);
  box-shadow: 0 0 100px rgba(207, 154, 69, 0.11);
}

.hero-visual img {
  position: relative;
  z-index: 2;
  display: block;
  width: min(118%, 700px);
  max-width: none;
  height: auto;
  opacity: 0.93;
  filter: contrast(1.05) saturate(0.94) drop-shadow(0 30px 65px rgba(0, 0, 0, 0.5));
  -webkit-mask-image: radial-gradient(ellipse at center, #000 46%, rgba(0, 0, 0, 0.88) 64%, transparent 84%);
  mask-image: radial-gradient(ellipse at center, #000 46%, rgba(0, 0, 0, 0.88) 64%, transparent 84%);
}

.hero-visual > p {
  position: absolute;
  right: 8%;
  bottom: 5%;
  z-index: 4;
  margin: 0;
  color: #8f98a4;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  writing-mode: vertical-rl;
}

.hero-visual > p span {
  color: var(--gold);
}

.hero-orbit {
  position: absolute;
  z-index: 1;
  border: 1px solid rgba(227, 191, 121, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.hero-orbit::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold);
}

.hero-orbit-one {
  width: min(38vw, 470px);
  aspect-ratio: 1;
  animation: orbitSpin 32s linear infinite;
}

.hero-orbit-two {
  width: min(30vw, 370px);
  aspect-ratio: 1;
  border-color: rgba(105, 182, 200, 0.12);
  animation: orbitSpin 24s linear infinite reverse;
}

.hero-account-link {
  top: 24px;
  right: 24px;
  min-height: 40px;
  padding: 9px 15px;
  border-color: rgba(227, 191, 121, 0.22);
  border-radius: 7px;
  color: #e8d4ab;
  background: rgba(9, 14, 21, 0.76);
  box-shadow: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  backdrop-filter: blur(14px);
}

@keyframes orbitSpin {
  to {
    transform: rotate(360deg);
  }
}

.layout-grid,
.result-section,
.auth-section {
  margin-top: 26px;
}

.card {
  position: relative;
  overflow: hidden;
  border-color: var(--line);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(15, 22, 32, 0.94), rgba(8, 13, 20, 0.94)),
    var(--card);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.025), transparent 28%);
}

.card > * {
  position: relative;
  z-index: 1;
}

.form-card {
  padding: clamp(24px, 4vw, 46px);
  scroll-margin-top: 24px;
  border-color: rgba(213, 174, 103, 0.18);
  background:
    radial-gradient(circle at 94% 0%, rgba(198, 149, 71, 0.1), transparent 25%),
    linear-gradient(145deg, rgba(14, 21, 31, 0.97), rgba(7, 12, 19, 0.96));
}

.section-head {
  align-items: flex-start;
}

.section-head h2,
.result-header h2,
.result-tab-header h2,
.account-hero h1,
.account-empty h2,
.account-report-card h2,
.report-document-head h1,
.report-document-card h1 {
  color: var(--ink);
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  letter-spacing: 0.01em;
}

.section-head h2 {
  font-size: clamp(1.62rem, 2.5vw, 2.1rem);
}

.section-kicker,
.info-label,
.note-title {
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.17em;
}

.status-pill,
.summary-badge {
  border-color: rgba(213, 174, 103, 0.16);
  background: rgba(213, 174, 103, 0.055);
}

.status-pill {
  border-radius: 6px;
  color: #aeb5bf;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}

.status-pill.ready {
  color: #d9c497;
  background: rgba(213, 174, 103, 0.08);
}

.status-pill.ready::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 7px;
  border-radius: 50%;
  background: #dfbd76;
  box-shadow: 0 0 9px rgba(223, 189, 118, 0.68);
  vertical-align: 1px;
}

.status-pill.offline {
  color: #d88d80;
  border-color: rgba(240, 139, 121, 0.18);
  background: rgba(240, 139, 121, 0.07);
}

.chart-form {
  margin-top: 32px;
}

.form-grid {
  gap: 20px 16px;
}

.field {
  gap: 9px;
}

.field span {
  color: #c9cbd0;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.field input,
.field select,
.field textarea {
  min-height: 54px;
  border-color: rgba(145, 163, 179, 0.14);
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.72);
  color: var(--ink);
  caret-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #555f6d;
}

.field select option {
  color: var(--ink);
  background: #0b111a;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(225, 188, 119, 0.52);
  box-shadow: 0 0 0 3px rgba(213, 169, 94, 0.075), 0 10px 32px rgba(0, 0, 0, 0.18);
  transform: none;
}

.field-hint,
.metric-card small,
.analysis-intro,
.analysis-purchase-hint,
.analysis-payment-panel p,
.analysis-share-status,
.note-card p,
.info-item p,
.result-subtitle {
  color: var(--muted);
}

.suggestions {
  border-color: rgba(213, 174, 103, 0.18);
  border-radius: 10px;
  background: rgba(9, 14, 22, 0.98);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(20px);
}

.suggestion-button {
  color: var(--ink);
}

.suggestion-button:hover,
.suggestion-button:focus-visible {
  background: rgba(213, 169, 94, 0.09);
}

.advanced-box {
  padding: 17px 18px 21px;
  border: 1px solid rgba(108, 145, 167, 0.13);
  border-radius: 10px;
  background: rgba(9, 16, 24, 0.56);
}

.advanced-box summary {
  color: #98abb8;
  font-size: 0.86rem;
  font-weight: 600;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  border-radius: 7px;
  letter-spacing: 0.025em;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid rgba(245, 217, 159, 0.38);
  background: linear-gradient(115deg, #e4c17b 0%, #b97d35 100%);
  color: #171109;
  box-shadow: 0 12px 34px rgba(177, 121, 48, 0.16), inset 0 1px rgba(255, 255, 255, 0.46);
}

.secondary-button {
  border-color: rgba(213, 174, 103, 0.18);
  background: rgba(13, 20, 29, 0.8);
  color: #d6bb84;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.primary-button:hover,
.primary-button:focus-visible {
  box-shadow: 0 18px 42px rgba(177, 121, 48, 0.25), inset 0 1px rgba(255, 255, 255, 0.5);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: rgba(231, 195, 126, 0.4);
  background: rgba(24, 31, 40, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.message-card {
  border-radius: 8px;
}

.message-card.error {
  color: #f2a393;
  border-color: rgba(240, 139, 121, 0.22);
  background: rgba(116, 42, 34, 0.17);
}

.message-card.info {
  color: #9fd4c3;
  border-color: rgba(117, 198, 173, 0.18);
  background: rgba(49, 118, 96, 0.12);
}

.auth-card {
  padding: clamp(24px, 4vw, 38px);
  background-color: #09101a;
  background-image:
    linear-gradient(90deg, rgba(10, 17, 26, 0.99) 0%, rgba(10, 17, 26, 0.97) 48%, rgba(7, 12, 19, 0.56) 100%),
    url('/images/jingshi_logo.png'),
    radial-gradient(circle at 92% 15%, rgba(82, 144, 165, 0.09), transparent 25%);
  background-position: center, 104% 48%, center;
  background-size: cover, 56% auto, cover;
  background-repeat: no-repeat;
}

.auth-form {
  grid-template-columns: minmax(0, 540px);
  margin-top: 20px;
}

.auth-mode-tabs {
  width: fit-content;
  padding: 4px;
  border: 1px solid rgba(135, 154, 170, 0.12);
  border-radius: 8px;
  background: rgba(4, 8, 13, 0.55);
}

.auth-mode-button {
  min-height: 36px;
  padding: 8px 14px;
  border: 0;
  border-radius: 5px;
  color: #7f8996;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
}

.auth-mode-button.is-active {
  color: #1b140b;
  border-color: transparent;
  background: linear-gradient(115deg, #e4c17b, #be8842);
  box-shadow: 0 7px 20px rgba(177, 121, 48, 0.14);
}

.auth-recovery-card {
  border-color: rgba(117, 198, 173, 0.19);
  border-radius: 10px;
  background: rgba(45, 107, 88, 0.1);
}

.auth-recovery-card code {
  color: #e9d7ad;
  background: rgba(4, 9, 14, 0.8);
}

.account-hero {
  min-height: 240px;
  padding: clamp(28px, 5vw, 52px);
  border-color: rgba(213, 174, 103, 0.18);
  background:
    radial-gradient(circle at 84% 42%, rgba(204, 155, 74, 0.15), transparent 24%),
    linear-gradient(125deg, rgba(14, 22, 33, 0.98), rgba(6, 11, 18, 0.98));
}

.account-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.4rem);
}

.account-quota {
  min-width: 180px;
  min-height: 140px;
  border-color: rgba(213, 174, 103, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 169, 91, 0.11), transparent 68%);
  box-shadow: inset 0 0 32px rgba(213, 174, 103, 0.05), 0 0 50px rgba(213, 174, 103, 0.05);
}

.account-quota strong {
  color: var(--brand-strong);
  font-family: 'Marcellus', serif;
  font-size: 2.35rem;
}

.account-report-card,
.account-empty {
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(14, 21, 31, 0.96), rgba(7, 12, 18, 0.96));
}

.account-report-meta div,
.info-item,
.metric-card,
.summary-badge {
  border-color: rgba(131, 153, 170, 0.11);
  border-radius: 8px;
  background: rgba(6, 11, 17, 0.52);
}

.account-report-meta dd,
.summary-badge,
.metric-card {
  color: var(--ink);
}

.report-document-card {
  background: #0a1018;
}

.result-tabs,
.ziwei-analysis-card {
  border-color: rgba(213, 174, 103, 0.16);
  background:
    radial-gradient(circle at 95% 0%, rgba(213, 174, 103, 0.09), transparent 24%),
    linear-gradient(145deg, rgba(14, 21, 31, 0.97), rgba(7, 12, 19, 0.97));
}

.tab-button {
  border-color: rgba(134, 154, 171, 0.13);
  border-radius: 6px;
  color: #8993a0;
  background: rgba(6, 11, 17, 0.55);
}

.tab-button.is-active {
  color: #171109;
  background: linear-gradient(115deg, #e4c17b, #b97d35);
  box-shadow: 0 10px 30px rgba(177, 121, 48, 0.17);
}

.report-brief span {
  border-color: rgba(105, 182, 200, 0.14);
  border-radius: 5px;
  color: #9ebdca;
  background: rgba(62, 130, 153, 0.07);
}

.analysis-loading {
  border-color: rgba(213, 174, 103, 0.17);
  border-radius: 10px;
  background: rgba(9, 15, 23, 0.78);
}

.analysis-spinner span {
  background: linear-gradient(135deg, #f0d291, #b77d38);
  box-shadow: 0 0 13px rgba(224, 183, 104, 0.34);
}

.analysis-output {
  border-color: rgba(213, 174, 103, 0.11);
  color: #d8d8d6;
}

.analysis-output h1,
.analysis-output h2,
.analysis-output h3,
.analysis-output h4 {
  color: #f1e7d1;
  font-family: 'Noto Serif SC', 'Songti SC', serif;
}

.analysis-output h2 {
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(213, 174, 103, 0.12);
}

.analysis-output blockquote {
  border-left-color: rgba(213, 174, 103, 0.48);
  background: rgba(213, 174, 103, 0.055);
}

.analysis-output table {
  border-radius: 8px;
  background: rgba(5, 10, 16, 0.6);
}

.analysis-output th,
.analysis-output td {
  border-color: rgba(136, 154, 169, 0.1);
}

.analysis-output th {
  color: var(--brand-strong);
  background: rgba(213, 174, 103, 0.075);
}

.analysis-output pre,
code {
  background: rgba(3, 7, 12, 0.6);
}

.analysis-output a {
  color: var(--brand-strong);
}

.analysis-share-panel,
.report-lock-panel,
.report-lock-overlay,
.analysis-payment-panel {
  border-color: rgba(213, 174, 103, 0.14);
  border-radius: 10px;
  background: rgba(7, 13, 20, 0.92);
}

.analysis-share-head h3,
.report-lock-overlay h2,
.analysis-payment-panel h3 {
  color: var(--ink);
}

.analysis-share-preview-wrap {
  border-color: rgba(213, 174, 103, 0.13);
  background: #080d14;
}

.share-platform-button {
  border-color: rgba(132, 151, 166, 0.12);
  border-radius: 8px;
  color: #c7c9cc;
  background: linear-gradient(180deg, rgba(15, 22, 31, 0.98), rgba(8, 13, 20, 0.92));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.report-lock-fade {
  background: linear-gradient(180deg, rgba(7, 13, 20, 0), rgba(7, 13, 20, 0.98) 58%);
}

.locked-chapter-list li {
  border-color: rgba(105, 182, 200, 0.14);
  border-radius: 6px;
  color: #9bbdca;
  background: rgba(62, 130, 153, 0.07);
}

.analysis-chat {
  border-color: rgba(213, 174, 103, 0.11);
}

.chat-message {
  border-color: rgba(133, 152, 168, 0.12);
  border-radius: 10px;
}

.chat-message.user {
  color: #e5d2aa;
  background: rgba(178, 126, 55, 0.1);
}

.chat-message.assistant {
  background: rgba(8, 14, 21, 0.74);
}

.mock-payment-button {
  border-color: rgba(240, 139, 121, 0.22);
  color: #e89b8d;
  background: rgba(116, 42, 34, 0.14);
}

.ziwei-palace {
  border-color: rgba(132, 152, 168, 0.11);
  border-radius: 10px;
  background: rgba(6, 11, 17, 0.58);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.ziwei-palace:hover {
  border-color: rgba(213, 174, 103, 0.25);
  background: rgba(12, 18, 26, 0.84);
  transform: translateY(-2px);
}

.palace-flags span,
.star-chip.major {
  color: #dfc18a;
  background: rgba(213, 174, 103, 0.1);
}

.star-chip {
  color: #c6cbd1;
  background: rgba(134, 154, 171, 0.08);
}

.chart-table th,
.chart-table td {
  border-color: rgba(132, 152, 168, 0.1);
}

.chart-table thead th,
.ziwei-row-title {
  color: var(--brand-strong);
}

/* Shared journey polish · account, report, payment and mention flows */
.ui-count-pill {
  min-width: 58px;
  justify-content: center;
  border-color: rgba(105, 182, 200, 0.18);
  color: #b8c8d2;
  background: rgba(105, 182, 200, 0.07);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.ui-count-pill::before {
  content: none !important;
}

.account-actions {
  margin: 14px 0 22px;
}

.account-back-link {
  min-height: 42px;
  padding-block: 9px;
  font-size: 0.84rem;
  text-decoration: none;
}

.account-report-actions .primary-button {
  flex: 1 1 220px;
}

.account-report-actions .secondary-button,
.account-report-form {
  flex: 0 1 auto;
}

.account-report-form .secondary-button {
  min-height: 48px;
  margin-top: 0;
}

.analysis-related-reports {
  gap: 16px;
  margin-top: 18px;
  padding: 18px 20px;
  border-color: rgba(213, 174, 103, 0.17);
  border-radius: 12px;
  background:
    radial-gradient(circle at 96% 0%, rgba(105, 182, 200, 0.09), transparent 30%),
    linear-gradient(145deg, rgba(12, 19, 28, 0.96), rgba(6, 11, 18, 0.96));
  box-shadow: inset 2px 0 rgba(213, 174, 103, 0.42), inset 0 1px rgba(255, 255, 255, 0.025);
}

.analysis-related-reports-head {
  gap: 20px;
}

.analysis-related-reports-head > div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.analysis-related-reports h3 {
  color: #f1e7d1;
  font-family: 'Noto Serif SC', 'Songti SC', serif;
  font-size: 1.18rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.analysis-related-reports .field-hint {
  color: #8995a3;
  line-height: 1.7;
}

.analysis-related-report-chip,
.account-chat-chip {
  border-color: rgba(213, 174, 103, 0.2);
  background: rgba(213, 174, 103, 0.075);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.analysis-related-report-chip strong,
.account-chat-chip strong {
  color: #eee3cd;
}

.analysis-related-report-chip em,
.account-chat-chip em {
  color: #929ba7;
}

.analysis-related-report-chip button,
.account-chat-chip button {
  border: 1px solid rgba(151, 167, 181, 0.12);
  color: #bac0c8;
  background: rgba(3, 7, 12, 0.42);
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.analysis-related-report-chip button:hover,
.account-chat-chip button:hover {
  border-color: rgba(240, 139, 121, 0.28);
  color: #f0a194;
  background: rgba(116, 42, 34, 0.16);
}

.analysis-related-report-suggest,
.account-chat-suggest {
  gap: 10px;
}

.analysis-related-report-suggestion,
.account-chat-suggestion {
  position: relative;
  border-color: rgba(132, 154, 171, 0.16);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 23, 33, 0.98), rgba(8, 14, 21, 0.98));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025), 0 12px 28px rgba(0, 0, 0, 0.18);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.analysis-related-report-suggestion::after,
.account-chat-suggestion::after {
  content: '选择';
  position: absolute;
  top: 10px;
  right: 12px;
  color: #788693;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.analysis-related-report-suggestion strong,
.account-chat-suggestion strong {
  padding-right: 42px;
  color: #eee5d4;
  font-weight: 700;
}

.analysis-related-report-suggestion span,
.account-chat-suggestion span {
  color: #8f9aa7;
}

.analysis-related-report-suggestion:hover,
.analysis-related-report-suggestion:focus-visible,
.account-chat-suggestion:hover,
.account-chat-suggestion:focus-visible {
  border-color: rgba(224, 187, 116, 0.42);
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(28, 31, 33, 0.98), rgba(12, 18, 25, 0.98));
  box-shadow: inset 2px 0 rgba(224, 187, 116, 0.62), 0 16px 34px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}

.analysis-related-report-suggestion:hover::after,
.analysis-related-report-suggestion:focus-visible::after,
.account-chat-suggestion:hover::after,
.account-chat-suggestion:focus-visible::after {
  color: var(--brand-strong);
}

.account-chat-panel.is-unavailable .account-chat-form {
  opacity: 0.62;
}

.analysis-export-actions {
  padding-top: 16px;
  border-top: 1px solid rgba(132, 152, 168, 0.1);
}

.primary-button:focus-visible,
.secondary-button:focus-visible,
.auth-mode-button:focus-visible,
.tab-button:focus-visible,
.share-platform-button:focus-visible,
.analysis-related-report-suggestion:focus-visible,
.account-chat-suggestion:focus-visible,
.analysis-related-report-chip button:focus-visible,
.account-chat-chip button:focus-visible,
.hero-account-link:focus-visible {
  outline: 2px solid rgba(240, 207, 140, 0.86);
  outline-offset: 3px;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 1px solid rgba(240, 207, 140, 0.58);
  outline-offset: 2px;
}

.field input[aria-invalid='true'] {
  border-color: rgba(240, 139, 121, 0.72);
  background: rgba(116, 42, 34, 0.1);
  box-shadow: 0 0 0 3px rgba(240, 139, 121, 0.08);
}

.auth-inline-error {
  display: block;
  margin-top: 1px;
  color: #f2a393;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.6;
}

.auth-form-error {
  margin: 0;
}

.auth-rules {
  display: grid;
  gap: 9px;
  padding: 14px 16px;
  border: 1px solid rgba(105, 182, 200, 0.16);
  border-radius: 8px;
  background: rgba(105, 182, 200, 0.055);
}

.auth-rules p {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  color: #9ca8b5;
  font-size: 0.82rem;
  line-height: 1.65;
}

.auth-rules strong {
  color: #d8c18f;
}

[aria-busy='true'] .primary-button:disabled {
  opacity: 0.72;
}

@media (max-width: 1040px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  }

  .hero-title {
    font-size: clamp(3rem, 7vw, 5.2rem);
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100vw - 24px, 100%);
    padding-top: 12px;
  }

  .hero {
    min-height: 0;
    padding: 68px 24px 26px;
    border-radius: 22px;
  }

  .hero-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
  }

  .hero-copy {
    max-width: 100%;
    margin: 0;
  }

  .hero-title {
    font-size: clamp(3.1rem, 15vw, 5rem);
  }

  .hero-text {
    max-width: 34em;
    font-size: 0.98rem;
  }

  .hero-visual {
    width: 100%;
    min-height: clamp(330px, 58vw, 380px);
    margin-top: 8px;
  }

  .hero-visual img {
    width: min(128%, 620px);
  }

  .hero-orbit-one {
    width: min(74vw, 390px);
  }

  .hero-orbit-two {
    width: min(58vw, 310px);
  }

  .hero-visual::before {
    width: min(70vw, 370px);
  }

  .hero-visual > p {
    right: 3%;
  }

  .hero-account-link {
    position: absolute;
    top: 16px;
    right: 16px;
    margin: 0;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100vw - 16px, 100%);
    padding-bottom: 56px;
  }

  .hero {
    padding: 64px 18px 18px;
    border-radius: 18px;
  }

  .hero-eyebrow {
    margin-bottom: 18px;
    font-size: 0.62rem;
    letter-spacing: 0.14em;
  }

  .hero-title {
    font-size: clamp(2.8rem, 15.5vw, 4.1rem);
  }

  .hero-text {
    margin-top: 20px;
    line-height: 1.78;
  }

  .hero-capabilities {
    gap: 6px;
    margin-top: 18px;
  }

  .hero-capabilities span {
    padding: 7px 10px 7px 21px;
    font-size: 0.7rem;
  }

  .hero-capabilities span::before {
    left: 9px;
  }

  .hero-cta {
    width: 100%;
    margin-top: 24px;
  }

  .hero-visual {
    min-height: 310px;
    margin-top: 10px;
  }

  .hero-visual img {
    width: min(144%, 540px);
  }

  .hero-visual > p {
    display: none;
  }

  .form-card,
  .info-card,
  .result-tabs,
  .chart-card,
  .note-card,
  .ziwei-analysis-card,
  .auth-card,
  .account-report-card,
  .account-empty {
    padding: 20px;
    border-radius: 15px;
  }

  .auth-card {
    background-image:
      radial-gradient(circle at 92% 15%, rgba(82, 144, 165, 0.09), transparent 25%),
      linear-gradient(145deg, rgba(13, 20, 30, 0.97), rgba(7, 12, 19, 0.97));
    background-position: center;
    background-size: cover;
  }

  .section-head {
    display: grid;
  }

  .status-pill {
    width: fit-content;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .auth-mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  .auth-mode-button {
    padding-inline: 8px;
  }

  .account-hero {
    padding: 26px 20px;
    border-radius: 16px;
  }

  .account-quota {
    min-height: 112px;
    border-radius: 12px;
  }

  .account-report-meta {
    grid-template-columns: 1fr 1fr;
  }

  .account-report-actions .primary-button,
  .account-report-actions .secondary-button,
  .account-report-form {
    flex: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-orbit,
  .analysis-spinner span {
    animation: none;
  }
}

/* Public language controls */
.hero-toolbar {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-toolbar .hero-account-link {
  position: static;
  inset: auto;
  margin: 0;
  white-space: nowrap;
}

.language-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(42px, auto));
  align-items: center;
  min-height: 40px;
  padding: 3px;
  border: 1px solid rgba(227, 191, 121, 0.24);
  border-radius: 8px;
  background: rgba(7, 13, 20, 0.82);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.language-switcher button {
  min-height: 32px;
  padding: 5px 10px;
  border: 0;
  border-radius: 5px;
  color: #a9b4c1;
  background: transparent;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.language-switcher button:hover,
.language-switcher button:focus-visible {
  color: #f0dfb9;
  outline: none;
}

.language-switcher button.is-active {
  color: #171109;
  background: linear-gradient(115deg, #e4c17b, #be8842);
}

.account-page-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

html[data-language='en'] .hero-title {
  max-width: 12em;
  margin-inline: auto;
}

html[data-language='en'] .hero-title span,
html[data-language='en'] .hero-title strong {
  letter-spacing: -0.025em;
  text-wrap: balance;
}

html[data-language='en'] :is(.primary-button, .secondary-button, .hero-cta, button, .status-pill) {
  overflow-wrap: anywhere;
}

html[data-language='en'] :is(.hero-text, .field-hint, .support-note, .account-hero p) {
  text-wrap: pretty;
}

@media (max-width: 720px) {
  .hero-toolbar {
    top: 14px;
    right: 14px;
    left: 14px;
    justify-content: flex-end;
  }

  .language-switcher {
    min-height: 38px;
  }

  .language-switcher button {
    min-height: 30px;
    padding-inline: 8px;
  }

  html[data-language='en'] .hero-copy {
    text-align: left;
  }

  html[data-language='en'] .hero-title {
    margin-inline: 0;
  }
}
