﻿:root {
  --bg: #f3f4ef;
  --ink: #171916;
  --muted: #68706a;
  --panel: #fbfbf8;
  --panel-strong: #ffffff;
  --line: #d9ddd4;
  --line-dark: #323832;
  --soft: #eceee7;
  --accent: #9b6a48;
  --accent-deep: #1f4a40;
  --blue: #45687d;
  --shadow: 0 24px 70px rgba(23, 25, 22, 0.12);
  --radius: 8px;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(23, 25, 22, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(23, 25, 22, 0.04) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
  letter-spacing: 0;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding: 14px 16px;
  color: #f4f2ea;
  background: #171916;
  border: 1px solid #272d28;
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(23, 25, 22, 0.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: linear-gradient(145deg, #f3e5d1, #d7bd97);
  border: 1px solid rgba(230, 214, 189, 0.48);
  border-radius: 10px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 12px 28px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.brand-mark svg {
  display: block;
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 2px 2px rgba(23, 25, 22, 0.22));
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
}

.card {
  background: rgba(251, 251, 248, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.screen { display: none; }
.screen.active { display: block; }

.hero {
  overflow: hidden;
  min-height: 620px;
  background:
    linear-gradient(135deg, rgba(251, 251, 248, 0.96), rgba(232, 234, 225, 0.92)),
    linear-gradient(90deg, rgba(31, 74, 64, 0.1), rgba(155, 106, 72, 0.08));
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, 0.72fr);
  gap: 32px;
  align-items: stretch;
  min-height: inherit;
  padding: 40px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 680px;
}

.eyebrow {
  width: fit-content;
  color: var(--accent-deep);
  border: 1px solid rgba(31, 74, 64, 0.22);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
}

.hero h1 {
  margin-top: 18px;
  font-size: 58px;
  line-height: 1.02;
  font-weight: 900;
}

.hero .sub {
  margin-top: 20px;
  max-width: 620px;
  color: #4e5650;
  font-size: 17px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
  max-width: 620px;
}

.stat {
  padding: 14px;
  border: 1px solid rgba(23, 25, 22, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.56);
}

.stat strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.cover-art {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 18px;
  color: #f4f2ea;
  background: #171916;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  min-height: 520px;
  overflow: hidden;
}

.cover-top,
.cover-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: #cfd3ca;
  font-size: 12px;
}

.cover-index {
  color: #e6d6bd;
  font-weight: 800;
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.art-grid img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(244, 242, 234, 0.14);
  background: #242923;
  filter: saturate(0.88) contrast(1.02);
}

button {
  border: 0;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease, border-color .16s ease, background .16s ease;
}

button:hover { transform: translateY(-1px); }

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.btn-primary,
.btn-secondary {
  min-height: 48px;
  border-radius: 7px;
  padding: 13px 18px;
  font-weight: 800;
  line-height: 1.2;
}

.btn-primary {
  color: #f7f5ef;
  background: #171916;
  border: 1px solid #171916;
  box-shadow: 0 18px 34px rgba(23, 25, 22, 0.2);
}

.btn-primary:hover {
  background: #223128;
  border-color: #223128;
}

.btn-secondary {
  color: #171916;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(23, 25, 22, 0.18);
}

.test-wrap,
.result-wrap {
  padding: 28px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(251, 251, 248, 0.94);
  border: 1px solid rgba(23, 25, 22, 0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
}

.link-button {
  color: var(--muted);
  background: transparent;
  border: 0;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 4px;
  box-shadow: none;
}

.link-button:hover {
  color: var(--ink);
  transform: none;
}

.progress {
  height: 7px;
  background: #e3e6de;
  border: 1px solid rgba(23, 25, 22, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--blue));
  border-radius: inherit;
  transition: width .22s ease;
}

.progress-text {
  color: #3f4741;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.test-status {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.question-list {
  display: grid;
  gap: 12px;
  min-height: 460px;
}

.question {
  display: block;
  min-height: 460px;
  padding: 28px;
  background: var(--panel-strong);
  border: 1px solid rgba(23, 25, 22, 0.1);
  border-radius: var(--radius);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 5px 8px;
  color: #171916;
  background: #eceee7;
  border: 1px solid rgba(23, 25, 22, 0.1);
  font-weight: 800;
}

.question-title {
  color: #1d211d;
  max-width: 780px;
  font-size: 17px;
  font-weight: 620;
  line-height: 1.85;
  white-space: pre-wrap;
}

.options {
  display: grid;
  gap: 10px;
  max-width: 820px;
  margin-top: 24px;
}

.option {
  display: grid;
  grid-template-columns: 22px 32px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 13px 16px;
  border: 1px solid rgba(23, 25, 22, 0.12);
  border-radius: var(--radius);
  background: rgba(249, 250, 246, 0.86);
  color: #252a25;
  line-height: 1.6;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.option:hover {
  border-color: rgba(31, 74, 64, 0.36);
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(23, 25, 22, 0.05);
}

.option:has(input:checked) {
  border-color: rgba(31, 74, 64, 0.55);
  background: #f2f6f2;
  box-shadow: inset 3px 0 0 rgba(31, 74, 64, 0.7);
}

.option input {
  margin: 0;
  accent-color: var(--accent-deep);
  transform: scale(1.02);
  flex-shrink: 0;
}

.option-code {
  color: #6f5b4c;
  font-weight: 900;
  line-height: 1.4;
}

.actions-bottom,
.result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 8px;
}

.actions-bottom {
  position: sticky;
  bottom: 12px;
  z-index: 7;
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(251, 251, 248, 0.94);
  border: 1px solid rgba(23, 25, 22, 0.1);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 34px rgba(23, 25, 22, 0.1);
}

.hint {
  max-width: 560px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

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

.result-layout {
  display: grid;
  gap: 14px;
}

.result-top {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: stretch;
}

.poster-box,
.type-box,
.analysis-box,
.dim-box,
.note-box {
  border: 1px solid rgba(23, 25, 22, 0.1);
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.poster-box {
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  min-height: 360px;
  padding: 12px;
  background: #171916;
}

.poster-image {
  display: block;
  width: 100%;
  min-height: 260px;
  max-height: 540px;
  object-fit: contain;
  border-radius: 6px;
  background: #f2f4ef;
}

.poster-box.no-image .poster-image {
  display: none;
}

.poster-caption {
  margin-top: 12px;
  color: #d8d2c3;
  font-size: 14px;
  line-height: 1.8;
}

.type-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(31, 74, 64, 0.08), rgba(155, 106, 72, 0.08)),
    #ffffff;
}

.type-kicker {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.type-name {
  margin-top: 12px;
  font-size: 48px;
  font-weight: 900;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.type-subname {
  margin-top: 14px;
  color: #59615b;
  font-size: 15px;
  line-height: 1.8;
}

.match {
  width: fit-content;
  margin-top: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 12px;
  color: #171916;
  background: #e6d6bd;
  border: 1px solid rgba(155, 106, 72, 0.28);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.4;
}

.share-status {
  max-width: 360px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.analysis-box,
.dim-box,
.note-box {
  padding: 20px;
}

.analysis-box h3,
.dim-box h3,
.note-box h3 {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.analysis-box p {
  color: #2f362f;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
}

.dim-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dim-item {
  border: 1px solid rgba(23, 25, 22, 0.1);
  border-radius: var(--radius);
  padding: 13px;
  background: #f9faf6;
}

.dim-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dim-item-name {
  color: #1f241f;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.4;
}

.dim-item-score {
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.dim-item p,
.note-box p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

@media (max-width: 940px) {
  .hero-layout,
  .result-top {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 0;
  }

  .cover-art {
    height: clamp(430px, 72vw, 560px);
    min-height: 0;
  }

  .dim-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1180px);
    padding: 14px 0 42px;
  }

  .hero-layout,
  .test-wrap,
  .result-wrap {
    padding: 16px;
  }

  .hero h1 {
    font-size: 38px;
  }

  .hero .sub {
    font-size: 15px;
  }

  .hero-stats,
  .dim-list {
    grid-template-columns: 1fr;
  }

  .art-grid {
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr auto;
  }

  .topbar .progress {
    grid-column: 1 / -1;
    order: 2;
  }

  .test-status {
    justify-content: flex-start;
  }

  .type-name {
    font-size: 34px;
  }

  .option {
    grid-template-columns: 20px 24px minmax(0, 1fr);
    align-items: start;
    padding: 12px;
  }

  .question-list,
  .question {
    min-height: 0;
  }

  .question {
    padding: 18px;
  }

  .question-title {
    font-size: 16px;
    line-height: 1.8;
  }

  .actions-bottom {
    bottom: 8px;
    padding: 12px;
  }

  .actions-bottom,
  .result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button-row,
  .pager-row,
  .button-row button,
  .pager-row button {
    width: 100%;
  }
}

