:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #2b2d42;
    --text-muted: #8d99ae;
    --success: #4cc9f0;
    --border-radius: 16px;
    --shadow: 0 10px 30px rgba(0,0,0,0.05);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

#app {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
}

/* 屏幕切换动画 */
.screen {
    display: none;
    animation: fadeIn 0.4s ease;
    flex: 1;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

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

/* 欢迎页 */
#welcome-screen {
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
}

.hero-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

h1 { font-size: 24px; font-weight: 800; margin-bottom: 16px; }
p { font-size: 15px; color: var(--text-muted); }

/* 进度条 */
.progress-container {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

/* 动画：题目切入 */
.animate-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 题目卡片 */
.question-card {
    background: var(--card-bg);
    padding: 30px 24px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    margin-top: 10px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.question-text {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 30px;
    line-height: 1.4;
    color: var(--text);
}

/* 选项按钮 - MBTI 风格 */
.options-grid {
    display: grid;
    gap: 15px;
    margin-top: auto;
}

.option-btn {
    padding: 18px 20px;
    border: 2px solid #edeff2;
    border-radius: 16px;
    background: white;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.option-btn:active { transform: scale(0.97); }

.option-btn.selected {
    border-color: var(--primary);
    background-color: var(--primary);
    color: white;
    box-shadow: 0 8px 16px rgba(67, 97, 238, 0.2);
}


/* 底部导航 */
.nav-buttons {
    margin-top: auto;
    padding: 20px 0;
    display: flex;
    gap: 12px;
}

.btn-primary {
    flex: 2;
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

.btn-secondary {
    flex: 1;
    background: #edf2f7;
    color: var(--text);
    border: none;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
}

/* 报告页 */
.report-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.chart-container {
    width: 100%;
    height: 260px;
    margin-top: 12px;
}

.major-item {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f2f5;
}

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

.rank {
    width: 36px;
    height: 36px;
    background: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-right: 12px;
    color: var(--primary);
}

.major-name { font-weight: 700; font-size: 16px; }
.match-score { margin-left: auto; color: var(--primary); font-weight: 800; }

.analysis-section p {
    margin: 0 0 12px 0;
}

.category-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.category-item {
    padding: 16px;
    border-radius: 14px;
    background: #f6f8ff;
    border: 1px solid #e6ebff;
}

.category-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    background: #4361ee;
    color: white;
    margin-bottom: 8px;
}

.category-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 6px;
}

.category-desc {
    font-size: 14px;
    color: #444;
    line-height: 1.6;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #FFF;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    margin: 20px auto;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
