/* ==========================================================================
   ☯️ 灵签阁 · 宝宝起名板块核心 CSS 样式系统
   ========================================================================== */

/* 1. CSS 变量与设计令牌 (Tokens) */
:root {
    --xuan-bg: #130E0A;           /* 极深玄色背景 */
    --xuan-card: #201712;         /* 卡片背景 */
    --gold-primary: #C9A05C;      /* 流金主色 */
    --gold-light: #F5E6B8;        /* 淡金 */
    --gold-dark: #8B6914;         /* 暗金 */
    --vermillion: #D9381E;        /* 朱砂红 */
    --vermillion-light: #F2573D;  /* 朱砂红 悬停 */
    --vermillion-dark: #B32410;   /* 朱砂红 点击 */
    --paper-warm: #F4EFE6;        /* 宣纸米黄 */
    --text-ink: #2C2825;          /* 墨香黑 */
    --text-light: #E8E2D9;        /* 纸张白 */
    --text-muted: #8E8377;        /* 烟灰色 */
    --border-gold: rgba(201, 160, 94, 0.25);
    
    --font-title: 'Zhi Mang Xing', 'KaiTi', cursive;
    --font-body: 'Noto Serif SC', 'Georgia', serif;
    --transition-base: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s ease;
}

/* 2. 重置与基础布局 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--xuan-bg);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 3. 背景与粒子特效 */
.fixed-bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, var(--xuan-bg) 0%, var(--xuan-card) 50%, var(--xuan-bg) 100%);
    z-index: -3;
}

.background-pattern {
    position: fixed;
    inset: 0;
    background-image: url('https://images.unsplash.com/photo-1608889174653-81f1b203c9b7?q=80&w=2000&auto=format&fit=crop'); /* Placeholder water color */
    background-size: cover;
    background-position: center;
    opacity: 0.08;
    z-index: -2;
    filter: grayscale(1);
}

.radial-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(201, 160, 94, 0.12) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* 萤火上升动画 */
.glow-rise-container {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.glow-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: rgba(245, 230, 184, 0.45);
    border-radius: 50%;
    filter: blur(1px);
    box-shadow: 0 0 10px rgba(201, 160, 94, 0.8);
    animation: glow-rise 6s infinite linear;
}

@keyframes glow-rise {
    0% {
        transform: translateY(110vh) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-10vh) scale(1.2);
        opacity: 0;
    }
}

/* 4. 页头 Logo 与操作栏 */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 50;
    background-color: rgba(19, 14, 10, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(201, 160, 94, 0.15);
    padding-top: env(safe-area-inset-top);
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--gold-primary);
}

.logo-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 5px rgba(201, 160, 94, 0.4));
    animation: pulse-glow 3s infinite ease-in-out;
}

.brand-name {
    font-family: var(--font-title);
    font-size: 26px;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 0.1em;
}

.circle-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-gold);
    background: transparent;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.circle-btn:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}

.circle-btn.playing {
    animation: rotate-music 4s infinite linear;
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}

@keyframes rotate-music {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 5. 主内容容器 */
.app-main {
    margin-top: 60px;
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    padding: 40px 16px 80px 16px;
}

.content-wrapper {
    width: 100%;
    max-width: 600px;
}

.app-section {
    width: 100%;
}

.app-section.hidden {
    display: none !important;
}

/* 6. 输入表单模块 */
.hero-header {
    text-align: center;
    margin-bottom: 30px;
}

.calligraphy-title {
    font-family: var(--font-title);
    font-size: 48px;
    font-weight: normal;
    background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-primary) 60%, var(--gold-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.8;
}

.naming-form {
    background-color: rgba(32, 23, 18, 0.95);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.form-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 15px;
    color: var(--gold-light);
    letter-spacing: 0.05em;
}

.required {
    color: var(--vermillion);
}

/* 姓氏输入框 (下划线风格) */
.border-bottom-vermillion input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(217, 56, 30, 0.3);
    color: var(--gold-light);
    font-size: 20px;
    font-family: var(--font-body);
    padding: 8px 0;
    text-align: center;
    outline: none;
    transition: var(--transition-base);
    letter-spacing: 0.1em;
}

.border-bottom-vermillion input:focus {
    border-bottom-color: var(--vermillion);
}

/* 日期输入框 */
.date-input {
    width: 100%;
    background-color: rgba(19, 14, 10, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    padding: 10px 12px;
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 15px;
    outline: none;
    transition: var(--transition-fast);
}

.date-input:focus {
    border-color: var(--gold-primary);
}

/* 单选框按钮组 (乾造 / 坤造) */
.radio-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.radio-label {
    position: relative;
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background-color: rgba(19, 14, 10, 0.3);
}

.radio-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-label span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.radio-label.active {
    border-color: var(--gold-primary);
    background-color: rgba(201, 160, 94, 0.1);
}

.radio-label.active span {
    color: var(--gold-light);
}

/* 五行复选框多选 */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.checkbox-label {
    position: relative;
    border: 1px solid var(--border-gold);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-fast);
    background-color: rgba(19, 14, 10, 0.3);
}

.checkbox-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-label span {
    font-size: 13px;
    color: var(--text-muted);
}

.checkbox-label.active {
    border-color: var(--gold-primary);
    background-color: rgba(201, 160, 94, 0.1);
}

.checkbox-label.active span {
    color: var(--gold-light);
}

/* 核心行动按钮 */
.submit-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--vermillion-light) 0%, var(--vermillion) 50%, var(--vermillion-dark) 100%);
    color: var(--text-light);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(217, 56, 30, 0.3);
    transition: var(--transition-base);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(217, 56, 30, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.animate-spin-slow {
    animation: rotate-music 6s infinite linear;
}

/* 7. 排盘加载动效 */
.loading-container {
    text-align: center;
    padding: 80px 20px;
    background-color: rgba(32, 23, 18, 0.95);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.taiji-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
}

.taiji-svg {
    width: 100%;
    height: 100%;
    animation: rotate-music 3s infinite linear;
    filter: drop-shadow(0 0 10px rgba(201, 160, 94, 0.4));
}

.loading-title {
    font-family: var(--font-title);
    font-size: 32px;
    color: var(--gold-light);
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.loading-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    max-width: 320px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

.loading-progress-bar {
    width: 80%;
    height: 3px;
    background-color: rgba(201, 160, 94, 0.1);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-fill {
    width: 0;
    height: 100%;
    background-color: var(--gold-primary);
    animation: progress-fill-anim 3s infinite ease-in-out;
}

@keyframes progress-fill-anim {
    0% { width: 0; }
    50% { width: 85%; }
    100% { width: 100%; }
}

/* 8. 宣纸卷轴报告页 */
.naming-scroll {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
    filter: drop-shadow(0 10px 25px rgba(0,0,0,0.6));
}

.scroll-handle {
    height: 14px;
    background: linear-gradient(90deg, #5A3D28 0%, #C9A05C 10%, #E8D4A2 50%, #C9A05C 90%, #5A3D28 100%);
    border-radius: 7px;
    position: relative;
    z-index: 10;
}

.scroll-handle.top {
    margin-bottom: -4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.scroll-handle.bottom {
    margin-top: -4px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.4);
}

.scroll-body {
    background-color: var(--paper-warm);
    color: var(--text-ink);
    padding: 36px 24px;
    border-left: 2px solid #D8CBB5;
    border-right: 2px solid #D8CBB5;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

/* 印章特效 */
.seal-container {
    position: absolute;
    top: 20px;
    right: 20px;
    pointer-events: none;
    transform: rotate(-10deg);
    opacity: 0.85;
}

.seal-stamp {
    font-family: var(--font-title);
    font-size: 16px;
    color: var(--vermillion);
    border: 2px solid var(--vermillion);
    padding: 4px 6px;
    border-radius: 4px;
    letter-spacing: 0.1em;
    font-weight: bold;
    display: inline-block;
    box-shadow: 0 0 2px rgba(217, 56, 30, 0.4);
    background-color: rgba(244, 239, 230, 0.6);
}

.scroll-title {
    text-align: center;
    font-size: 32px;
    color: #4C261A;
    margin-bottom: 24px;
    letter-spacing: 0.1em;
}

/* 八字命盘看板 */
.bazi-board {
    background-color: rgba(216, 203, 181, 0.4);
    border: 1px solid rgba(139, 105, 20, 0.15);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 30px;
}

.board-title {
    font-size: 14px;
    color: #6C4235;
    font-weight: 600;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(139, 105, 20, 0.1);
    padding-bottom: 6px;
}

.board-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.grid-cell {
    font-size: 13px;
}

.grid-cell .lbl {
    color: #7E6857;
}

.grid-cell .val {
    font-weight: 600;
    color: var(--text-ink);
}

/* 名字卡片推荐列表 */
.names-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.name-card {
    border-bottom: 1px dashed rgba(139, 105, 20, 0.15);
    padding-bottom: 24px;
}

.name-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.name-header {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 12px;
}

.name-display {
    font-family: var(--font-title);
    font-size: 40px;
    color: #4C261A;
    line-height: 1;
    letter-spacing: 0.05em;
}

.name-props {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.prop-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.prop-badge.wuxing {
    background-color: #E2D2B8;
    color: #6A4E2C;
}

.prop-badge.stroke {
    background-color: #D3E2E6;
    color: #3C6875;
}

.prop-badge.lucky {
    background-color: #EAC9C5;
    color: var(--vermillion);
}

/* 名字解析条目 */
.name-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-row {
    font-size: 14px;
    line-height: 1.6;
}

.detail-row .tag {
    font-weight: 600;
    color: #7E4F42;
    display: inline-block;
    min-width: 45px;
}

.poetry-quote {
    background-color: rgba(216, 203, 181, 0.25);
    border-left: 3px solid var(--gold-primary);
    padding: 8px 12px;
    font-style: italic;
    color: #554C46;
    margin-top: 4px;
    border-radius: 0 4px 4px 0;
}

/* 9. 付费结缘解锁卡 */
.unlock-card {
    background-color: var(--xuan-card);
    border: 1px solid var(--gold-primary);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    margin-bottom: 24px;
}

.unlock-title {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.unlock-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.pay-btn {
    width: 100%;
    max-width: 280px;
    height: 46px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--vermillion-light) 0%, var(--vermillion) 50%, var(--vermillion-dark) 100%);
    color: var(--text-light);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(217, 56, 30, 0.25);
    transition: var(--transition-fast);
}

.pay-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(217, 56, 30, 0.35);
}

.back-action {
    text-align: center;
}

.back-btn {
    background: transparent;
    border: 1px solid var(--border-gold);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition-fast);
}

.back-btn:hover {
    color: var(--gold-primary);
    border-color: var(--gold-primary);
}

/* 10. 页脚与免责 */
.site-footer {
    text-align: center;
    padding: 40px 20px 60px 20px;
    border-top: 1px solid rgba(201, 160, 94, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.footer-blessing {
    color: var(--gold-primary);
    font-size: 14px;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
}

.footer-disclaimer {
    color: var(--text-muted);
    font-size: 11px;
    max-width: 500px;
    margin: 0 auto 12px auto;
    line-height: 1.6;
}

.footer-copyright {
    color: rgba(142, 131, 119, 0.45);
    font-size: 10px;
}

/* Pulse animation for logos */
@keyframes pulse-glow {
    0% { filter: drop-shadow(0 0 5px rgba(201, 160, 94, 0.3)); }
    50% { filter: drop-shadow(0 0 12px rgba(201, 160, 94, 0.65)); }
    100% { filter: drop-shadow(0 0 5px rgba(201, 160, 94, 0.3)); }
}

/* Responsive Overrides */
@media(max-width: 480px) {
    .calligraphy-title {
        font-size: 38px;
    }
    .naming-form {
        padding: 16px;
    }
    .scroll-body {
        padding: 24px 16px;
    }
    .name-display {
        font-size: 32px;
    }
}
