:root {
    --bg-1: #fff7fb;
    --bg-2: #eef5ff;
    --card: rgba(255, 255, 255, 0.92);
    --text: #1f2937;
    --muted: #667085;
    --border: rgba(148, 163, 184, 0.26);
    --primary: #7c3aed;
    --primary-2: #ec4899;
    --blue: #2563eb;
    --shadow: 0 22px 60px rgba(79, 70, 229, 0.14);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.7;
    background:
        radial-gradient(circle at 8% 10%, rgba(236, 72, 153, 0.16), transparent 28%),
        radial-gradient(circle at 92% 6%, rgba(37, 99, 235, 0.15), transparent 30%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.35) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 70%);
}

header {
    max-width: 960px;
    margin: 28px auto 0;
    padding: 44px 34px;
    color: #fff;
    text-align: center;
    border-radius: 0 0 32px 32px;
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 55%, #f97316 100%);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

header::after {
    content: "";
    position: absolute;
    width: 280px;
    height: 280px;
    right: -90px;
    top: -120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}

header h1 {
    margin: 0 0 14px;
    font-size: clamp(30px, 6vw, 48px);
    letter-spacing: 0.04em;
    position: relative;
    z-index: 1;
}

header p {
    max-width: 760px;
    margin: 0 auto;
    opacity: 0.93;
    position: relative;
    z-index: 1;
}

#test-section,
.result-section {
    max-width: 900px;
    margin: 28px auto;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

#test-intro,
#depression-info {
    border: 1px solid rgba(124, 58, 237, 0.14);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.07), rgba(236, 72, 153, 0.06));
    padding: 18px 20px;
    color: #344054;
}

#test-intro {
    margin-bottom: 22px;
}

#test-intro a,
footer a {
    color: #7c3aed;
    font-weight: 700;
    text-decoration: none;
}

#test-intro a:hover,
footer a:hover {
    text-decoration: underline;
}

.question {
    margin-bottom: 20px;
    padding: 28px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
    animation: fadeIn 0.42s ease;
}

.question:hover {
    box-shadow: 0 18px 40px rgba(124, 58, 237, 0.12);
}

.question-text {
    margin: 0 0 18px;
    color: #101828;
    font-size: 20px;
    font-weight: 800;
}

.answer-options {
    display: grid;
    gap: 12px;
}

.answer-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    color: #344054;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 16px;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.answer-options label::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 50%;
    border: 2px solid #c4b5fd;
    background: #fff;
    box-shadow: inset 0 0 0 4px #fff;
    transition: all 0.2s ease;
}

.answer-options label:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 58, 237, 0.48);
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.12);
}

.answer-options input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.answer-options label.selected,
.answer-options label:has(input[type="radio"]:checked) {
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    box-shadow: 0 14px 30px rgba(236, 72, 153, 0.2);
    font-weight: 700;
}

.answer-options label.selected::before,
.answer-options label:has(input[type="radio"]:checked)::before {
    border-color: #fff;
    background: #fff;
    box-shadow: inset 0 0 0 5px #ec4899;
}

.button-container {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
}

button,
#prev-btn,
#submit-btn,
.retest-btn {
    min-width: 150px;
    padding: 13px 24px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    box-shadow: 0 12px 26px rgba(124, 58, 237, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

#prev-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #64748b, #475569);
}

#submit-btn {
    background: linear-gradient(135deg, #2563eb, #7c3aed 50%, #ec4899);
}

button:hover,
#prev-btn:hover,
#submit-btn:hover,
.retest-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 18px 34px rgba(124, 58, 237, 0.28);
}

.completion-message {
    margin: 22px 0;
    padding: 22px;
    text-align: center;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(37, 99, 235, 0.08));
    border: 1px solid rgba(34, 197, 94, 0.18);
}

.completion-message p {
    margin: 0 0 14px;
    color: #166534;
    font-weight: 800;
}

.completion-message img {
    max-width: 120px;
    border-radius: 18px;
}

#depression-info {
    margin-top: 34px;
}

#depression-info h3 {
    margin: 24px 0 10px;
    color: #111827;
}

#depression-info h3:first-child {
    margin-top: 0;
}

#depression-info p,
#depression-info li {
    color: #475467;
}

.result-section {
    max-width: 960px;
    padding: 0;
    overflow: hidden;
}

.result-card {
    position: relative;
    padding: 42px;
    overflow: hidden;
}

.result-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(236, 72, 153, 0.16), transparent 32%),
        radial-gradient(circle at 90% 18%, rgba(37, 99, 235, 0.13), transparent 28%);
    pointer-events: none;
}

.result-card > * {
    position: relative;
    z-index: 1;
}

.result-kicker {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    color: #7c3aed;
    border: 1px solid rgba(124, 58, 237, 0.18);
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.08);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.result-card h2 {
    margin: 16px 0 8px;
    color: #101828;
    font-size: clamp(26px, 5vw, 40px);
    line-height: 1.2;
}

.result-tip {
    margin: 0 0 24px;
    color: var(--muted);
}

.gender-info {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
    padding: 12px 18px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.gender-info span {
    color: var(--muted);
    font-weight: 700;
}

.gender-info strong {
    color: #111827;
    font-size: 20px;
}

.progress-container {
    display: grid;
    gap: 20px;
}

.result-item {
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.result-meta span {
    color: #111827;
    font-size: 18px;
    font-weight: 900;
}

.result-meta strong {
    color: #111827;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.progress-track {
    width: 100%;
    height: 18px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5e7eb;
}

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-same .progress-fill {
    background: linear-gradient(90deg, #ec4899, #a855f7);
}

.result-opposite .progress-fill {
    background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.result-both .progress-fill {
    background: linear-gradient(90deg, #f97316, #ec4899, #7c3aed);
}

.description {
    margin: 28px 0 24px;
    padding: 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.08));
    border: 1px solid rgba(124, 58, 237, 0.12);
}

.description p {
    margin: 0;
    color: #4c1d95;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.retest-btn {
    display: block;
    margin: 0 auto;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
}

footer {
    max-width: 960px;
    margin: 26px auto 38px;
    color: #667085;
    text-align: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    header,
    #test-section,
    .result-section,
    footer {
        width: calc(100% - 28px);
        margin-left: auto;
        margin-right: auto;
    }

    header {
        margin-top: 14px;
        padding: 34px 20px;
        border-radius: 0 0 26px 26px;
    }

    #test-section {
        padding: 18px;
    }

    .question {
        padding: 20px;
    }

    .question-text {
        font-size: 18px;
    }

    .button-container {
        flex-direction: column;
    }

    button,
    #prev-btn,
    #submit-btn,
    .retest-btn {
        width: 100%;
    }

    .result-card {
        padding: 28px 18px;
    }

    .gender-info {
        width: 100%;
        justify-content: center;
    }

    .result-item {
        padding: 16px;
    }

    .description p {
        font-size: 16px;
    }
}


.logout-line {
    margin-top: 16px;
}

.logout-line a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
}

.logout-line a:hover {
    background: rgba(255, 255, 255, 0.28);
    text-decoration: none;
}

.auth-page {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: min(430px, 100%);
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.admin-card {
    width: min(500px, 100%);
}

.auth-card h1 {
    margin: 0 0 10px;
    font-size: 28px;
    color: #101828;
}

.auth-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

.auth-card form {
    display: grid;
    gap: 13px;
}

.auth-card label {
    font-weight: 800;
    color: #344054;
}

.auth-card input[type="password"] {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 14px;
    color: var(--text);
    font-size: 16px;
    background: #fff;
    outline: none;
}

.auth-card input[type="password"]:focus {
    border-color: rgba(124, 58, 237, 0.7);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.auth-error,
.auth-success {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 700;
}

.auth-error {
    color: #b42318;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.22);
}

.auth-success {
    color: #027a48;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.24);
}

.auth-links {
    margin-top: 20px !important;
    text-align: center;
}

.auth-links a {
    color: #7c3aed;
    font-weight: 800;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}
