/* ============================================
   命理乾坤 — Premium Styles
   古风玄学主题 · 玻璃态 · 丝滑动效
   ============================================ */

/* === CSS Variables === */
:root {
    /* Light Theme */
    --bg-primary: #faf7f2;
    --bg-secondary: #f0ebe0;
    --bg-card: rgba(255, 255, 255, 0.72);
    --bg-card-hover: rgba(255, 255, 255, 0.88);
    --text-primary: #2c2416;
    --text-secondary: #6b5e4a;
    --text-tertiary: #9b8d7a;
    --border-color: rgba(139, 119, 90, 0.15);
    --border-glow: rgba(180, 120, 60, 0.25);
    --accent: #b8472e;
    --accent-light: #d47050;
    --accent-gold: #c4943a;
    --accent-gold-light: #e0b860;
    --gold: #c4943a;
    --success: #5a8a4a;
    --success-bg: rgba(90, 138, 74, 0.08);
    --danger: #c0392b;
    --card-shadow: 0 4px 24px rgba(44, 36, 22, 0.06), 0 1px 4px rgba(44, 36, 22, 0.04);
    --card-shadow-hover: 0 8px 40px rgba(44, 36, 22, 0.1), 0 2px 8px rgba(44, 36, 22, 0.06);
    --glass-blur: blur(24px) saturate(160%);
    --glass-border: 1px solid rgba(139, 119, 90, 0.12);
    --gradient-hero: linear-gradient(135deg, #b8472e 0%, #c4943a 50%, #d47050 100%);
    --gradient-card: linear-gradient(135deg, rgba(184, 71, 46, 0.04) 0%, rgba(196, 148, 58, 0.06) 100%);
    --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
    --bg-primary: #1a1612;
    --bg-secondary: #241e18;
    --bg-card: rgba(30, 26, 20, 0.78);
    --bg-card-hover: rgba(40, 34, 26, 0.88);
    --text-primary: #e8e0d0;
    --text-secondary: #b0a590;
    --text-tertiary: #7a7060;
    --border-color: rgba(180, 160, 130, 0.12);
    --border-glow: rgba(200, 140, 60, 0.3);
    --accent: #d47050;
    --accent-light: #e89070;
    --accent-gold: #d4a840;
    --accent-gold-light: #e8c870;
    --gold: #d4a840;
    --success: #7ab868;
    --success-bg: rgba(122, 184, 104, 0.1);
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), 0 1px 4px rgba(0, 0, 0, 0.15);
    --card-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
    --glass-blur: blur(24px) saturate(140%);
    --glass-border: 1px solid rgba(180, 160, 130, 0.1);
    --gradient-hero: linear-gradient(135deg, #d47050 0%, #d4a840 50%, #e89070 100%);
    --gradient-card: linear-gradient(135deg, rgba(212, 112, 80, 0.06) 0%, rgba(212, 168, 64, 0.08) 100%);
}

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100dvh;
    overflow-x: hidden;
    transition: background-color 0.4s var(--transition-smooth),
                color 0.4s var(--transition-smooth);
}

h1, h2, h3, h4 {
    font-family: 'Noto Serif SC', 'STSong', 'SimSun', serif;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
}

/* === Particle Canvas === */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* === Theme Toggle === */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: var(--glass-border);
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s var(--transition-smooth);
    box-shadow: var(--card-shadow);
}

.theme-toggle:hover {
    transform: scale(1.08);
    box-shadow: var(--card-shadow-hover);
    color: var(--accent-gold);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    transition: all 0.3s var(--transition-smooth);
}

[data-theme="light"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: block; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

/* === App Container === */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* === Step Sections === */
.step-section {
    display: none;
    animation: fadeSlideIn 0.5s var(--transition-smooth);
}

.step-section.active {
    display: block;
}

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

/* === Hero Header === */
.hero-header {
    text-align: center;
    padding: 40px 0 32px;
}

.hero-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    color: var(--accent);
    opacity: 0;
    animation: heroReveal 0.8s var(--transition-bounce) 0.1s forwards;
}

.hero-icon svg {
    width: 100%;
    height: 100%;
}

@keyframes heroReveal {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 900;
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: 0.08em;
    opacity: 0;
    animation: heroReveal 0.8s var(--transition-bounce) 0.2s forwards;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 0.15em;
    margin-bottom: 8px;
    opacity: 0;
    animation: heroReveal 0.8s var(--transition-bounce) 0.3s forwards;
}

.hero-desc {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    max-width: 480px;
    margin: 0 auto;
    opacity: 0;
    animation: heroReveal 0.8s var(--transition-bounce) 0.4s forwards;
}

/* === Marketing CTA Strip === */
.marketing-cta-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 840px;
    margin: 1.5rem auto 1rem;
    padding: 0 1rem;
}
.cta-strip-item {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    text-align: center;
    transition: all 0.3s var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    animation: heroReveal 0.6s var(--transition-bounce) 0.5s forwards;
    opacity: 0;
}
.cta-strip-item:nth-child(2) { animation-delay: 0.6s; }
.cta-strip-item:nth-child(3) { animation-delay: 0.7s; }
.cta-strip-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-glow);
}
.cta-strip-icon {
    font-size: 1.6rem;
}
.cta-strip-item strong {
    font-size: 0.95rem;
    color: var(--gold, #d4a574);
}
.cta-strip-item span:last-child {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
@media (max-width: 768px) {
    .marketing-cta-strip {
        grid-template-columns: 1fr;
        gap: 0.7rem;
    }
    .cta-strip-item {
        flex-direction: row;
        text-align: left;
        padding: 0.8rem 1rem;
    }
    .cta-strip-item span:last-child { font-size: 0.75rem; }
}

/* === Glass Card === */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: var(--card-shadow);
    transition: all 0.4s var(--transition-smooth);
}

.glass-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-header {
    text-align: center;
    margin-bottom: 28px;
}

.card-badge {
    display: inline-block;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    background: var(--gradient-card);
    color: var(--accent);
    border: 1px solid var(--border-glow);
    margin-bottom: 12px;
}

.card-badge.success {
    color: var(--success);
    background: var(--success-bg);
    border-color: rgba(90, 138, 74, 0.2);
}

.card-badge.badge-wechat {
    color: #07c160;
    background: rgba(7, 193, 96, 0.1);
    border-color: rgba(7, 193, 96, 0.2);
}

.card-badge.badge-alipay {
    color: #1677ff;
    background: rgba(22, 119, 255, 0.1);
    border-color: rgba(22, 119, 255, 0.2);
}

.card-title {
    font-size: 1.4rem;
    color: var(--text-primary);
}

/* === Form === */
.birth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    grid-template-columns: 1.2fr 0.8fr;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
}

.form-group input,
.form-group select {
    height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    border: var(--glass-border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.25s var(--transition-smooth);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b5e4a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--border-glow);
    box-shadow: 0 0 0 3px rgba(180, 120, 60, 0.1);
    background: var(--bg-card);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

/* === 年代快捷按钮 === */
.decade-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.decade-btns button {
    flex: 1;
    min-width: 44px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s var(--transition-smooth);
}

.decade-btns button:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.decade-btns button.active {
    background: var(--gradient-hero);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}

/* === 年月日三级联动 === */
.date-selects {
    display: flex;
    align-items: center;
    gap: 4px;
}

.date-selects select {
    height: 48px;
    padding: 0 12px;
    border-radius: 12px;
    border: var(--glass-border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.25s var(--transition-smooth);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b5e4a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    cursor: pointer;
}

.date-selects select:focus {
    border-color: var(--border-glow);
    box-shadow: 0 0 0 3px rgba(180, 120, 60, 0.1);
    background: var(--bg-card);
}

.date-selects select#birthYear {
    flex: 3;
    padding-right: 28px;
}

.date-selects select#birthMonth {
    flex: 2;
    padding-right: 28px;
}

.date-selects select#birthDay {
    flex: 2;
    padding-right: 28px;
}

.date-sep {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 500;
    flex-shrink: 0;
}

.form-hint {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-tertiary);
    letter-spacing: 0.03em;
    min-height: 1.2em;
}

/* === Buttons === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: var(--gradient-hero);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s var(--transition-bounce);
    letter-spacing: 0.05em;
    box-shadow: 0 4px 16px rgba(184, 71, 46, 0.25);
    margin-top: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(184, 71, 46, 0.35);
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s var(--transition-smooth);
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    border: var(--glass-border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-glow);
    color: var(--text-primary);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
}

.magnetic-btn {
    transition: transform 0.3s var(--transition-bounce);
}

.magnetic-btn:hover {
    transform: scale(1.03);
}

/* === Features Grid === */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 32px;
}

.feature-item {
    padding: 24px;
    border-radius: 16px;
    background: var(--bg-card);
    border: var(--glass-border);
    text-align: center;
    transition: all 0.3s var(--transition-smooth);
    cursor: default;
}

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-glow);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feature-item h3 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.feature-item p {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* === Trust Badges === */
.trust-badges {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 700px;
    margin: 2rem auto 1.5rem;
    padding: 0 1rem;
    flex-wrap: wrap;
}
.trust-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 80px;
}
.trust-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold, #d4a574);
    font-family: 'Noto Serif SC', serif;
}
.trust-label {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}
.hero-cta-bottom {
    text-align: center;
    margin: 1.5rem auto;
    padding: 1.5rem 1rem;
    max-width: 600px;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: 16px;
}
.hero-cta-bottom p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}
@media (max-width: 600px) {
    .trust-badges { gap: 1rem; }
    .trust-num { font-size: 1.2rem; }
    .trust-label { font-size: 0.7rem; }
    .hero-cta-bottom { margin: 1rem 0.5rem; padding: 1.2rem 0.8rem; }
    .hero-cta-bottom p { font-size: 0.9rem; }
}

/* === Bazi Display === */
.bazi-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.bazi-pillar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 20px;
    border-radius: 14px;
    background: var(--bg-secondary);
    border: var(--glass-border);
    min-width: 72px;
    transition: all 0.3s var(--transition-smooth);
}

.bazi-pillar:hover {
    transform: translateY(-2px);
    border-color: var(--border-glow);
    box-shadow: var(--card-shadow-hover);
}

.bazi-pillar .pillar-label {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bazi-pillar .pillar-chars {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.1em;
    line-height: 1.2;
}

.bazi-pillar .pillar-stem {
    font-size: 0.75rem;
    color: var(--accent);
    margin-top: 2px;
}

/* === Info Grid === */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.info-item {
    padding: 16px;
    border-radius: 12px;
    background: var(--bg-secondary);
    text-align: center;
    border: var(--glass-border);
}

.info-item .info-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.info-item .info-value {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* === Analysis Preview === */
.analysis-preview {
    margin-bottom: 28px;
    padding: 20px;
    border-radius: 14px;
    background: var(--gradient-card);
    border: var(--glass-border);
}

.analysis-preview h3 {
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.analysis-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.analysis-item:last-child {
    border-bottom: none;
}

.analysis-item .ai-label {
    color: var(--text-tertiary);
}

.analysis-item .ai-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* === Locked Section === */
.locked-section {
    margin-top: 8px;
    padding: 28px;
    border-radius: 16px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color);
}

.locked-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.locked-header h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.lock-icon {
    width: 22px;
    height: 22px;
    color: var(--accent-gold);
}

.locked-items {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
}

.locked-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--bg-card);
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: var(--glass-border);
}

.locked-item svg {
    width: 16px;
    height: 16px;
    color: var(--accent-gold);
    flex-shrink: 0;
}

/* === Pricing === */
.pricing-title {
    text-align: center;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.pricing-grid {
    display: grid;
    gap: 12px;
}

.pricing-plan {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--bg-card);
    border: var(--glass-border);
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

.pricing-plan:hover {
    border-color: var(--border-glow);
    transform: translateX(4px);
    box-shadow: var(--card-shadow-hover);
}

.pricing-plan.recommended {
    border-color: var(--accent-gold);
    background: var(--gradient-card);
    position: relative;
}

.pricing-plan.recommended::before {
    content: '推荐';
    position: absolute;
    top: -10px;
    right: 16px;
    padding: 2px 12px;
    border-radius: 10px;
    background: var(--accent-gold);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
}

.plan-info h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.plan-info p {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}

.plan-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

/* === Preview Actions === */
.preview-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
    gap: 12px;
}

/* === Report Section === */
.report-container {
    animation: fadeSlideIn 0.5s var(--transition-smooth);
}

.report-header {
    text-align: center;
    padding: 32px 0 24px;
}

.report-header .report-badge {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 20px;
    background: var(--success-bg);
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.report-header h2 {
    font-size: 1.6rem;
    color: var(--text-primary);
}

.report-section {
    margin-bottom: 20px;
}

.report-section-title {
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 14px;
    padding-left: 14px;
    border-left: 3px solid var(--accent-gold);
}

.report-text {
    font-size: 0.92rem;
    line-height: 1.9;
    color: var(--text-secondary);
    padding: 20px;
    background: var(--bg-card);
    border-radius: 14px;
    border: var(--glass-border);
}

.report-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.report-insight {
    margin-top: 12px;
    padding: 12px 16px;
    background: var(--gradient-card);
    border-radius: 10px;
    border-left: 3px solid var(--accent-gold);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

.report-subsection {
    margin-bottom: 16px;
}

.report-subtitle {
    font-size: 0.95rem;
    color: var(--accent-gold);
    margin-bottom: 10px;
    padding-left: 8px;
    border-left: 2px solid var(--accent-gold-light);
}

/* === Five Elements Bar === */
.fe-bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.fe-label {
    width: 24px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}
.fe-bar-track {
    flex: 1;
    height: 18px;
    background: var(--bg-overlay);
    border-radius: 9px;
    overflow: hidden;
}
.fe-bar-fill {
    height: 100%;
    border-radius: 9px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.fe-value {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    min-width: 70px;
}

/* === Palace Card === */
.palace-card {
    padding: 14px 16px;
    margin-bottom: 10px;
    background: var(--gradient-card);
    border-radius: 10px;
    border-left: 3px solid var(--accent-gold-light);
}
.palace-card strong {
    color: var(--accent-gold);
}
.palace-card.current-decadal {
    border-left: 3px solid var(--accent-gold);
    background: linear-gradient(135deg, rgba(193, 39, 45, 0.12) 0%, rgba(212, 175, 55, 0.08) 100%);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.12);
}
.decadal-advice {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--accent-gold-light);
    color: var(--color-text-secondary);
    font-size: 0.92em;
    line-height: 1.6;
}

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 32px;
    animation: modalSlideIn 0.4s var(--transition-bounce);
    /* 限制弹窗最大高度，内容超出可滚动 */
    max-height: 90vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .modal-card {
        max-width: 440px;
        padding: 36px 40px;
    }
}

@media (max-width: 480px) {
    .modal-card {
        max-width: 100%;
        margin: 0;
        padding: 24px 20px;
        border-radius: 20px 20px 0 0;
        max-height: 85vh;
    }
    .modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--accent);
    color: #fff;
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.payment-details {
    text-align: center;
}

.payment-amount {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--accent);
    font-family: 'Noto Serif SC', serif;
}

.payment-desc {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin: 8px 0 24px;
}

.payment-qr {
    padding: 20px;
}

.qr-placeholder {
    width: 140px;
    height: 140px;
    margin: 0 auto 16px;
    color: var(--text-tertiary);
    opacity: 0.6;
}

.qr-placeholder svg {
    width: 100%;
    height: 100%;
}

/* 微信支付二维码 */
.payment-qr-loading {
    padding: 28px 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.payment-qr-loading .spinner-ring {
    margin: 0 auto 14px;
    width: 36px;
    height: 36px;
}

#paymentQRCode {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    margin: 12px auto;
    background: #fff;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    width: 220px;
    height: 220px;
}

#paymentQRCode canvas,
#paymentQRCode img {
    width: 200px;
    height: 200px;
}

.qr-hint {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-top: 10px;
}

.payment-status {
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 8px;
    min-height: 22px;
}

/* 演示模式按钮区域 */
.modal-actions-demo {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.modal-actions-demo .btn-primary {
    gap: 8px;
}

/* 支付方式选择 Tab */
.payment-tabs {
    display: flex;
    gap: 0;
    margin: 20px 0 16px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 4px;
}

.payment-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
}

.payment-tab .tab-icon {
    font-size: 1rem;
}

.payment-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

.payment-tab.active[data-method="wechat"] {
    color: #07c160;
}

.payment-tab.active[data-method="alipay"] {
    color: #1677ff;
}

/* 移动端：调起支付按钮 */
.payment-mobile {
    padding: 20px;
    text-align: center;
}

.payment-app-icon {
    font-size: 48px;
    margin-bottom: 16px;
    line-height: 1;
}

.payment-mobile-hint {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.6;
}

.payment-launch-btn {
    width: 100%;
    max-width: 300px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
}

/* 微信支付按钮颜色 */
.payment-launch-btn.wechat {
    background: #07c160;
    color: #fff;
}

.payment-launch-btn.wechat:hover {
    background: #06ad56;
}

/* 支付宝按钮颜色 */
.payment-launch-btn.alipay {
    background: #1677ff;
    color: #fff;
}

.payment-launch-btn.alipay:hover {
    background: #0958d9;
}

.payment-launch-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 移动端弹窗从底部弹出 */
@media (max-width: 768px) {
    .modal-overlay {
        align-items: flex-end;
    }

    .modal-card {
        max-width: 100%;
        width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 28px 20px 36px;
        animation: modalSlideUp 0.4s var(--transition-bounce);
    }

    #paymentQRCode {
        width: 180px;
        height: 180px;
    }

    #paymentQRCode canvas,
    #paymentQRCode img {
        width: 160px;
        height: 160px;
    }
}

@keyframes modalSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@media (prefers-color-scheme: dark) {
    .payment-tabs {
        background: rgba(255, 255, 255, 0.06);
    }

    .payment-tab.active {
        background: rgba(255, 255, 255, 0.12);
    }
}

[data-theme="dark"] .payment-tabs {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .payment-tab.active {
    background: rgba(255, 255, 255, 0.12);
}

.modal-actions {
    margin-top: 8px;
}

/* === Loading Overlay === */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loadingText {
    color: #fff;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
}

/* === Toast === */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 400;
    padding: 14px 28px;
    border-radius: 12px;
    background: var(--text-primary);
    color: var(--bg-primary);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.4s var(--transition-bounce);
    white-space: nowrap;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success);
    color: #fff;
}

.toast.error {
    background: var(--danger);
    color: #fff;
}

/* === Responsive === */
@media (max-width: 640px) {
    .app-container {
        padding: 20px 16px 60px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-icon {
        width: 56px;
        height: 56px;
    }

    .glass-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }

    .date-selects {
        flex-wrap: wrap;
    }

    .date-selects select {
        font-size: 0.85rem;
    }

    .decade-btns button {
        font-size: 0.72rem;
        padding: 0 6px;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .bazi-display {
        gap: 8px;
    }

    .bazi-pillar {
        padding: 12px 14px;
        min-width: 60px;
    }

    .bazi-pillar .pillar-chars {
        font-size: 1.2rem;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .locked-items {
        grid-template-columns: 1fr;
    }

    .pricing-plan {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .plan-price {
        align-self: flex-end;
    }
}

@media (max-width: 380px) {
    .hero-title {
        font-size: 1.7rem;
    }

    .bazi-pillar {
        padding: 10px 10px;
        min-width: 50px;
    }

    .bazi-pillar .pillar-chars {
        font-size: 1rem;
    }
}

/* === Accessibility === */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* === Back to Top Button === */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 24px;
    z-index: 150;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: var(--glass-border);
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--card-shadow);
    transition: all 0.3s var(--transition-smooth);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
}

@media (max-width: 480px) {
    .back-to-top {
        bottom: 20px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
}

/* === Touch Optimization for Forms === */
@media (max-width: 640px) {
    /* 防止 iOS 输入框自动缩放 */
    input[type="text"],
    input[type="number"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }

    /* 触摸目标至少 44px */
    .btn-primary,
    .btn-secondary,
    button[type="submit"],
    .decade-btns button,
    .pricing-plan button {
        min-height: 44px;
    }

    .form-group select,
    .form-group input {
        min-height: 44px;
    }

    /* 修复小屏下报告内容横向溢出 */
    .report-section {
        word-break: break-word;
        overflow-wrap: break-word;
    }
}

/* ============================================================
   导航栏
   ============================================================ */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: rgba(26, 26, 46, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.3s;
}

[data-theme="light"] .site-nav {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-logo svg { color: var(--accent-gold); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--accent-gold);
    background: rgba(212, 165, 116, 0.08);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        border-bottom: var(--glass-border);
        transform: translateY(-110%);
        transition: transform 0.3s var(--transition-smooth);
        opacity: 0;
        pointer-events: none;
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .nav-toggle { display: flex; }
}

/* ============================================================
   知识科普区块
   ============================================================ */
.knowledge-section,
.faq-section {
    max-width: 1000px;
    margin: 64px auto 0;
    padding: 0 24px;
}

.section-heading {
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.95rem;
    margin-bottom: 36px;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.knowledge-card {
    padding: 28px;
    text-align: left;
}

.knowledge-card h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.knowledge-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.75;
    margin-bottom: 10px;
}

.knowledge-link {
    display: inline-block;
    margin-top: 8px;
    color: var(--accent-gold);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: opacity 0.2s;
}

.knowledge-link:hover { opacity: 0.75; }

@media (max-width: 640px) {
    .knowledge-grid { grid-template-columns: 1fr; }
    .section-heading { font-size: 1.5rem; }
}

/* ============================================================
   FAQ 区块
   ============================================================ */
.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.faq-item {
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 24px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.2s;
    list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--accent-gold);
    transition: transform 0.3s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover { color: var(--accent-gold); }

.faq-item p {
    padding: 0 24px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.75;
}

.section-cta {
    text-align: center;
    margin-top: 28px;
    margin-bottom: 48px;
}

.section-cta .btn-secondary {
    display: inline-block;
    padding: 10px 28px;
    text-decoration: none;
}

@media (max-width: 640px) {
    .faq-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
    margin-top: 80px;
    padding: 56px 24px 28px;
    border-top: 1px solid var(--border-color);
}

.footer-inner { max-width: 1200px; margin: 0 auto; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
    gap: 36px;
    margin-bottom: 32px;
}

.footer-brand { max-width: 280px; }

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.footer-logo svg { color: var(--accent-gold); }

.footer-desc {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    line-height: 1.7;
}

.footer-links-group h4 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
}

.footer-links-group a {
    display: block;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-links-group a:hover { color: var(--accent-gold); }

.footer-text {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.footer-text.disclaimer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
    opacity: 0.6;
    font-size: 0.78rem;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.footer-bottom-links { display: flex; align-items: center; gap: 8px; }

.footer-bottom-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-bottom-links a:hover { color: var(--accent-gold); }

.footer-bottom-links span {
    color: var(--border-color);
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
    .footer-brand { max-width: none; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ============================================================
   打印样式
   ============================================================ */
@media print {
    /* 隐藏交互元素 */
    .site-nav,
    .theme-toggle,
    #particleCanvas,
    #step-form,
    #step-preview,
    .modal-overlay,
    .loading-overlay,
    .back-to-top,
    .knowledge-section,
    .faq-section,
    .site-footer,
    .preview-actions,
    .locked-section,
    #paymentModal {
        display: none !important;
    }

    /* 报告全宽显示 */
    #step-report {
        display: block !important;
        width: 100%;
        padding: 0;
    }

    .app-container {
        max-width: 100%;
        padding: 0 10mm;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 11pt;
        line-height: 1.6;
    }

    .report-section,
    .card,
    .glass-card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        break-inside: avoid;
    }

    .report-section h3,
    .report-section h2 {
        color: black !important;
    }

    .report-section p,
    .report-section span,
    .report-section li {
        color: #333 !important;
    }

    /* 八字柱表格适配 */
    .bazi-display {
        justify-content: flex-start;
    }

    .bazi-pillar {
        background: white !important;
        border: 1px solid #ccc !important;
    }

    @page {
        margin: 15mm;
        size: A4;
    }
}
