/* ═══════════════════════════════════════════════
   唐人浓度鉴定器 · 样式
   ═══════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a0f;
    --surface: #141420;
    --border: rgba(255, 255, 255, 0.08);
    --text: #f3f4f6;
    --text-dim: rgba(255, 255, 255, 0.6);
    --accent: #fbbf24;
    --accent2: #ef4444;
    --radius: 16px;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body {
    background:
        radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.06), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(239, 68, 68, 0.06), transparent 50%),
        var(--bg);
}

/* ─── 页面系统 ─── */
.page { display: none; min-height: 100dvh; padding: 20px; }
.page.active { display: flex; align-items: center; justify-content: center; }

/* ─── 首页 ─── */
.start-container {
    text-align: center;
    max-width: 420px;
    padding: 40px 20px;
}
.start-icon { font-size: 4rem; margin-bottom: 16px; animation: bounce 2s ease-in-out infinite; }
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.start-title {
    font-size: 2rem;
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #fbbf24, #ef4444, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.start-subtitle {
    font-size: 1rem;
    color: var(--text-dim);
    margin-bottom: 24px;
}
.start-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}
.start-tags span {
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-dim);
}
.btn-start {
    display: inline-block;
    padding: 16px 40px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #fbbf24, #ef4444);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3);
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(251, 191, 36, 0.4); }
.start-note {
    margin-top: 16px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
}

/* ─── 答题页 ─── */
.quiz-container { width: 100%; max-width: 520px; }
.quiz-progress { margin-bottom: 24px; }
.progress-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
    margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #ef4444);
    border-radius: 3px;
    transition: width 0.3s ease;
}
.progress-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: right;
    display: block;
}
.quiz-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 22px;
}
.quiz-question {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.6;
    margin-bottom: 24px;
    text-align: center;
}
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-option {
    display: block;
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
}
.quiz-option:hover {
    background: rgba(251, 191, 36, 0.08);
    border-color: rgba(251, 191, 36, 0.3);
    transform: translateX(4px);
}
.quiz-option.selected {
    background: rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
    transform: scale(0.98);
}

/* ─── 结果页 ─── */
.result-container { width: 100%; max-width: 480px; }
.result-card {
    background:
        radial-gradient(circle at 20% 10%, rgba(251, 191, 36, 0.08), transparent 45%),
        radial-gradient(circle at 80% 90%, rgba(239, 68, 68, 0.08), transparent 45%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 32px 22px;
    text-align: center;
}
.result-kicker {
    font-size: 0.72rem;
    letter-spacing: 3px;
    color: var(--text-dim);
    font-weight: 800;
    margin-bottom: 16px;
}
.result-emoji { font-size: 4rem; margin-bottom: 12px; }
.result-art {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
    border: 3px solid rgba(255,255,255,0.12);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.result-name {
    font-size: 1.8rem;
    font-weight: 950;
    margin-bottom: 4px;
    color: var(--accent, #fbbf24);
}
.result-title {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}
.result-subtitle {
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    margin-bottom: 20px;
}

/* 唐浓度条 */
.tang-meter {
    margin: 20px 0;
    padding: 18px;
    border-radius: 16px;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
}
.tang-meter-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    text-align: left;
    margin-bottom: 8px;
    font-weight: 700;
}
.tang-meter-bar {
    height: 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
    margin-bottom: 8px;
}
.tang-meter-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 1s ease;
}
.tang-meter-value {
    font-size: 1.6rem;
    font-weight: 900;
    text-align: center;
}
.tang-grade {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    font-size: 0.9rem;
    font-weight: 900;
    vertical-align: middle;
}
.tang-grade-label {
    font-size: 0.85rem;
    font-weight: 800;
    text-align: center;
    margin-top: 4px;
}

.result-quote {
    font-style: italic;
    color: var(--text-dim);
    margin: 16px 0;
    font-size: 0.9rem;
    line-height: 1.6;
}
.result-desc {
    text-align: left;
    line-height: 1.8;
    font-size: 0.92rem;
    color: rgba(255,255,255,0.8);
    margin: 16px 0;
}

/* 标签 */
.result-traits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 16px 0;
}
.trait-tag {
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.2);
    font-size: 0.8rem;
    font-weight: 700;
    color: #fbbf24;
}

/* 五维图 */
.result-dimensions {
    margin: 20px 0;
    padding: 18px;
    border-radius: 16px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
}
.dim-title {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 700;
    margin-bottom: 14px;
    text-align: left;
}
.dim-grid { display: flex; flex-direction: column; gap: 10px; }
.dim-item { display: grid; grid-template-columns: 70px 1fr 40px; align-items: center; gap: 10px; }
.dim-label { font-size: 0.78rem; color: var(--text-dim); text-align: right; }
.dim-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.dim-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #fbbf24, #ef4444); transition: width 0.8s ease; }
.dim-value { font-size: 0.78rem; color: var(--text-dim); font-weight: 700; }

/* 操作按钮 */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
    justify-content: center;
}
.btn-retry, .btn-share {
    padding: 14px 24px;
    border: none;
    border-radius: 14px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-retry {
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-retry:hover { background: rgba(255,255,255,0.12); }
.btn-share {
    background: linear-gradient(135deg, #fbbf24, #ef4444);
    color: #fff;
    box-shadow: 0 6px 18px rgba(251, 191, 36, 0.25);
}
.btn-share:hover { transform: translateY(-2px); }

/* ─── Toast ─── */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 12px;
    background: rgba(20, 20, 32, 0.95);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 9999;
    backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── 响应式 ─── */
@media (max-width: 480px) {
    .start-title { font-size: 1.6rem; }
    .quiz-card { padding: 22px 16px; }
    .result-card { padding: 24px 16px; }
    .result-name { font-size: 1.5rem; }
    .dim-item { grid-template-columns: 60px 1fr 36px; }
}
