:root {
    --bg: #0a0e17;
    --panel: #111827;
    --text: #e5e7eb;
    --muted: #6b7280;
    --line: #1f2937;
    --soft: #1a2332;
    --accent: #10b981;
    --accent-strong: #059669;
    --red: #ef4444;
    --amber: #f59e0b;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
    --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: var(--bg);
    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(16, 185, 129, 0.15), rgba(16, 185, 129, 0.02));
    pointer-events: none;
}

.hero::before {
    content: "";
    position: absolute;
    left: -40px;
    bottom: -40px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.01));
    pointer-events: none;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.08);
    border-radius: 999px;
    padding: 8px 14px;
    margin-bottom: 16px;
    letter-spacing: 0.05em;
    font-weight: 600;
}

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

.hero h1 {
    font-size: clamp(26px, 5vw, 48px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    max-width: 680px;
    background: linear-gradient(135deg, #e5e7eb 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero .sub {
    margin-top: 14px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.75;
    max-width: 720px;
}

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

.hero-minimal {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 42px 20px;
}

.hero-minimal::after,
.hero-minimal::before {
    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: linear-gradient(135deg, var(--accent-strong), var(--accent));
    color: #fff;
    padding: 14px 24px;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.2);
    font-weight: 700;
    font-size: 15px;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 16px 40px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: var(--soft);
    color: var(--accent);
    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: var(--soft);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress > span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-strong), var(--accent));
    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, #141c2b, #111827);
}

.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: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--accent);
    font-weight: 600;
}

.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: var(--soft);
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease;
    line-height: 1.5;
}

.option:hover {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
}

.option:has(input:checked) {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
}

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

.option-code {
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    min-width: 22px;
}

.actions-bottom {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

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

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

.result-top {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.type-box {
    flex: 1;
    min-width: 280px;
}

.type-kicker {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.type-name {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, #e5e7eb 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.match {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent);
}

.type-intro {
    margin-top: 12px;
    font-size: 16px;
    color: var(--muted);
    font-style: italic;
    line-height: 1.6;
}

.analysis-box,
.dim-box,
.note-box {
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #141c2b, #111827);
}

.analysis-box h3,
.dim-box h3,
.note-box h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--accent);
}

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

#resultDesc {
    color: var(--text);
}

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

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

.dim-item-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.dim-item-name {
    font-weight: 700;
    font-size: 14px;
}

.dim-item-score {
    font-size: 13px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
}

.dim-item-score.level-H {
    color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
}

.dim-item-score.level-M {
    color: var(--amber);
    background: rgba(245, 158, 11, 0.1);
}

.dim-item-score.level-L {
    color: var(--red);
    background: rgba(239, 68, 68, 0.1);
}

.dim-item p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.author-box {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
}

.author-box summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    color: var(--muted);
    background: var(--soft);
}

.author-box summary:hover {
    color: var(--text);
}

.author-content {
    padding: 16px 20px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 14px;
}

.author-content p {
    margin-bottom: 8px;
}

.author-content p:last-child {
    margin-bottom: 0;
}

.result-actions {
    margin-top: 24px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 600px) {
    .shell {
        padding: 12px 10px 40px;
    }

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

    .question {
        padding: 14px;
    }

    .option {
        padding: 12px;
    }

    .hero {
        padding: 20px;
    }
}
