:root {
    --bg: #fef8f0;
    --panel: #ffffff;
    --text: #2a1e12;
    --muted: #786a60;
    --line: #e8d5c0;
    --soft: #f6ece0;
    --accent: #d4883a;
    --accent-strong: #b8722e;
    --shadow: 0 16px 40px rgba(120, 80, 40, 0.08);
    --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: radial-gradient(circle at top left, #fffcf8 0, #fef8f0 36%, #fdf5ee 100%);
    color: var(--text);
    min-height: 100vh;
}

.shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 56px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero {
    padding: 28px;
    margin-top: 20px;
    overflow: hidden;
    position: relative;
}
.hero::after {
    content: "";
    position: absolute;
    right: -60px; top: -60px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(200,150,100,0.18), rgba(200,150,100,0.02));
    pointer-events: none;
}

h1, h2, h3, p { margin: 0; }

.hero h1 {
    font-size: clamp(28px, 5vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.03em;
    max-width: 680px;
}

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

.hero-minimal {
    min-height: 48vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 42px 20px;
}
.hero-minimal::after { display: none; }
.hero-minimal h1 { max-width: none; margin: 0; }

.hero-actions-single { justify-content: center; margin-top: 28px; }

button {
    border: 0;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
    font: inherit;
}
button:hover { transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: 0.55; transform: none; }

.btn-primary {
    background: var(--accent-strong);
    color: #fff;
    padding: 14px 20px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(77,106,83,0.18);
    font-weight: 700;
}
.btn-secondary {
    background: #fff;
    color: var(--accent-strong);
    padding: 14px 20px;
    border-radius: 14px;
    border: 1px solid var(--line);
    font-weight: 700;
}

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

.test-wrap, .result-wrap { margin-top: 22px; padding: 22px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.progress {
    flex: 1;
    min-width: 240px;
    height: 10px;
    background: #f0e4d4;
    border-radius: 999px;
    overflow: hidden;
}
.progress > span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #d4a06a, #b8722e);
    border-radius: inherit;
    transition: width .22s ease;
}

.progress-text {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.question-list { display: grid; gap: 16px; }

.question {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #fffcf8);
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--soft);
    border: 1px solid var(--line);
}

.question-title {
    font-size: 16px;
    line-height: 1.7;
    white-space: pre-wrap;
}

.options { display: grid; gap: 10px; margin-top: 14px; }

.option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.option:hover { border-color: #d4a06a; background: #fdf5ee; }
.option.selected { border-color: var(--accent-strong); background: var(--soft); }

.option input {
    margin-top: 3px;
    accent-color: var(--accent-strong);
    transform: scale(1.1);
    flex-shrink: 0;
}

.option-code {
    font-weight: 800;
    color: var(--accent-strong);
    min-width: 22px;
}

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

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

/* ---- Result Page ---- */
.result-layout { display: grid; gap: 18px; }

.result-top {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 18px;
    align-items: stretch;
}

.poster-box, .type-box, .analysis-box, .dim-box, .note-box {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff, #fffcf8);
}

.poster-box {
    display: grid;
    grid-template-rows: 1fr auto;
    min-height: 280px;
    overflow: hidden;
    position: relative;
    background: radial-gradient(circle at top right, rgba(200,150,100,0.16), rgba(200,150,100,0) 40%),
                linear-gradient(180deg, #ffffff, #fffcf8);
}
.poster-box::after {
    content: "";
    position: absolute;
    right: -46px; bottom: -46px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(200,150,100,0.12), rgba(200,150,100,0.01));
    pointer-events: none;
}

.poster-image-frame {
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.26)),
        linear-gradient(135deg, #f6ddc6, #fef4ea);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
}

.poster-image {
    width: 100%;
    height: 100%;
    min-height: 252px;
    max-height: 460px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255,255,255,0.78);
    box-shadow: 0 14px 36px rgba(68, 43, 18, 0.14);
}

.poster-chip {
    position: absolute;
    left: 16px;
    top: 16px;
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 250, 243, 0.9);
    border: 1px solid rgba(232, 213, 192, 0.9);
    color: var(--accent-strong);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
}

.poster-toggle {
    position: absolute;
    right: 16px;
    top: 16px;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(42, 30, 18, 0.82);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(42, 30, 18, 0.18);
    position: absolute;
    z-index: 2;
}

.poster-toggle.is-disabled,
.poster-toggle:disabled {
    opacity: 0.55;
    box-shadow: none;
}

.poster-caption {
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
    position: relative;
    z-index: 1;
}

.type-kicker {
    font-size: 12px;
    color: var(--accent-strong);
    margin-bottom: 8px;
    letter-spacing: .06em;
}

.type-name {
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.type-subname {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.match {
    margin-top: 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 14px;
    background: var(--soft);
    border: 1px solid var(--line);
    color: var(--accent-strong);
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
}

.analysis-box h3, .dim-box h3, .note-box h3 { font-size: 16px; margin-bottom: 12px; }

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

.dim-list { display: grid; gap: 12px; }

.dim-item {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    background: #fff;
}

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

.dim-item-name { font-size: 14px; font-weight: 700; color: var(--text); }
.dim-item-score { color: var(--accent-strong); font-weight: 800; font-size: 14px; white-space: nowrap; }
.dim-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

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

.result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.result-credit {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
    text-align: right;
}

.result-credit p { margin: 0; }

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

@media (max-width: 600px) {
    .shell { padding: 14px 12px 42px; }
    .hero, .test-wrap, .result-wrap { padding: 16px; }
    .hero h1 { font-size: 32px; }
    .question-title { font-size: 15px; }
    .result-credit { text-align: left; }
}
