:root {
    --primary-color: #4b0082;
    --secondary-color: #f4e04d;
    --bg-color: #0f0a1a;
    --bg-elevated: rgba(255, 255, 255, 0.06);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-color: #f7f3ff;
    --text-muted: rgba(247, 243, 255, 0.72);
    --text-soft: rgba(247, 243, 255, 0.5);
    --shadow-color: rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(75, 0, 130, 0.35), transparent 35%),
        radial-gradient(circle at right 20%, rgba(244, 224, 77, 0.08), transparent 28%),
        linear-gradient(180deg, #120a1f 0%, #0c0816 100%);
    color: var(--text-color);
}

.page-shell {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.opening-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at center, rgba(244, 224, 77, 0.14), transparent 24%),
        rgba(10, 7, 19, 0.9);
    backdrop-filter: blur(18px);
}

.opening-core {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.opening-box {
    position: relative;
    width: 132px;
    height: 132px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
    animation: boxFloat 1.8s ease-in-out infinite;
}

.opening-box::before,
.opening-box::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.opening-box::before {
    top: 22px;
    width: 78px;
    height: 12px;
    border-radius: 999px;
    background: rgba(244, 224, 77, 0.75);
    box-shadow: 0 0 28px rgba(244, 224, 77, 0.42);
}

.opening-box::after {
    inset: 28px 24px 24px;
    border-radius: 24px;
    border: 1px solid rgba(244, 224, 77, 0.16);
}

.opening-lid,
.opening-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.opening-lid::before,
.opening-lid::after,
.opening-glow::before,
.opening-glow::after {
    content: "";
    position: absolute;
}

.opening-lid::before {
    top: 18px;
    left: 20px;
    right: 20px;
    height: 28px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(244, 224, 77, 0.9), rgba(255, 240, 163, 0.62));
}

.opening-lid::after {
    top: -14px;
    left: 50%;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(244, 224, 77, 0.34);
    transform: translateX(-50%);
}

.opening-glow::before {
    inset: 42px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(244, 224, 77, 0.42), transparent 68%);
    animation: glowPulse 1.6s ease-in-out infinite;
}

.opening-glow::after {
    top: 16px;
    left: 50%;
    width: 6px;
    height: 88px;
    background: linear-gradient(180deg, rgba(244, 224, 77, 0.92), transparent);
    box-shadow: 0 0 18px rgba(244, 224, 77, 0.4);
    transform: translateX(-50%);
}

.opening-kicker,
.opening-copy,
.opening-title {
    margin: 0;
}

.opening-kicker {
    color: var(--secondary-color);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.opening-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: -0.04em;
}

.opening-copy {
    max-width: 460px;
    color: var(--text-muted);
    line-height: 1.8;
}

.ambient {
    position: absolute;
    width: 28rem;
    height: 28rem;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    pointer-events: none;
}

.ambient-left {
    top: -10rem;
    left: -8rem;
    background: rgba(75, 0, 130, 0.5);
}

.ambient-right {
    right: -8rem;
    bottom: -8rem;
    background: rgba(244, 224, 77, 0.14);
}

.container {
    position: relative;
    z-index: 1;
    width: min(960px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0;
}

.panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    backdrop-filter: blur(18px);
    box-shadow: 0 24px 80px var(--shadow-color);
    padding: 32px;
}

.home-content,
.quiz-container,
.result-container {
    display: none;
}

.home-content {
    display: grid;
    gap: 28px;
}

.hero-meta,
.result-topbar,
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(244, 224, 77, 0.24);
    background: rgba(244, 224, 77, 0.08);
    color: var(--secondary-color);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.5rem, 7vw, 4.75rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
}

.subtitle,
.hero-hint,
.result-copy,
.loading-copy,
.personality-slogan {
    color: var(--text-muted);
}

.subtitle {
    max-width: 660px;
    margin: 16px 0 0;
    font-size: 1.05rem;
    line-height: 1.8;
}

.hero-actions {
    display: grid;
    gap: 12px;
}

.btn-main,
.btn-secondary,
.option-btn {
    font: inherit;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.22s ease, border-color 0.22s ease, background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.btn-main {
    border: 1px solid rgba(244, 224, 77, 0.48);
    background: linear-gradient(135deg, var(--secondary-color), #fff2a6);
    color: #1c1227;
    padding: 18px 28px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 12px 40px rgba(244, 224, 77, 0.18);
    animation: breathe 2.6s ease-in-out infinite;
}

.btn-main:hover,
.btn-secondary:hover,
.option-btn:hover {
    transform: translateY(-1px);
}

.btn-secondary {
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    padding: 12px 18px;
}

.hero-hint,
.quiz-progress,
.milestone-text,
.loading-copy,
.page-footer {
    margin: 0;
}

.result-block,
.question-card {
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
}

.block-label,
.dimension-label {
    color: var(--text-soft);
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.scene-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.scene-card {
    position: relative;
    min-height: 148px;
    overflow: hidden;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(75, 0, 130, 0.18));
    border: 1px solid rgba(255, 255, 255, 0.08);
    animation: sceneFloat 8s ease-in-out infinite;
}

.scene-card::before,
.scene-card::after,
.scene-dot {
    position: absolute;
    content: "";
    display: block;
    background: rgba(247, 243, 255, 0.1);
}

.scene-card::before {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    top: 24px;
    left: 28px;
}

.scene-card::after {
    width: 96px;
    height: 16px;
    border-radius: 999px;
    bottom: 24px;
    left: 22px;
}

.scene-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    right: 22px;
    top: 20px;
    background: rgba(244, 224, 77, 0.2);
    box-shadow: 0 0 24px rgba(244, 224, 77, 0.12);
}

.scene-card:nth-child(2),
.scene-card:nth-child(5) {
    animation-delay: -2s;
}

.scene-card:nth-child(3),
.scene-card:nth-child(6) {
    animation-delay: -4s;
}

.scene-card-phone::before {
    width: 50px;
    height: 88px;
    border-radius: 20px;
}

.scene-card-phone::after {
    width: 70px;
    bottom: 18px;
}

.scene-card-group::before {
    width: 38px;
    height: 38px;
    box-shadow: 46px 6px 0 rgba(247, 243, 255, 0.08), 92px 14px 0 rgba(247, 243, 255, 0.06);
}

.scene-card-group::after {
    width: 118px;
}

.scene-card-coffee::before {
    width: 80px;
    height: 48px;
    border-radius: 0 0 24px 24px;
}

.scene-card-coffee::after {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    right: 32px;
    left: auto;
    top: 44px;
    bottom: auto;
}

.scene-card-chat::before {
    width: 98px;
    height: 54px;
    border-radius: 22px;
}

.scene-card-chat::after {
    width: 56px;
    height: 56px;
    border-radius: 20px;
    left: auto;
    right: 28px;
    bottom: 26px;
}

.scene-card-party::before {
    width: 32px;
    height: 68px;
    border-radius: 18px;
    box-shadow: 38px -10px 0 rgba(247, 243, 255, 0.1), 76px 4px 0 rgba(247, 243, 255, 0.08);
}

.scene-card-party::after {
    width: 120px;
}

.scene-card-walk::before {
    width: 30px;
    height: 78px;
    border-radius: 18px;
    left: 50%;
    transform: translateX(-50%);
}

.scene-card-walk::after {
    width: 78px;
    left: 50%;
    transform: translateX(-50%);
}


.quotes-scroller {
    display: grid;
    gap: 10px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(75, 0, 130, 0.18), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(244, 224, 77, 0.14);
}

.quote-label {
    color: var(--secondary-color);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quote-text {
    min-height: 32px;
    font-size: 1rem;
    line-height: 1.7;
    transition: opacity 0.3s ease;
}

.page-footer {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.quiz-container,
.result-container {
    gap: 24px;
}

.quiz-progress {
    margin-top: 10px;
    font-size: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), #fff7c9);
    border-radius: inherit;
    transition: width 0.28s ease;
}

.question-card {
    padding: 28px;
    display: grid;
    gap: 18px;
}

.question-text {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    line-height: 1.5;
    letter-spacing: -0.02em;
}

.milestone-text {
    font-size: 0.95rem;
    color: var(--secondary-color);
}

.options {
    display: grid;
    gap: 14px;
}

.option-btn {
    width: 100%;
    padding: 16px 18px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
}

.option-btn:hover {
    border-color: rgba(244, 224, 77, 0.38);
    background: rgba(244, 224, 77, 0.08);
}

.quiz-loading {
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 32px 0 10px;
}

.analysis-symbols {
    min-height: 28px;
    color: var(--secondary-color);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.84;
}

.loading-title {
    margin: 0;
    font-size: 1.1rem;
}

.loader {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(244, 224, 77, 0.18);
    border-top-color: var(--secondary-color);
    animation: spin 0.9s linear infinite;
}

.result-topbar {
    margin-bottom: 18px;
}

.result-header {
    margin: 10px 0 0;
    color: var(--text-muted);
}

.personality-card {
    position: relative;
    display: grid;
    gap: 24px;
    padding: 28px;
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(244, 224, 77, 0.12), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blindbox-card::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 18px;
    border: 1px dashed rgba(244, 224, 77, 0.18);
    pointer-events: none;
}

.card-ribbon {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(244, 224, 77, 0.12);
    border: 1px solid rgba(244, 224, 77, 0.26);
    color: var(--secondary-color);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.personality-head {
    display: flex;
    align-items: center;
    gap: 18px;
}

.personality-emoji {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(244, 224, 77, 0.08);
    border: 1px solid rgba(244, 224, 77, 0.18);
    font-size: 2rem;
}

.personality-type {
    margin: 0 0 6px;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.personality-name {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1;
}

.personality-slogan {
    margin: 0;
    font-size: 1rem;
}

.result-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
}

.result-block {
    padding: 20px;
}

.result-block:last-child {
    grid-column: 2;
}

.detail-list {
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--text-muted);
    line-height: 1.8;
}

.result-copy {
    margin: 12px 0 0;
    line-height: 1.8;
}

.btn-restart {
    margin-top: 24px;
}

.social-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-social {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 14px;
    border-radius: 16px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(244, 224, 77, 0.3);
}

.bottom-actions {
    display: grid;
    place-items: center;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.45s ease;
}

.pop-in {
    animation: popIn 0.5s cubic-bezier(0.26, 0.53, 0.74, 1.48);
}

@keyframes breathe {

    0%,
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 12px 40px rgba(244, 224, 77, 0.18);
    }

    50% {
        transform: translateY(-1px) scale(1.015);
        box-shadow: 0 16px 46px rgba(244, 224, 77, 0.3);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.45;
        transform: scale(0.92);
    }

    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

@keyframes boxFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes sceneFloat {

    0%,
    100% {
        transform: translateY(0);
        border-color: rgba(255, 255, 255, 0.08);
    }

    50% {
        transform: translateY(-5px);
        border-color: rgba(244, 224, 77, 0.18);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(12px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@media (max-width: 900px) {

    .result-grid {
        grid-template-columns: 1fr 1fr;
    }

    .scene-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-block:last-child {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .container {
        width: min(100%, calc(100% - 24px));
        padding: 20px 0;
    }

    .panel {
        padding: 22px;
        border-radius: 22px;
    }

    .hero-meta,
    .result-topbar,
    .quiz-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .result-grid,
    .scene-gallery {
        grid-template-columns: 1fr;
    }

    .question-card,
    .personality-card {
        padding: 22px;
    }

    .personality-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
