* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6c5ce7;
    --primary-dark: #5a4bd1;
    --secondary-color: #a29bfe;
    --bg-gradient-start: #0c0c1d;
    --bg-gradient-end: #1a1a3e;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    --dom-color: #e74c3c;
    --sub-color: #9b59b6;
    --switch-color: #3498db;
    --master-color: #f39c12;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page {
    display: none;
    width: 100%;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

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

/* 开始页面 */
.header {
    text-align: center;
    margin-bottom: 40px;
}

.title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #fff 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 8px;
}

.divider {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--dom-color), var(--sub-color), var(--switch-color), var(--master-color));
    margin: 20px auto 0;
    border-radius: 2px;
}

.intro {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
}

.description {
    font-size: 1.05rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.8;
}

.disclaimer {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.disclaimer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 6px;
}

.disclaimer p:last-child {
    margin-bottom: 0;
}

.info-box {
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.info-box p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 4px 0;
    padding-left: 20px;
    position: relative;
}

.info-box li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

/* 按钮样式 */
.btn {
    padding: 14px 36px;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7c6ff0 0%, #6a5be5 100%);
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

#start-btn {
    display: block;
    margin: 0 auto;
    padding: 16px 60px;
    font-size: 1.15rem;
}

/* 进度条 */
.progress-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 0 8px;
}

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

.progress-fill::after {
    content: '';
    display: block;
    height: 100%;
    width: calc(var(--progress, 0) * 1%);
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.progress-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
}

/* 题目区域 */
.question-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.question-text {
    font-size: 1.15rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 28px;
    line-height: 1.7;
}

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

.option-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.98rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.option-btn:hover {
    background: rgba(108, 92, 231, 0.1);
    border-color: rgba(108, 92, 231, 0.4);
    color: var(--text-primary);
}

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

.option-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

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

/* 导航按钮 */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.nav-buttons .btn {
    flex: 1;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* 邮箱页面 */
.email-form {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 36px;
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    background: rgba(108, 92, 231, 0.05);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 20px;
}

.form-note {
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.2);
    border-radius: 10px;
    padding: 14px 18px;
    margin-bottom: 24px;
}

.form-note p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

#submit-btn {
    width: 100%;
}

/* 结果页面 */
.result-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    backdrop-filter: blur(10px);
}

.result-summary {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.dimension {
    padding: 4px 0;
}

.bar-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bar-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.bar-track {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
}

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

.dom-color {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.sub-color {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.switch-color {
    background: linear-gradient(90deg, #3498db, #2980b9);
}

.master-color {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.bar-value {
    text-align: right;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dimension-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-style: italic;
}

.final-type {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.15), rgba(162, 155, 254, 0.1));
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 14px;
    margin-bottom: 20px;
}

.final-type h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-type p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.result-footer {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--card-border);
}

.result-footer p {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

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

.result-actions .btn {
    min-width: 180px;
}

#restart-btn {
    display: block;
    margin: 0 auto;
}

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

    .title {
        font-size: 2.2rem;
        letter-spacing: 4px;
    }

    .subtitle {
        font-size: 1rem;
        letter-spacing: 5px;
    }

    .intro, .question-container, .email-form, .result-container {
        padding: 24px;
    }

    .question-text {
        font-size: 1.05rem;
    }

    .option-btn {
        padding: 14px 16px;
        font-size: 0.92rem;
    }

    .nav-buttons .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px;
}

.loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 成功提示 */
.success-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 0.95rem;
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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