/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #a78bfa;
    --primary-light: #c4b5fd;
    --secondary: #60a5fa;
    --bg-gradient-start: #faf5ff;
    --bg-gradient-end: #eff6ff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-primary: #1e1b4b;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: rgba(167, 139, 250, 0.2);
    --shadow: 0 4px 20px rgba(167, 139, 250, 0.15);
    --shadow-hover: 0 8px 30px rgba(167, 139, 250, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.page.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.container {
    max-width: 480px;
    margin: 0 auto;
}

/* 品牌 */
.brand {
    text-align: center;
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

/* 首页样式 */
.hero {
    text-align: center;
    padding: 30px 0;
}

.energy-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.energy-svg {
    width: 100%;
    height: 100%;
}

h1 {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
}

/* 卡片样式 */
.intro-card, .tips-card, .result-card, .suggestion-card, .score-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.intro-card h2, .tips-card h3, .result-card h2, .suggestion-card h3 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 12px;
}

.intro-card p, .tips-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.intro-card strong, .tips-card strong {
    color: var(--text-primary);
}

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 16px 0;
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(167, 139, 250, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.5);
}

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

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--bg-gradient-start);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 进度条 */
.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

/* 题目卡片 */
.question-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    min-height: 400px;
}

.question-text {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: var(--primary-light);
    background: var(--bg-gradient-start);
}

.option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
}

.option-radio {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.option.selected .option-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.option.selected .option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.option-text {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* 导航按钮 */
.nav-buttons {
    display: flex;
    gap: 12px;
}

.nav-buttons .btn-secondary,
.nav-buttons .btn-primary {
    flex: 1;
}

/* 结果页样式 */
.result-header {
    text-align: center;
    margin-bottom: 24px;
}

.result-header h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

.result-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.score-card {
    text-align: center;
    padding: 30px;
}

.score-circle {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 20px;
}

.score-circle canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-value span {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.score-value small {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
}

.level-badge {
    display: inline-block;
    padding: 8px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 500;
}

.result-card h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.level-emotion {
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 16px;
}

.interpretation {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.suggestion-card {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
}

.suggestion-card h3 {
    color: var(--text-primary);
}

.suggestion-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 能量层级图表 */
.energy-scale {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.energy-scale h3 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
}

.scale-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.scale-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.scale-item.active {
    background: linear-gradient(135deg, rgba(167, 139, 250, 0.2) 0%, rgba(96, 165, 250, 0.2) 100%);
    border-color: var(--primary);
}

.scale-range {
    font-size: 12px;
    color: var(--text-light);
    width: 70px;
    flex-shrink: 0;
}

.scale-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.scale-emotion {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.action-buttons .btn-secondary,
.action-buttons .btn-primary {
    flex: 1;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px 0;
}

.footer p {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

/* 响应式 */
@media (max-width: 375px) {
    .container {
        padding: 0 10px;
    }

    h1 {
        font-size: 24px;
    }

    .question-text {
        font-size: 16px;
    }

    .option {
        padding: 14px;
    }

    .option-text {
        font-size: 14px;
    }
}

/* 动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.question-card {
    animation: slideIn 0.4s ease;
}

/* 分享提示 */
.share-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}
