:root {
    --bg-primary: #0a0a0c;
    --acc-dark: #141418;
    --accent-primary: #2ed573;
    --text-primary: #e0e0e6;
    --text-light: #f8f8fa;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(20, 20, 24, 0.9);
}

@font-face { 
    font-family: 'InterLocal'; 
    src: url('fonts/Inter-Regular.woff2') format('woff2'); 
    font-weight: 400; 
    font-display: swap; /* 【平滑切换】消除浏览器 Slow network 干预报错 */
}

* { margin:0; padding:0; box-sizing:border-box; font-family:'InterLocal', 'Inter', -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    background-image: radial-gradient(circle at 50% 50%, rgba(46, 213, 115, 0.05) 0%, transparent 60%);
    overflow-y: scroll; /* 【定海神针】强制垂直滚动条，消灭水平抖动 */
}

#app {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* 顶级导航栏 */
.master-nav {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    padding: 0.5rem;
    margin-top: 2.5rem;
    backdrop-filter: blur(12px);
    z-index: 100;
    /* 【防漂移】固定宽度上限，不随内容高度变化而偏移 */
    width: fit-content;
    flex-shrink: 0;
}
.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 40px;
}
.nav-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }
.nav-divider { width: 1px; height: 30px; background: rgba(255, 255, 255, 0.1); margin: 0 0.5rem; }

/* 核心对齐容器 */
.container {
    width: 100%;
    margin-top: 2.5rem;
    padding: 0 1.5rem 5rem;
    display: flex;
    justify-content: center;
}
.pane {
    display: none;
    width: 100%;
    max-width: 950px; /* 【智能自适应】最大 950px，小屏下自动占满 100% */
    margin: 0 auto;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.pane.active { display: block; }

.glass-box {
    background: var(--glass-bg);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3.5rem;
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    width: 100%;
}

/* 首页对齐（特例：居中） */
#home-pane .glass-box { text-align: center; }
#home-pane h1 { font-size: 3.5rem; font-weight: 800; margin-bottom: 0.5rem; }
#home-pane h2 { font-size: 1.1rem; color: var(--accent-primary); letter-spacing: 4px; margin-bottom: 3rem; }

/* 列表容器：利用 grid 保持对齐 */
.info-grid { display: grid; grid-template-columns: repeat(1, 1fr); gap: 1.5rem; margin: 3rem 0; text-align: left; }
@media (min-width: 800px) { .info-grid { grid-template-columns: repeat(3, 1fr); } }
.info-item { background: rgba(255, 255, 255, 0.02); padding: 1.2rem; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); }
.info-item h4 { font-size: 0.8rem; color: var(--accent-primary); margin-bottom: 0.8rem; }
.info-item p { font-size: 0.75rem; color: var(--text-secondary); line-height: 1.6; }

/* 其他板块对齐（左对齐，增强可读性） */
#extraction-pane .glass-box, #specimen-pane .glass-box, #simulation-pane .glass-box { text-align: left; }

#q-number { font-size: 0.85rem; color: var(--accent-primary); margin-bottom: 0.8rem; }
.progress-bar { height: 2px; background: rgba(255, 255, 255, 0.05); border-radius: 10px; margin: 1rem 0 2rem; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent-primary); width: 0; transition: width 0.6s ease; }
#q-text { font-size: 1.5rem; font-weight: 600; line-height: 1.5; margin-bottom: 3rem; }

.options-grid { display: flex; flex-direction: column; gap: 1rem; }
.option-btn { width: 100%; text-align: left; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255,255,255,0.1); padding: 1.2rem 2rem; border-radius: 10px; color: var(--text-primary); cursor: pointer; transition: 0.2s; font-size: 1rem; }
.option-btn:hover { border-color: var(--accent-primary); background: rgba(255,255,255,0.08); }
.option-btn.selected { background: var(--accent-primary); color: #000; font-weight: 600; }

.btn { background: transparent; border: 1px solid rgba(255,255,255,0.15); color: var(--text-primary); padding: 1rem 2.8rem; border-radius: 50px; cursor: pointer; transition: 0.3s; }
.btn.accent-btn { background: var(--accent-primary); color: #000; border: none; }
.btn.accent-btn:hover { background: #35f181; box-shadow: 0 0 20px rgba(46,213,115,0.3); }

/* 灵魂报告排版增强 */
#soul-profiling-display {
    line-height: 2;
    color: var(--text-primary);
    font-size: 1.05rem;
    padding: 1rem 0;
}
#soul-profiling-display h2 { 
    color: var(--accent-primary); 
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
    margin: 3rem 0 1.5rem;
    font-size: 1.6rem;
    letter-spacing: 1px;
}
#soul-profiling-display h3 { 
    color: var(--text-light); 
    margin-top: 2.5rem; 
    font-size: 1.25rem;
    font-weight: 700;
}
#soul-profiling-display p { margin-bottom: 1.5rem; opacity: 0.95; }
#soul-profiling-display ul { padding-left: 1.5rem; margin-bottom: 2rem; list-style-type: '— '; }
#soul-profiling-display li { margin-bottom: 0.8rem; color: var(--text-secondary); }
#soul-profiling-display strong { color: var(--accent-primary); font-weight: 600; }
#soul-profiling-display blockquote {
    border-left: 2px rgba(46, 213, 115, 0.3) solid;
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* 对话界面专项 */
.upload-phase, .chat-phase { display: none; }
.upload-phase.active-phase, .chat-phase.active-phase { display: block; }
.upload-area { border: 1px dashed rgba(255,255,255,0.15); padding: 3rem; margin: 2rem auto; border-radius: 15px; cursor: pointer; text-align: center; }
.upload-area:hover { border-color: var(--accent-primary); background: rgba(46,213,115,0.05); }

.chat-history { height: 400px; overflow-y: auto; padding-right: 1.5rem; margin: 2rem 0; }
.message { margin-bottom: 1.8rem; line-height: 1.6; }
.user-msg { color: var(--accent-primary); text-align: right; }
.soul-msg { color: var(--text-primary); text-align: left; }

.chat-input-area { display: flex; gap: 1rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,0.05); }
input[type="text"] { flex: 1; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); color:#fff; padding: 0.8rem 1.5rem; border-radius: 10px; outline: none; }
input[type="text"]:focus { border-color: var(--accent-primary); }

.spinner { width: 30px; height: 30px; border: 2px solid rgba(255,255,255,0.1); border-top-color: var(--accent-primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1.5rem; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* 响应式适配：针对手机与窄屏 */
@media (max-width: 768px) {
    .master-nav { margin-top: 1rem; padding: 0.3rem; }
    .nav-btn { padding: 0.6rem 1rem; font-size: 0.8rem; }
    
    .pane { padding: 0 10px; }
    .glass-box { padding: 1.5rem; border-radius: 15px; }

    #home-pane h1 { font-size: 2.2rem; }
    #home-pane h2 { font-size: 0.9rem; letter-spacing: 2px; }
    .subtitle { font-size: 0.9rem !important; }

    #q-text { font-size: 1.2rem; margin-bottom: 2rem; }
    .option-btn { padding: 1rem; font-size: 0.9rem; }

    .chat-history { height: 350px; }
}

.highlight-green { color: var(--accent-primary); font-weight: 600; text-shadow: 0 0 10px rgba(46, 213, 115, 0.3); }

/* 页脚样式 */
.master-footer {
    width: 100%;
    max-width: 950px;
    margin: 4rem auto 2rem;
    padding: 2rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.3s;
}

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

@media (max-width: 600px) {
    .master-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .footer-links a {
        margin: 0 0.75rem;
    }
}