:root {
    --ink: #20242a;
    --muted: #66707a;
    --line: #dfe3e7;
    --soft: #f4f6f7;
    --surface: #ffffff;
    --teal: #15756d;
    --teal-dark: #0d5b55;
    --teal-soft: #e6f3f1;
    --yellow: #f0c45a;
    --red: #b74c4c;
    --radius: 8px;
    --content: 1100px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--soft); color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif; line-height: 1.65; }
button, input { font: inherit; }
button { letter-spacing: 0; }
a { color: var(--teal); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.site-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); }
.header-inner { max-width: var(--content); min-height: 64px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 18px; font-weight: 750; text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; }
.header-inner nav { display: flex; align-items: center; gap: 24px; }
.header-inner nav a, .header-inner nav button { padding: 5px 0; border: 0; background: transparent; color: var(--muted); font-size: 14px; text-decoration: none; cursor: pointer; }
.header-inner nav a:hover, .header-inner nav a[aria-current="page"], .header-inner nav button:hover { color: var(--teal); }

.app-shell { min-height: calc(100vh - 137px); }
.view { max-width: var(--content); margin: 0 auto; padding: 46px 24px 70px; }
.intro-copy { max-width: 720px; }
.eyebrow { margin: 0 0 6px; color: var(--teal); font-size: 13px; font-weight: 750; }
.intro-copy h1, .result-header h1 { margin: 0; font-size: 36px; line-height: 1.25; }
.intro-copy > p:last-child { margin: 12px 0 0; color: var(--muted); }

.test-layout { margin-top: 30px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 24px; align-items: start; }
.test-picker, .type-preview, .question-panel, .result-header, .report-section, .status-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.test-picker { padding: 24px; }
.picker-head, .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.picker-head h2, .section-heading h2, .report-section h2, .type-preview h2 { margin: 0; font-size: 20px; }
.picker-head span, .section-heading span { color: var(--muted); font-size: 13px; }
.count-options { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.count-option { min-height: 102px; position: relative; padding: 16px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "number title" "number time"; column-gap: 15px; align-items: center; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; }
.count-option:hover { border-color: #9dbeb9; background: #fbfdfd; }
.count-option.is-selected { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.count-number { grid-area: number; min-width: 62px; color: var(--teal); font-size: 22px; font-weight: 800; }
.count-option strong { grid-area: title; align-self: end; font-size: 15px; }
.count-option small { grid-area: time; align-self: start; color: var(--muted); }
.count-option em { position: absolute; top: 8px; right: 8px; padding: 1px 6px; border-radius: 3px; background: var(--yellow); color: #493500; font-size: 11px; font-style: normal; }
.picker-actions, .result-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.primary-button, .secondary-button, .text-button, .back-button { min-height: 42px; padding: 9px 18px; border-radius: 5px; cursor: pointer; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--teal); background: var(--teal); color: #fff; text-decoration: none; }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { border: 1px solid var(--teal); background: var(--surface); color: var(--teal); }
.secondary-button:hover { background: var(--teal-soft); }
.text-button { padding-left: 5px; padding-right: 5px; border: 0; background: transparent; color: var(--muted); }
.text-button:hover { color: var(--teal); }
.privacy-note { margin: 15px 0 0; color: var(--muted); font-size: 13px; }

.type-preview { padding: 20px; }
.type-collage { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 10px; border-radius: 6px; background: #edf0ee; }
.type-collage img { width: 100%; aspect-ratio: 1 / 1.05; object-fit: contain; }
.type-preview h2 { margin-top: 20px; }
.type-preview ul { margin: 10px 0 0; padding-left: 20px; }
.type-preview li { margin: 5px 0; }
.type-preview > p { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.test-view { max-width: 850px; }
.test-topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 15px; }
.test-topbar > :last-child { justify-self: end; }
.progress-copy { display: flex; align-items: baseline; gap: 8px; }
.progress-copy span { color: var(--muted); font-size: 13px; }
.progress-track { height: 7px; margin: 14px 0 28px; overflow: hidden; border-radius: 4px; background: #dfe5e4; }
.progress-track > span { width: 0; height: 100%; display: block; background: var(--teal); transition: width .2s ease; }
.question-panel { min-height: 430px; padding: 44px; }
.question-step { margin: 0; color: var(--teal); font-size: 13px; font-weight: 700; }
.question-panel h1 { max-width: 680px; min-height: 76px; margin: 12px 0 28px; font-size: 27px; line-height: 1.45; }
.answer-options { display: grid; gap: 12px; }
.answer-button { width: 100%; min-height: 62px; padding: 14px 18px; border: 1px solid #bdc8c7; border-radius: 6px; background: #fbfcfc; color: var(--ink); text-align: left; cursor: pointer; }
.answer-button:hover, .answer-button:focus-visible { border-color: var(--teal); background: var(--teal-soft); outline: none; }
.answer-button span { margin-right: 10px; color: var(--teal); font-weight: 800; }
.back-button { margin-top: 24px; border: 0; background: transparent; color: var(--muted); }
.back-button:hover:not(:disabled) { color: var(--teal); }
.back-button:disabled { opacity: .45; cursor: default; }

.result-view { max-width: 960px; }
.result-header { padding: 28px; }
.result-identity { display: flex; align-items: center; gap: 20px; }
.result-identity img { width: 112px; height: 112px; object-fit: contain; border-radius: 6px; background: var(--soft); }
.result-name { margin: 4px 0 0; color: var(--teal); font-size: 19px; font-weight: 700; }
.result-header > p { max-width: 760px; margin: 18px 0 0; color: var(--muted); }
.report-section { margin-top: 18px; padding: 24px; }
.dimension-list { margin-top: 20px; display: grid; gap: 18px; }
.dimension-labels { display: flex; justify-content: space-between; gap: 15px; font-size: 14px; }
.dimension-labels strong { color: var(--teal); }
.dimension-bar { height: 10px; margin-top: 7px; display: flex; overflow: hidden; border-radius: 5px; background: var(--line); }
.dimension-bar span:first-child { background: var(--teal); }
.dimension-bar span:last-child { background: var(--yellow); }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.report-grid .report-section { margin-top: 0; }
.report-grid { margin-top: 18px; }
.report-section ul { margin: 14px 0 0; padding-left: 20px; }
.report-section li { margin: 7px 0; }
.report-section > p { margin: 14px 0 0; color: var(--muted); }
.tag-list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list span { padding: 5px 9px; border: 1px solid #b8d3cf; border-radius: 4px; background: var(--teal-soft); color: var(--teal-dark); font-size: 13px; }
.result-disclaimer { margin: 22px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.types-page { max-width: var(--content); margin: 0 auto; padding: 42px 24px 70px; }
.types-page > header { max-width: 760px; }
.types-page h1, .legal-page h1, .status-panel h1 { margin: 0; font-size: 34px; }
.types-page > header p, .legal-page > p, .status-panel p { color: var(--muted); }
.type-group { margin-top: 38px; }
.type-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.type-group-head h2 { margin: 0; font-size: 21px; }
.type-group-head p { margin: 0; color: var(--muted); font-size: 13px; }
.type-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.type-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.type-card img { width: 100%; aspect-ratio: 1 / .75; object-fit: contain; background: var(--soft); border-radius: 5px; }
.type-card h3 { margin: 14px 0 0; font-size: 18px; }
.type-card strong { color: var(--teal); font-size: 14px; }
.type-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.types-cta { margin-top: 36px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); background: var(--surface); }
.types-cta p { margin: 0; }

.legal-page { max-width: 780px; margin: 0 auto; padding: 46px 24px 70px; }
.legal-page section { margin-top: 30px; }
.legal-page h2 { font-size: 20px; }
.status-panel { max-width: 620px; margin: 70px auto; padding: 40px; text-align: center; }

.contact-dialog { width: min(420px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.contact-dialog::backdrop { background: rgba(23, 29, 32, .46); }
.dialog-head { min-height: 58px; padding: 11px 13px 11px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-head button { width: 36px; height: 36px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 25px; cursor: pointer; }
.dialog-head button:hover { background: var(--soft); color: var(--ink); }
.contact-items { padding: 8px 20px 20px; }
.contact-items > div { min-height: 70px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "label action" "value action"; align-items: center; border-bottom: 1px solid var(--line); }
.contact-items > div:last-child { border-bottom: 0; }
.contact-items span { grid-area: label; align-self: end; color: var(--muted); font-size: 13px; }
.contact-items strong { grid-area: value; align-self: start; }
.contact-items button { grid-area: action; min-width: 68px; min-height: 36px; border: 1px solid var(--teal); border-radius: 5px; background: #fff; color: var(--teal); cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 50; transform: translateX(-50%); padding: 9px 14px; border-radius: 5px; background: var(--ink); color: #fff; font-size: 14px; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer > div { max-width: var(--content); min-height: 72px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 13px; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); }

@media (max-width: 800px) {
    .test-layout { grid-template-columns: 1fr; }
    .type-preview { display: grid; grid-template-columns: 180px 1fr; column-gap: 20px; }
    .type-preview h2 { margin-top: 0; }
    .type-preview ul { grid-column: 2; }
    .type-preview > p { grid-column: 1 / -1; }
    .type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .header-inner { min-height: 58px; padding: 8px 16px; }
    .brand span { display: none; }
    .header-inner nav { gap: 14px; }
    .header-inner nav a, .header-inner nav button { font-size: 13px; }
    .view, .types-page, .legal-page { padding: 28px 16px 50px; }
    .intro-copy h1, .result-header h1, .types-page h1, .legal-page h1 { font-size: 28px; }
    .test-layout { margin-top: 22px; }
    .test-picker { padding: 16px; }
    .count-options { grid-template-columns: 1fr; }
    .count-option { min-height: 80px; }
    .type-preview { display: block; padding: 16px; }
    .type-preview h2 { margin-top: 18px; }
    .question-panel { min-height: 390px; padding: 28px 18px; }
    .question-panel h1 { min-height: 90px; font-size: 23px; }
    .answer-button { min-height: 64px; }
    .test-topbar { grid-template-columns: auto 1fr auto; }
    .progress-copy { justify-self: center; flex-direction: column; align-items: center; gap: 0; }
    .result-header, .report-section { padding: 18px; }
    .result-identity img { width: 82px; height: 82px; }
    .report-grid { grid-template-columns: 1fr; gap: 12px; }
    .type-grid { grid-template-columns: 1fr; }
    .type-card { display: grid; grid-template-columns: 110px 1fr; column-gap: 16px; }
    .type-card img { grid-row: 1 / 4; aspect-ratio: 1 / 1; }
    .type-card h3 { margin-top: 0; }
    .types-cta, .site-footer > div { align-items: flex-start; flex-direction: column; }
}

@media print {
    .site-header, .site-footer, .result-actions, .result-disclaimer { display: none !important; }
    body { background: #fff; }
    .result-view { max-width: none; padding: 0; }
    .result-header, .report-section { break-inside: avoid; border-color: #bbb; }
}
