:root {
  --bg: #f5ede2;
  --bg-deep: #eadfcf;
  --surface: rgba(255, 250, 244, 0.84);
  --surface-strong: rgba(255, 252, 248, 0.96);
  --surface-soft: rgba(255, 255, 255, 0.68);
  --ink: #1f1916;
  --muted: #6a625b;
  --line: rgba(120, 96, 74, 0.16);
  --line-strong: rgba(120, 96, 74, 0.28);
  --accent: #c76640;
  --accent-deep: #89391d;
  --accent-soft: rgba(199, 102, 64, 0.12);
  --green: #2a6155;
  --green-soft: rgba(42, 97, 85, 0.12);
  --gold: #bc955b;
  --shadow: 0 30px 70px rgba(64, 40, 20, 0.12);
  --shadow-soft: 0 16px 34px rgba(64, 40, 20, 0.08);
  --radius-xl: 32px;
  --radius-lg: 26px;
  --radius-md: 20px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Aptos", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(199, 102, 64, 0.18), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(42, 97, 85, 0.16), transparent 24%),
    radial-gradient(circle at 50% 115%, rgba(188, 149, 91, 0.18), transparent 32%),
    linear-gradient(180deg, #f8f2e9 0%, #efe5d7 52%, #efe8dd 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -180px;
  left: -120px;
  background: rgba(199, 102, 64, 0.16);
}

body::after {
  right: -140px;
  bottom: -180px;
  background: rgba(42, 97, 85, 0.14);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p,
ol {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Georgia", "Times New Roman", "Songti SC", "SimSun", serif;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 72px;
}

.hero,
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.9), rgba(255, 248, 241, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: float-in 0.55s ease both;
}

.hero::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.46), transparent 70%);
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.92fr);
  gap: 28px;
  padding: 36px;
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.guide-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 25, 22, 0.48);
  backdrop-filter: blur(5px);
}

.guide-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(86vh, 920px);
  overflow: hidden;
  border: 1px solid rgba(220, 205, 190, 0.96);
  border-radius: 20px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 30px 80px rgba(64, 40, 20, 0.24);
}

.guide-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 16px;
  border-bottom: 1px solid rgba(120, 96, 74, 0.14);
  background: rgba(255, 252, 248, 0.98);
}

.guide-dialog h2 {
  margin-top: 8px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.18;
}

.guide-dialog h3 {
  margin: 20px 0 0;
  font-family: "Aptos", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  color: var(--ink);
}

.guide-content {
  max-height: calc(min(86vh, 920px) - 108px);
  overflow: auto;
  padding: 0 24px 24px;
  color: var(--muted);
  line-height: 1.8;
}

.guide-content p,
.guide-content ol {
  margin: 10px 0 0;
}

.guide-content ol {
  padding-left: 1.4em;
}

.guide-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.84);
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.guide-close-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: #fff;
}

.guide-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid rgba(42, 97, 85, 0.22);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  color: var(--green);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.guide-open-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(42, 97, 85, 0.42);
  background: #fff;
}

.hero-compact {
  display: block;
  padding: 24px 28px;
}

.hero-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.hero-copy,
.hero-side,
.home-main,
.home-side,
.settings-stack {
  display: grid;
  gap: 20px;
}

.hero-copy {
  align-content: center;
}

.eyebrow {
  display: inline-flex;
  align-self: start;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(44px, 6vw, 70px);
  line-height: 0.98;
}

.hero-compact h1 {
  margin-top: 10px;
  font-size: clamp(34px, 4vw, 48px);
}

.lead {
  max-width: 58ch;
  font-size: 17px;
  line-height: 1.9;
  color: var(--muted);
}

.hero-compact .lead {
  max-width: 78ch;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.75;
}

.hero-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-compact .hero-pill-row {
  margin-top: 14px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(120, 96, 74, 0.14);
  border-radius: var(--radius-pill);
  background: rgba(255, 253, 249, 0.92);
  box-shadow: var(--shadow-soft);
  font-size: 14px;
  font-weight: 700;
}

.hero-compact .hero-pill {
  min-height: 34px;
  padding: 0 13px;
  font-size: 13px;
}

.hero-note,
.hero-step,
.source-card,
.settings-card,
.summary-card,
.status-card,
.answers-panel,
.progress-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.98), rgba(255, 248, 241, 0.9));
  box-shadow: var(--shadow-soft);
}

.hero-note {
  padding: 22px;
  background: linear-gradient(145deg, rgba(255, 242, 233, 0.98), rgba(255, 255, 255, 0.78));
}

.hero-note-label,
.section-kicker,
.mode-caption,
.summary-label,
.player-kicker,
.status-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.hero-note-label {
  margin-bottom: 10px;
  color: var(--accent-deep);
}

.hero-note p:last-child {
  color: var(--muted);
  line-height: 1.8;
}

.hero-steps {
  display: grid;
  gap: 12px;
}

.hero-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 251, 246, 0.94));
}

.hero-step-index {
  font-family: "Georgia", "Times New Roman", "Songti SC", "SimSun", serif;
  font-size: 26px;
  line-height: 1;
  color: var(--green);
}

.hero-step-title {
  font-size: 15px;
  font-weight: 700;
}

.hero-step-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.panel {
  margin-top: 24px;
  padding: 32px;
}

.panel-toolbar,
.panel-head,
.player-top,
.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.panel-toolbar,
.player-top {
  align-items: start;
}

.panel-toolbar {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(120, 96, 74, 0.12);
}

.section-title {
  margin-top: 8px;
  font-size: clamp(28px, 3vw, 40px);
}

.mode-wrap {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.mode-switch {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-pill);
  background: rgba(42, 97, 85, 0.08);
  box-shadow: inset 0 0 0 1px rgba(42, 97, 85, 0.08);
}

.mode-btn {
  min-width: 124px;
  height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

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

.mode-btn.active {
  background: linear-gradient(135deg, #fffdf9, #fff1e5);
  color: var(--ink);
  box-shadow: 0 10px 18px rgba(64, 40, 20, 0.08);
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.home-main {
  align-content: start;
}

.home-side {
  align-content: start;
}

.source-section {
  margin: 0;
}

.source-card,
.settings-card,
.summary-card,
.answers-panel {
  padding: 22px;
}

.source-card::after,
.settings-card::after,
.summary-card::after,
.status-card::after,
.answers-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  width: 84px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), rgba(199, 102, 64, 0));
}

.accent-card {
  background: linear-gradient(145deg, rgba(255, 245, 237, 0.98), rgba(255, 252, 248, 0.96));
}

.panel-head {
  align-items: end;
}

.panel-head p {
  max-width: 28ch;
  color: var(--muted);
  line-height: 1.75;
}

h3 {
  margin-top: 6px;
  font-size: 27px;
}

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

.settings-card .picker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.picker,
.textarea-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 700;
}

.picker span,
.textarea-field span {
  color: var(--muted);
  font-size: 14px;
}

select,
.text-input,
textarea {
  width: 100%;
  border: 1px solid rgba(120, 96, 74, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

select,
.text-input {
  height: 52px;
  padding: 0 15px;
}

textarea {
  min-height: 180px;
  padding: 14px 15px;
  line-height: 1.75;
  resize: vertical;
}

select:hover:not(:disabled),
.text-input:hover,
textarea:hover {
  border-color: rgba(137, 57, 29, 0.26);
}

select:focus-visible,
.text-input:focus-visible,
textarea:focus-visible,
.mode-btn:focus-visible,
.primary-btn:focus-visible,
.ghost-btn:focus-visible,
.file-btn:focus-visible {
  box-shadow: 0 0 0 4px rgba(42, 97, 85, 0.14);
}

select:focus-visible,
.text-input:focus-visible,
textarea:focus-visible {
  border-color: rgba(42, 97, 85, 0.42);
}

select:disabled {
  background: linear-gradient(180deg, #efe8de, #ebe2d5);
  color: #978b7c;
}

.textarea-field {
  margin-top: 16px;
}

.custom-actions,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.custom-actions {
  margin-top: 16px;
}

.file-btn,
.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.file-btn {
  border: 1px dashed rgba(42, 97, 85, 0.3);
  background: rgba(42, 97, 85, 0.08);
  color: var(--green);
}

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

.compact-btn {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
}

.summary-card {
  background: linear-gradient(145deg, rgba(42, 97, 85, 0.12), rgba(255, 255, 255, 0.82));
}

.home-summary {
  min-height: 0;
}

.full-width {
  width: 100%;
}

#summaryText {
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.8;
}

.summary-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.preview-card {
  background: linear-gradient(145deg, rgba(255, 252, 248, 0.98), rgba(42, 97, 85, 0.1));
}

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

.preview-title {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
}

.preview-count {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: rgba(42, 97, 85, 0.1);
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
  line-height: 34px;
}

.preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.preview-item {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 100%;
  padding: 6px 11px;
  border: 1px solid rgba(120, 96, 74, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.voice-test-card {
  display: grid;
  gap: 14px;
}

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

.voice-test-field {
  gap: 7px;
}

.voice-test-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.voice-test-chip {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(120, 96, 74, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.voice-test-chip:hover {
  border-color: rgba(42, 97, 85, 0.28);
  background: #fff;
}

.range-input {
  width: 100%;
  accent-color: var(--green);
}

.voice-test-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.home-actions {
  margin-top: -4px;
}

.home-main .home-actions {
  justify-content: flex-start;
}

.home-main .primary-btn {
  min-width: 220px;
}

.primary-btn,
.ghost-btn {
  border: 0;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 16px 28px rgba(137, 57, 29, 0.24);
}

.primary-btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ghost-btn {
  border: 1px solid rgba(120, 96, 74, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: 0 10px 20px rgba(64, 40, 20, 0.06);
}

.hint-text {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.panel-player,
.panel-completion {
  padding: 30px;
}

#playerTitle,
#completionTitle {
  margin-top: 8px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.progress-wrap {
  margin-top: 24px;
  padding: 20px 22px;
}

.progress-meta {
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.progress-bar {
  margin-top: 10px;
  width: 100%;
  height: 16px;
  border-radius: var(--radius-pill);
  background: rgba(42, 97, 85, 0.12);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #5c9b8b, #8ec9b8);
  box-shadow: 0 0 18px rgba(42, 97, 85, 0.24);
  transition: width 0.28s ease;
}

.status-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.status-card {
  min-height: 172px;
  padding: 22px;
}

.status-value {
  margin-top: 14px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.32;
}

.muted {
  font-family: "Aptos", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--muted);
  font-size: 19px;
  font-weight: 700;
}

#completionSummary {
  max-width: 46ch;
  color: var(--muted);
  line-height: 1.8;
}

.completion-actions {
  margin-top: 22px;
}

.answers-panel {
  margin-top: 22px;
}

.answers-list {
  margin: 14px 0 0;
  padding-left: 22px;
  line-height: 1.9;
}

.answers-list li + li {
  margin-top: 6px;
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .mode-wrap {
    justify-items: start;
  }

  .panel-head {
    flex-direction: column;
    align-items: start;
  }

  .panel-head p {
    max-width: none;
  }

  .home-actions {
    margin-top: 0;
  }
}

@media (max-width: 760px) {
  .shell {
    padding: 20px 14px 48px;
  }

  .hero,
  .panel,
  .panel-player,
  .panel-completion {
    padding: 22px;
    border-radius: 24px;
  }

  .guide-modal {
    padding: 14px;
  }

  .guide-header {
    padding: 20px 18px 14px;
  }

  .guide-content {
    padding: 0 18px 20px;
  }

  .hero-title-row {
    flex-direction: column;
    gap: 14px;
  }

  .guide-open-btn {
    width: 100%;
  }

  .hero-note,
  .hero-step,
  .source-card,
  .settings-card,
  .summary-card,
  .status-card,
  .answers-panel,
  .progress-wrap {
    border-radius: 22px;
  }

  .panel-toolbar,
  .player-top,
  .progress-meta {
    flex-direction: column;
    align-items: start;
  }

  .mode-switch {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mode-btn {
    width: 100%;
    min-width: 0;
  }

  .picker-grid,
  .settings-card .picker-grid,
  .status-board {
    grid-template-columns: 1fr;
  }

  .custom-actions,
  .actions {
    flex-direction: column;
  }

  .file-btn,
  .primary-btn,
  .ghost-btn {
    width: 100%;
  }

  .status-card {
    min-height: 0;
  }
}
