/* ============================================================
   散户画像游戏 · 品牌暗色主题
   沿用 灵魂瞎话家 设计系统：品红锚点 · 偏粉近黑 · 玻璃态 · 彩虹签名
   移动端优先（微信 H5 传播）
   ============================================================ */

:root {
    --brand: #DE0156;
    --brand-glow: #FF3B81;
    --brand-deep: #9B0140;
    --brand-soft: #FF8FB6;
    --bg-0: #0A0A0E;
    --bg-1: #121017;
    --surface: #17171F;
    --surface-2: #1F1F29;
    --line: rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);
    --t1: #FFFFFF;
    --t2: #B9B9C4;
    --t3: #74747F;
    --teal: #2DD4BF;
    --amber: #F5A623;
    --violet: #8B7BFF;
    --green: #16C784;
    --red: #FF4D6D;
    --rainbow: linear-gradient(90deg, #DE0156 0%, #FF3B81 22%, #F5A623 46%, #2DD4BF 70%, #8B7BFF 100%);
    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 24px;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    background:
        radial-gradient(1100px 700px at 85% -10%, rgba(222, 1, 86, .14), transparent 60%),
        radial-gradient(900px 600px at -10% 40%, rgba(139, 123, 255, .08), transparent 55%),
        linear-gradient(160deg, #170810, #0A0A0E);
    background-attachment: fixed;
    color: var(--t1);
    font-family: "PingFang SC", "Source Han Sans SC", "Noto Sans SC", -apple-system, system-ui, sans-serif;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── 容器：移动端居中，桌面端限宽 ─────────────────────── */
.app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    padding: 24px 20px 40px;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ── 屏幕切换 ─────────────────────────────────────────── */
.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    animation: fadeInUp .5s var(--ease) both;
}
.screen.active {
    display: flex;
}

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

/* ── 落地页 ───────────────────────────────────────────── */
.landing {
    justify-content: center;
    text-align: center;
    gap: 6px;
}
.landing-brand {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--t2);
    margin: 4px 0 16px;
}
.landing-eyebrow {
    font-size: 40px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--brand-glow);
    margin-bottom: 14px;
    line-height: 1.15;
}
.landing-title {
    font-size: 40px;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 1px;
    margin-bottom: 30px;
}
.landing-title .accent {
    background: var(--rainbow);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.landing-sub {
    font-size: 14px;
    color: var(--t2);
    margin: 18px 0 30px;
}
.landing-coin {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 22px;
    box-shadow: 0 0 32px rgba(222, 1, 86, .35), 0 0 80px rgba(222, 1, 86, .15);
    animation: coinFloat 3.2s var(--ease) infinite alternate;
}
@keyframes coinFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-7px); }
}

/* 七宗罪罪状墙（两行均匀分布） */
.sin-wall {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 0;
    margin: 0;
    padding: 14px 6px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
}
.sin-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    flex: 1 1 25%;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--t1);
}
.sin-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--t3);
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}
.sin-item:nth-child(1) .sin-dot { background: #FF3B81; }
.sin-item:nth-child(2) .sin-dot { background: #F5A623; }
.sin-item:nth-child(3) .sin-dot { background: #2DD4BF; }
.sin-item:nth-child(4) .sin-dot { background: #FF4D6D; }
.sin-item:nth-child(5) .sin-dot { background: #8B7BFF; }
.sin-item:nth-child(6) .sin-dot { background: #5B8DEF; }
.sin-item:nth-child(7) .sin-dot { background: #DE0156; }
.landing-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 34px;
}
.preview-card {
    width: 100px;
    padding: 16px 8px 12px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform .2s;
}
.preview-good {
    background: rgba(22,199,132,.08);
    border: 1.5px solid rgba(22,199,132,.25);
}
.preview-bad {
    background: rgba(255,77,109,.08);
    border: 1.5px solid rgba(255,77,109,.25);
}
.preview-avatar {
    font-size: 36px;
    line-height: 1;
}
.preview-name {
    font-size: 11px;
    font-weight: 800;
    color: var(--t2);
    text-align: center;
}
.preview-good .preview-name { color: #4ade80; }
.preview-bad .preview-name { color: #ff8fa3; }
.preview-vs {
    font-size: 13px;
    font-weight: 900;
    color: var(--t3);
    letter-spacing: 2px;
}

/* ── 按钮 ─────────────────────────────────────────────── */
.btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    border-radius: var(--r-md);
    transition: transform .15s var(--ease), box-shadow .3s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn-brand {
    background: linear-gradient(135deg, var(--brand), var(--brand-glow));
    color: #fff;
    font-size: 17px;
    padding: 16px 24px;
    box-shadow: 0 8px 28px rgba(222, 1, 86, .35);
    width: 100%;
}
.btn-brand:hover { box-shadow: 0 10px 36px rgba(222, 1, 86, .5); }
.btn-ghost {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line-strong);
    color: var(--t2);
    font-size: 14px;
    padding: 13px 20px;
}

/* ── 答题页 ───────────────────────────────────────────── */
.quiz-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 12px 0 14px;
    min-height: 32px;
}
.quiz-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--t3);
    font-variant-numeric: tabular-nums;
    text-align: center;
    flex: 1;
}
.quiz-count b { color: var(--brand-glow); font-size: 16px; }
.quiz-spacer {
    width: 60px;
}
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--t3);
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    padding: 6px 12px;
    width: auto;
    white-space: nowrap;
    transition: all .2s;
}
.btn-back:hover {
    color: var(--t1);
    border-color: var(--line-strong);
}
.btn-back:active { transform: scale(.96); }
.progress-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    overflow: hidden;
    margin-bottom: 30px;
}
.progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--rainbow);
    transition: width .4s var(--ease);
}

.question-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.q-tag {
    display: inline-block;
    align-self: flex-start;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--brand-glow);
    background: rgba(222, 1, 86, .1);
    border: 1px solid rgba(222, 1, 86, .25);
    border-radius: 999px;
    padding: 3px 10px;
    margin-bottom: 12px;
}
.q-hint {
    font-size: 15.5px;
    font-weight: 700;
    color: var(--t2);
    margin-bottom: 10px;
    line-height: 1.5;
}
.question-text {
    font-size: 23px;
    font-weight: 800;
    line-height: 1.45;
    margin-bottom: 8px;
}
.question-sub {
    font-size: 13px;
    color: var(--t3);
    margin-bottom: 24px;
}
.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.option {
    text-align: left;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    padding: 17px 18px;
    color: var(--t1);
    font-size: 15.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s var(--ease);
    display: flex;
    align-items: center;
    gap: 12px;
    touch-action: manipulation; /* iOS：消除双击缩放判定，点按即响应 */
}
/* 悬停只做轻微反馈，不做粉色高亮（避免被误认为已选中） */
.option:hover {
    border-color: rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .04);
}
.option:active {
    background: rgba(255, 255, 255, .1);
    border-color: var(--brand-glow);
}
.option .opt-key {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--t3);
    flex-shrink: 0;
    transition: all .2s;
}
.option:hover .opt-key {
    background: rgba(255, 255, 255, .12);
    color: var(--t1);
}

/* 多选题选中态（元认知多选）：强反馈——渐变粉底 + 光晕 + 键标弹跳，一眼可见 */
.option.selected {
    border-color: var(--brand-glow);
    background: linear-gradient(135deg, rgba(222, 1, 86, .22), rgba(222, 1, 86, .10));
    box-shadow: 0 0 0 1px rgba(222, 1, 86, .4), 0 6px 24px rgba(222, 1, 86, .18);
}
.option.selected .opt-key {
    background: var(--brand);
    color: #fff;
    box-shadow: 0 0 14px rgba(222, 1, 86, .55);
    animation: keyPop .28s var(--ease);
}
.option.selected .opt-label {
    color: #fff;
}
@keyframes keyPop {
    0% { transform: scale(.8); }
    60% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* 多选确认按钮（仅元认知题显示） */
.btn-confirm {
    margin-top: 14px;
    width: 100%;
}

/* 触摸设备（手机/微信）：无 hover 残留，点按即 active */
@media (hover: none) {
    .option:hover {
        border-color: var(--line);
        background: var(--surface);
    }
    .option:hover .opt-key {
        background: rgba(255, 255, 255, .06);
        color: var(--t3);
    }
}

/* ── 结果页 / 卡片 ────────────────────────────────────── */
.result-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* 这是要被 html2canvas 截图的区域 */
.card {
    position: relative;
    background:
        radial-gradient(700px 400px at 90% -5%, rgba(222, 1, 86, .16), transparent 55%),
        linear-gradient(165deg, #1A1017, #0C0A10);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    padding: 26px 22px 22px;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--rainbow);
}
.card-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--t3);
    margin-bottom: 14px;
}
.card-persona {
    font-size: 30px;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 6px;
    padding-right: 108px; /* 右上角雷达图让位，长标题自动换行 */
}
.card-persona.gradient {
    background: var(--rainbow);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.card-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 16px;
}
.card-judge {
    font-size: 14px;
    color: var(--t2);
    line-height: 1.6;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .03);
    border-left: 3px solid var(--brand);
    border-radius: 0 10px 10px 0;
    margin-bottom: 18px;
}

/* 散户毒度条（社交货币感） */
.card-tox {
    margin: 20px 0 16px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .03);
    border-radius: 12px;
}
.tox-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 8px;
}
.tox-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--t3);
}
.tox-num {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.tox-max {
    font-size: 12px;
    color: var(--t3);
    font-weight: 700;
}
.tox-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    overflow: hidden;
}
.tox-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--rainbow);
    transition: width .6s var(--ease);
}

.radar-box {
    position: absolute;
    top: 44px;
    right: 20px;
    width: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.radar-title {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--t3);
    text-align: center;
}
.radar-box canvas {
    max-width: 100%;
    height: auto;
}

/* ── 卡片视觉区：头像+雷达并排（毒度上方）────────────── */
.card-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 4px 0 18px;
}
.card-avatar {
    flex-shrink: 0;
    width: 172px;
    height: 196px;
    border-radius: 18px;
    border: 2px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.03);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
}
.avatar-placeholder {
    font-size: 56px;
    line-height: 1;
    filter: grayscale(.3);
}
.avatar-img {
    width: 142px;
    height: 142px;
    object-fit: cover;
    border-radius: 16px;
    image-rendering: pixelated;
}
.avatar-label {
    font-size: 14px;
    font-weight: 800;
    color: var(--t3);
    text-align: center;
    line-height: 1.3;
    max-width: 150px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.card-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--t3);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.card-section-label::before {
    content: "";
    width: 3px; height: 12px;
    border-radius: 2px;
    background: var(--brand-glow);
}
.card-affirm {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--t1);
    line-height: 1.6;
    margin-bottom: 16px;
}

/* ── 组合解读（主罪/副罪/亮点/雷区/引擎/元认知）────────── */
.combo-box {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 18px;
}
.combo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--t2);
    line-height: 1.6;
    background: rgba(255, 255, 255, .03);
    border-radius: 12px;
    padding: 11px 13px;
}
.combo-tag {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    margin-top: 1px;
    letter-spacing: .5px;
}
.combo-tag.main { background: rgba(222, 1, 86, .16); color: #ff8fb6; }
.combo-tag.sub { background: rgba(255, 77, 109, .12); color: #ff8fa3; }
.combo-tag.light { background: rgba(45, 212, 191, .12); color: #5eead4; }
.combo-tag.risk { background: rgba(245, 166, 35, .12); color: #fbbf24; }
.combo-tag.engine { background: rgba(139, 123, 255, .14); color: #b3a6ff; }
.combo-tag.meta { background: rgba(91, 141, 239, .14); color: #9db8f2; }
.card-reality {
    font-size: 13px;
    color: var(--t2);
    line-height: 1.6;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .03);
    border-radius: 12px;
    margin-bottom: 16px;
}
.reality-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.tone-win { background: rgba(22, 199, 132, .15); color: #4ade80; }
.tone-flat { background: rgba(245, 166, 35, .15); color: #fbbf24; }
.tone-lose { background: rgba(255, 77, 109, .15); color: #ff8fa3; }
.tone-hide { background: rgba(139, 123, 255, .15); color: #b3a6ff; }

.card-antidote {
    font-size: 13.5px;
    color: var(--teal);
    font-weight: 600;
    line-height: 1.6;
    padding: 12px 14px;
    background: rgba(45, 212, 191, .08);
    border: 1px solid rgba(45, 212, 191, .2);
    border-radius: 12px;
    margin-bottom: 20px;
}
.card-antidote b { color: #5eead4; }

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.card-brand {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.card-brand .cb-name {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .5px;
}
.card-brand .cb-slogan {
    font-size: 10.5px;
    color: var(--t3);
}
.card-brand .cb-handles {
    font-size: 10.5px;
    color: var(--brand-soft);
    font-weight: 700;
}
.card-qr {
    text-align: center;
    flex-shrink: 0;
}
.card-qr canvas, .card-qr img {
    display: block;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
}
.card-qr .qr-tip {
    font-size: 9px;
    color: var(--t3);
    margin-top: 4px;
}

.card-disclaimer {
    font-size: 9.5px;
    color: var(--t3);
    line-height: 1.5;
    margin-top: 16px;
    opacity: .8;
}

/* ── 结果页操作按钮 ───────────────────────────────────── */
.result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.result-hint {
    font-size: 12px;
    color: var(--t3);
    text-align: center;
    margin-top: 2px;
}

/* ── 加载态 ───────────────────────────────────────────── */
.loading {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 14, .92);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 999;
}
.loading.active { display: flex; }
.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(255, 255, 255, .12);
    border-top-color: var(--brand-glow);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    font-size: 14px;
    color: var(--t2);
    font-weight: 600;
}

/* ── 桌面端微调 ───────────────────────────────────────── */
@media (min-width: 520px) {
    .app { padding-top: 40px; }
}

/* ── 复制提示 toast ───────────────────────────────────── */
.toast {
    position: fixed;
    left: 50%;
    bottom: 48px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(23, 23, 31, .96);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    padding: 12px 22px;
    font-size: 14px;
    font-weight: 700;
    color: var(--t1);
    box-shadow: 0 12px 36px rgba(0, 0, 0, .5);
    opacity: 0;
    pointer-events: none;
    transition: all .3s var(--ease);
    z-index: 1100;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
