:root {
  --bg: #0a0c10;
  --surface: rgba(18, 22, 30, 0.85);
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8e4df;
  --muted: #8a8580;
  --accent: #c4a574;
  --accent-dim: rgba(196, 165, 116, 0.25);
  --radius: 12px;
  /* 用 Google「Noto * SC」简体专用族，避免系统 Noto CJK .ttc 选错语言面导致错字 */
  --font: "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", serif;
  --font-ui: "Noto Sans SC", "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(90, 70, 120, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(74, 103, 65, 0.12), transparent);
}

.app {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.header h1 {
  font-family: var(--font);
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  margin: 0 0 0.5rem;
  padding-left: 0.35em;
}

.subtitle {
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

.header .debug-link-wrap {
  margin: 0.5rem 0 0;
}

.debug-link {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.debug-link:hover {
  color: var(--accent);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.intro {
  font-family: var(--font-ui);
  text-align: center;
  color: var(--muted);
  margin-bottom: 2rem;
}

.btn {
  font-family: var(--font-ui);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s, border-color 0.2s;
}

.btn.primary {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  background: var(--accent-dim);
  color: var(--text);
  border-color: rgba(196, 165, 116, 0.4);
}

.btn.primary:hover:not(:disabled) {
  background: rgba(196, 165, 116, 0.35);
}

.btn.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.secondary {
  background: transparent;
  color: var(--muted);
  margin-top: 1rem;
}

.progress-wrap {
  margin-bottom: 1.25rem;
}

.progress-bar {
  height: 2px;
  background: var(--accent-dim);
  border-radius: 1px;
  width: 0%;
  transition: width 0.3s;
}

.progress-text {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
}

.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  backdrop-filter: blur(8px);
}

#question-text {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0 0 1.25rem;
  white-space: pre-wrap;
}

.question-group-label {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin: 0 0 0.65rem;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.option {
  font-family: var(--font-ui);
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.option:hover {
  border-color: rgba(196, 165, 116, 0.35);
}

.option.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.option.color-swatch {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  text-align: left;
  padding: 0.65rem 0.85rem;
}

.color-swatches {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}

.color-swatch-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.color-label {
  font-size: 0.95rem;
}

.color-note {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.color-hex-tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 0.85;
}

.color-custom-panel {
  margin-top: 0.5rem;
  padding: 0.85rem 0.95rem;
  border: 1px dashed rgba(196, 165, 116, 0.25);
  border-radius: var(--radius);
  background: rgba(12, 16, 24, 0.35);
}

.color-custom-panel.active {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.color-custom-title {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.color-custom-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.color-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  position: relative;
}

.color-picker-preview {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  display: block;
}

.color-picker-input {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

.color-note-input {
  flex: 1;
  min-width: 10rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(8, 10, 16, 0.5);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.color-custom-confirm {
  width: auto;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.color-final-preview {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(196, 165, 116, 0.3);
  background: rgba(196, 165, 116, 0.08);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.color-final-preview.hidden {
  display: none;
}

.color-final-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--accent);
}

.color-final-content {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}

.swatch-inline {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 4px;
}

.color-final-hex {
  font-family: var(--font-ui);
  color: var(--accent);
}

.color-final-sep {
  color: var(--muted);
}

.color-final-note {
  color: var(--text);
}

.swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.swatch-none {
  background:
    linear-gradient(135deg, transparent 46%, rgba(255, 255, 255, 0.35) 48%, rgba(255, 255, 255, 0.35) 52%, transparent 54%),
    repeating-conic-gradient(rgba(255, 255, 255, 0.12) 0% 25%, transparent 0% 50%) 50% / 10px 10px;
  background-color: rgba(255, 255, 255, 0.04);
}

.color-swatch-none .color-label {
  color: var(--muted);
}

.animal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.animal-chip {
  font-family: var(--font-ui);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.animal-chip.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

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

.start-probe-hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  opacity: 0.75;
  max-width: 36rem;
  line-height: 1.5;
}

.free-input {
  margin-top: 1rem;
}

.free-input.hidden {
  display: none;
}

.options-toggle {
  display: block;
  width: 100%;
  margin: 1rem 0 0.5rem;
  font-size: 0.9rem;
}

.options-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
}

.options-drawer.hidden {
  display: none;
}

.options-drawer .options-list,
.options-drawer .animal-grid,
.options-drawer .color-swatches {
  margin-top: 0.5rem;
}

.animal-free-first,
.color-free-first {
  margin-top: 0;
}

.community-notice {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
  opacity: 0.9;
}

.option.community,
.animal-chip.community {
  border-style: dashed;
  border-color: rgba(196, 165, 116, 0.45);
}

.community-badge {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--accent);
  margin-left: 0.5rem;
  opacity: 0.85;
}

.free-input input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: var(--font-ui);
}

.loader {
  width: 48px;
  height: 48px;
  margin: 2rem auto;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

#screen-loading {
  text-align: center;
  color: var(--muted);
}

.result-prompt-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.prompt-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

.prompt-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.prompt-column-jing .prompt-track-label {
  color: var(--accent);
}

.prompt-column-xiang .prompt-track-label {
  color: #c4a574;
}

.prompt-section-full {
  margin-top: 0.25rem;
}

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

.aspect-note {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.prompt-track-label {
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  margin: 0 0 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.prompt-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  backdrop-filter: blur(8px);
}

.prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.prompt-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
}

.copy-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  width: auto;
  margin: 0;
}

.prompt-box {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  line-height: 1.55;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.75rem;
  resize: vertical;
}

.prompt-box-full {
  font-size: 0.78rem;
}

.result-text h2 {
  font-weight: 400;
  margin-top: 0;
}

#interpretation {
  font-family: var(--font-ui);
  color: var(--muted);
  font-size: 0.95rem;
}

.ir-details {
  margin-top: 1rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--muted);
}

.ir-details pre {
  overflow: auto;
  max-height: 200px;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.75rem;
  border-radius: 8px;
}

.probe-result-panel {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.probe-result-panel.hidden {
  display: none;
}

.probe-result-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.probe-peaks {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.probe-peak {
  display: grid;
  grid-template-columns: 7.5rem 1fr minmax(6rem, 9rem);
  gap: 0.5rem;
  align-items: center;
  font-size: 0.85rem;
  font-family: var(--font-ui);
}

.probe-peak-bar {
  display: block;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.probe-peak-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  opacity: 0.85;
}

.probe-peak-val {
  text-align: right;
  opacity: 0.8;
  font-size: 0.8rem;
}

.probe-model-json,
.probe-symbol-prose {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.78rem;
  line-height: 1.45;
  max-height: 220px;
  overflow: auto;
  opacity: 0.9;
}

.probe-symbol-rows {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.probe-sym-row {
  font-size: 0.88rem;
  line-height: 1.45;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hidden {
  display: none !important;
}

/* ── 问题森林回顾 ── */
.review-header {
  margin-bottom: 1.25rem;
}

.review-header h2 {
  font-weight: 400;
  margin: 0 0 0.5rem;
}

.forest-counter {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.review-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.review-forest {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.forest-node {
  position: relative;
}

.forest-children {
  margin-left: 1.25rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(196, 165, 116, 0.25);
}

.forest-connector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.35rem 0;
}

.connector-arrow {
  color: var(--accent);
}

.connector-label {
  opacity: 0.8;
}

.node-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  backdrop-filter: blur(8px);
}

.node-card.dynamic {
  border-style: dashed;
}

.node-card.pending {
  opacity: 0.85;
  border-color: rgba(196, 165, 116, 0.35);
}

.node-q {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.node-a {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 0.9rem;
}

.node-pending-label {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.node-meta {
  margin-bottom: 0.5rem;
}

.tag {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.dynamic-tag {
  color: var(--accent);
}

.situational-tag {
  color: #9eb8d4;
}

.group-tag {
  color: var(--accent);
  border-color: rgba(196, 165, 116, 0.35);
}

.group-tag-guardian {
  color: #c4a574;
}

.expand-btn {
  width: auto;
  margin: 0.25rem 0.5rem 0 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  display: inline-block;
}

.expand-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.node-elaboration {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  line-height: 1.45;
}

.node-elaborate-panel {
  margin-top: 0.75rem;
  padding: 0.85rem 0.95rem;
  background: rgba(12, 16, 24, 0.45);
  border: 1px solid rgba(196, 165, 116, 0.2);
  border-radius: calc(var(--radius) - 2px);
}

.elaborate-panel-title {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  color: var(--accent);
}

.elaborate-panel-hint {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.elaborate-textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(8, 10, 16, 0.6);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 5.5rem;
}

.elaborate-textarea:focus {
  outline: none;
  border-color: rgba(196, 165, 116, 0.45);
}

.elaborate-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  gap: 0.75rem;
}

.elaborate-counter {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: var(--muted);
}

.elaborate-save-btn {
  width: auto;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.elaborate-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.elaborate-divider::before,
.elaborate-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(196, 165, 116, 0.15);
}

.expand-questions-btn {
  width: 100%;
  font-size: 0.82rem;
}

.btn.loading {
  pointer-events: none;
  opacity: 0.75;
}

.btn.loading::after {
  content: '';
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.45em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -0.1em;
  animation: btn-spin 0.65s linear infinite;
}

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

.answer-pending-btn {
  width: auto;
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.dynamic-quiz-panel {
  background: rgba(18, 22, 30, 0.95);
  border: 1px solid rgba(196, 165, 116, 0.35);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.dynamic-quiz-panel h3 {
  margin: 0 0 0.75rem;
  font-weight: 400;
  font-size: 1rem;
  color: var(--accent);
}

.generate-btn {
  max-width: 100%;
}

.generate-hint {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--accent);
  line-height: 1.45;
}

.generate-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.node-inline-quiz {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(196, 165, 116, 0.15);
}

.node-inline-quiz .inline-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.node-inline-quiz .option {
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
}

.node-inline-quiz .free-input {
  margin-bottom: 0.65rem;
}

.node-inline-quiz .free-input input {
  width: 100%;
}

.node-inline-quiz .inline-submit {
  width: auto;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}
