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

:root {
    /* 颜色变量 */
    --primary-color: #4361ee;
    --primary-light: #6a8cff;
    --primary-dark: #3a56d4;
    --secondary-color: #7209b7;
    --secondary-light: #9d4edd;
    --accent-color: #f72585;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #f94144;
    
    /* 中性色 */
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --gray: #e9ecef;
    --medium-gray: #adb5bd;
    --dark-gray: #495057;
    --black: #212529;
    
    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #4361ee, #3a56d4);
    --gradient-secondary: linear-gradient(135deg, #7209b7, #9d4edd);
    --gradient-accent: linear-gradient(135deg, #f72585, #ff7eb3);
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.2);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 过渡效果 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--dark-gray);
    background-color: var(--light-gray);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页面切换效果 */
.page-wrapper {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.page-wrapper.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 欢迎页面样式 */
.welcome-content {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
}

.logo-container {
    text-align: center;
    margin-bottom: 40px;
    max-width: 600px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 48px;
    color: var(--primary-color);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--medium-gray);
    font-weight: 300;
}

.welcome-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    width: 100%;
}

.card-header {
    text-align: center;
    margin-bottom: 40px;
}

.card-header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.tagline {
    color: var(--medium-gray);
    font-size: 1.1rem;
    font-weight: 300;
}

.test-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--light-gray);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.info-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.info-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.5rem;
}

.info-content h3 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.info-content p {
    color: var(--medium-gray);
    font-size: 0.9rem;
}

.instructions {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: var(--radius-md);
    margin-bottom: 30px;
}

.instructions h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
}

.instructions ul {
    list-style-type: none;
}

.instructions li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.instructions li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.privacy-notice {
    text-align: center;
    padding: 15px;
    background: rgba(67, 97, 238, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    color: var(--primary-color);
}

.privacy-notice i {
    margin-right: 10px;
}

/* 按钮样式 */
.btn-primary, .btn-secondary {
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.4);
}

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

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

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* 测试页面样式 */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-small {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    font-weight: 600;
}

.logo-small i {
    font-size: 1.5rem;
}

.test-progress {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--medium-gray);
}

.progress-bar {
    height: 8px;
    background: var(--gray);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    width: 0%;
    transition: width var(--transition-normal);
}

.timer {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
}

.question-container {
    max-width: 800px;
    margin: 40px auto;
}

.dimension-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

#current-dimension {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.dimension-dots {
    display: flex;
    gap: 10px;
}

.dimension-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray);
    transition: all var(--transition-normal);
}

.dimension-dot.active {
    background: var(--primary-color);
    transform: scale(1.2);
}

.dimension-dot:nth-child(1).active {
    background: var(--primary-color);
}

.dimension-dot:nth-child(2).active {
    background: var(--secondary-color);
}

.dimension-dot:nth-child(3).active {
    background: var(--accent-color);
}

.question-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.question-number {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 20px;
    display: inline-block;
    background: rgba(67, 97, 238, 0.1);
    padding: 8px 16px;
    border-radius: var(--radius-full);
}

.question-text {
    font-size: 1.4rem;
    line-height: 1.6;
    color: var(--black);
    margin-bottom: 40px;
}

.options-container {
    margin-bottom: 40px;
}

.option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    margin-bottom: 15px;
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.option:hover {
    background: var(--gray);
    transform: translateX(5px);
}

.option.selected {
    border-color: var(--primary-color);
    background: rgba(67, 97, 238, 0.1);
    transform: translateX(10px);
}

.option.selected:before {
    content: "✓";
    position: absolute;
    left: -25px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: bold;
}

.option-label {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    flex-shrink: 0;
}

.option.selected .option-label {
    background: var(--primary-color);
    color: var(--white);
}

.option-text {
    flex: 1;
    font-size: 1.1rem;
}

.question-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--gray);
}

.question-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--medium-gray);
    font-size: 0.9rem;
}

.stat-item i {
    color: var(--primary-color);
}

.test-footer {
    text-align: center;
    padding: 20px;
    color: var(--medium-gray);
    font-size: 0.9rem;
    margin-top: 20px;
}

.save-notice {
    margin-top: 10px;
    color: var(--accent-color);
    font-weight: 300;
}

/* 结果页面样式 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}

.result-container {
    max-width: 1000px;
    margin: 40px auto;
}

.result-summary {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.summary-header {
    text-align: center;
    margin-bottom: 40px;
}

.summary-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.completion-info {
    color: var(--medium-gray);
    font-size: 0.95rem;
}

.profile-card {
    border: 2px solid var(--gray);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 20px 30px;
    color: var(--white);
}

.profile-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-content {
    padding: 30px;
}

.profile-description {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 30px;
    color: var(--dark-gray);
}

.profile-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.trait-badge {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: var(--white);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-block;
}

.dimension-results {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
    overflow: hidden;
}

.dimension-tabs {
    display: flex;
    background: var(--light-gray);
    border-bottom: 1px solid var(--gray);
}

.dimension-tab {
    flex: 1;
    padding: 20px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: var(--medium-gray);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.dimension-tab:hover {
    background: var(--gray);
    color: var(--primary-color);
}

.dimension-tab.active {
    background: var(--white);
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
}

.dimension-content {
    padding: 40px;
}

.dimension-panel {
    display: none;
}

.dimension-panel.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

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

.category-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.chart-container {
    padding: 25px;
    background: var(--light-gray);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.chart-header {
    margin-bottom: 20px;
}

.chart-header h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.chart-header p {
    color: var(--medium-gray);
    font-size: 0.9rem;
}

.chart-bar {
    height: 30px;
    background: var(--gray);
    border-radius: var(--radius-full);
    margin-top: 15px;
    overflow: hidden;
    position: relative;
}

.chart-fill {
    height: 100%;
    border-radius: var(--radius-full);
    width: 0%;
    transition: width 1s ease-out;
    position: relative;
}

.chart-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
}

.recommendations {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 40px;
}

.recommendations h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.recommendations-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.recommendation-card {
    padding: 25px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-left: 5px solid var(--primary-color);
}

.recommendation-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.recommendation-card ul {
    list-style-type: none;
}

.recommendation-card li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.recommendation-card li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.result-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 40px 0;
}

.result-actions .btn-primary,
.result-actions .btn-secondary {
    max-width: 200px;
    padding: 12px 24px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--white);
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.9);
    animation: modalIn 0.3s ease forwards;
}

@keyframes modalIn {
    to {
        transform: scale(1);
    }
}

.loading-spinner {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .logo h1 {
        font-size: 2rem;
    }
    
    .welcome-card {
        padding: 25px;
    }
    
    .test-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .test-progress {
        max-width: 100%;
        width: 100%;
    }
    
    .question-card {
        padding: 25px;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .option {
        padding: 15px;
    }
    
    .question-nav {
        flex-direction: column;
        gap: 20px;
    }
    
    .question-stats {
        order: 1;
    }
    
    .result-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .dimension-tabs {
        flex-direction: column;
    }
    
    .category-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .card-header h2 {
        font-size: 1.4rem;
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
    }
    
    .dimension-indicator {
        flex-direction: column;
        gap: 15px;
    }
}

/* 打印样式 */
@media print {
    .test-header,
    .question-nav,
    .test-footer,
    .result-actions,
    .dimension-tabs,
    .btn-primary,
    .btn-secondary {
        display: none;
    }
    
    .result-container {
        box-shadow: none;
        margin: 0;
    }
    
    body {
        background: white;
    }
    
    .profile-card,
    .dimension-results,
    .recommendations {
        break-inside: avoid;
    }
}