/* 基础样式 */
:root {
    --primary: #4f46e5;
    --primary-dark: #3730a3;
    --primary-light: #a5b4fc;
    --secondary: #7c3aed;
    --secondary-dark: #5b21b6;
    --heart: #ec4899;
    --head: #06b6d4;
    --gut: #f59e0b;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --bg: #f8fafc;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.test-container, .results-container, .about-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 页头 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    border-radius: var(--radius-xl);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: float 20s linear infinite;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 800;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 10px;
}

/* 用户统计 */
.user-stats {
    margin: 30px 0;
}

.avatars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid white;
    position: relative;
    animation: floatAvatar 3s infinite ease-in-out;
    animation-delay: calc(var(--i) * 0.2s);
}

.user-count {
    margin-left: 20px;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-content {
    flex: 1;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

/* 特性网格 */
.features {
    margin: 40px 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary);
    font-size: 1.8rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.feature {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.feature:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.feature i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature h3 {
    color: var(--text);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.feature p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* 引言 */
.quote {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: var(--radius);
    padding: 30px;
    margin: 40px 0;
    position: relative;
    border-left: 5px solid var(--primary);
}

.quote-icon {
    position: absolute;
    top: -15px;
    left: 30px;
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.quote-text {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 15px;
    line-height: 1.8;
}

.quote-text strong {
    color: var(--primary);
}

.quote-author {
    text-align: right;
    color: var(--text-light);
    font-style: italic;
    font-size: 0.9rem;
}

/* 按钮 */
.btn-main {
    display: block;
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.btn-main:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.3);
}

.btn-main:active {
    transform: translateY(-1px);
}

.btn-main i {
    margin-right: 10px;
}

.btn-secondary {
    display: inline-block;
    padding: 15px 25px;
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.btn-secondary i {
    margin-right: 8px;
}

/* 脉冲动画 */
.pulse {
    animation: pulse-animation 2s infinite;
}

@keyframes pulse-animation {
    0% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(79, 70, 229, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
    }
}

/* 背景动画 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.3;
}

.circle-1 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: 10%;
    left: 10%;
    animation: float 20s infinite ease-in-out;
}

.circle-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: 10%;
    right: 10%;
    animation: float 25s infinite ease-in-out reverse;
}

.circle-3 {
    width: 250px;
    height: 250px;
    background: var(--heart);
    top: 50%;
    right: 20%;
    animation: float 30s infinite ease-in-out;
}

/* 动画关键帧 */
@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(10px, -10px);
    }
    50% {
        transform: translate(0, 0);
    }
    75% {
        transform: translate(-10px, 10px);
    }
}

@keyframes floatAvatar {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 测试页样式 */
.test-header {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.test-progress {
    margin-bottom: 15px;
}

.progress-bar {
    height: 10px;
    background: var(--border);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

.test-timer {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary);
    font-weight: 600;
}

/* 题目区 */
.question-area {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.question-number {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.question-number .number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    background: var(--bg);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-number .label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.question-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--text);
    margin-bottom: 20px;
    font-weight: 600;
}

.question-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    color: var(--text-light);
    font-size: 0.9rem;
}

.question-hint i {
    color: var(--primary);
}

/* 选项区 */
.options-area {
    margin-bottom: 30px;
}

.option-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.option-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.option-item.selected {
    border-color: var(--primary);
    background: #eef2ff;
}

.option-emoji {
    font-size: 2rem;
    min-width: 60px;
    text-align: center;
}

.option-content {
    flex: 1;
}

.option-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
}

.option-desc {
    font-size: 0.9rem;
    color: var(--text-light);
}

.option-select {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-item.selected .option-select {
    border-color: var(--primary);
    background: var(--primary);
}

.option-item.selected .select-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: white;
}

/* 控制区 */
.controls-area {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.btn-control {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-control:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-prev {
    background: var(--bg);
    color: var(--text-light);
}

.btn-skip {
    background: #fef3c7;
    color: #92400e;
}

.btn-next {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

/* 测试统计 */
.test-stats {
    display: flex;
    justify-content: space-around;
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.stat {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.stat i {
    color: var(--primary);
}

/* 导航提示 */
.navigation-hint {
    background: #f0f9ff;
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
    border: 1px solid #bae6fd;
}

.navigation-hint i {
    color: var(--primary);
    margin-right: 10px;
}

/* 加载遮罩 */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.spinner {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    position: relative;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border: 5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text h3 {
    color: var(--primary);
    margin-bottom: 10px;
}

.loading-text p {
    color: var(--text-light);
    margin-bottom: 20px;
}

.loading-tips {
    background: #f0f9ff;
    border-radius: 10px;
    padding: 15px;
    color: var(--text-light);
    font-size: 0.9rem;
    border-left: 4px solid var(--primary);
}

.loading-tips i {
    color: var(--primary);
    margin-right: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-area {
        flex-direction: column;
    }
    
    .btn-control {
        width: 100%;
    }
    
    .test-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .option-item {
        padding: 15px;
    }
    
    .option-emoji {
        font-size: 1.5rem;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 30px 15px;
    }
    
    .quote {
        padding: 20px;
    }
    
    .question-number .number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .option-text {
        font-size: 1rem;
    }
}

/* 打印样式 */
@media print {
    .btn-action, .navigation-hint, .test-timer {
        display: none !important;
    }
    
    .container, .test-container, .results-container {
        padding: 0;
        margin: 0;
        max-width: 100%;
    }
    
    .chart-container {
        page-break-inside: avoid;
    }
}
/* 额外的通用样式 */

/* Toast消息样式 */
.custom-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    border-radius: var(--radius);
    padding: 15px 20px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 350px;
}

.custom-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.custom-toast i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-success i {
    color: var(--success);
}

.toast-error i {
    color: var(--error);
}

.toast-warning i {
    color: var(--warning);
}

.toast-info i {
    color: var(--info);
}

.custom-toast span {
    color: var(--text);
    font-weight: 500;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* 加载遮罩 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: inherit;
}

.loading-spinner {
    text-align: center;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-message {
    color: var(--text);
    font-weight: 500;
}

/* 工具提示 */
.custom-tooltip {
    position: fixed;
    background: var(--text);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 10000;
    pointer-events: none;
}

.custom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text);
}

/* 动画类 */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-20px);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(20px);
}

.fade-in-up.animate,
.fade-in-left.animate,
.fade-in-right.animate {
    opacity: 1;
    transform: translate(0);
    transition: all 0.6s ease;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease;
}

/* 表单验证样式 */
.is-valid {
    border-color: var(--success) !important;
}

.is-invalid {
    border-color: var(--error) !important;
}

.was-validated .form-control:invalid {
    border-color: var(--error);
}

/* 数字计数器 */
.number-counter {
    font-family: monospace;
    font-weight: 700;
}

/* 进度条 */
.animated-progress {
    height: 8px;
    background: var(--primary);
    border-radius: 4px;
    transition: width 1s ease;
}

/* 响应式辅助类 */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* 打印相关 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f172a;
        --card: #1e293b;
        --text: #f1f5f9;
        --text-light: #cbd5e1;
        --border: #334155;
    }
    
    body {
        background: var(--bg);
        color: var(--text);
    }
    
    .stat-card,
    .feature,
    .quote,
    .option-item,
    .test-stats,
    .navigation-hint,
    .report-section,
    .detail-card,
    .grid-item,
    .sc-item,
    .match-card,
    .plan-card,
    .disclaimer,
    .info-card,
    .highlight-box,
    .center-card,
    .type-card,
    .direction-card,
    .type-quote,
    .theory-panel {
        background: var(--card);
        color: var(--text);
    }
    
    .stat-card:hover,
    .feature:hover,
    .option-item:hover,
    .grid-item:hover,
    .sc-item:hover,
    .match-card:hover,
    .plan-card:hover,
    .info-card:hover {
        background: #2d3748;
    }
    
    .question-hint,
    .loading-tips {
        background: #1e293b;
        border-color: #334155;
    }
    
    .tag-strength {
        background: rgba(16, 185, 129, 0.2);
        border-color: rgba(16, 185, 129, 0.3);
    }
    
    .tag-challenge {
        background: rgba(239, 68, 68, 0.2);
        border-color: rgba(239, 68, 68, 0.3);
    }
    
    .custom-toast {
        background: var(--card);
        color: var(--text);
    }
}