:root {
  --ink: #08133d;
  --soft-ink: #3d4054;
  --paper: #fff9df;
  --cream: #fffdf4;
  --line: #e7ddba;
  --yellow: #f7de36;
  --red: #f0523d;
  --green: #246b55;
  --blue: #2467b2;
  --shadow: 0 20px 60px rgba(8, 19, 61, .16);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: #ece8da;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  overflow-x: hidden;
}

button, input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 0;
}

.phone {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--cream);
  border: 1px solid rgba(8, 19, 61, .08);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.topbar {
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 244, .92);
  position: sticky;
  top: 0;
  z-index: 5;
}

.brand {
  font-weight: 900;
  letter-spacing: 0;
}

.ghost-btn {
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.content {
  padding: 18px;
  padding-bottom: 92px;
}

.hero {
  background: var(--yellow);
  padding: 26px 22px 22px;
  border: 1px solid rgba(8, 19, 61, .18);
  position: relative;
  overflow: hidden;
}

.hero:before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .16;
  background-image: radial-gradient(#5c5948 1px, transparent 1px);
  background-size: 42px 42px;
}

.hero > * { position: relative; }

.quote {
  font-size: 54px;
  line-height: .8;
  font-weight: 900;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 8.8vw, 44px);
  line-height: 1.12;
  letter-spacing: 0;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.hero .sub {
  margin: 14px 0 0;
  color: #111;
  font-size: 18px;
  line-height: 1.45;
  font-weight: 800;
}

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

.duel-side {
  min-height: 132px;
  padding: 14px 10px;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 244, .72);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.duel-side .icon {
  font-size: 38px;
  font-weight: 900;
}

.duel-side strong {
  font-size: 21px;
  line-height: 1.12;
  letter-spacing: 0;
  word-break: break-all;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(8, 19, 61, .18);
  background: #fff;
  color: var(--soft-ink);
  font-size: 13px;
  font-weight: 800;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.tab {
  min-height: 46px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 900;
}

.tab.active {
  background: var(--ink);
  color: #fff;
}

.section {
  background: #fff;
  border: 1px solid var(--line);
  padding: 16px;
  margin-top: 14px;
}

.section h2 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: 0;
}

.section p {
  color: var(--soft-ink);
  font-size: 15px;
  line-height: 1.65;
  margin: 8px 0 0;
}

.question {
  background: var(--paper);
  border: 1px solid #eadb94;
  padding: 15px;
  margin: 12px 0;
}

.q-title {
  font-weight: 900;
  font-size: 17px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  margin-top: 8px;
  text-align: left;
  background: #fff;
  border: 1px solid #e0d6b4;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
}

.option.selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.letter {
  font-weight: 900;
  min-width: 20px;
}

.bottom-actions {
  position: sticky;
  bottom: 0;
  background: rgba(255, 253, 244, .96);
  border-top: 1px solid var(--line);
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  z-index: 5;
}

.primary {
  min-height: 48px;
  background: var(--red);
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.secondary {
  min-height: 44px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--ink);
  font-weight: 900;
}

.grid {
  display: grid;
  gap: 12px;
}

.test-card {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.test-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0;
}

.test-card .mini-duel {
  background: var(--yellow);
  border: 1px solid rgba(8, 19, 61, .18);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  font-weight: 900;
  min-height: 84px;
}

.mini-duel div {
  border: 1px solid var(--ink);
  background: rgba(255,255,255,.58);
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.comment-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px dashed #e0d6b4;
  padding-bottom: 8px;
  color: var(--soft-ink);
  font-size: 14px;
  line-height: 1.45;
}

.comment-item strong {
  color: var(--ink);
}

.answer-code {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.score-row {
  margin: 12px 0;
}

.score-label {
  display: flex;
  justify-content: space-between;
  font-weight: 900;
  margin-bottom: 6px;
}

.bar {
  height: 12px;
  background: #eee3bf;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--ink);
}

.report-title {
  font-size: 28px;
  line-height: 1.16;
  font-weight: 900;
  margin: 0 0 12px;
}

.report-block {
  border-left: 5px solid var(--ink);
  padding-left: 12px;
  margin-top: 14px;
}

.warning {
  background: #fff2e8;
  border: 1px solid #f4c19f;
  color: #743516;
  padding: 12px;
  font-weight: 800;
  line-height: 1.5;
}

.empty-note {
  color: var(--soft-ink);
  font-size: 14px;
  line-height: 1.6;
}

@media (min-width: 900px) {
  .shell {
    padding: 18px;
  }

  .phone {
    width: 430px;
    min-height: calc(100vh - 36px);
  }
}
