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

:root {
    --primary-color: #8b5cf6;
    --primary-dark: #6d28d9;
    --secondary-color: #ec4899;
    --accent-color: #f59e0b;
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-light: #252542;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #6b6b7b;
    --mach-color: #8b5cf6;
    --narc-color: #ec4899;
    --psych-color: #ef4444;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* 页面切换动画 */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    z-index: 1;
}

.page.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* 引导页样式 */
#landing-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1025 50%, var(--bg-dark) 100%);
}

.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.05) 0%, transparent 70%);
    animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(2deg); }
}

#landing-page .content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.logo {
    margin-bottom: 2rem;
}

.eye-icon {
    width: 120px;
    height: 120px;
    animation: eyePulse 3s ease-in-out infinite;
}

.eye-outline {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 2;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.eye-pupil {
    fill: var(--secondary-color);
    animation: pupilMove 4s ease-in-out infinite;
}

.eye-highlight {
    fill: rgba(255, 255, 255, 0.8);
}

@keyframes eyePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.3)); }
    50% { transform: scale(1.05); filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.6)); }
}

@keyframes pupilMove {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(3px, -2px); }
    50% { transform: translate(-2px, 2px); }
    75% { transform: translate(2px, 1px); }
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.features {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.feature-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
}

.feature-icon {
    font-size: 1.5rem;
}

.feature-item span:last-child {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 按钮样式 */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(139, 92, 246, 0.5);
}

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

.btn-primary svg {
    width: 20px;
    height: 20px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-secondary svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.test-info {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.music-toggle {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 2;
}

.music-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.music-toggle.playing {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--primary-color);
}

.music-toggle.playing .music-icon {
    animation: musicPulse 1s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.music-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.music-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* 答题页样式 */
#quiz-page {
    background: var(--bg-dark);
    padding: 0;
}

.quiz-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(15, 15, 26, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.back-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
}

.progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width var(--transition-normal);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.progress-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* 移动端答题页布局优化 */
.quiz-content {
    padding: 0.5rem 1rem 1rem;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.question-container {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}

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

/* 题目图标样式 - 移动端优化 */
.question-icon {
    font-size: 6.7rem;
    text-align: center;
    margin-bottom: 1rem;
    margin-top: -0.3rem;
    animation: iconPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.8));
    display: block;
    width: 100%;
    line-height: 1;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.25); opacity: 1; }
}

.question-text {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
    padding: 0 0.5rem;
}

/* 移动端优化 */
@media screen and (max-width: 768px) {
    .quiz-content {
        padding: 0 1rem 1rem;
    }
    
    .question-icon {
        font-size: 5.3rem;
        margin-bottom: 0.75rem;
        margin-top: -0.2rem;
    }
    
    .question-text {
        font-size: 1.5rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
        padding: 0 0.3rem;
    }
    
    .option-btn {
        padding: 1rem 1.2rem;
        font-size: 1rem;
    }
}

/* 小屏幕手机优化 */
@media screen and (max-width: 375px) {
    .quiz-content {
        padding: 0 0.8rem 0.8rem;
    }
    
    .question-icon {
        font-size: 4.7rem;
        margin-bottom: 0.5rem;
        margin-top: -0.1rem;
    }
    
    .question-text {
        font-size: 1.3rem;
        line-height: 1.5;
        margin-bottom: 1rem;
        padding: 0 0.2rem;
    }
    
    .option-btn {
        padding: 0.9rem 1rem;
        font-size: 0.95rem;
    }
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-btn {
    padding: 1.25rem 1.5rem;
    font-size: 1rem;
    text-align: left;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 16px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.option-btn:hover {
    background: var(--bg-card-light);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(5px);
}

.option-btn:hover::before {
    opacity: 1;
}

.option-btn.selected {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-color);
}

.option-btn.selected::before {
    opacity: 1;
}

/* 结果页样式 */
#result-page {
    background: var(--bg-dark);
    padding: 0;
    overflow-y: auto;
}

.result-content {
    padding: 2rem 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.result-header {
    text-align: center;
    margin-bottom: 2rem;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.character-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.2); }
    50% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.4); }
}

.badge-icon {
    font-size: 1.5rem;
}

.chart-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

#radar-chart {
    max-width: 300px;
    max-height: 300px;
}

.scores-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.score-item {
    background: var(--bg-card);
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.score-name {
    font-weight: 500;
    color: var(--text-primary);
}

.score-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.score-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.score-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.score-item[data-dimension="machiavellianism"] .score-fill {
    background: linear-gradient(90deg, var(--mach-color), #a78bfa);
}

.score-item[data-dimension="narcissism"] .score-fill {
    background: linear-gradient(90deg, var(--narc-color), #f9a8d4);
}

.score-item[data-dimension="psychopathy"] .score-fill {
    background: linear-gradient(90deg, var(--psych-color), #fca5a5);
}

.score-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.result-summary {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(236, 72, 153, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.result-summary h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.result-summary p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.action-buttons .btn-secondary,
.action-buttons .btn-primary {
    flex: 1;
    min-width: 120px;
}

/* 分享弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: 1rem;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 1.5rem;
    max-width: 350px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1);
}

.share-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #252542 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.card-header h3 {
    font-size: 1.3rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.card-character {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.card-scores {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1.5rem;
}

.card-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.card-score-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card-score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.card-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.card-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.qr-placeholder {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-placeholder::after {
    content: 'QR';
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 响应式适配 */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    #landing-page {
        padding: 1.5rem;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .features {
        gap: 0.75rem;
        flex-direction: column;
    }
    
    .feature-item {
        padding: 0.75rem;
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
        padding: 1rem 2rem;
    }
    
    .test-info {
        font-size: 0.8rem;
    }
    
    .music-toggle {
        padding: 0.625rem 1rem;
        font-size: 0.75rem;
    }
    
    .music-icon {
        width: 18px;
        height: 18px;
    }
    
    .question-text {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    .option-btn {
        padding: 1rem 1rem;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .action-buttons .btn-secondary,
    .action-buttons .btn-primary {
        width: 100%;
        min-width: auto;
    }
    
    .result-header {
        margin-bottom: 1.5rem;
    }
    
    .result-title {
        font-size: 1.25rem;
    }
    
    .character-badge {
        padding: 0.625rem 1.25rem;
        font-size: 1rem;
    }
    
    .chart-container {
        margin-bottom: 1.5rem;
    }
    
    #radar-chart {
        max-width: 260px;
        max-height: 260px;
    }
    
    .score-item {
        padding: 1rem;
    }
    
    .score-header {
        margin-bottom: 0.5rem;
    }
    
    .score-name {
        font-size: 0.9rem;
    }
    
    .score-value {
        font-size: 1.1rem;
    }
    
    .score-desc {
        font-size: 0.85rem;
    }
    
    .result-summary {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .result-summary h3 {
        font-size: 1rem;
    }
    
    .result-summary p {
        font-size: 0.9rem;
    }
    
    .modal-content {
        padding: 1.25rem;
        max-width: 90%;
    }
    
    .share-card {
        padding: 1.5rem;
    }
    
    .card-character {
        font-size: 1.25rem;
        margin: 1.25rem 0;
    }
    
    .card-scores {
        gap: 0.75rem;
    }
    
    .card-score-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 375px) {
    html {
        font-size: 13px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .option-btn {
        padding: 0.875rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .result-title {
        font-size: 1.1rem;
    }
    
    #radar-chart {
        max-width: 240px;
        max-height: 240px;
    }
}

@media (min-width: 768px) {
    .quiz-content {
        padding: 3rem;
    }
    
    .result-content {
        padding: 3rem;
    }
}

/* 动画类 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-right {
    animation: slideInRight 0.4s ease;
}

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

.slide-in-left {
    animation: slideInLeft 0.4s ease;
}

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