:root {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Roboto Mono", ui-monospace, monospace;
  color: #ece3d3;
  background: #0f0d09;
  --bg: #0f0d09;
  --surface: #1b1813;
  --surface-2: #15120c;
  --panel-2: #221d15;
  --ink: #ece3d3;
  --muted: #8d8472;
  --line: rgba(201, 169, 106, 0.16);
  --line-strong: rgba(201, 169, 106, 0.34);
  --gold: #cba968;
  --gold-bright: #e9d6a6;
  --jade: #3fe0b0;
  --jade-glow: #3fe0b0;
  --jade-dark: #cba968;
  --cinnabar: #e2603f;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
  --glow-jade: 0 0 14px rgba(63, 224, 176, 0.45);
  --glow-gold: 0 0 16px rgba(201, 169, 106, 0.3);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: #e8dfd0;
  background:
    radial-gradient(125% 90% at 16% -8%, #211d13 0%, rgba(33, 29, 19, 0) 46%),
    radial-gradient(120% 80% at 92% 2%, rgba(63, 224, 176, 0.06) 0%, rgba(63, 224, 176, 0) 40%),
    radial-gradient(140% 120% at 84% 110%, rgba(226, 96, 63, 0.07) 0%, rgba(226, 96, 63, 0) 44%),
    linear-gradient(160deg, #100e0a 0%, #14110b 52%, #0d0b08 100%);
  background-attachment: fixed;
}
::selection { background: rgba(201, 169, 106, 0.28); color: #f4ecdc; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(201, 169, 106, 0.22); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 169, 106, 0.36); }
::-webkit-scrollbar-track { background: transparent; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.62; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(63, 224, 176, 0.36);
  outline-offset: 2px;
}
#app { display: grid; grid-template-columns: minmax(19rem, 23rem) minmax(0, 1fr); min-height: 100vh; }
.login-shell {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  min-height: 100vh;
  padding: 1.5rem;
}
.login-trust {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(22rem, 0.65fr);
  gap: 1rem;
  width: min(100%, 72rem);
  align-items: stretch;
}
.login-hero,
.login-card {
  padding: 2rem;
  background: rgba(24, 21, 16, 0.92);
  border: 1px solid rgba(201, 169, 106, 0.18);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
}
.login-hero {
  display: grid;
  align-content: center;
  min-height: 38rem;
  background:
    radial-gradient(circle at 8% 10%, rgba(63, 224, 176, 0.14), transparent 28rem),
    radial-gradient(circle at 86% 88%, rgba(226, 96, 63, 0.12), transparent 26rem),
    rgba(24, 21, 16, 0.9);
}
.login-hero h1 { font-size: clamp(2.4rem, 5vw, 4.8rem); max-width: 9em; }
.login-lead {
  max-width: 38rem;
  color: #b6ab92;
  font-size: 1.08rem;
  line-height: 1.8;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.trust-grid article,
.sample-report,
.privacy-details {
  padding: 1rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.trust-grid span,
.sample-report span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--jade-dark);
  font-size: 0.78rem;
  font-weight: 900;
}
.trust-grid strong,
.sample-report strong { display: block; color: var(--ink); line-height: 1.35; }
.trust-grid p,
.sample-report p,
.privacy-details p { margin: 0.55rem 0 0; color: var(--muted); line-height: 1.65; }
.privacy-details { margin-top: 0.75rem; }
.privacy-details summary {
  color: #e8dfd0;
  font-weight: 900;
  cursor: pointer;
}
.login-card { align-self: center; }
.login-form { display: grid; gap: 0.9rem; margin-top: 1.4rem; }
.login-form .primary-button { width: 100%; }
.sample-report { margin-top: 1rem; }
.sample-report ul {
  display: grid;
  gap: 0.4rem;
  margin: 0.7rem 0;
  padding-left: 1rem;
  color: #a39a85;
  font-size: 0.85rem;
  line-height: 1.55;
}
.sample-report button {
  min-height: 2.25rem;
  padding: 0 0.75rem;
  color: #cba968;
  background: #191610;
  border: 1px solid #2e2a1f;
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: 800;
}
.login-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.login-meta span { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.login-meta strong { color: var(--ink); font-size: 0.9rem; }
.auth-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.auth-switch button {
  min-height: 2rem;
  padding: 0 0.25rem;
  color: var(--jade-dark);
  background: transparent;
  border: 0;
  font-weight: 900;
}
.input-panel {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: start;
  min-height: 100vh;
  padding: 2rem;
  background: rgba(24, 21, 16, 0.78);
  border-right: 1px solid rgba(201, 169, 106, 0.18);
  backdrop-filter: blur(18px);
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 0 1.25rem;
  color: #1b1813;
  background: conic-gradient(from 45deg, var(--jade), var(--cinnabar), #4a86b0, var(--jade));
  border-radius: 50%;
  font-weight: 800;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0.5rem; font-size: 2.25rem; line-height: 1.05; }
h2 { margin-bottom: 0.75rem; font-size: 1.45rem; line-height: 1.2; }
h3 { margin-bottom: 0.75rem; font-size: 1rem; }
.muted, .fine-print, .note-line, .disclaimer { color: var(--muted); line-height: 1.7; }
.admin-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.admin-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.admin-strip strong {
  display: block;
  max-width: 12rem;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-strip small {
  display: block;
  margin-top: 0.3rem;
  color: #e2603f;
  font-size: 0.74rem;
  line-height: 1.4;
}
.admin-strip button {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: 0 0.65rem;
  color: #cba488;
  background: #241a13;
  border: 1px solid #3a261c;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
}
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.admin-actions .manage-button {
  color: #cba968;
  background: #191610;
  border-color: #2e2a1f;
}
.form-grid { display: grid; gap: 0.9rem; }
.form-group-title {
  margin: 0.35rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  color: #e8dfd0;
  font-size: 0.95rem;
}
.form-group-title:first-child {
  padding-top: 0;
  border-top: 0;
}
.field { display: grid; gap: 0.4rem; }
.field span { color: #b6ab92; font-size: 0.86rem; font-weight: 700; }
.field input, .field select, .field textarea, .chat-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.78rem 0.85rem;
  color: var(--ink);
  background: #1b1813;
}
.field textarea { min-height: 6.5rem; resize: vertical; line-height: 1.55; }
.checkbox-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 3rem;
  padding: 0.72rem 0.8rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  color: #b6ab92;
  font-size: 0.86rem;
  font-weight: 800;
}
.checkbox-field input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--jade-dark);
}
.scenario-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 0.85rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.scenario-fields .wide { grid-column: 1 / -1; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.button-row.model-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.primary-button, .ghost-button, .chat-form button, .image-generator button {
  min-height: 2.8rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-weight: 800;
}
.primary-button, .chat-form button { color: #1b1813; background: var(--jade-dark); }
.ghost-button { color: var(--jade-dark); background: #191610; border-color: #2e2a1f; }
.history-panel,
.purchase-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.history-head h2 { margin: 0; font-size: 1rem; }
.history-head button,
.history-search button {
  min-height: 2rem;
  padding: 0 0.65rem;
  color: var(--jade-dark);
  background: #191610;
  border: 1px solid #2e2a1f;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
}
.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.history-filters button,
.history-actions button,
.history-compare-head button {
  min-height: 2rem;
  padding: 0 0.65rem;
  color: var(--jade-dark);
  background: #191610;
  border: 1px solid #2e2a1f;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
}
.history-filters button.active,
.history-actions button.active {
  color: #1b1813;
  background: var(--jade-dark);
  border-color: var(--jade-dark);
}
.history-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(3.2rem, auto));
  gap: 0.35rem;
  align-content: start;
}
.history-actions button[data-delete-history] {
  color: #cba488;
  background: #241a13;
  border-color: #3a261c;
}
.history-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
}
.history-search input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.58rem 0.65rem;
  background: #1b1813;
}
.purchase-plan-list {
  display: grid;
  gap: 0.65rem;
}
.purchase-plan-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.75rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.purchase-plan-list strong,
.purchase-plan-list span,
.purchase-plan-list p {
  display: block;
  min-width: 0;
}
.purchase-plan-list strong { color: var(--ink); line-height: 1.35; }
.purchase-plan-list span {
  margin-top: 0.25rem;
  color: #cba968;
  font-size: 0.78rem;
  font-weight: 850;
}
.purchase-plan-list p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}
.purchase-plan-list button {
  min-height: 2.2rem;
  padding: 0 0.72rem;
  color: #1b1813;
  background: var(--jade-dark);
  border: 1px solid transparent;
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: 900;
}
.history-list {
  display: grid;
  gap: 0.6rem;
  max-height: 22rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}
.archive-list {
  display: grid;
  gap: 0.75rem;
  max-height: 28rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}
.history-dashboard {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}
.history-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.history-metrics article {
  min-width: 0;
  padding: 0.58rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.history-metrics span,
.latest-archive span,
.archive-topics > span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}
.history-metrics strong {
  display: block;
  margin-top: 0.15rem;
  color: var(--cinnabar);
  font-size: 1.3rem;
  line-height: 1;
}
.history-metrics small,
.latest-archive small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.latest-archive {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}
.latest-archive strong {
  display: block;
  margin-top: 0.16rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.latest-archive button,
.archive-topics button {
  min-height: 2.15rem;
  padding: 0 0.65rem;
  color: var(--ink);
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}
.archive-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.archive-topics button.active {
  color: #1b1813;
  background: var(--jade-dark);
  border-color: transparent;
}
.archive-card {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.archive-summary,
.archive-tags,
.privacy-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.archive-summary strong,
.privacy-panel strong { display: block; color: var(--ink); }
.archive-summary span,
.archive-tags span,
.privacy-panel span { color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.archive-stats {
  flex: 0 0 auto;
  min-width: 4rem;
  padding: 0.45rem 0.55rem;
  text-align: center;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.archive-stats b { display: block; color: var(--cinnabar); font-size: 1.2rem; line-height: 1.1; }
.archive-stats small { color: var(--muted); font-size: 0.72rem; }
.archive-tags { flex-wrap: wrap; justify-content: flex-start; }
.archive-tags span {
  padding: 0.25rem 0.45rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.history-list.nested { max-height: none; overflow: visible; padding-right: 0; }
.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: stretch;
}
.history-row > button:first-child {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.7rem;
  text-align: left;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.history-row strong,
.history-row span,
.history-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-row span,
.history-row small { color: var(--muted); font-size: 0.76rem; }
.history-compare {
  display: grid;
  gap: 0.75rem;
  padding: 0.8rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.history-compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}
.compare-grid article {
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.compare-grid h3 { margin: 0; font-size: 0.92rem; }
.compare-grid p {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.compare-grid b {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.privacy-panel {
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.privacy-actions {
  display: flex;
  gap: 0.45rem;
  flex: 0 0 auto;
}
.privacy-actions button {
  min-height: 2rem;
  padding: 0 0.65rem;
  color: var(--jade-dark);
  background: #191610;
  border: 1px solid #2e2a1f;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
}
.privacy-actions button.danger {
  color: #cba488;
  background: #241a13;
  border-color: #3a261c;
}
.privacy-panel .inline-error,
.privacy-panel .inline-success { flex-basis: 100%; }
.main-stage { min-width: 0; padding: 1.5rem; }
.tabs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  min-height: 3.25rem;
  overflow-x: auto;
  padding: 0.35rem;
  background: rgba(24, 21, 16, 0.72);
  border: 1px solid rgba(201, 169, 106, 0.18);
  border-radius: 0.75rem;
}
.tabs button {
  flex: 0 0 auto;
  min-width: 4rem;
  min-height: 2.35rem;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 0.45rem;
  color: #a39a85;
  background: transparent;
  font-weight: 800;
}
.tabs button.active { color: #14110b; background: #cba968; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: start; margin-top: 1rem; }
.report-panel, .chat-panel, .wide-band, .image-generator, .metric, .pillar, .palace, .tarot-card {
  background: rgba(24, 21, 16, 0.92);
  border: 1px solid rgba(201, 169, 106, 0.18);
}
.report-panel, .chat-panel { border-radius: 0.8rem; box-shadow: var(--shadow); }
.report-panel { min-height: calc(100vh - 6rem); padding: 1.25rem; }
.result-section, .pillars, .palace-grid, .tarot-row, .timeline { display: grid; gap: 0.75rem; }
.overview-compact {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
}
.overview-headline {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.overview-headline span {
  color: var(--jade-dark);
  font-size: 0.78rem;
  font-weight: 900;
}
.overview-headline h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.42rem;
  line-height: 1.55;
}
.overview-headline .profile-context { margin-bottom: 0; }
.overview-pillars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.overview-pillars article {
  min-height: 9rem;
  padding: 1rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.overview-pillars h3 { margin: 0 0 0.65rem; font-size: 0.95rem; }
.overview-details {
  padding: 0.9rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.overview-details summary {
  cursor: pointer;
  color: #79c9aa;
  font-weight: 900;
}
.overview-details > * + * { margin-top: 0.85rem; }
.overview-grid { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: 1rem; align-items: center; }
.profile-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.profile-context span {
  padding: 0.34rem 0.58rem;
  color: #b6ab92;
  background: #191610;
  border: 1px solid #2e2a1f;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}
.conclusion-lead {
  margin: 0 0 1rem;
  padding: 1rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.conclusion-lead span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--jade-dark);
  font-size: 0.78rem;
  font-weight: 900;
}
.conclusion-lead p { margin: 0; color: var(--ink); font-size: 1.05rem; line-height: 1.7; font-weight: 800; }
.summary-block {
  padding: 1rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.summary-block p { margin: 0; color: #d3c9b5; line-height: 1.75; }
.report-meta,
.evidence-chain,
.follow-ups,
.result-actions {
  padding: 1rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.report-meta h3,
.evidence-chain h3 { margin-bottom: 0.75rem; }
.meta-chip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
.meta-chip,
.meta-badge {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.72rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.meta-chip span,
.meta-badge span,
.meta-badge small,
.meta-chip small { color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.meta-chip strong,
.meta-badge strong { color: #e8dfd0; font-size: 0.9rem; }
.meta-badge { margin-bottom: 0.85rem; }
.meta-badge p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.evidence-chain ol {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding-left: 1.25rem;
  color: #d3c9b5;
  line-height: 1.65;
}
.fact-layers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.fact-layers article {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  min-height: 13rem;
  padding: 1rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.fact-layers h3,
.fact-layers p { margin: 0; }
.fact-layers > article > p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}
.follow-ups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.follow-ups.compact {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(24, 21, 16, 0.62);
}
.follow-ups span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}
.follow-ups button {
  min-height: 2.15rem;
  padding: 0 0.72rem;
  color: #cba968;
  background: #191610;
  border: 1px solid #2e2a1f;
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: 800;
}
.result-actions {
  display: grid;
  gap: 0.8rem;
  background: #1b1813;
}
.retention-center,
.themed-reports {
  padding: 1rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.retention-grid,
.theme-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.theme-card-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.retention-grid article,
.theme-card-grid article {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  min-height: 10rem;
  padding: 0.9rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.theme-card-grid article.active {
  background: #241a13;
  border-color: rgba(226, 96, 63, 0.32);
}
.retention-grid span,
.theme-card-grid span {
  color: var(--jade-dark);
  font-size: 0.76rem;
  font-weight: 900;
}
.retention-grid strong,
.theme-card-grid strong {
  color: var(--ink);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.theme-card-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}
.retention-grid button,
.theme-card-grid button {
  align-self: end;
  min-height: 2.15rem;
  padding: 0 0.72rem;
  color: #cba968;
  background: #191610;
  border: 1px solid #2e2a1f;
  border-radius: 0.45rem;
  font-size: 0.8rem;
  font-weight: 800;
}
.share-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.share-actions strong,
.share-actions span { display: block; }
.share-actions span {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}
.quick-actions,
.feedback-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.feedback-block.compact {
  margin-top: 0.85rem;
  padding: 0.75rem;
  background: rgba(24, 21, 16, 0.62);
  border: 1px solid rgba(201, 169, 106, 0.16);
  border-radius: 0.55rem;
}
.quick-actions button,
.feedback-row button {
  min-height: 2.2rem;
  padding: 0 0.78rem;
  border: 1px solid #2e2a1f;
  border-radius: 0.45rem;
  background: #191610;
  color: #cba968;
  font-size: 0.82rem;
  font-weight: 850;
}
.feedback-row button {
  background: #1b1813;
}
.ai-insight,
.final-summary {
  padding: 1rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.ai-insight span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--jade-dark);
  font-size: 0.76rem;
  font-weight: 900;
}
.ai-insight h3 { margin-bottom: 0.55rem; }
.ai-insight p,
.final-summary p { margin-bottom: 0.65rem; color: #d3c9b5; line-height: 1.75; }
.ai-insight small {
  display: block;
  color: var(--muted);
  line-height: 1.6;
}
.evidence-trace {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px dashed #2e2a1f;
}
.evidence-trace summary {
  cursor: pointer;
  color: #79c9aa;
  font-size: 0.78rem;
  font-weight: 900;
}
.evidence-trace .clean-list {
  margin-top: 0.55rem;
  font-size: 0.82rem;
}
.fact-id-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}
.fact-id-list code {
  border: 1px solid #2e2a1f;
  background: #1b1813;
  border-radius: 6px;
  padding: 0.18rem 0.42rem;
  font-size: 0.74rem;
  color: #79c9aa;
}
.final-summary {
  background: #221911;
  border-color: #3a261c;
}
.final-summary .section-heading { align-items: center; margin-bottom: 0.7rem; }
.final-summary h3 { margin: 0; }
.final-summary button {
  min-height: 2rem;
  padding: 0 0.7rem;
  color: #cba488;
  background: #241a13;
  border: 1px solid #3a261c;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
}
.insight-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.insight-grid section {
  min-height: 12rem;
  padding: 1rem;
  background: #1b1813;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.clean-list {
  display: grid;
  gap: 0.7rem;
  margin: 0;
  padding-left: 1.1rem;
  color: #d3c9b5;
  line-height: 1.65;
}
.clean-list li::marker { color: var(--jade); }
.wheel-wrap {
  display: grid;
  place-items: center;
  min-height: 18rem;
  border-radius: 0.75rem;
  background: #15120c;
  border: 1px solid var(--line);
}
.destiny-wheel { width: min(100%, 16rem); aspect-ratio: 1; }
.wheel-score { fill: var(--cinnabar); font-size: 2rem; font-weight: 900; }
.wheel-caption { fill: var(--muted); font-size: 0.68rem; font-weight: 800; }
.wheel-pillar { fill: #e9d6a6; font-size: 0.86rem; font-weight: 900; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.metric, .wide-band, .image-generator { padding: 1rem; border-radius: 0.65rem; }
.metric { min-height: 6.6rem; }
.metric span, .pillar span, .palace span, .tarot-card span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.metric strong { display: block; margin-top: 0.55rem; font-size: 1.05rem; line-height: 1.3; }
.metric small, .pillar small, .palace small, .tarot-card small, .timeline small { color: var(--muted); }
.bars { display: grid; gap: 0.65rem; }
.bar-row { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) 2rem; gap: 0.7rem; align-items: center; min-height: 1.55rem; }
.bar-track { height: 0.7rem; overflow: hidden; background: #181510; border-radius: 999px; }
.bar-track i { display: block; height: 100%; border-radius: inherit; }
.pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pillar { min-height: 7rem; padding: 1rem; border-radius: 0.65rem; }
.pillar strong { display: block; margin: 0.5rem 0 0.45rem; color: var(--cinnabar); font-size: 1.8rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.tag-row span { border: 1px solid #2e2a1f; border-radius: 999px; padding: 0.38rem 0.7rem; color: #cba968; background: #191610; font-size: 0.82rem; font-weight: 800; }
.timeline { grid-template-columns: repeat(8, minmax(6.5rem, 1fr)); overflow-x: auto; }
.timeline div { min-height: 5.6rem; padding: 0.8rem; border-left: 3px solid var(--jade); background: #15120c; border-radius: 0.45rem; }
.timeline b, .timeline span, .timeline small { display: block; }
.palace-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.palace-grid.compact { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.palace { min-height: 6rem; padding: 0.85rem; border-radius: 0.55rem; }
.palace.active { border-color: rgba(226, 96, 63, 0.45); background: #241a13; }
.palace strong { display: block; margin: 0.45rem 0; line-height: 1.35; }
.candidate-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.candidate-list article {
  min-height: 7.5rem;
  padding: 0.85rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.candidate-list article.recommended {
  background: #241a13;
  border-color: rgba(226, 96, 63, 0.32);
}
.candidate-list strong,
.candidate-list span,
.candidate-list small { display: block; line-height: 1.45; }
.candidate-list strong { color: var(--cinnabar); font-size: 1.2rem; }
.candidate-list span { margin-top: 0.35rem; color: #cba968; font-size: 0.82rem; font-weight: 900; }
.candidate-list small { margin-top: 0.45rem; color: var(--muted); }
.divination-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10.5rem;
  gap: 0.95rem;
  align-items: stretch;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(27, 24, 18, 0.96), rgba(17, 14, 9, 0.96)),
    #15120c;
  border: 1px solid rgba(201, 169, 106, 0.22);
  border-radius: 0.7rem;
  box-shadow: inset 0 1px 0 rgba(233, 214, 166, 0.05);
}
.divination-tool label {
  display: grid;
  gap: 0.5rem;
  margin: 0;
}
.divination-tool span {
  color: #b6ab92;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.divination-tool textarea {
  width: 100%;
  min-height: 5.6rem;
  padding: 0.85rem 0.9rem;
  resize: vertical;
  line-height: 1.6;
  color: var(--ink);
  background: #100d08;
  border: 1px solid rgba(201, 169, 106, 0.22);
  border-radius: 0.55rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  caret-color: var(--gold-bright);
}
.divination-tool button {
  min-width: 0;
  min-height: 5.6rem;
  padding: 0 1rem;
  align-self: end;
  border: 1px solid rgba(255, 202, 176, 0.24);
  border-radius: 0.55rem;
  color: #160c07;
  background: linear-gradient(180deg, #f06a4a 0%, #d94f31 100%);
  box-shadow: 0 10px 26px rgba(226, 96, 63, 0.18);
  font-weight: 900;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.divination-tool button:hover {
  background: linear-gradient(180deg, #ff7756 0%, #e45a3a 100%);
  box-shadow: 0 12px 28px rgba(226, 96, 63, 0.24);
}
.divination-tool button:active {
  transform: translateY(1px);
}
.divination-tool textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 106, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  outline: none;
}
.tarot-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tarot-card { min-height: 16rem; padding: 1.15rem; border-radius: 0.7rem; background: linear-gradient(165deg, #1d1a13 0%, #16130d 100%); color: var(--ink); border: 1px solid var(--line); border-top: 2px solid var(--jade-glow); }
.tarot-card.reversed { background: linear-gradient(165deg, #201711 0%, #17120d 100%); border-top-color: var(--cinnabar); }
.tarot-card span { color: var(--muted); }
.tarot-card small { display: inline-block; margin-top: 0.2rem; padding: 0.14rem 0.66rem; border-radius: 999px; color: #0c1a16; background: var(--jade-glow); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; }
.tarot-card.reversed small { color: #2c0f07; background: var(--cinnabar); }
.tarot-card p { margin-top: 0.6rem; color: #dccfb6; line-height: 1.68; }
.tarot-card .tarot-domain {
  margin-top: 0.85rem;
  padding-top: 0.7rem;
  color: #a89a80;
  border-top: 1px solid rgba(201, 169, 106, 0.14);
  font-size: 0.82rem;
}
.tarot-card strong { display: block; margin: 0.7rem 0 0.5rem; font-size: 1.7rem; font-family: var(--font-serif); color: var(--gold-bright); }
.gua-layout { display: grid; grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr); gap: 1rem; }
.hexagram { display: flex; flex-direction: column; gap: 0.6rem; justify-content: center; min-height: 16rem; padding: 1rem; background: #15120c; border: 1px solid var(--line); border-radius: 0.65rem; }
.yao { display: grid; grid-template-columns: minmax(7rem, 1fr) 3rem minmax(2.4rem, auto); gap: 0.6rem; align-items: center; min-height: 1.4rem; }
.yao small { color: var(--muted); font-size: 0.74rem; text-align: right; }
.yao.moving small { color: var(--cinnabar); font-weight: 800; }
.yao.shi b, .yao.ying b { color: var(--gold-bright); }
.solid-line, .broken-line { display: block; height: 0.55rem; background: #e8dfd0; border-radius: 999px; }
.broken-line { background: linear-gradient(90deg, #cba968 0 42%, transparent 42% 58%, #cba968 58% 100%); }
.liuyao-table { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
.liuyao-table article { min-height: 9.5rem; padding: 0.9rem; background: #17140e; border: 1px solid rgba(201, 169, 106, 0.18); border-radius: 0.65rem; }
.liuyao-table article.moving { border-color: rgba(226, 96, 63, 0.65); box-shadow: inset 0 0 0 1px rgba(226, 96, 63, 0.15); }
.liuyao-table article.use-god { background: linear-gradient(165deg, #1d1a13, #15120c); border-top: 2px solid var(--jade-glow); }
.liuyao-table span { display: block; color: var(--muted); font-size: 0.78rem; font-weight: 800; }
.liuyao-table strong { display: block; margin-top: 0.35rem; color: var(--gold-bright); font-family: var(--font-serif); font-size: 1.1rem; }
.liuyao-table small { display: block; margin-top: 0.25rem; color: #a89a80; }
.liuyao-table p { margin: 0.55rem 0 0; color: #d7cbb5; line-height: 1.65; }
.image-generator { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: start; margin-top: 1rem; }
.image-generator.disabled { color: var(--muted); background: #15120c; border-style: dashed; }
.image-generator button { color: #1b1813; background: var(--cinnabar); }
.image-generator img { grid-column: 1 / -1; width: min(100%, 32rem); border: 1px solid var(--line); border-radius: 0.65rem; }
.inline-error { margin: 0; color: #e2603f; line-height: 1.7; }
.inline-success { margin: 0; color: #cba968; line-height: 1.7; font-weight: 700; }
.form-error { grid-column: 1 / -1; }
.chat-panel { display: grid; grid-template-rows: auto minmax(18rem, 1fr) auto; gap: 0.8rem; min-height: 0; height: 100%; padding: 1rem; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.chat-head h2 { margin: 0; font-size: 1.1rem; }
.chat-head span { color: #cba968; font-size: 0.78rem; font-weight: 900; }
.chat-log { display: flex; flex-direction: column; gap: 0.75rem; overflow-y: auto; padding-right: 0.2rem; }
.bubble { max-width: 92%; padding: 0.75rem 0.85rem; color: #d3c9b5; background: #1a1711; border-radius: 0.65rem; line-height: 1.6; overflow-wrap: anywhere; word-break: break-word; }
.bubble.user { align-self: flex-end; color: #1b1813; background: #e8dfd0; }
.bubble.pending { border: 1px solid rgba(201, 169, 106, 0.28); }
.bubble.pending p::after { content: ""; display: inline-block; width: 0.55rem; height: 0.55rem; margin-left: 0.45rem; border-radius: 50%; background: currentColor; opacity: 0.45; animation: pulse-dot 1s ease-in-out infinite; vertical-align: middle; }
.bubble p { margin: 0; overflow-wrap: anywhere; word-break: break-word; }
.bubble p + p { margin-top: 0.55rem; }
@keyframes pulse-dot { 0%, 100% { transform: scale(0.72); opacity: 0.28; } 50% { transform: scale(1); opacity: 0.72; } }
.message-meta {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(201, 169, 106, 0.18);
}
.source-tags,
.message-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.source-tags span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}
.source-tags b,
.message-followups button {
  padding: 0.22rem 0.45rem;
  color: #cba968;
  background: #1b1813;
  border: 1px solid #2e2a1f;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
}
.message-followups button {
  border-radius: 0.45rem;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) 4rem; gap: 0.5rem; }
.floating-chat {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 80;
  display: grid;
  justify-items: end;
  gap: 0.75rem;
  pointer-events: none;
}
.floating-chat > * { pointer-events: auto; }
.chat-fab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 4rem;
  min-height: 4rem;
  padding: 0.48rem 0.78rem 0.48rem 0.48rem;
  color: var(--gold-bright);
  background: linear-gradient(145deg, rgba(32, 28, 20, 0.98), rgba(16, 14, 9, 0.98));
  border: 1px solid rgba(201, 169, 106, 0.38);
  border-radius: 999px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45), var(--glow-gold);
}
.chat-fab-mark {
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  color: #14110b;
  background: conic-gradient(from 45deg, var(--jade), var(--gold), var(--cinnabar), var(--jade));
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 800;
}
.chat-fab-copy { display: grid; gap: 0.1rem; min-width: 4.4rem; text-align: left; }
.chat-fab-copy strong { font-size: 0.9rem; line-height: 1.1; }
.chat-fab-copy small { color: var(--muted); font-size: 0.7rem; font-weight: 800; white-space: nowrap; }
.chat-fab i {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  width: 0.58rem;
  height: 0.58rem;
  background: var(--cinnabar);
  border: 2px solid #16130d;
  border-radius: 50%;
}
.floating-chat.busy .chat-fab-mark { animation: pulse-dot 1.25s ease-in-out infinite; }
.floating-chat-panel {
  position: relative;
  width: min(24rem, calc(100vw - 2rem));
  height: min(40rem, calc(100svh - 7rem));
  overflow: hidden;
  background: linear-gradient(180deg, rgba(28, 25, 19, 0.98), rgba(19, 16, 11, 0.98));
  border: 1px solid var(--line-strong);
  border-radius: 0.9rem;
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.58), var(--glow-gold);
}
.chat-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  color: var(--gold-bright);
  background: rgba(15, 13, 9, 0.84);
  border: 1px solid var(--line);
  border-radius: 50%;
}
.chat-close svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.floating-chat-panel .chat-head { padding-right: 2.7rem; }
.disclaimer { margin: 1.25rem 0 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: 0.86rem; }
.admin-shell {
  grid-column: 1 / -1;
  width: min(100%, 84rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1.5rem;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  background: rgba(24, 21, 16, 0.86);
  border: 1px solid rgba(201, 169, 106, 0.18);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
}
.admin-topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.admin-topbar .brand-mark { flex: 0 0 auto; margin: 0; width: 3rem; height: 3rem; }
.admin-topbar h1 { margin: 0 0 0.25rem; font-size: 1.7rem; }
.admin-topbar p { margin-bottom: 0; }
.admin-top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.65rem; }
.admin-top-actions .primary-button,
.admin-top-actions .ghost-button { min-width: 6rem; padding: 0 1rem; }
.admin-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin: 1rem 0;
  padding: 0.35rem;
  background: rgba(24, 21, 16, 0.76);
  border: 1px solid rgba(201, 169, 106, 0.18);
  border-radius: 0.75rem;
}
.admin-tabs button {
  flex: 0 0 auto;
  min-height: 2.35rem;
  padding: 0 0.9rem;
  color: #a39a85;
  background: transparent;
  border: 0;
  border-radius: 0.45rem;
  font-weight: 800;
}
.admin-tabs button.active { color: #1b1813; background: #e8dfd0; }
.admin-alert {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  background: rgba(24, 21, 16, 0.9);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: 1rem;
  align-items: start;
}
.admin-card {
  padding: 1.1rem;
  background: rgba(24, 21, 16, 0.94);
  border: 1px solid rgba(201, 169, 106, 0.18);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
}
.admin-card h2 { margin-bottom: 0.4rem; }
.admin-form { display: grid; gap: 1rem; }
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}
.section-heading h2 { margin: 0; }
.section-heading p { margin: 0; max-width: 38rem; }
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.two-col .wide { grid-column: 1 / -1; }
.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.admin-form .switch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.access-switches { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.switch-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 3rem;
  padding: 0.75rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  color: #b6ab92;
  font-weight: 800;
}
.switch-field.disabled {
  cursor: not-allowed;
  opacity: 0.72;
}
.switch-field input {
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 2.55rem;
  height: 1.45rem;
  border: 1px solid #2e2a1f;
  border-radius: 999px;
  background: #2e2a1f;
  transition: background 180ms ease, border-color 180ms ease;
}
.switch-field input::after {
  content: "";
  position: absolute;
  top: 0.16rem;
  left: 0.16rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #1b1813;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.52);
  transition: transform 180ms ease;
}
.switch-field input:checked { background: var(--jade-dark); border-color: var(--jade-dark); }
.switch-field input:checked::after { transform: translateX(1.08rem); }
.quota-field { max-width: 18rem; }
.status-list { display: grid; gap: 0.65rem; margin-top: 0.85rem; }
.status-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.status-list span,
.status-card span { color: var(--muted); font-size: 0.8rem; font-weight: 800; }
.status-list strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usage-observer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.usage-ledger-list {
  display: grid;
  gap: 0.65rem;
  max-height: 28rem;
  overflow-y: auto;
}
.usage-ledger-list article {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
}
.usage-ledger-list time,
.usage-ledger-list span,
.usage-ledger-list small {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.usage-ledger-list strong { color: var(--ink); }
.commerce-grid {
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.75fr);
}
.commerce-grid .usage-ledger-card {
  align-self: stretch;
}
.plan-editor-list {
  display: grid;
  gap: 0.8rem;
}
.plan-editor-row {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.plan-editor-row .ghost-button {
  justify-self: start;
}
.feedback-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.feedback-summary span {
  padding: 0.34rem 0.6rem;
  border: 1px solid #2e2a1f;
  border-radius: 999px;
  background: #191610;
  color: #cba968;
  font-size: 0.78rem;
  font-weight: 850;
}
.usage-observer article {
  min-height: 5.8rem;
  padding: 0.85rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.usage-observer span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.usage-observer strong {
  display: block;
  margin-top: 0.45rem;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.2;
}
.usage-observer small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  line-height: 1.45;
}
.model-message {
  padding: 0.75rem 0.85rem;
  background: #1a1711;
  border: 1px solid #2e2a1f;
  border-radius: 0.55rem;
}
.model-discovery {
  display: grid;
  gap: 0.9rem;
  padding: 0.9rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.model-discovery h3 {
  margin: 0 0 0.55rem;
  color: #b6ab92;
  font-size: 0.9rem;
}
.model-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.model-chip-list button {
  min-height: 2rem;
  max-width: 100%;
  padding: 0 0.65rem;
  color: #cba968;
  background: #191610;
  border: 1px solid #2e2a1f;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.version-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 0.75fr);
}
.version-status-list strong,
.version-log-list span,
.version-log-list small {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.version-warning {
  padding: 0.85rem;
  background: #241a13;
  border: 1px solid #3a261c;
  border-radius: 0.65rem;
}
.version-warning strong {
  display: block;
  margin-bottom: 0.45rem;
  color: #e8dfd0;
}
.version-summary-card {
  align-self: stretch;
}
.version-log-card {
  grid-column: 1 / -1;
}
.version-log-list article.failed {
  border-color: #553022;
  background: #241a13;
}
.version-log-list small {
  white-space: pre-wrap;
}
.status-cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}
.status-cards.compact-status {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 0.75rem;
}
.status-card {
  min-height: 6rem;
  padding: 0.9rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.status-card strong {
  display: block;
  margin-top: 0.55rem;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.algorithm-grid {
  grid-template-columns: minmax(0, 1fr) minmax(22rem, 0.85fr);
}
.algorithm-status {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0.9rem 0;
}
.quality-list,
.algorithm-module-list {
  display: grid;
  gap: 0.75rem;
}
.quality-list article,
.algorithm-module-list article {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.quality-list article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.quality-list article.passed {
  background: #1a1711;
  border-color: #2e2a1f;
}
.quality-list article.failed {
  background: #241a13;
  border-color: #3a261c;
}
.quality-list span {
  padding: 0.2rem 0.5rem;
  color: #cba968;
  background: #191610;
  border-radius: 0.4rem;
  font-size: 0.74rem;
  font-weight: 900;
}
.quality-list article.failed span {
  color: #e2603f;
  background: #2a1c14;
}
.quality-list p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.algorithm-module-list article div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.algorithm-module-list article div span {
  flex: 0 0 auto;
  padding: 0.2rem 0.5rem;
  color: #79c9aa;
  background: #191610;
  border-radius: 0.4rem;
  font-size: 0.74rem;
  font-weight: 900;
}
.algorithm-module-list small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.algorithm-module-list p,
.algorithm-module-list ul {
  margin: 0;
  color: #d3c9b5;
  line-height: 1.55;
}
.algorithm-module-list ul {
  padding-left: 1.1rem;
  color: var(--muted);
}
.users-grid { grid-template-columns: minmax(20rem, 0.82fr) minmax(0, 1.18fr); }
.user-list { display: grid; gap: 0.75rem; }
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  padding: 0.85rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.user-row strong,
.user-row span { display: block; }
.user-row span { margin-top: 0.25rem; color: var(--muted); font-size: 0.86rem; overflow-wrap: anywhere; }
.user-badges {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  gap: 0.45rem;
}
.user-badges i {
  padding: 0.25rem 0.5rem;
  color: #8d8472;
  background: #181510;
  border-radius: 0.45rem;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}
.user-badges i.ready { color: #cba968; background: #191610; }
.user-badges i.danger { color: #e2603f; background: #2a1c14; }
.row-actions {
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 0.45rem;
}
.row-actions button,
.danger-button {
  min-height: 2.25rem;
  padding: 0 0.7rem;
  color: #cba488;
  background: #241a13;
  border: 1px solid #3a261c;
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 800;
}
.row-actions button:first-child {
  color: #cba968;
  background: #191610;
  border-color: #2e2a1f;
}
.danger-button { margin-top: 1rem; }
.danger-button + .danger-button { margin-left: 0.5rem; }
.audit-list { display: grid; gap: 0.75rem; }
.admin-history-list { display: grid; gap: 0.75rem; }
.admin-history-list article {
  display: grid;
  gap: 0.45rem;
  padding: 0.85rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.admin-history-list strong,
.admin-history-list span { display: block; }
.admin-history-list span,
.admin-history-list small { color: var(--muted); font-size: 0.82rem; }
.admin-history-list p { margin: 0; color: #d3c9b5; line-height: 1.55; }
.audit-list article {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) minmax(8rem, auto);
  gap: 0.6rem 0.85rem;
  padding: 0.85rem;
  background: #15120c;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}
.audit-list time,
.audit-list span,
.audit-list small { color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.audit-list p { grid-column: 2 / -1; margin: 0; color: #d3c9b5; line-height: 1.55; }
.audit-list small { grid-column: 2 / -1; overflow-wrap: anywhere; }
@media (max-width: 1180px) {
  #app { grid-template-columns: 1fr; }
  .login-trust { grid-template-columns: 1fr; }
  .login-hero { min-height: auto; }
  .input-panel { position: static; min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field.wide, .button-row, .form-group-title, .checkbox-field { grid-column: 1 / -1; }
  .content-grid { grid-template-columns: 1fr; }
  .insight-grid { grid-template-columns: 1fr; }
  .fact-layers { grid-template-columns: 1fr; }
  .admin-grid, .users-grid { grid-template-columns: 1fr; }
  .status-cards, .status-cards.compact-status, .usage-observer, .overview-pillars, .theme-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .retention-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .main-stage, .input-panel { padding: 1rem; }
  .login-shell { padding: 1rem; place-items: stretch; }
  .login-hero, .login-card { padding: 1.1rem; }
  .trust-grid { grid-template-columns: 1fr; }
  .archive-summary, .privacy-panel { align-items: stretch; flex-direction: column; }
  .archive-stats { width: 100%; }
  .privacy-actions, .history-actions { width: 100%; }
  .privacy-actions button { flex: 1 1 0; }
  .history-row { grid-template-columns: 1fr; }
  .history-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .share-actions { align-items: stretch; flex-direction: column; }
  .quick-actions button,
  .feedback-row button { flex: 1 1 auto; }
  .compare-grid { grid-template-columns: 1fr; }
  .history-row small {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .form-grid, .scenario-fields, .overview-grid, .overview-pillars, .retention-grid, .theme-card-grid, .metric-grid, .meta-chip-grid, .pillars, .palace-grid, .palace-grid.compact, .divination-tool, .tarot-row, .gua-layout, .image-generator { grid-template-columns: 1fr; }
  .button-row { grid-template-columns: 1fr; }
  .report-panel { padding: 1rem; }
  .wheel-wrap { min-height: 14rem; }
  .destiny-wheel { width: 13rem; }
  h1 { font-size: 1.9rem; }
  .admin-shell { padding: 1rem; }
  .admin-topbar, .admin-topbar > div:first-child, .section-heading { align-items: stretch; flex-direction: column; }
  .admin-top-actions, .admin-actions { justify-content: stretch; }
  .admin-top-actions button, .admin-actions button { flex: 1 1 auto; }
  .two-col, .switch-grid, .admin-form .switch-grid, .access-switches, .status-cards, .status-cards.compact-status, .usage-observer, .overview-pillars, .user-row, .button-row.model-actions { grid-template-columns: 1fr; }
  .status-list strong { white-space: normal; overflow-wrap: anywhere; }
  .danger-button + .danger-button { margin-left: 0; }
  .audit-list article { grid-template-columns: 1fr; }
  .audit-list p,
  .audit-list small { grid-column: 1; }
}

/* ============================================================
   墨金 · 玄青 主题增强层 (ink-gold + jade-tech)
   ============================================================ */
.brand-mark {
  font-family: var(--font-serif);
  color: var(--gold-bright);
  background: radial-gradient(circle at 50% 34%, #322a1b 0%, #1b150d 58%, #120e08 100%);
  border: 1px solid rgba(201, 169, 106, 0.6);
  box-shadow:
    inset 0 0 0 3px rgba(201, 169, 106, 0.16),
    inset 0 0 12px rgba(201, 169, 106, 0.18),
    0 0 22px rgba(201, 169, 106, 0.2);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 0 12px rgba(201, 169, 106, 0.5);
}
h1, .login-hero h1 { font-family: var(--font-serif); letter-spacing: 0.05em; color: var(--gold-bright); }
h2, h3 { letter-spacing: 0.02em; color: var(--ink); }
a { color: var(--gold); }

.primary-button, .chat-form button {
  color: #14110b;
  background: linear-gradient(180deg, #e3c588 0%, #cba968 100%);
  border: 1px solid rgba(233, 214, 166, 0.5);
  box-shadow: 0 6px 22px rgba(201, 169, 106, 0.2);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.primary-button:hover, .chat-form button:hover {
  background: linear-gradient(180deg, #efd6a0 0%, #d8b673 100%);
  box-shadow: var(--glow-gold), 0 8px 26px rgba(201, 169, 106, 0.28);
}
.ghost-button, .manage-button {
  color: var(--gold-bright);
  background: rgba(201, 169, 106, 0.06);
  border: 1px solid var(--line-strong);
}
.ghost-button:hover, .manage-button:hover { background: rgba(201, 169, 106, 0.14); border-color: var(--gold); }
.danger-button { color: #ffd9cd; background: rgba(226, 96, 63, 0.14); border: 1px solid rgba(226, 96, 63, 0.4); }
.danger-button:hover { background: rgba(226, 96, 63, 0.24); }

.field input, .field select, .field textarea, .chat-form input, .history-search input, .two-col input, .scenario-fields input {
  background: #14110b;
  border: 1px solid var(--line);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus, .chat-form input:focus, .history-search input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 169, 106, 0.16);
  outline: none;
}
::placeholder { color: #6f6857; }

.input-panel, .report-panel, .chat-panel {
  background: linear-gradient(180deg, rgba(28, 25, 19, 0.96), rgba(19, 16, 11, 0.96));
  border: 1px solid var(--line);
}
.input-panel { border-right: 1px solid var(--line); }
.metric, .pillar, .palace, .wide-band, .image-generator, .summary-block, .history-row, .status-card, .admin-card, .login-card, .login-hero, .tarot-card, .gua-layout, .timeline > div {
  border: 1px solid var(--line);
}
.metric:hover, .pillar:hover, .palace:hover, .history-row:hover { border-color: var(--line-strong); }
.metric strong { color: var(--gold-bright); }
.metric span, .pillar span, .palace span { color: var(--muted); letter-spacing: 0.04em; }
.pillar strong { color: var(--gold-bright); }

.tabs button:hover { color: var(--gold-bright); }
.tabs button.active { box-shadow: 0 4px 18px rgba(201, 169, 106, 0.26); }

.destiny-wheel { width: min(100%, 16rem); aspect-ratio: 1; }
.wheel-ring-outer { stroke: rgba(201, 169, 106, 0.5); stroke-width: 0.8; }
.wheel-ring-dash { stroke: rgba(201, 169, 106, 0.3); stroke-width: 0.6; stroke-dasharray: 1.5 4.5; }
.wheel-tick { stroke: rgba(201, 169, 106, 0.42); stroke-width: 0.7; }
.wheel-arc-bg { stroke: rgba(255, 255, 255, 0.06); stroke-width: 4; }
.wheel-arc { stroke: var(--jade-glow); stroke-width: 4; }
.wheel-node { fill: var(--jade-glow); }
.wheel-core { fill: rgba(9, 8, 5, 0.55); stroke: rgba(201, 169, 106, 0.28); stroke-width: 0.6; }
.wheel-score { fill: var(--gold-bright); font-family: var(--font-serif); font-size: 1.35rem; font-weight: 600; letter-spacing: 0.16em; }
.wheel-caption { fill: var(--muted); font-size: 0.62rem; letter-spacing: 0.32em; }
.wheel-pillar { fill: var(--gold); font-size: 0.84rem; font-weight: 500; }

.bar-track { background: rgba(255, 255, 255, 0.05); }
.bar-track i { filter: saturate(1.2) brightness(1.16); }
.bar-row span { color: var(--gold); font-weight: 500; }
.bar-row b { color: var(--gold-bright); font-family: var(--font-mono); }

.ai-insight { border: 1px solid var(--line); border-left: 2px solid var(--jade-glow); }
.final-summary { border: 1px solid var(--line); border-left: 2px solid var(--gold); }
.evidence-chain, .fact-layers, .global-summary, .privacy-panel, .usage-ledger-card { border: 1px solid var(--line); }
.disclaimer, .fine-print, .note-line { color: var(--muted); }
.tag-row span, .meta-badge, .source-tags span, .archive-tags span { border: 1px solid var(--line); color: var(--gold); }
.inline-success { color: var(--jade-glow); }
.bubble { background: rgba(201, 169, 106, 0.05); border: 1px solid var(--line); }
.bubble.user { background: rgba(63, 224, 176, 0.07); border-color: rgba(63, 224, 176, 0.22); }
.chat-head span { color: var(--gold); letter-spacing: 0.12em; }

/* ===== layout robustness: responsive hero + fact grids ===== */
.overview-grid { grid-template-columns: 1fr; gap: 1.25rem; align-items: stretch; justify-items: center; }
.wheel-wrap { display: flex; justify-content: center; align-items: center; }
.overview-grid > div:last-child { width: 100%; }
.metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.insight-grid { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.fact-layers { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.overview-pillars { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); }
.pillars { grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr)); }

/* ===== mobile usability pass ===== */
@media (max-width: 760px) {
  body {
    min-height: 100svh;
    background-attachment: scroll;
  }

  h1 { font-size: 1.75rem; line-height: 1.15; }
  h2 { font-size: 1.24rem; line-height: 1.25; }
  h3 { font-size: 0.98rem; }

  .login-shell,
  .admin-shell {
    min-height: 100svh;
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.9rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }

  .login-trust,
  .content-grid,
  .admin-grid,
  .users-grid,
  .commerce-grid,
  .algorithm-grid,
  .two-col,
  .switch-grid,
  .admin-form .switch-grid,
  .access-switches,
  .scenario-fields,
  .retention-grid,
  .theme-card-grid,
  .candidate-list,
  .tarot-row,
  .gua-layout,
  .liuyao-table,
  .image-generator {
    grid-template-columns: 1fr;
  }

  .login-hero,
  .login-card,
  .input-panel,
  .report-panel,
  .chat-panel,
  .admin-card,
  .wide-band,
  .summary-block,
  .overview-compact,
  .overview-headline,
  .overview-details,
  .retention-center,
  .themed-reports,
  .result-actions,
  .final-summary,
  .ai-insight {
    border-radius: 0.68rem;
  }

  .login-hero,
  .login-card,
  .report-panel,
  .chat-panel,
  .admin-card {
    padding: 0.9rem;
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.34);
  }

  .login-hero h1 { font-size: 2rem; max-width: none; }
  .login-lead { font-size: 0.98rem; line-height: 1.7; }
  .login-meta { flex-direction: column; gap: 0.45rem; }

  .input-panel {
    gap: 1rem;
    min-height: auto;
    padding: 0.95rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    backdrop-filter: none;
  }

  .input-panel .brand-mark {
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.2rem;
  }

  .admin-strip,
  .history-head,
  .archive-summary,
  .privacy-panel,
  .share-actions,
  .section-heading,
  .admin-topbar,
  .admin-topbar > div:first-child {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-strip strong {
    max-width: 100%;
    white-space: normal;
  }

  .admin-actions,
  .admin-top-actions,
  .privacy-actions,
  .quick-actions,
  .feedback-row,
  .row-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
    width: 100%;
  }

  .quick-actions,
  .feedback-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-actions button,
  .admin-strip button,
  .admin-top-actions button,
  .privacy-actions button,
  .quick-actions button,
  .feedback-row button,
  .row-actions button,
  .retention-grid button,
  .theme-card-grid button,
  .image-generator button,
  .divination-tool button {
    width: 100%;
    min-height: 2.75rem;
  }

  .field input,
  .field select,
  .field textarea,
  .chat-form input,
  .history-search input,
  .two-col input,
  .scenario-fields input {
    min-height: 2.85rem;
    font-size: 16px;
  }

  .field textarea,
  .divination-tool textarea {
    min-height: 6.25rem;
    font-size: 16px;
  }

  .checkbox-field,
  .switch-field {
    min-height: 3.25rem;
    align-items: center;
  }

  .main-stage {
    padding: 0.75rem;
  }

  .tabs,
  .admin-tabs {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: auto;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
    padding: 0.55rem 0.75rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    scroll-padding-inline: 0.75rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .admin-tabs { margin-top: 0.75rem; margin-bottom: 0.75rem; }

  .tabs button,
  .admin-tabs button {
    min-height: 2.65rem;
    padding: 0 0.9rem;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .content-grid {
    gap: 0.75rem;
    margin-top: 0.75rem;
  }

  .report-panel {
    min-height: auto;
  }

  .result-section,
  .history-panel,
  .purchase-panel,
  .admin-form,
  .plan-editor-list,
  .quality-list,
  .algorithm-module-list,
  .audit-list,
  .admin-history-list {
    gap: 0.7rem;
  }

  .purchase-plan-list article {
    grid-template-columns: minmax(0, 1fr);
  }

  .purchase-plan-list button {
    width: 100%;
  }

  .overview-headline,
  .overview-pillars article,
  .fact-layers article,
  .insight-grid section,
  .retention-grid article,
  .theme-card-grid article,
  .metric,
  .pillar,
  .palace,
  .tarot-card,
  .liuyao-table article,
  .candidate-list article,
  .status-card,
  .usage-observer article {
    min-height: auto;
    padding: 0.82rem;
  }

  .overview-headline h2,
  .conclusion-lead p {
    font-size: 1rem;
    line-height: 1.65;
  }

  .overview-details summary {
    display: flex;
    align-items: center;
    min-height: 2.65rem;
  }

  .metric-grid,
  .meta-chip-grid,
  .status-cards,
  .status-cards.compact-status,
  .usage-observer,
  .algorithm-status {
    grid-template-columns: repeat(auto-fit, minmax(9.4rem, 1fr));
  }

  .pillars,
  .palace-grid,
  .palace-grid.compact,
  .overview-pillars,
  .fact-layers,
  .insight-grid {
    grid-template-columns: repeat(auto-fit, minmax(8.8rem, 1fr));
  }

  .wheel-wrap { min-height: 12rem; }
  .destiny-wheel { width: min(100%, 12.8rem); }

  .history-search {
    grid-template-columns: 1fr;
  }

  .history-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    -webkit-overflow-scrolling: touch;
  }

  .history-filters button {
    flex: 0 0 auto;
    min-height: 2.45rem;
  }

  .history-list,
  .archive-list,
  .usage-ledger-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .history-row {
    grid-template-columns: 1fr;
  }

  .history-row strong,
  .history-row span,
  .history-row small {
    white-space: normal;
  }

  .history-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .divination-tool {
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .divination-tool button {
    min-height: 3rem;
    align-self: stretch;
  }

  .tarot-card strong {
    font-size: 1.38rem;
  }

  .hexagram {
    min-height: 12rem;
  }

  .yao {
    grid-template-columns: minmax(5.8rem, 1fr) 2.5rem minmax(2rem, auto);
    gap: 0.5rem;
  }

  .chat-panel {
    grid-template-rows: auto minmax(12rem, 42svh) auto;
  }

  .chat-log {
    min-height: 12rem;
    padding-right: 0;
  }

  .bubble {
    max-width: 100%;
    padding: 0.72rem 0.78rem;
  }

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

  .chat-form button {
    min-height: 2.85rem;
  }

  .floating-chat {
    right: max(0.75rem, env(safe-area-inset-right));
    bottom: max(0.75rem, env(safe-area-inset-bottom));
    left: max(0.75rem, env(safe-area-inset-left));
  }

  .chat-fab {
    justify-self: end;
    min-height: 3.6rem;
    padding-right: 0.7rem;
  }

  .chat-fab-mark {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.05rem;
  }

  .floating-chat-panel {
    width: 100%;
    height: min(82svh, 42rem);
    border-radius: 0.9rem 0.9rem 0.65rem 0.65rem;
  }

  .model-chip-list {
    display: grid;
    grid-template-columns: 1fr;
  }

  .model-chip-list button {
    min-height: 2.55rem;
    text-align: left;
  }

  .quality-list article,
  .audit-list article {
    grid-template-columns: 1fr;
  }

  .quality-list p,
  .audit-list p,
  .audit-list small {
    grid-column: 1;
  }

  .algorithm-module-list article div,
  .status-list div {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .status-list strong {
    max-width: 100%;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .row-actions {
    grid-column: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .main-stage,
  .input-panel,
  .admin-shell,
  .login-shell {
    padding-right: 0.65rem;
    padding-left: 0.65rem;
  }

  .tabs,
  .admin-tabs {
    margin-right: -0.65rem;
    margin-left: -0.65rem;
    padding-right: 0.65rem;
    padding-left: 0.65rem;
  }

  .metric-grid,
  .meta-chip-grid,
  .status-cards,
  .status-cards.compact-status,
  .usage-observer,
  .algorithm-status,
  .overview-pillars,
  .fact-layers,
  .insight-grid,
  .pillars,
  .palace-grid,
  .palace-grid.compact,
  .quick-actions,
  .feedback-row,
  .row-actions {
    grid-template-columns: 1fr;
  }

  .history-actions {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   v18 · 设计精修层 (refinement pass)
   层级 / 标签栏 / 微交互 / 信息密度 / 移动端操作
   ============================================================ */

/* 尊重系统的减少动态偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---- 区块标题层级：小标签 + h3 前导金条 ---- */
.section-eyebrow { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.55rem; }
.section-eyebrow > span { color: var(--gold); font-size: 0.74rem; font-weight: 900; letter-spacing: 0.18em; text-transform: uppercase; }
.section-eyebrow > small { color: var(--muted); font-size: 0.76rem; letter-spacing: 0.02em; }
.summary-block h3, .wide-band h3, .fact-layers h3, .evidence-chain h3, .report-meta h3 {
  position: relative; padding-left: 0.72rem;
}
.summary-block h3::before, .wide-band h3::before, .fact-layers h3::before, .evidence-chain h3::before, .report-meta h3::before {
  content: ""; position: absolute; left: 0; top: 0.16em; bottom: 0.16em;
  width: 3px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  box-shadow: 0 0 8px rgba(201, 169, 106, 0.45);
}
.fact-layers h3 { font-size: 0.95rem; }

/* ---- 总览：一句话结论作为视觉焦点 ---- */
.overview-headline {
  background: linear-gradient(160deg, #211b11 0%, #15120c 70%);
  border-left: 2px solid var(--gold);
  box-shadow: inset 0 0 30px rgba(201, 169, 106, 0.05);
}
.overview-headline h2 { font-family: var(--font-serif); letter-spacing: 0.01em; }

/* ---- 总览速览容器（取代原 details open 的文字墙） ---- */
.overview-snapshot {
  display: grid; gap: 1rem; padding: 1.1rem;
  background: #1b1813; border: 1px solid var(--line); border-radius: 0.75rem;
}

/* ---- 折叠完整依据明细（默认收起） ---- */
.evidence-fold {
  background: #15120c; border: 1px solid var(--line); border-radius: 0.65rem; overflow: hidden;
}
.evidence-fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  min-height: 3rem; padding: 0.7rem 1rem; cursor: pointer; list-style: none;
  transition: background 0.16s ease;
}
.evidence-fold > summary::-webkit-details-marker { display: none; }
.evidence-fold > summary:hover { background: rgba(201, 169, 106, 0.06); }
.fold-label { display: flex; align-items: center; gap: 0.5rem; color: var(--gold-bright); font-weight: 800; letter-spacing: 0.02em; }
.fold-label::before {
  content: "›"; display: inline-block; color: var(--gold); font-size: 1.1rem; font-weight: 900;
  transition: transform 0.2s ease; transform: rotate(0deg);
}
.evidence-fold[open] > summary .fold-label::before { transform: rotate(90deg); }
.fold-hint { color: var(--muted); font-size: 0.76rem; letter-spacing: 0.02em; }
.evidence-fold[open] > summary { border-bottom: 1px solid var(--line); }
.evidence-fold-body { display: grid; gap: 0.85rem; padding: 0.9rem 1rem 1rem; }
.evidence-fold-body .fact-layers,
.evidence-fold-body .evidence-chain { border: 0; padding: 0; background: transparent; }

/* ---- 桌面：标签栏吸顶，切换栏目不必回滚 ---- */
@media (min-width: 1181px) {
  .tabs {
    position: sticky; top: 0; z-index: 12;
    background: linear-gradient(180deg, rgba(26, 23, 17, 0.94), rgba(20, 17, 11, 0.82));
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 24px -16px rgba(0, 0, 0, 0.7);
  }
}

/* ---- 标签栏交互精修（全宽适用） ---- */
.tabs button {
  position: relative;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}
.tabs button:hover:not(.active) { background: rgba(201, 169, 106, 0.10); }
.tabs button.active {
  background: linear-gradient(180deg, #ecdaab 0%, #cba968 100%);
  box-shadow: 0 4px 16px rgba(201, 169, 106, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}
.tabs button:active { transform: translateY(1px); }

/* ---- 卡片微交互：悬停抬升 + 描边辉光 ---- */
.metric, .pillar, .palace, .tarot-card, .timeline > div,
.theme-card-grid article, .retention-grid article, .meta-chip {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.metric:hover, .pillar:hover, .palace:hover, .tarot-card:hover,
.theme-card-grid article:hover, .retention-grid article:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.55), var(--glow-gold);
}

/* ---- 可点击次级控件（追问 / 反馈 / 历史筛选 / 示例） ---- */
.follow-ups button, .quick-actions button, .feedback-row button,
.history-filters button, .source-tags button, .model-chip-list button {
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.follow-ups button:hover, .quick-actions button:hover, .feedback-row button:hover, .history-filters button:hover {
  color: var(--gold-bright); border-color: var(--gold);
  background: rgba(201, 169, 106, 0.1); transform: translateY(-1px);
}
.follow-ups span { color: var(--gold); font-weight: 800; letter-spacing: 0.06em; }

/* ---- 按钮按压反馈 ---- */
.primary-button, .ghost-button, .manage-button, .danger-button { transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease, border-color 0.16s ease; }
.primary-button:active, .ghost-button:active, .manage-button:active, .danger-button:active { transform: translateY(1px); }

/* ---- 排版节奏：列表行距统一 ---- */
.fact-layers ul, .evidence-chain ol, .overview-pillars ul { line-height: 1.7; }
.fact-layers li, .overview-pillars li { margin-bottom: 0.4rem; }

/* ---- 移动端：悬浮聊天按钮避让内容 ---- */
@media (max-width: 760px) {
  .main-stage { padding-bottom: 5.5rem; }
  .evidence-fold > summary { min-height: 2.85rem; }
  .section-eyebrow { gap: 0.35rem; }
}
