/* ============================================
   MonoMind — Minimal Modern
   Pure white, clean type, one accent color
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&family=Nunito:wght@400;500;600;700&family=ZCOOL+KuaiLe&family=Noto+Sans+SC:wght@300;400;500;600&display=swap');

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #FFFFFF;
    --text: #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent: #1a1a1a;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --hover-bg: #f9fafb;
    --radius: 8px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Plus Jakarta Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-serif: 'DM Serif Display', 'Georgia', serif;
}

/* Force dark mode — galaxy background is always dark */
:root {
    --bg: #050a14;
    --text: #b0bec5;
    --text-secondary: #8a9bae;
    --text-muted: #5a6b7e;
    --accent: #c9a84c;
    --border: rgba(55,65,81,0.5);
    --border-light: rgba(31,41,55,0.5);
    --hover-bg: rgba(255,255,255,0.02);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px;
    font-weight: 400;
}

/* --- Layout --- */
.container {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 24px 80px;
    transition: opacity 0.35s ease;
}

/* --- Shared galaxy/nav layout (persists across SPA navigation) --- */
canvas#galaxy {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}
canvas#c {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1; pointer-events: auto;
}
.vignette {
    position: fixed; inset: 0; z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 25%, rgba(1,1,8,0.35) 65%, rgba(1,1,8,0.65) 100%);
}
.top-nav {
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 10; pointer-events: none;
    display: flex; justify-content: center; align-items: center; gap: 24px;
    padding: 10px 24px 20px;
    background: linear-gradient(to bottom, rgba(5,10,20,0.92) 40%, rgba(5,10,20,0));
}
.top-nav a {
    font-size: 0.75rem; color: var(--text-muted);
    text-decoration: none; letter-spacing: 0.03em;
    transition: color 0.2s; text-shadow: 0 1px 8px rgba(0,0,0,0.5);
    pointer-events: auto;
}
.top-nav a:hover { color: var(--text); }

/* --- Home-only UI (hidden by SPA on other pages, faded smoothly) --- */
.home-ui {
    transition: opacity 0.4s ease;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* Article body: sans-serif (avoid 宋体 fallback) */
[data-article-block]:not(h1):not(h2):not(h3) {
    font-family: var(--font-sans);
}

.hero-title {
    font-family: var(--font-sans);
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.7;
    margin-bottom: 32px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 36px;
    border: none;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: rgba(100, 140, 220, 0.15);
    color: rgba(200, 215, 240, 0.9);
    border: 1px solid rgba(100, 140, 220, 0.25);
    box-shadow: none;
}
.btn-primary:hover {
    background: rgba(100, 140, 220, 0.25);
    color: rgba(220, 230, 245, 0.95);
    border-color: rgba(100, 140, 220, 0.4);
    box-shadow: 0 2px 12px rgba(100, 140, 220, 0.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text);
}

.btn-lg {
    padding: 16px 48px;
    font-size: 1rem;
}

/* --- Quiz Screens --- */
.quiz-screen {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.quiz-screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeSlideOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* Glass card for quiz screens (standalone, not inside .quiz-card) */
.quiz-screen .glass-card {
    background: rgba(8, 12, 28, 0.35);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: 0 0 40px rgba(201,168,76,0.02), 0 4px 20px rgba(0,0,0,0.12);
    max-width: 640px;
    margin: 0 auto;
}

/* --- Welcome Screen --- */
.welcome-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.welcome-meta {
    display: flex;
    gap: 32px;
    margin: 32px 0 48px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

.meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.5;
    flex-shrink: 0;
}

/* --- Progress --- */
.progress-container {
    margin-bottom: 40px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.05em;
}

.progress-bar {
    height: 3px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(201,168,76,0.4), rgba(201,168,76,0.7));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 0%;
    box-shadow: 0 0 8px rgba(201,168,76,0.15);
}

/* --- Question --- */
.question-number {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.question-text {
    font-size: clamp(1.5rem, 5vw, 2rem);
    margin-bottom: 40px;
    color: var(--text);
}

/* --- Options --- */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-btn {
    display: block;
    width: 100%;
    padding: 18px 24px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(148,163,184,0.1);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    line-height: 1.5;
    cursor: pointer;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(1);
    -webkit-tap-highlight-color: transparent;
}

.option-btn:hover {
    background: rgba(255,255,255,0.04);
    border-color: rgba(148,163,184,0.2);
    padding-left: 28px;
}

.option-btn:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

.option-btn.selected {
    background: rgba(210, 220, 235, 0.8);
    color: #0a0a14;
    border-color: rgba(210, 220, 235, 0.5);
    box-shadow: 0 0 20px rgba(210,220,235,0.08);
    animation: optionPulse 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes optionPulse {
    0% { transform: scale(0.97); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.option-btn.selected span {
    color: #0a0a14;
}

.option-btn span {
    position: relative;
    z-index: 1;
    color: inherit;
}

/* --- Result Screen --- */
.result-card {
    padding: 0;
}

.result-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(148,163,184,0.1);
    width: 100%;
}

.result-philosopher {
    font-size: clamp(2.5rem, 10vw, 4rem);
    color: var(--text);
    margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(201,168,76,0.06);
}

.result-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.3rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 32px;
}

.result-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 48px;
    font-weight: 300;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-bottom: 40px;
    border-top: 1px solid rgba(148,163,184,0.1);
    border-bottom: 1px solid rgba(148,163,184,0.1);
}

.stat-card {
    padding: 24px 16px;
    text-align: center;
    border-right: 1px solid rgba(148,163,184,0.08);
    background: transparent;
    border-radius: 0;
    border-bottom: none;
}

.stat-card:last-child {
    border-right: none;
}

.stat-value {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text);
    display: block;
    text-shadow: 0 0 16px rgba(201,168,76,0.1);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-top: 4px;
    font-weight: 400;
}

/* Traits */
.traits {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
}

.trait-tag {
    padding: 6px 16px;
    border: 1px solid rgba(148,163,184,0.15);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    background: rgba(255,255,255,0.02);
}

/* Secondary match */
.secondary-match {
    padding: 24px 0;
    border-top: 1px solid rgba(148,163,184,0.08);
    border-bottom: 1px solid rgba(148,163,184,0.08);
    margin-bottom: 40px;
}

.secondary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.secondary-name {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Share */
.share-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.share-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Screenshot-optimized share card */
.share-card {
    margin: 32px auto 0;
    width: 320px;
    aspect-ratio: 9 / 16;
    max-height: 568px;
    border-radius: 20px;
    background: linear-gradient(170deg, #0a0e1a 0%, #0d1528 40%, #111b33 100%);
    border: 1px solid rgba(148,163,184,0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}
.share-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(99,102,241,0.06) 0%, transparent 70%),
                radial-gradient(ellipse at 30% 70%, rgba(201,168,76,0.04) 0%, transparent 50%);
    pointer-events: none;
}
.share-card-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-muted);
    margin-bottom: 16px;
    position: relative;
}
.share-card-name {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--text);
    margin-bottom: 8px;
    position: relative;
    text-shadow: 0 0 30px rgba(201,168,76,0.08);
    line-height: 1.2;
}
.share-card-title {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    position: relative;
}
.share-card-score {
    font-size: 2.5rem;
    font-family: var(--font-serif);
    color: var(--text);
    position: relative;
    text-shadow: 0 0 20px rgba(201,168,76,0.1);
}
.share-card-score-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-top: 4px;
    position: relative;
}
.share-card-brand {
    position: absolute;
    bottom: 24px;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(148,163,184,0.12);
    background: rgba(255,255,255,0.02);
    color: var(--text-secondary);
    transition: all 0.25s ease;
    text-decoration: none;
    font-family: var(--font-sans);
    white-space: nowrap;
}

.share-btn:hover {
    border-color: rgba(148,163,184,0.3);
    color: var(--text);
    background: rgba(255,255,255,0.04);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: #0a0a14;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Landing Page --- */
.quiz-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 0;
}

.quiz-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.quiz-card .glass-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 28px 0;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
    backdrop-filter: none;
    border-radius: 0;
    box-shadow: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.quiz-card:hover .glass-card {
    background: transparent;
    transform: none;
    border-color: var(--border);
}

.quiz-card-left {
    display: flex;
    gap: 20px;
    align-items: baseline;
}

.quiz-card-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.quiz-card-info h3 {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 4px;
    color: var(--text);
}

.quiz-card-info p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0;
    font-weight: 300;
}

.quiz-card-meta {
    display: none;
}

.quiz-card-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.quiz-card:hover .quiz-card-arrow {
    color: var(--text);
    transform: translateX(4px);
}

.badge-new {
    display: inline-block;
    padding: 2px 8px;
    background: var(--text);
    color: var(--bg);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    vertical-align: middle;
    margin-left: 8px;
    font-family: var(--font-sans);
}

.badge-soon {
    display: inline-block;
    padding: 2px 8px;
    background: var(--border-light);
    color: var(--text-muted);
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    vertical-align: middle;
    margin-left: 8px;
    font-family: var(--font-sans);
}

.quiz-card.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* --- Header --- */
.site-header {
    padding: 8px 0 40px;
    position: relative;
    z-index: 10;
    pointer-events: all;
}

.site-header a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
    font-weight: 400;
    padding: 8px 4px;
    display: inline-block;
}

.site-header a:hover {
    color: var(--text);
}

/* --- Footer --- */
.site-footer {
    text-align: center;
    padding: 60px 0 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 0.02em;
}

/* --- Result animations --- */
.result-card > * {
    animation: fadeUp 0.5s ease both;
}
.result-card > *:nth-child(1) { animation-delay: 0.05s; }
.result-card > *:nth-child(2) { animation-delay: 0.15s; }
.result-card > *:nth-child(3) { animation-delay: 0.25s; }
.result-card > *:nth-child(4) { animation-delay: 0.35s; }
.result-card > *:nth-child(5) { animation-delay: 0.45s; }
.result-card > *:nth-child(6) { animation-delay: 0.55s; }
.result-card > *:nth-child(7) { animation-delay: 0.65s; }
.result-card > *:nth-child(8) { animation-delay: 0.75s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .container {
        padding: 20px 20px 60px;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .quiz-card .glass-card {
        padding: 20px 0;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        justify-content: center;
    }
}

/* --- Cookie Consent Banner --- */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: 16px 24px;
    background: rgba(8, 12, 28, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-family: var(--font-sans);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.cookie-consent.visible {
    transform: translateY(0);
}
.cookie-consent p {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 300;
    margin: 0;
    max-width: 600px;
    line-height: 1.5;
    text-shadow: none;
}
.cookie-consent p a {
    color: #c9a84c;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-consent-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.cookie-btn {
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}
.cookie-btn-accept {
    background: rgba(241, 245, 249, 0.9);
    color: #0f172a;
}
.cookie-btn-accept:hover {
    background: #fff;
}
.cookie-btn-decline {
    background: transparent;
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.15);
}
.cookie-btn-decline:hover {
    border-color: rgba(148, 163, 184, 0.3);
    color: #e2e8f0;
}
@media (max-width: 640px) {
    .cookie-consent {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 20px 16px;
    }
}

/* --- Accessibility: Focus Visible --- */
a:focus-visible,
button:focus-visible,
.option-btn:focus-visible,
.btn:focus-visible,
.share-btn:focus-visible,
.cookie-btn:focus-visible {
    outline: 2px solid rgba(201, 168, 76, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
}

/* --- Accessibility: Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .progress-fill {
        transition: none;
    }
}
