/**
 * 动物塑心理测试 - 修复版样式文件
 * 多巴胺配色 + 现代极简 + 流畅交互
 */

/* ==================== CSS 变量 ==================== */
:root {
    /* 颜色系统 */
    --primary: #FF6B9D;
    --primary-light: #FFB3D9;
    --secondary: #FFC75F;
    --accent: #845EC2;
    --success: #00D084;
    --info: #0093D0;
    
    /* 中性色 */
    --bg: #FAFBFC;
    --surface: #FFFFFF;
    --border: #E8E8E8;
    --text: #2C3E50;
    --text-light: #7F8C8D;
    
    /* 间距 */
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 12px;
    --gap-lg: 16px;
    --gap-xl: 24px;
    --gap-2xl: 32px;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    
    /* 过渡 */
    --trans: 300ms ease;
}

/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
}

/* ==================== 容器布局 ==================== */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--gap-lg);
}

.main-content {
    min-height: calc(100vh - 300px);
}

/* 页面显示/隐藏 */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 400ms ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 头部 ==================== */
.header {
    text-align: center;
    padding: var(--gap-2xl) 0 var(--gap-xl);
    margin-bottom: var(--gap-2xl);
    border-bottom: 2px solid var(--border);
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--gap-md);
}

.logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.title {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-light);
    margin: var(--gap-sm) 0 0 0;
}

/* ==================== 卡片样式 ==================== */
.welcome-card,
.question-card,
.main-animal-card,
.share-card-content {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--gap-2xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

/* ==================== 欢迎卡片 ==================== */
.welcome-card h2 {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: var(--gap-lg);
}

.welcome-card p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: var(--gap-md);
    line-height: 1.8;
}

.welcome-card p strong {
    color: var(--text);
    font-weight: 600;
}

.info-box {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.08), rgba(0, 147, 208, 0.08));
    border-left: 4px solid var(--primary);
    padding: var(--gap-lg);
    border-radius: var(--radius-md);
    margin: var(--gap-xl) 0;
}

.info-box h3 {
    font-size: 14px;
    color: var(--text);
    margin-bottom: var(--gap-md);
    font-weight: 600;
}

.info-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

.info-box li {
    font-size: 14px;
    color: var(--text-light);
    padding-left: var(--gap-lg);
    position: relative;
}

.info-box li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: bold;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans);
    text-decoration: none;
    font-family: inherit;
    outline: none;
    text-align: center;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

/* 主色按钮 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #C44569);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 次色按钮 */
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary);
}

/* 大按钮 */
.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    width: 100%;
    min-height: 56px;
}

/* 分享按钮 */
.btn-share {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
    flex: 1;
    min-height: 44px;
}

.btn-share:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 157, 0.05);
}

/* 小按钮 */
.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

/* ==================== 进度条 ==================== */
.progress-container {
    margin-bottom: var(--gap-2xl);
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 400ms ease;
    border-radius: var(--radius-full);
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    margin-top: var(--gap-md);
    font-weight: 600;
}

/* ==================== 题目页面 ==================== */
.question-header {
    margin-bottom: var(--gap-lg);
}

.layer-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--info), #0075A3);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.question-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: var(--gap-xl) 0;
    line-height: 1.8;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: var(--gap-lg);
    margin-bottom: var(--gap-2xl);
}

.btn-option {
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
    padding: var(--gap-lg);
    text-align: left;
    transition: all var(--trans);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 16px;
    line-height: 1.6;
    font-family: inherit;
    font-weight: 500;
}

.btn-option:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 157, 0.05);
    transform: translateX(6px);
}

.btn-option.selected {
    background: linear-gradient(135deg, var(--primary), #C44569);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateX(6px);
}

/* ==================== 答案提示 ==================== */
.answer-indicator {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    padding: var(--gap-lg);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ==================== 加载动画 ==================== */
.loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    gap: var(--gap-xl);
}

.loading-container h2 {
    font-size: 24px;
    color: var(--primary);
}

.loading-container p {
    color: var(--text-light);
    font-size: 16px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== 结果页面 ==================== */
.result-header {
    text-align: center;
    margin-bottom: var(--gap-2xl);
}

.result-header h2 {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: var(--gap-md);
}

/* 主导动物卡 */
.main-animal-card {
    text-align: center;
    margin-bottom: var(--gap-2xl);
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05), rgba(0, 147, 208, 0.05));
}

.animal-emoji {
    font-size: 80px;
    line-height: 1;
    display: block;
    margin-bottom: var(--gap-lg);
}

.main-animal-card h1 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: var(--gap-md);
}

.animal-group-tag {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary), #F9A825);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    margin-bottom: var(--gap-lg);
    font-weight: 600;
}

.score-info {
    font-size: 16px;
    color: var(--text-light);
    font-weight: 600;
}

.score-info span {
    font-size: 28px;
    color: var(--primary);
    font-weight: 700;
}

/* 性格解析 */
.personality-section {
    margin-bottom: var(--gap-2xl);
    padding: var(--gap-2xl);
    background: var(--bg);
    border-radius: var(--radius-xl);
}

.personality-section h3 {
    font-size: 18px;
    margin-bottom: var(--gap-lg);
    color: var(--text);
}

.personality-text {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-light);
    padding: var(--gap-lg);
    background: var(--surface);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
}

/* 辅助动物 */
.secondary-animal-section {
    margin-bottom: var(--gap-2xl);
}

.secondary-animal-section h3 {
    font-size: 18px;
    margin-bottom: var(--gap-lg);
    color: var(--text);
}

.secondary-animal-card {
    display: flex;
    gap: var(--gap-lg);
    align-items: center;
    padding: var(--gap-lg);
    background: linear-gradient(135deg, rgba(132, 94, 194, 0.08), rgba(255, 199, 95, 0.08));
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--gap-lg);
}

.secondary-emoji {
    font-size: 50px;
    flex-shrink: 0;
}

.secondary-info {
    flex: 1;
}

.secondary-info h4 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: var(--gap-sm);
    font-weight: 600;
}

.secondary-info p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: var(--gap-md);
}

.score-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary), #F9A825);
    color: white;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
}

.combination-text {
    padding: var(--gap-lg);
    background: var(--bg);
    border-radius: var(--radius-lg);
    color: var(--text-light);
    line-height: 1.8;
    border-left: 4px solid var(--accent);
}

/* ==================== 动物分布 ==================== */
.animal-distribution {
    margin-bottom: var(--gap-2xl);
}

.animal-distribution h3 {
    font-size: 18px;
    margin-bottom: var(--gap-lg);
    color: var(--text);
}

.distribution-chart {
    display: flex;
    flex-direction: column;
    gap: var(--gap-lg);
}

.distribution-item {
    animation: slideIn 500ms ease;
}

.distribution-label {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    margin-bottom: var(--gap-sm);
}

.animal-emoji {
    font-size: 20px;
}

.animal-name {
    font-weight: 600;
    color: var(--text);
    min-width: 60px;
}

.distribution-bar-container {
    width: 100%;
    height: 24px;
    background: var(--border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.distribution-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--gap-md);
    transition: width 600ms ease;
    border-radius: var(--radius-full);
}

.distribution-score {
    color: white;
    font-size: 12px;
    font-weight: 600;
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 100%;
        opacity: 1;
    }
}

/* ==================== 分享区域 ==================== */
.share-section {
    margin: var(--gap-2xl) 0;
}

.share-section h3 {
    font-size: 18px;
    margin-bottom: var(--gap-lg);
    color: var(--text);
}

.share-buttons {
    display: flex;
    gap: var(--gap-md);
    margin-bottom: var(--gap-lg);
}

.share-card {
    animation: fadeIn 400ms ease;
}

.share-card-content {
    text-align: center;
    background: linear-gradient(135deg, #FFE5F0, #E0F7FF);
    padding: var(--gap-2xl);
}

.share-card-content h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: var(--gap-lg);
}

.share-result {
    margin-bottom: var(--gap-lg);
    padding: var(--gap-lg);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.share-emoji {
    font-size: 60px;
    display: block;
    margin-bottom: var(--gap-md);
}

.share-result h2 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: var(--gap-md);
}

.share-result p {
    font-size: 14px;
    color: var(--text-light);
}

.share-footer {
    font-size: 14px;
    color: var(--text);
    margin: var(--gap-lg) 0;
}

/* ==================== 按钮组 ==================== */
.button-group {
    display: flex;
    gap: var(--gap-lg);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--gap-2xl);
}

.result-buttons {
    margin-top: var(--gap-3xl);
}

/* ==================== 页脚 ==================== */
.footer {
    text-align: center;
    padding: var(--gap-2xl) var(--gap-lg);
    color: var(--text-light);
    font-size: 14px;
    border-top: 1px solid var(--border);
    margin-top: var(--gap-3xl);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .container {
        padding: var(--gap-md);
    }
    
    .logo {
        width: 60px;
        height: 60px;
    }
    
    .title {
        font-size: 28px;
    }
    
    .welcome-card,
    .question-card,
    .main-animal-card,
    .personality-section {
        padding: var(--gap-lg);
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .btn-option {
        padding: var(--gap-md);
    }
    
    .animal-emoji {
        font-size: 60px;
    }
    
    .main-animal-card h1 {
        font-size: 24px;
    }
    
    .secondary-animal-card {
        flex-direction: column;
        text-align: center;
    }
    
    .secondary-emoji {
        font-size: 40px;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .btn-share {
        width: 100%;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 24px;
    }
    
    .welcome-card h2 {
        font-size: 22px;
    }
    
    .btn-large {
        padding: 12px 20px;
        min-height: 48px;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    body {
        background: white;
    }
    
    .btn,
    .button-group {
        display: none;
    }
}
