:root {
  --navy: #004165;
  --navy-deep: #002f4a;
  --maroon: #772432;
  --maroon-dark: #5f1c28;
  --yellow: #f2df74;
  --yellow-soft: #fff8d4;
  --sky: #a9b2b1;
  --ink: #19323e;
  --muted: #617681;
  --line: #dce6e8;
  --canvas: #f5f8f7;
  --white: #ffffff;
  --shadow: 0 18px 55px rgba(0, 65, 101, 0.11);
  --radius-lg: 28px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 5%, rgba(242, 223, 116, 0.28), transparent 24rem),
    var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-header, .site-footer { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }

.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--navy); text-decoration: none; }
.brand strong { display: block; font-size: 15px; letter-spacing: 0.02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.brand-mark { display: flex; gap: 3px; align-items: center; padding: 7px 8px; border: 1px solid rgba(0, 65, 101, 0.13); border-radius: 12px; background: var(--white); }
.brand-mark i { width: 9px; height: 22px; display: block; border-radius: 8px; transform: skew(-18deg); }
.brand-mark i:nth-child(1) { background: var(--navy); }
.brand-mark i:nth-child(2) { background: var(--yellow); }
.brand-mark i:nth-child(3) { background: var(--maroon); }
.header-meta { display: flex; align-items: center; gap: 20px; }
.level-tag { color: var(--maroon); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.text-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; padding: 8px 0; }
.text-button:hover, .text-button:focus-visible { color: var(--navy); }

#app { width: min(1180px, calc(100% - 48px)); margin: 0 auto; flex: 1; display: flex; }
.screen { width: 100%; padding: 38px 0 76px; animation: rise-in 0.35s ease both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow { margin: 0 0 13px; color: var(--maroon); font-size: 12px; font-weight: 800; letter-spacing: 0.13em; }
h1, h2, h3, p { margin-top: 0; }
h1 { color: var(--navy); font-size: clamp(38px, 6vw, 76px); line-height: 1.05; letter-spacing: -0.06em; margin-bottom: 22px; }
h2 { color: var(--navy); font-size: clamp(26px, 4vw, 42px); line-height: 1.16; letter-spacing: -0.04em; margin-bottom: 14px; }
h3 { color: var(--navy); line-height: 1.3; margin-bottom: 8px; }
.lead { max-width: 620px; color: var(--muted); font-size: 17px; line-height: 1.8; }

.intro-grid, .home-grid { display: grid; grid-template-columns: 1.12fr 0.88fr; gap: 70px; align-items: center; min-height: 625px; }
.home-grid { grid-template-columns: 0.82fr 1.18fr; gap: 55px; }
.intro-copy { position: relative; }
.intro-copy::before { content: ""; position: absolute; left: -32px; top: 8px; width: 7px; height: 150px; border-radius: 8px; background: var(--yellow); }
.intro-copy h1 span { color: var(--maroon); display: block; }
.intro-actions { display: flex; align-items: center; gap: 18px; margin-top: 34px; flex-wrap: wrap; }
.primary-button, .secondary-button { border-radius: 999px; border: 1px solid transparent; cursor: pointer; min-height: 50px; padding: 0 24px; font-weight: 800; transition: transform 0.2s, box-shadow 0.2s, background 0.2s; }
.primary-button { color: var(--white); background: var(--maroon); box-shadow: 0 9px 20px rgba(119, 36, 50, 0.22); }
.primary-button:hover, .primary-button:focus-visible { background: var(--maroon-dark); transform: translateY(-2px); box-shadow: 0 12px 25px rgba(119, 36, 50, 0.28); }
.secondary-button { color: var(--navy); background: transparent; border-color: var(--line); }
.secondary-button:hover, .secondary-button:focus-visible { border-color: var(--navy); background: var(--white); transform: translateY(-2px); }
.button-note { color: var(--muted); font-size: 12px; }

.intro-card { position: relative; padding: 34px; border-radius: var(--radius-lg); background: var(--navy); color: var(--white); overflow: hidden; box-shadow: var(--shadow); }
.intro-card::after { content: ""; width: 210px; height: 210px; position: absolute; right: -95px; top: -88px; border: 30px solid var(--yellow); border-radius: 50%; opacity: 0.95; }
.intro-card h2 { color: var(--white); font-size: 26px; letter-spacing: -0.025em; position: relative; z-index: 1; }
.intro-card > p { color: rgba(255,255,255,0.75); font-size: 14px; line-height: 1.8; position: relative; z-index: 1; }
.fact-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 28px 0 0; position: relative; z-index: 1; }
.fact { padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.24); }
.fact strong { display: block; color: var(--yellow); font-size: 28px; line-height: 1.1; }
.fact span { display: block; color: rgba(255,255,255,0.7); font-size: 12px; margin-top: 4px; }
.intro-ribbon { position: relative; height: 118px; margin: 38px -34px -34px; background: var(--maroon); display: flex; align-items: center; padding: 0 34px; overflow: hidden; }
.intro-ribbon::before { content: ""; width: 165px; height: 165px; position: absolute; right: 20px; border: 2px solid rgba(242,223,116,0.5); border-radius: 50%; }
.intro-ribbon p { max-width: 260px; position: relative; z-index: 1; color: var(--white); font-size: 13px; margin: 0; }

.test-catalog { display: grid; gap: 12px; }
.catalog-header { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 8px; }
.catalog-header h2 { font-size: 27px; margin: 0; }
.catalog-count { color: var(--sky); font-size: 11px; font-weight: 900; letter-spacing: 0.13em; }
.test-card { position: relative; padding: 20px 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; }
.test-card:hover { border-color: rgba(0,65,101,0.28); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,65,101,0.08); }
.test-card.featured { border-top: 4px solid var(--maroon); }
.test-card:nth-of-type(3) { border-top: 4px solid var(--yellow); }
.test-card-top, .test-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.test-card-index { color: var(--sky); font-size: 12px; font-weight: 900; }
.test-card-status { color: var(--muted); font-size: 11px; }
.test-card h2 { margin: 14px 0 5px; font-size: 21px; letter-spacing: -0.025em; }
.test-card p { min-height: 48px; color: var(--muted); font-size: 13px; line-height: 1.65; margin-bottom: 15px; }
.test-card-bottom > span { color: var(--muted); font-size: 11px; }
.card-link { padding: 5px 0; border: 0; background: transparent; color: var(--maroon); cursor: pointer; font-size: 13px; font-weight: 900; }
.card-link:hover, .card-link:focus-visible { color: var(--navy); }
.card-reset { display: block; margin: 13px 0 0 auto; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.card-reset:hover, .card-reset:focus-visible { color: var(--maroon); }
.quiz-badge { display: inline-block; margin-top: 20px; padding: 8px 11px; border-radius: 8px; color: var(--maroon); background: var(--yellow-soft); font-size: 11px; font-weight: 800; }

.test-top { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.test-top h1 { font-size: clamp(32px, 5vw, 54px); margin-bottom: 0; }
.progress-meta { text-align: right; color: var(--muted); font-size: 13px; white-space: nowrap; }
.progress-meta strong { display: block; color: var(--navy); font-size: 22px; }
.progress-track { height: 7px; border-radius: 10px; background: #dfe9e9; overflow: hidden; margin-bottom: 33px; }
.progress-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy), var(--maroon)); transition: width 0.25s ease; }
.test-layout { display: grid; grid-template-columns: 0.32fr 0.68fr; gap: 30px; align-items: start; }
.test-aside { padding: 22px 0; border-top: 3px solid var(--yellow); }
.test-aside h2 { font-size: 22px; margin-bottom: 10px; }
.test-aside p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.scale-key { display: grid; gap: 11px; margin-top: 30px; }
.scale-key div { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.scale-key b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--navy); background: var(--yellow-soft); font-size: 12px; }
.question-panel { padding: clamp(25px, 5vw, 55px); border-radius: var(--radius-lg); background: var(--white); box-shadow: var(--shadow); }
.question-number { color: var(--maroon); font-size: 13px; font-weight: 800; letter-spacing: 0.1em; }
.question-panel h2 { max-width: 680px; font-size: clamp(24px, 3.4vw, 38px); margin: 16px 0 40px; }
.answer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.answer-option { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 100px; padding: 13px 8px; border: 1px solid var(--line); border-radius: 15px; color: var(--navy); background: #fbfdfd; cursor: pointer; transition: all 0.18s ease; }
.answer-option:hover, .answer-option:focus-visible { border-color: var(--navy); transform: translateY(-2px); }
.answer-option.selected { color: var(--white); border-color: var(--maroon); background: var(--maroon); box-shadow: 0 8px 18px rgba(119, 36, 50, 0.18); }
.answer-option .score { font-size: 23px; font-weight: 900; line-height: 1; }
.answer-option .label { font-size: 12px; }
.question-actions { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-top: 36px; }
.question-actions .primary-button:disabled, .question-actions .secondary-button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.question-hint { color: var(--muted); font-size: 12px; }

.results-hero { display: grid; grid-template-columns: 1fr 0.92fr; gap: 56px; align-items: center; min-height: 330px; }
.results-hero h1 { margin-bottom: 10px; }
.result-title { color: var(--maroon); font-size: 18px; font-weight: 900; margin-bottom: 16px; }
.result-score { display: inline-flex; gap: 8px; align-items: baseline; margin-top: 15px; padding: 9px 15px; border-radius: 10px; color: var(--navy); background: var(--yellow-soft); font-weight: 800; }
.result-score strong { font-size: 25px; }
.hero-emblem { width: min(100%, 350px); aspect-ratio: 1; margin-left: auto; position: relative; display: grid; place-items: center; }
.hero-emblem::before, .hero-emblem::after { content: ""; position: absolute; border-radius: 50%; }
.hero-emblem::before { inset: 8%; border: 20px solid var(--navy); border-right-color: var(--yellow); transform: rotate(-22deg); }
.hero-emblem::after { inset: 22%; border: 16px solid var(--maroon); border-left-color: transparent; transform: rotate(35deg); }
.hero-emblem-inner { width: 47%; aspect-ratio: 1; display: grid; place-items: center; padding: 20px; border-radius: 50%; background: var(--white); color: var(--navy); box-shadow: 0 12px 30px rgba(0,65,101,0.12); text-align: center; font-size: 19px; font-weight: 900; line-height: 1.25; position: relative; z-index: 1; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 55px 0 18px; }
.section-heading h2 { margin: 0; font-size: 27px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.score-board { padding: 25px 28px; border-radius: var(--radius-md); background: var(--white); box-shadow: 0 9px 30px rgba(0,65,101,0.07); }
.score-row { display: grid; grid-template-columns: 44px 105px 1fr 54px; gap: 14px; align-items: center; min-height: 48px; border-bottom: 1px solid #eef3f3; }
.score-row:last-child { border-bottom: 0; }
.score-rank { color: var(--sky); font-size: 14px; font-weight: 900; }
.score-row:first-child .score-rank { color: var(--maroon); }
.score-name { color: var(--navy); font-size: 14px; font-weight: 800; }
.score-meter { height: 9px; border-radius: 99px; background: #edf3f3; overflow: hidden; }
.score-fill { height: 100%; border-radius: inherit; background: var(--navy); transform-origin: left; animation: grow 0.7s ease both; }
.score-row:first-child .score-fill { background: var(--maroon); }
@keyframes grow { from { width: 0 !important; } }
.score-value { color: var(--navy); font-size: 14px; font-weight: 900; text-align: right; }
.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.insight-card { padding: 25px; border-radius: var(--radius-md); background: var(--white); border-top: 4px solid var(--navy); }
.insight-card.accent { border-top-color: var(--yellow); }
.insight-card h3 { font-size: 19px; }
.insight-card p, .insight-card li { color: var(--muted); font-size: 14px; line-height: 1.75; }
.insight-card ul { padding-left: 19px; margin: 10px 0 0; }
.results-actions { display: flex; justify-content: center; gap: 15px; margin-top: 42px; flex-wrap: wrap; }
.disclaimer { max-width: 680px; margin: 25px auto 0; color: var(--muted); font-size: 12px; text-align: center; }
.radar-panel { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.95fr); gap: 28px; align-items: center; padding: 24px 28px; border-radius: var(--radius-md); background: var(--white); box-shadow: 0 9px 30px rgba(0,65,101,0.07); }
.radar-chart-wrap { min-width: 0; display: grid; place-items: center; }
.radar-chart { display: block; width: 100%; max-width: 560px; }
.radar-notes { padding: 8px 0 8px 25px; border-left: 1px solid var(--line); }
.radar-key { display: flex; align-items: center; gap: 9px; color: var(--navy); font-size: 13px; font-weight: 900; }
.radar-key-swatch { width: 18px; height: 10px; display: inline-block; border: 2px solid var(--maroon); border-radius: 4px; background: rgba(119,36,50,.16); }
.radar-notes p { color: var(--muted); font-size: 13px; line-height: 1.75; }
.radar-values { display: grid; gap: 8px; margin-top: 20px; }
.radar-values div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px solid #eef3f3; color: var(--muted); font-size: 12px; }
.radar-values strong { color: var(--maroon); }
.quiz-review { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz-review-item { padding: 19px 21px; border: 1px solid var(--line); border-left: 4px solid var(--maroon); border-radius: 14px; background: var(--white); }
.quiz-review-item.correct { border-left-color: #17745a; }
.quiz-review-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: 0.08em; }
.quiz-review-item.correct .quiz-review-top strong { color: #17745a; }
.quiz-review-item.wrong .quiz-review-top strong { color: var(--maroon); }
.quiz-review-item h3 { margin: 14px 0 11px; font-size: 16px; }
.quiz-review-item p { color: var(--muted); font-size: 12px; line-height: 1.65; margin-bottom: 5px; }

.site-footer { padding: 20px 0 28px; border-top: 1px solid rgba(169,178,177,0.35); display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }

:focus-visible { outline: 3px solid rgba(242, 223, 116, 0.95); outline-offset: 3px; }

@media (max-width: 820px) {
  .site-header, #app, .site-footer { width: min(100% - 32px, 640px); }
  .site-header { min-height: 74px; }
  .header-meta .text-button { display: none; }
  .intro-grid, .home-grid, .results-hero, .test-layout, .insight-grid, .quiz-review, .radar-panel { grid-template-columns: 1fr; gap: 30px; }
  .intro-grid { min-height: 0; padding: 55px 0 45px; }
  .intro-copy::before { left: -16px; height: 100px; }
  .intro-card { max-width: 560px; }
  .hero-emblem { width: min(67vw, 290px); margin: 0 auto; }
  .radar-notes { padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .results-hero { min-height: 0; }
  .test-aside { padding: 0 0 5px; }
  .scale-key { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; }
  .question-panel { padding: 26px 20px; }
  .question-panel h2 { margin-bottom: 28px; }
}

@media (max-width: 500px) {
  .site-header, #app, .site-footer { width: calc(100% - 24px); }
  .brand strong { font-size: 13px; }
  .brand small { font-size: 10px; }
  .level-tag { font-size: 10px; }
  .screen { padding-top: 22px; padding-bottom: 50px; }
  h1 { font-size: 43px; }
  .lead { font-size: 15px; }
  .intro-actions { align-items: stretch; flex-direction: column; }
  .intro-actions button { width: 100%; }
  .intro-card { padding: 25px; }
  .intro-ribbon { margin: 28px -25px -25px; padding: 0 25px; }
  .test-top { align-items: start; flex-direction: column; gap: 8px; }
  .progress-meta { text-align: left; }
  .progress-meta strong { display: inline; margin-right: 5px; }
  .answer-grid:not(.quiz-options) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .answer-grid:not(.quiz-options) .answer-option { min-height: 78px; padding: 10px 4px; border-radius: 12px; }
  .answer-grid:not(.quiz-options) .answer-option .score { font-size: 20px; }
  .answer-grid:not(.quiz-options) .answer-option .label { font-size: 10px; white-space: nowrap; }
  .question-actions { align-items: stretch; flex-direction: column-reverse; }
  .question-actions button { width: 100%; }
  .question-hint { text-align: center; order: 3; }
  .score-board { padding: 13px 15px; }
  .score-row { grid-template-columns: 28px 67px 1fr 38px; gap: 7px; }
  .score-name, .score-value { font-size: 12px; }
  .site-footer { flex-direction: column; gap: 4px; }
}
