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

:root {
    --primary-color: #6366f1;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e1b4b 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-radius: 16px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 25px 80px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 600px;
}

/* 页面切换动画 */
.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

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

/* 欢迎页样式 */
.welcome-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 50px 40px;
    text-align: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.logo {
    margin-bottom: 24px;
}

.logo .icon {
    font-size: 64px;
    display: inline-block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.title {
    font-size: 32px;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.description {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.description p {
    margin-bottom: 8px;
}

.btn-start {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

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

.personalities-preview {
    margin-top: 32px;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* 答题页样式 */
.quiz-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

.progress-section {
    margin-bottom: 32px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 14px;
}

.progress-text {
    color: var(--text-secondary);
}

.progress-count {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 5%;
}

.question-section {
    margin-bottom: 32px;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.5;
}

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

.option {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.option.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.option-letter {
    width: 28px;
    height: 28px;
    background: #e5e7eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.option:hover .option-letter,
.option.selected .option-letter {
    background: var(--primary-color);
    color: white;
}

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

.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.btn-prev,
.btn-next {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-prev {
    background: #f3f4f6;
    color: var(--text-secondary);
}

.btn-prev:hover {
    background: #e5e7eb;
}

.btn-next {
    background: var(--primary-gradient);
    color: white;
    flex: 1;
}

.btn-next:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-next:disabled {
    background: #e5e7eb;
    color: var(--text-light);
    cursor: not-allowed;
}

/* 加载页样式 */
.loading-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow);
}

.loading-animation {
    margin-bottom: 32px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
}

.loading-tips {
    color: var(--text-light);
    font-size: 14px;
    min-height: 20px;
}

/* 结果页样式 */
.result-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    text-align: center;
}

.result-header {
    margin-bottom: 28px;
}

.result-label {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.rare-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    box-shadow: 0 4px 15px rgba(255, 170, 0, 0.4);
    animation: glow 2s ease-in-out infinite alternate;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

@keyframes glow {
    from {
        box-shadow: 0 4px 15px rgba(255, 170, 0, 0.4);
        transform: scale(1);
    }
    to {
        box-shadow: 0 6px 25px rgba(255, 170, 0, 0.6);
        transform: scale(1.02);
    }
}

.result-name {
    font-size: 36px;
    font-weight: 800;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.result-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.result-tag {
    background: var(--secondary-gradient);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.result-card {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 28px;
}

.result-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.result-description {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 24px;
}

.result-description p {
    margin-bottom: 12px;
}

.result-quote {
    padding: 20px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #f5576c;
}

.quote-mark {
    color: #f5576c;
    font-size: 20px;
    font-weight: 700;
}

#result-quote {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    font-style: italic;
}

.result-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-restart,
.btn-share {
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-restart {
    background: var(--primary-gradient);
    color: white;
}

.btn-restart:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

.btn-share:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* 分享弹窗 */
.share-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.share-modal.active {
    display: flex;
}

.share-content {
    background: white;
    padding: 32px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.share-content p {
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--text-primary);
}

.share-content button {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 640px) {
    body {
        padding: 16px;
    }

    .welcome-card,
    .quiz-container,
    .loading-container,
    .result-container {
        padding: 32px 24px;
    }

    .title {
        font-size: 26px;
    }

    .result-name {
        font-size: 28px;
    }

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

    .option {
        padding: 14px 16px;
    }

    .btn-start {
        padding: 14px 40px;
        font-size: 16px;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-restart,
    .btn-share {
        width: 100%;
    }
}

/* 特殊动画效果 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading-tips {
    animation: pulse 2s infinite;
}
