:root {
  --bg-1: #f7fbf7;
  --bg-2: #eef5f0;
  --card: rgba(255, 255, 255, 0.94);
  --line: #dbe8dd;
  --text: #1e2a22;
  --subtext: #6a786f;
  --brand-1: #55735c;
  --brand-2: #3f5f48;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #eef5f0;
  color: var(--text);
  overflow-x: hidden;
}

button {
  font: inherit;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid rgba(85, 115, 92, 0.28);
  outline-offset: 2px;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 16px;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
  overflow: visible;
}

.screen {
  width: min(100%, 1100px);
  margin: 0 auto;
}

.mobile-test-top,
.mobile-test-bottom {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  z-index: 20;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(31, 45, 36, 0.88);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  animation: toastFade 1.8s ease;
}

.toast-success {
  background: rgba(58, 98, 66, 0.92);
}

.toast-warning {
  background: rgba(114, 83, 39, 0.92);
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.45;
  pointer-events: none;
}

.bg-orb-1 {
  width: 180px;
  height: 180px;
  top: -24px;
  right: -20px;
  background: radial-gradient(circle, rgba(155, 213, 168, 0.75) 0%, rgba(155, 213, 168, 0) 72%);
}

.bg-orb-2 {
  width: 156px;
  height: 156px;
  left: -30px;
  top: 220px;
  background: radial-gradient(circle, rgba(215, 234, 195, 0.8) 0%, rgba(215, 234, 195, 0) 72%);
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(219, 232, 221, 0.9);
  border-radius: 24px;
  box-shadow: 0 12px 36px rgba(47, 73, 55, 0.09);
  backdrop-filter: blur(8px);
}

.card-lite,
.question,
.poster-box,
.type-box,
.analysis-box,
.dim-box,
.note-box,
.dim-item {
  background: linear-gradient(180deg, #ffffff, #fbfdfb);
  border: 1px solid #e1ebe3;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(61, 93, 70, 0.05);
}

.hero,
.test-wrap,
.result-wrap {
  padding: clamp(18px, 4vw, 32px);
}

.hero-minimal {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.hero-fancy {
  padding-block: clamp(56px, 10vw, 90px);
}

.hero-badge,
.badge,
.type-kicker,
.match {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eef8f0, #e6f2e9);
  border: 1px solid var(--line);
  color: #4d6a53;
  font-size: clamp(13px, 2.6vw, 18px);
}

.hero-title {
  margin: 20px 0 0;
  font-size: clamp(28px, 6vw, 52px);
  line-height: 1.25;
  font-weight: 800;
}

.hero-title-strong {
  color: #486a50;
  text-shadow: 0 6px 18px rgba(91, 122, 98, 0.18);
}

.hero-subtitle,
.progress-text,
.meta-text,
.hint,
.paragraph,
.topbar-subtitle,
.poster-caption,
.type-subname,
.dim-item-desc,
.option-label {
  color: var(--subtext);
  line-height: 1.8;
}

.hero-subtitle {
  margin-top: 20px;
  max-width: 560px;
  font-size: clamp(15px, 3vw, 22px);
}

.hero-actions {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 32px;
}

.btn {
  border: 0;
  border-radius: 18px;
  font-size: clamp(15px, 2.8vw, 18px);
  font-weight: 700;
  padding: 0 28px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover:not(:disabled),
.option:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-1) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 12px 24px rgba(69, 101, 77, 0.22);
}

.btn-secondary {
  background: #fff;
  color: #4d6a53;
  border: 1px solid var(--line);
}

.btn:disabled {
  opacity: 0.55;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-hero {
  min-width: min(100%, 320px);
  min-height: 56px;
  border-radius: 999px;
}

.btn-ghost {
  min-width: min(100%, 320px);
}

.btn-action {
  flex: 1;
  min-height: 52px;
}

.btn-submit:disabled {
  background: linear-gradient(135deg, #cad6cd 0%, #b8c5bb 100%);
  color: #fff;
}

.btn-submit-pseudo-disabled {
  background: linear-gradient(135deg, #cad6cd 0%, #b8c5bb 100%);
  color: #fff;
  box-shadow: none;
}

.topbar,
.actions-bottom,
.poster-box,
.type-box,
.analysis-box,
.dim-box,
.note-box,
.dim-item,
.result-hero {
  padding: clamp(16px, 3vw, 24px);
}

.topbar {
  margin-bottom: 20px;
}

.test-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.test-sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  min-width: 0;
}

.sidebar-panel {
  padding: 24px;
}

.sticky-panel {
  position: static;
  overflow: visible;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #fbfdfb);
}

.stat-label {
  color: var(--subtext);
  font-size: 13px;
  line-height: 1.5;
}

.stat-value {
  margin-top: 8px;
  color: #223126;
  font-weight: 800;
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.1;
}

.hint-block {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7fbf8;
  border: 1px solid #e3ece5;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.sidebar-actions .btn-action {
  width: 100%;
}

.topbar-head,
.question-meta,
.dim-item-top,
.action-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.topbar-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.topbar-head-compact {
  align-items: center;
  margin-bottom: 8px;
}

.topbar-head .progress-text {
  flex: 0 0 auto;
  white-space: nowrap;
  line-height: 1.2;
  text-align: right;
  font-size: 18px;
}

.topbar-title,
.section-title {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 700;
  color: #223126;
}

.topbar-title {
  line-height: 1.2;
}

.topbar-subtitle {
  font-size: 14px;
  line-height: 1.6;
}

.progress {
  height: 12px;
  background: #edf3ee;
  border-radius: 999px;
  overflow: hidden;
}

.progress-inner {
  height: 100%;
  background: linear-gradient(90deg, #abd2b2, #5b7a62);
}

.progress-text-strong,
.hint-strong {
  color: #395543;
  font-weight: 700;
}

.question-list,
.dim-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.test-main {
  min-width: 0;
}

.question {
  padding: clamp(18px, 3vw, 28px);
}

.question-pending {
  border-color: #91ad96;
  box-shadow: 0 0 0 3px rgba(145, 173, 150, 0.18), 0 10px 24px rgba(76, 112, 84, 0.08);
}

.question-flash {
  animation: questionFlash 1.6s ease;
}

.question-title,
.type-name {
  margin-top: 16px;
  font-size: clamp(19px, 3.8vw, 30px);
  line-height: 1.7;
  font-weight: 700;
  color: #1f2d24;
}

.options {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.option {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 6px 18px rgba(56, 83, 63, 0.04);
  text-align: left;
}

.option-active {
  border-color: #7ea084;
  background: linear-gradient(180deg, #f2f8f3, #ecf5ee);
  box-shadow: 0 10px 24px rgba(76, 112, 84, 0.12);
}

.option-code {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #4d6a53;
  border-radius: 50%;
  background: #edf6ef;
}

.option-active .option-code {
  background: #4d6a53;
  color: #fff;
}

.actions-bottom,
.analysis-box,
.dim-box,
.note-box,
.result-actions {
  margin-top: 24px;
}

.action-row {
  flex-wrap: wrap;
}

.action-row-fixed {
  gap: 16px;
}

.result-hero {
  background: linear-gradient(180deg, #fcfffc, #f6fbf7);
}

.result-hero-head {
  margin-bottom: 14px;
}

.responsive-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

.poster-image {
  width: 100%;
  display: block;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(54, 82, 61, 0.12);
}

.poster-box.no-image {
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.poster-fallback {
  min-height: 220px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef6f0, #e6f0e8);
  color: #4d6a53;
  font-weight: 700;
}

.match,
.type-subname {
  margin-top: 14px;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn-share {
  min-height: 46px;
}

.dim-item {
  background: #fff;
}

.dim-item-name,
.dim-item-score {
  font-size: clamp(14px, 2.6vw, 17px);
}

@keyframes questionFlash {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 3px rgba(145, 173, 150, 0.18), 0 10px 24px rgba(76, 112, 84, 0.08);
  }
  35% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 6px rgba(126, 160, 132, 0.22), 0 14px 28px rgba(76, 112, 84, 0.14);
  }
}

@keyframes toastFade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
  12%,
  80% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(23, 34, 27, 0.42);
}

.modal {
  width: min(100%, 480px);
  padding: 24px;
}

.modal-actions {
  margin-top: 18px;
}

@media print {
  .bg-orb,
  .result-actions,
  .share-actions,
  .toast,
  .modal-mask {
    display: none !important;
  }

  .page-shell,
  body {
    background: #fff;
  }

  .screen,
  .result-wrap,
  .result-hero,
  .poster-box,
  .type-box,
  .analysis-box,
  .dim-box,
  .note-box {
    box-shadow: none;
    border-color: #d8d8d8;
  }
}

@media (max-width: 900px) {
  .test-layout,
  .responsive-grid {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    overflow: visible;
  }

  .test-sidebar {
    position: static;
    top: auto;
  }

  .sidebar-actions {
    flex-direction: row;
  }

  .sidebar-actions .btn-action {
    width: auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 12px;
  }

  .screen-test {
    padding-bottom: 24px;
  }

  .screen-test .test-wrap {
    display: block;
    padding: 16px;
  }

  .screen-test .test-sidebar {
    display: none;
  }

  .mobile-test-top,
  .mobile-test-bottom {
    display: none;
  }

  .topbar-mobile-inline {
    margin-bottom: 14px;
  }

  .mobile-sidebar-actions {
    margin-top: 0;
  }

  .mobile-sidebar-actions .btn-action {
    width: 100%;
    min-height: 48px;
  }

  .screen-test .question-list {
    gap: 14px;
  }

  .action-row-fixed,
  .topbar-head,
  .question-meta,
  .dim-item-top,
  .share-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-action {
    width: 100%;
  }

  .stats-grid,
  .sidebar-actions,
  .mobile-sidebar-actions {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .topbar-head .progress-text {
    text-align: left;
    font-size: 18px;
  }

  .option {
    padding: 16px;
  }
}