/* ============================================================
   全站共享样式
   - 视觉语言与首页 css/home.css 保持一致：米白纸感底、墨色主色、细边框、大圆角
   - 测评页结构类名保持不变，仅升级视觉与交互
   ============================================================ */

:root {
    --paper: #f4f3ef;
    --ink: #101114;
    --ink-soft: #3c3f46;
    --muted: #6c7078;
    --line: #e5e3dd;
    --line-strong: #d3d0c7;
    --blue: #2f6bff;
    --cyan: #5fd3ff;
    --violet: #7c5cff;
    --pink: #ff5c8a;
    --radius-lg: 28px;
    --radius-md: 16px;
    --shadow-soft: 0 1px 2px rgba(16, 17, 20, 0.04), 0 20px 45px -32px rgba(16, 17, 20, 0.4);
    --font-sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
textarea {
    font-family: inherit;
}

/* ============================================================
   旧版首页遗留组件（保留兼容，避免影响仍在引用它们的页面）
   ============================================================ */

.main-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 24px 8px 80px 8px;
}

.main-title {
    font-size: 1.7em;
    font-weight: 700;
    text-align: center;
    margin: 24px 0 18px 0;
    letter-spacing: 0.06em;
}

.card {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    padding: 22px 20px 18px 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.card-icon {
    width: 36px;
    height: 36px;
    background: #eaf0ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.icon-bar {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg fill="%234e73df" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M3 17h3v-7H3v7zm5 0h3v-12H8v12zm5 0h3v-4h-3v4zm5 0h3v-9h-3v9z"/></svg>') no-repeat center/contain;
}

.icon-heart {
    display: inline-block;
    width: 20px;
    height: 20px;
    font-size: 18px;
    color: #e74c3c;
    text-align: center;
    line-height: 20px;
}

.icon-love {
    display: inline-block;
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #ff6b9d;
    text-align: center;
    line-height: 20px;
}

.card-content {
    flex: 1;
    margin-bottom: 10px;
}

.card-title {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 6px;
}

.card-desc {
    color: var(--muted);
    font-size: 0.96em;
    line-height: 1.7;
    margin-bottom: 8px;
}

.card-info {
    color: #97948b;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.card-btn {
    align-self: flex-end;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 9px 22px;
    font-size: 0.94em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s, transform 0.2s;
}

.card-btn:hover {
    background: #2a2d35;
    transform: translateY(-1px);
}

.sex-test-card .card-icon {
    background: #ffe6e3;
}

.possessiveness-test-card .card-icon {
    background: #ffe0f0;
}

.scl90-card .card-icon {
    background: #e6f2ff;
}

.scl90-card {
    border-left: 4px solid #4e73df;
}

.sex-test-card {
    border-left: 4px solid #e74c3c;
}

.possessiveness-test-card {
    border-left: 4px solid #ff6b9d;
}

.yandere-test-card {
    border-left: 4px solid #ff2e7e;
}

.loveview-test-card {
    border-left: 4px solid #10b981;
}

.milu-pref-card {
    border-left: 4px solid var(--violet);
}

.section-title {
    font-size: 1.1em;
    font-weight: 700;
    margin: 18px 0 8px 0;
    letter-spacing: 0.01em;
}

.desc-block {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px 16px;
    color: var(--muted);
    font-size: 0.96em;
    line-height: 1.8;
    box-shadow: var(--shadow-soft);
}

.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 10px 0 8px 0;
    text-align: center;
    font-size: 0.92em;
    z-index: 10;
}

.footer-links span {
    margin: 0 10px;
    color: var(--blue);
    cursor: pointer;
    font-size: 0.95em;
}

.footer-copy {
    color: #97948b;
    font-size: 0.88em;
    margin-top: 4px;
}

/* ============================================================
   弹窗（授权码 / 密码）
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    width: 100%;
    height: 100%;
    padding: 20px;
    background: rgba(10, 11, 14, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 360px;
    padding: 30px 26px 24px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.5);
    text-align: center;
    box-sizing: border-box;
    animation: modalIn 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.modal-content h3 {
    margin: 0 0 18px 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--ink);
}

.modal-content input[type="text"],
.modal-content input[type="password"] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfaf7;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.modal-content input[type="text"]:focus,
.modal-content input[type="password"]:focus {
    border-color: var(--ink);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(16, 17, 20, 0.06);
}

.modal-content button {
    width: 100%;
    height: 46px;
    margin-top: 6px;
    border: none;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s, transform 0.2s;
}

.modal-content button:hover {
    background: #2a2d35;
}

.modal-content button:active {
    transform: scale(0.99);
}

.close {
    position: absolute;
    right: 14px;
    top: 10px;
    font-size: 22px;
    line-height: 1;
    color: #b3b0a8;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: var(--ink);
}

.error {
    min-height: 18px;
    margin: 0 0 8px 0;
    color: #e5484d;
    font-size: 12.5px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   测评界面
   ============================================================ */

body:has(.test-container) {
    min-height: 100vh;
    padding: 0 0 56px;
    background:
        radial-gradient(620px 420px at 8% -10%, rgba(47, 107, 255, 0.10), transparent 62%),
        radial-gradient(680px 460px at 96% 2%, rgba(124, 92, 255, 0.10), transparent 64%),
        radial-gradient(520px 380px at 50% 112%, rgba(255, 92, 138, 0.07), transparent 66%),
        var(--paper);
    background-attachment: fixed;
}

.test-header,
.test-header *,
.test-container,
.test-container * {
    box-sizing: border-box;
}

.test-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 16px 20px;
    background: rgba(244, 243, 239, 0.86);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.test-header::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    transform: rotate(45deg);
}

.test-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.08em;
    color: var(--ink-soft);
    text-align: center;
}

.test-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: calc(100% - 40px);
    max-width: 720px;
    margin: 30px auto 0;
    padding: 34px 38px 30px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.progress-bar-bg {
    width: 100%;
    height: 5px;
    margin-bottom: 24px;
    background: #efece5;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    border-radius: 999px;
    transition: width 0.4s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.question-info {
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: #a6a29a;
    font-variant-numeric: tabular-nums;
}

.question-title {
    margin: 0 0 26px 0;
    font-size: clamp(19px, 2.2vw, 23px);
    font-weight: 700;
    line-height: 1.65;
    letter-spacing: -0.005em;
    color: var(--ink);
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    background: #fbfaf7;
    border: 1px solid var(--line);
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-soft);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.option-card:hover {
    background: #fff;
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -20px rgba(16, 17, 20, 0.6);
}

.option-card.selected {
    background: #fff;
    border-color: var(--ink);
    color: var(--ink);
    box-shadow: 0 0 0 1px var(--ink), 0 14px 28px -24px rgba(16, 17, 20, 0.55);
}

.option-radio {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
    background: #fff;
    border: 1.5px solid #c9c6bd;
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.2s;
}

.option-radio:checked {
    border-color: var(--ink);
}

.option-radio:checked::after {
    content: "";
    position: absolute;
    inset: 4px;
    background: var(--ink);
    border-radius: 50%;
}

/* 部分旧测试只切换 .selected，不勾选 radio；用选中类兜底，保证圆圈状态一致 */
.option-card.selected .option-radio {
    border-color: var(--ink);
}

.option-card.selected .option-radio::after {
    content: "";
    position: absolute;
    inset: 4px;
    background: var(--ink);
    border-radius: 50%;
}

.option-radio:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.test-btns {
    display: flex;
    gap: 12px;
    margin-top: auto;
}

.nav-btn {
    flex: 1;
    min-height: 48px;
    padding: 12px 18px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.nav-btn:hover:not(:disabled) {
    background: #fbfaf7;
    border-color: var(--line-strong);
}

.nav-btn:active:not(:disabled) {
    transform: scale(0.99);
}

.nav-btn:disabled {
    background: #f5f3ee;
    border-color: #eeece6;
    color: #bdbab1;
    cursor: not-allowed;
}

.main-btn {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
    box-shadow: 0 14px 28px -22px rgba(16, 17, 20, 0.8);
}

.main-btn:hover:not(:disabled) {
    background: linear-gradient(120deg, var(--blue), var(--violet));
    border-color: transparent;
    box-shadow: 0 16px 30px -18px rgba(47, 107, 255, 0.55);
}

.main-btn:disabled {
    background: #d9d6ce;
    border-color: #d9d6ce;
    color: #fff;
    box-shadow: none;
}

.nav-btn:focus-visible,
.main-btn:focus-visible,
.modal-content button:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

/* 保证点击整张选项卡片生效（原有规则，保留） */
.option-card * {
    pointer-events: none;
}

@media (max-width: 640px) {
    body:has(.test-container) {
        padding-bottom: 40px;
    }

    .test-header {
        padding: 13px 16px;
    }

    .test-title {
        font-size: 12.5px;
        letter-spacing: 0.04em;
    }

    .test-container {
        width: calc(100% - 24px);
        margin-top: 16px;
        padding: 24px 18px 20px;
        border-radius: 20px;
    }

    .progress-bar-bg {
        margin-bottom: 20px;
    }

    .question-title {
        margin-bottom: 22px;
        font-size: 18px;
    }

    .options-list {
        gap: 9px;
        margin-bottom: 22px;
    }

    .option-card {
        padding: 14px 14px;
        border-radius: 12px;
        font-size: 14.5px;
    }

    .nav-btn {
        min-height: 46px;
        font-size: 13.5px;
    }
}

/* ============================================================
   设置入口与设置页
   ============================================================ */

.settings-btn {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 1000;
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 14px 30px -14px rgba(16, 17, 20, 0.7);
    transition: transform 0.25s, background 0.25s, box-shadow 0.25s;
}

.settings-btn:hover {
    background: #2a2d35;
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -14px rgba(16, 17, 20, 0.8);
}

.settings-btn:active {
    transform: scale(0.96);
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

.container h1 {
    margin: 12px 0 24px 0;
    font-size: clamp(24px, 3vw, 30px);
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.01em;
}

.container h2 {
    margin: 26px 0 12px 0;
    font-size: 17px;
    font-weight: 700;
}

.container input[type="text"],
.container input[type="password"] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    margin-bottom: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    font-size: 15px;
    color: var(--ink);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.container input[type="text"]:focus,
.container input[type="password"]:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(16, 17, 20, 0.06);
}

.container button {
    padding: 11px 22px;
    margin-right: 10px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.container button:hover {
    background: #2a2d35;
    transform: translateY(-1px);
}

.container .success {
    color: #0f8a5f;
    font-size: 13.5px;
    margin-top: 8px;
}

@media (max-width: 640px) {
    .settings-btn {
        right: 15px;
        bottom: 70px;
        width: 45px;
        height: 45px;
        font-size: 14px;
    }

    .container {
        padding: 20px 16px 48px;
    }

    .main-container {
        padding: 10px 8px 80px 8px;
    }

    .card {
        padding: 18px 16px 14px 16px;
    }

    .footer {
        font-size: 0.88em;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .option-card:hover,
    .nav-btn:hover:not(:disabled),
    .settings-btn:hover,
    .container button:hover {
        transform: none;
    }
}
