/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f5f7;
    color: #1a1a1a;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Page System ===== */
.page { display: none; min-height: 100vh; }
.page.active { display: flex; flex-direction: column; }

/* ===== Brand ===== */
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-logo {
    font-size: 1.5rem; font-weight: 800; color: #e85931;
    letter-spacing: 2px;
}
.brand-sub { font-size: 0.75rem; color: #999; letter-spacing: 1px; }
.brand-small .brand-logo { font-size: 1.1rem; }
.brand-small .brand-sub { font-size: 0.65rem; }

/* ===== Buttons ===== */
.btn-primary {
    background: #e85931; color: #fff; border: none;
    padding: 14px 40px; font-size: 1rem; font-weight: 600;
    border-radius: 50px; cursor: pointer; transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(232,89,49,0.3);
}
.btn-primary:hover { background: #d44a25; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,89,49,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }

.btn-secondary {
    background: transparent; color: #e85931; border: 1.5px solid #e85931;
    padding: 12px 32px; font-size: 0.95rem; font-weight: 600;
    border-radius: 50px; cursor: pointer; transition: all 0.3s;
}
.btn-secondary:hover { background: #fff5f2; }

.btn-back {
    background: transparent; color: #999; border: none;
    padding: 8px 16px; font-size: 0.9rem; cursor: pointer;
}
.btn-back:hover { color: #666; }

/* ===== Landing Page ===== */
#page-landing { align-items: center; justify-content: center; position: relative; }
.landing-bg {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(135deg, #fff5f2 0%, #ffe8e0 50%, #ffd9cc 100%);
    z-index: -1;
}
.landing-bg::before {
    content: ''; position: absolute; top: -100px; right: -100px;
    width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(232,89,49,0.12) 0%, transparent 70%);
}
.landing-bg::after {
    content: ''; position: absolute; bottom: -50px; left: -50px;
    width: 300px; height: 300px; border-radius: 50%;
    background: radial-gradient(circle, rgba(232,89,49,0.08) 0%, transparent 70%);
}
.landing-content {
    max-width: 520px; width: 90%; text-align: center; padding: 40px 20px;
    animation: fadeInUp 0.8s ease;
}
.landing-title {
    font-size: 2.2rem; font-weight: 800; margin: 24px 0 16px;
    color: #1a1a1a; letter-spacing: 1px;
}
.landing-desc {
    font-size: 0.95rem; color: #666; margin-bottom: 40px; line-height: 1.8;
}
.landing-stats {
    display: flex; align-items: center; justify-content: center; gap: 0;
    margin-bottom: 40px;
}
.stat-item { padding: 0 24px; }
.stat-num { font-size: 2rem; font-weight: 800; color: #e85931; }
.stat-unit { font-size: 1rem; font-weight: 600; }
.stat-label { font-size: 0.8rem; color: #999; margin-top: 4px; }
.stat-divider { width: 1px; height: 40px; background: #ddd; }
.btn-start { font-size: 1.1rem; padding: 16px 48px; }
.landing-foot { font-size: 0.75rem; color: #aaa; margin-top: 20px; }

/* ===== Quiz Page ===== */
#page-quiz { background: #fff; }
.quiz-header {
    position: sticky; top: 0; background: #fff; z-index: 10;
    padding: 16px 20px 0; border-bottom: 1px solid #f0f0f0;
}
.quiz-progress-bar {
    height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden;
    margin-bottom: 12px;
}
.quiz-progress-fill {
    height: 100%; background: linear-gradient(90deg, #e85931, #ff7a50);
    border-radius: 2px; transition: width 0.4s ease; width: 0%;
}
.quiz-header-info {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 12px;
}
.quiz-section { font-size: 0.85rem; color: #e85931; font-weight: 600; }
.quiz-count { font-size: 0.85rem; color: #999; }

.quiz-body {
    flex: 1; padding: 32px 20px 100px; max-width: 600px; width: 100%;
    margin: 0 auto;
}
.quiz-question-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; }
.quiz-question-subtitle { font-size: 0.9rem; color: #999; margin-bottom: 28px; }

/* 单选/多选 */
.option-list { display: flex; flex-direction: column; gap: 12px; }
.option-item {
    display: flex; align-items: center; padding: 16px 20px;
    background: #f8f8f8; border: 2px solid transparent; border-radius: 12px;
    cursor: pointer; transition: all 0.2s; font-size: 1rem;
}
.option-item:hover { background: #f0f0f0; }
.option-item.selected {
    background: #fff5f2; border-color: #e85931; color: #e85931;
    font-weight: 600;
}
.option-radio {
    width: 22px; height: 22px; border: 2px solid #ddd; border-radius: 50%;
    margin-right: 14px; flex-shrink: 0; position: relative; transition: all 0.2s;
}
.option-checkbox {
    width: 22px; height: 22px; border: 2px solid #ddd; border-radius: 6px;
    margin-right: 14px; flex-shrink: 0; position: relative; transition: all 0.2s;
}
.option-item.selected .option-radio { border-color: #e85931; }
.option-item.selected .option-radio::after {
    content: ''; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%); width: 12px; height: 12px;
    background: #e85931; border-radius: 50%;
}
.option-item.selected .option-checkbox { border-color: #e85931; background: #e85931; }
.option-item.selected .option-checkbox::after {
    content: '✓'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%); color: #fff; font-size: 14px; font-weight: bold;
}

/* 量表对 */
.scale-pairs { display: flex; flex-direction: column; gap: 28px; }
.scale-pair {
    background: #f8f8f8; border-radius: 16px; padding: 20px;
}
.scale-pair-labels {
    display: flex; justify-content: space-between; margin-bottom: 16px;
    font-size: 0.9rem; font-weight: 500;
}
.scale-pair-left { text-align: left; max-width: 45%; }
.scale-pair-right { text-align: right; max-width: 45%; color: #e85931; }
.scale-pair-left.active { color: #e85931; font-weight: 700; }
.scale-pair-right.active { color: #e85931; font-weight: 700; }
.scale-pair-left:not(.active) { color: #666; }
.scale-pair-right:not(.active) { color: #666; }
.scale-buttons {
    display: flex; justify-content: space-between; gap: 8px;
}
.scale-btn {
    width: 44px; height: 44px; border-radius: 50%;
    border: 2px solid #ddd; background: #fff; cursor: pointer;
    font-size: 0.9rem; font-weight: 600; color: #999; transition: all 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.scale-btn:hover { border-color: #e85931; color: #e85931; }
.scale-btn.selected {
    background: #e85931; border-color: #e85931; color: #fff;
    transform: scale(1.1);
}

.quiz-footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; border-top: 1px solid #f0f0f0;
    padding: 12px 20px; display: flex; justify-content: space-between; align-items: center;
    max-width: 600px; margin: 0 auto;
}

/* ===== Loading Page ===== */
#page-loading {
    align-items: center; justify-content: center; background: linear-gradient(180deg, #fff5f2, #fff);
}
.loading-content { text-align: center; max-width: 420px; width: 90%; padding: 40px 20px; }
.loading-spinner-wrap { margin-bottom: 32px; }
.loading-spinner { animation: spin 1.2s linear infinite; }
.spinner-circle { animation: dash 1.5s ease-in-out infinite; }
.loading-title {
    font-size: 1.2rem; font-weight: 700; margin-bottom: 32px; color: #1a1a1a;
    min-height: 1.5em;
}
.loading-steps {
    text-align: left; margin-bottom: 32px; display: flex; flex-direction: column; gap: 12px;
}
.loading-step {
    display: flex; align-items: center; gap: 12px;
    font-size: 0.9rem; color: #ccc; transition: all 0.4s;
}
.loading-step.active { color: #e85931; font-weight: 500; }
.loading-step.done { color: #4caf50; }
.loading-step-icon {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid currentColor; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 10px;
}
.loading-step.active .loading-step-icon { animation: pulse 1s infinite; }
.loading-step.done .loading-step-icon::after { content: '✓'; }
.loading-progress {
    height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden; margin-bottom: 12px;
}
.loading-progress-bar {
    height: 100%; background: linear-gradient(90deg, #e85931, #ff7a50);
    border-radius: 2px; transition: width 0.5s; width: 0%;
}
.loading-hint { font-size: 0.8rem; color: #bbb; }

/* ===== Result Page ===== */
#page-result { background: #f5f5f7; }
.result-header {
    background: linear-gradient(135deg, #e85931, #ff7a50);
    color: #fff; padding: 40px 20px 32px; text-align: center;
}
.result-header .brand-logo { color: #fff; }
.result-header .brand-sub { color: rgba(255,255,255,0.7); }
.result-title {
    font-size: 1.3rem; font-weight: 700; margin: 20px 0 8px;
    line-height: 1.5;
}
.result-subtitle { font-size: 0.85rem; opacity: 0.85; }
.result-body { flex: 1; max-width: 600px; width: 100%; margin: 0 auto; padding: 24px 20px; }

.country-card {
    background: #fff; border-radius: 16px; padding: 24px; margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    animation: fadeInUp 0.5s ease;
}
.country-card-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.country-card-name { display: flex; align-items: center; gap: 8px; }
.country-flag { font-size: 1.8rem; }
.country-name { font-size: 1.2rem; font-weight: 700; }
.country-probability {
    font-size: 2rem; font-weight: 800; color: #e85931;
}
.country-probability-unit { font-size: 0.9rem; font-weight: 600; }
.country-bar {
    height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; margin-bottom: 16px;
}
.country-bar-fill {
    height: 100%; background: linear-gradient(90deg, #e85931, #ff7a50);
    border-radius: 4px; transition: width 1s ease; width: 0%;
}
.country-reason {
    font-size: 0.9rem; color: #333; line-height: 1.7; margin-bottom: 12px;
}
.country-reason strong { color: #e85931; }
.country-risk {
    font-size: 0.85rem; color: #888; line-height: 1.6;
    padding: 10px 14px; background: #f8f8f8; border-radius: 8px; margin-bottom: 12px;
}
.country-risk::before { content: '⚠️ '; }
.country-action {
    font-size: 0.85rem; color: #e85931; font-weight: 500;
    padding: 8px 14px; background: #fff5f2; border-radius: 8px; display: inline-block;
}
.country-action::before { content: '→ '; }

.other-countries {
    background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.other-countries-title { font-size: 0.9rem; font-weight: 600; color: #666; margin-bottom: 12px; }
.other-country-list { display: flex; flex-wrap: wrap; gap: 8px; }
.other-country-tag {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; background: #f8f8f8; border-radius: 20px;
    font-size: 0.8rem; color: #666;
}
.other-country-tag .prob { color: #e85931; font-weight: 600; }

.overall-advice {
    background: linear-gradient(135deg, #fff5f2, #ffe8e0);
    border-radius: 16px; padding: 24px; margin-bottom: 16px;
    border-left: 4px solid #e85931;
}
.overall-advice-title { font-size: 0.9rem; font-weight: 700; color: #e85931; margin-bottom: 8px; }
.overall-advice-text { font-size: 0.9rem; color: #333; line-height: 1.7; }

.result-footer { max-width: 600px; width: 100%; margin: 0 auto; padding: 0 20px 40px; }
.result-cta {
    background: #fff; border-radius: 16px; padding: 32px 24px; text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06); margin-bottom: 16px;
}
.cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.result-disclaimer { font-size: 0.7rem; color: #bbb; text-align: center; line-height: 1.5; }

/* ===== WeChat Step (答题后微信号收集) ===== */
.wechat-step {
    text-align: center; padding: 20px 0;
    animation: fadeInUp 0.4s ease;
}
.wechat-step-icon {
    font-size: 3rem; margin-bottom: 20px;
}
.wechat-step-title {
    font-size: 1.3rem; font-weight: 700; color: #1a1a1a;
    margin-bottom: 8px; line-height: 1.5;
}
.wechat-step-desc {
    font-size: 0.88rem; color: #999; margin-bottom: 24px; line-height: 1.6;
}
.wechat-input {
    width: 100%; max-width: 360px; padding: 14px 18px;
    font-size: 1rem; border: 2px solid #e0e0e0; border-radius: 12px;
    outline: none; transition: border-color 0.2s; text-align: center;
    background: #fff; margin-bottom: 10px;
}
.wechat-input:focus { border-color: #e85931; }
.wechat-input::placeholder { color: #ccc; }
.wechat-step-note {
    font-size: 0.78rem; color: #aaa; margin-bottom: 16px;
}
.wechat-step-skip {
    font-size: 0.82rem; color: #bbb; cursor: pointer;
    text-decoration: underline; text-decoration-color: #eee;
    text-underline-offset: 3px; transition: color 0.2s;
}
.wechat-step-skip:hover { color: #e85931; }

/* ===== Starter Pack CTA ===== */
.starter-pack-section {
    max-width: 600px; width: 100%; margin: 0 auto; padding: 0 20px 16px;
}
.sp-card {
    background: #fff; border-radius: 20px; padding: 32px 24px;
    box-shadow: 0 4px 24px rgba(232,89,49,0.12);
    border: 1px solid rgba(232,89,49,0.08);
    position: relative; overflow: hidden;
    animation: fadeInUp 0.6s ease 0.3s both;
}
.sp-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, #e85931, #ff7a50, #ffb088);
}
.sp-badge {
    display: inline-block; background: linear-gradient(135deg, #e85931, #ff7a50);
    color: #fff; font-size: 0.72rem; font-weight: 600;
    padding: 4px 14px; border-radius: 20px; margin-bottom: 16px;
    letter-spacing: 1px;
}
.sp-title {
    font-size: 1.3rem; font-weight: 800; color: #1a1a1a;
    margin-bottom: 12px; line-height: 1.4;
}
.sp-desc {
    font-size: 0.88rem; color: #666; line-height: 1.7; margin-bottom: 6px;
}
.sp-desc b { color: #e85931; }
.sp-desc-sub {
    font-size: 0.92rem; color: #555; line-height: 1.8; margin-bottom: 24px;
    font-weight: 400;
}
.sp-highlight {
    color: #e85931; font-weight: 800;
}
.sp-section-label {
    font-size: 0.78rem; font-weight: 700; color: #e85931;
    letter-spacing: 1px; margin: 20px 0 10px; display: flex;
    align-items: center; gap: 8px;
}
.sp-section-label::before {
    content: ''; width: 3px; height: 14px; background: #e85931; border-radius: 2px;
}
.sp-features {
    display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px;
}
.sp-feature {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 16px; background: #fafafa; border-radius: 12px;
    transition: background 0.2s;
}
.sp-feature:hover { background: #fff5f2; }
.sp-feature-icon { font-size: 1.4rem; flex-shrink: 0; line-height: 1.5; }
.sp-feature-info { flex: 1; }
.sp-feature-name {
    font-size: 0.92rem; font-weight: 700; color: #1a1a1a; margin-bottom: 2px;
}
.sp-tag-hot {
    display: inline-block; background: #e85931; color: #fff;
    font-size: 0.62rem; font-weight: 600; padding: 1px 6px;
    border-radius: 4px; vertical-align: middle; margin-left: 4px;
}
.sp-feature-detail {
    font-size: 0.78rem; color: #999; line-height: 1.5;
}
.sp-extras {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
    margin-bottom: 20px; padding: 12px 0;
    border-top: 1px dashed #eee; border-bottom: 1px dashed #eee;
}
.sp-extras span {
    font-size: 0.8rem; color: #666;
}
.sp-price-row {
    display: flex; align-items: baseline; justify-content: center;
    gap: 10px; margin-bottom: 24px;
}
.sp-price-original {
    font-size: 0.85rem; color: #bbb; text-decoration: line-through;
}
.sp-price-current {
    font-size: 2.2rem; font-weight: 800; color: #e85931;
}
.sp-price-tag {
    font-size: 0.72rem; color: #fff; background: #e85931;
    padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.sp-buy-row {
    display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap;
}
.sp-qr { text-align: center; }
.sp-qr img {
    width: 160px; height: 160px; border-radius: 12px;
    border: 1px solid #f0f0f0;
}
.sp-qr p {
    font-size: 0.75rem; color: #999; margin-top: 8px;
}
.sp-link-btn {
    display: block; text-align: center;
    background: linear-gradient(135deg, #e85931, #ff7a50);
    color: #fff; font-size: 0.95rem; font-weight: 600;
    padding: 14px 40px; border-radius: 50px; text-decoration: none;
    transition: all 0.3s; box-shadow: 0 4px 16px rgba(232,89,49,0.3);
}
.sp-link-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(232,89,49,0.4); }
.sp-product-name {
    text-align: center; font-size: 0.85rem; font-weight: 700; color: #333;
    margin-bottom: 16px; letter-spacing: 0.5px;
}

/* ===== Result Action Buttons ===== */
.result-actions {
    display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px;
}
.btn-action {
    background: #fff; border: 1.5px solid #e85931; color: #e85931;
    font-size: 0.85rem; font-weight: 600; padding: 10px 22px;
    border-radius: 50px; cursor: pointer; transition: all 0.3s;
}
.btn-action:hover { background: #fff5f2; transform: translateY(-1px); }
.btn-action:active { transform: translateY(0); }
.btn-restart {
    background: transparent; border: none; color: #999;
    font-size: 0.8rem; padding: 10px 16px; cursor: pointer;
    text-decoration: underline; text-decoration-color: #ddd; text-underline-offset: 3px;
}
.btn-restart:hover { color: #666; }
.result-toast {
    position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.8); color: #fff; font-size: 0.82rem;
    padding: 10px 24px; border-radius: 50px; z-index: 9999;
    animation: fadeInUp 0.3s ease; pointer-events: none;
}

/* ===== Animations ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dashoffset: 226; }
    50% { stroke-dashoffset: 56; }
    100% { stroke-dashoffset: 226; transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .landing-title { font-size: 1.8rem; }
    .quiz-question-title { font-size: 1.2rem; }
    .scale-btn { width: 38px; height: 38px; font-size: 0.8rem; }
    .country-probability { font-size: 1.6rem; }
}
