/* ============================================
   第一版UI设计 - 卡通插画风格
   浪漫色调，圆润可爱
   ============================================ */

:root {
    /* 色彩方案 - 浪漫色调为主 */
    --color-pink: #f093fb;
    --color-pink-light: #f5c2f7;
    --color-purple: #764ba2;
    --color-purple-light: #a78bfa;
    --color-blue: #4facfe;
    --color-blue-light: #00f2fe;
    --color-blue-dark: #667eea;
    
    /* 辅助色 - 明亮活泼 */
    --color-red: #f5576c;
    --color-yellow: #ffd93d;
    --color-green: #6bcf7f;
    
    /* 中性色 */
    --color-white: #ffffff;
    --color-cream: #fff8e7;
    --color-black: #1a1a1a;
    
    /* 圆角 */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 30px;
    
    /* 阴影 - 柔和多层 */
    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-large: 0 20px 60px rgba(0, 0, 0, 0.2);
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    --font-weight-normal: 400;
    --font-weight-bold: 600;
    
    /* 过渡动画 */
    --transition: 0.3s ease;
}

/* ============================================
   Global Styles
   ============================================ */

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

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    padding: 20px;
    color: var(--color-black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#app {
    max-width: 900px;
    margin: 0 auto;
}

/* ============================================
   Page Transitions
   ============================================ */

.page {
    display: none;
    animation: pageEnter 0.3s ease;
}

.page.active {
    display: block;
}

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

/* ============================================
   Progress Bar
   ============================================ */

.progress-bar-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-medium);
    backdrop-filter: blur(10px);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    font-size: 18px;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 50%, #4facfe 100%);
    border-radius: var(--radius-md);
    transition: width 0.5s ease;
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    box-shadow: var(--shadow-soft);
    outline: none;
    font-family: var(--font-family);
    color: var(--color-white);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 20px 20px 0 0;
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-soft);
}

.btn:focus {
    outline: 2px solid var(--color-yellow);
    outline-offset: 2px;
}

/* Primary Button - 粉色渐变 */
.btn-primary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

/* Secondary Button - 蓝色渐变 */
.btn-secondary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
}

/* Success Button - 绿色渐变 */
.btn-success {
    background: linear-gradient(135deg, #6bcf7f 0%, #4facfe 100%);
}

.btn-success:hover {
    background: linear-gradient(135deg, #4facfe 0%, #6bcf7f 100%);
}

/* Danger Button - 红色渐变 */
.btn-danger {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ============================================
   Cards - 圆角卡片设计
   ============================================ */

.welcome-container,
.challenge-container,
.complete-container,
.scratch-container,
.reward-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-large);
    backdrop-filter: blur(10px);
    position: relative;
}

.question-card {
    background: var(--color-cream);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-top: 20px;
    box-shadow: var(--shadow-soft);
}

/* ============================================
   Typography - 圆润可爱字体
   ============================================ */

.welcome-title,
.page-title,
.complete-title,
.reward-title {
    font-size: 42px;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    line-height: 1.2;
}

.section-header h2 {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.section-subtitle {
    font-size: 18px;
    font-weight: var(--font-weight-normal);
    color: rgba(0, 0, 0, 0.7);
}

.question-number {
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin-bottom: 20px;
    text-align: center;
}

.question-content {
    font-size: 24px;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    margin-bottom: 20px;
    line-height: 1.6;
    text-align: center;
}

.question-reward {
    text-align: center;
    font-size: 22px;
    font-weight: var(--font-weight-bold);
    color: var(--color-red);
    margin-bottom: 30px;
}

.welcome-subtitle,
.complete-message,
.scratch-rule {
    font-size: 20px;
    font-weight: var(--font-weight-normal);
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ============================================
   Welcome Page
   ============================================ */

.welcome-container {
    text-align: center;
    padding: 60px 20px;
}

.welcome-illustration {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 40px 0;
    font-size: 100px;
}

.character {
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

/* ============================================
   Input Fields
   ============================================ */

.text-input,
.textarea-input,
.number-input {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: var(--font-weight-normal);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-black);
    transition: all var(--transition);
    font-family: var(--font-family);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.text-input:focus,
.textarea-input:focus,
.number-input:focus {
    outline: none;
    border-color: var(--color-blue);
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.1);
}

.textarea-input {
    resize: vertical;
    min-height: 150px;
}

.three-inputs {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.number-input-wrapper {
    flex: 1;
    max-width: 200px;
}

.number-input {
    text-align: center;
}

/* ============================================
   Option Buttons
   ============================================ */

.option-btn {
    width: 100%;
    padding: 18px;
    margin: 10px 0;
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-md);
    background: var(--color-white);
    color: var(--color-black);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    box-shadow: var(--shadow-soft);
    position: relative;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    pointer-events: none;
}

.option-btn:hover {
    border-color: var(--color-blue);
    transform: translateX(5px);
    box-shadow: var(--shadow-medium);
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
}

.option-btn.selected {
    background: linear-gradient(135deg, #6bcf7f 0%, #4facfe 100%);
    color: var(--color-white);
    border-color: transparent;
    box-shadow: var(--shadow-medium);
    transform: translateX(5px);
}

.option-btn.selected::before {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
}

/* ============================================
   Help Buttons
   ============================================ */

.help-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.help-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    color: var(--color-black);
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-soft);
    position: relative;
}

.help-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), transparent);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    pointer-events: none;
}

.help-btn:hover {
    background: linear-gradient(135deg, #ffd93d 0%, #f5576c 100%);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.help-content {
    margin: 20px 0;
    padding: 16px;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
    border: 2px solid rgba(79, 172, 254, 0.3);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
}

.help-message {
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
}

/* ============================================
   Validation Area
   ============================================ */

.validation-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* ============================================
   Feedback Messages
   ============================================ */

.feedback-area {
    margin: 20px 0;
    text-align: center;
}

.feedback {
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: var(--font-weight-bold);
    display: inline-block;
    animation: fadeIn 0.3s ease;
    box-shadow: var(--shadow-soft);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.feedback.success {
    background: linear-gradient(135deg, #6bcf7f 0%, #4facfe 100%);
    color: var(--color-white);
}

.feedback.error {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: var(--color-white);
}

/* ============================================
   Navigation Buttons
   ============================================ */

.navigation-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

/* ============================================
   Section Complete Page
   ============================================ */

.complete-container {
    text-align: center;
    padding: 60px 20px;
}

.complete-title {
    animation: fadeIn 0.5s ease;
}

/* ============================================
   Scratch Card Page
   ============================================ */

.scratch-container {
    text-align: center;
    padding: 60px 20px;
}

.scratch-card-content {
    margin: 40px 0;
}

.scratch-illustration {
    font-size: 120px;
    margin-bottom: 30px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

/* ============================================
   Final Challenge
   ============================================ */

.final-instruction {
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    color: var(--color-black);
    text-align: center;
    margin: 30px 0;
    padding: 24px;
    background: linear-gradient(135deg, #ffd93d 0%, #f5576c 100%);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-medium);
    animation: fadeIn 0.5s ease;
}

/* ============================================
   Reward Page
   ============================================ */

.reward-container {
    text-align: center;
    padding: 60px 20px;
}

.reward-illustration {
    font-size: 120px;
    margin: 30px 0;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
}

.reward-summary {
    max-width: 600px;
    margin: 40px auto;
    background: var(--color-cream);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-large);
}

.reward-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 20px;
    font-weight: var(--font-weight-bold);
    border-bottom: 2px dashed rgba(0, 0, 0, 0.1);
}

.reward-item:last-child {
    border-bottom: none;
}

.reward-label {
    color: rgba(0, 0, 0, 0.7);
}

.reward-value {
    color: var(--color-red);
}

.reward-total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    font-size: 24px;
    font-weight: var(--font-weight-bold);
}

.total-label {
    color: var(--color-black);
}

.total-value {
    color: var(--color-red);
}

/* ============================================
   Answer Area
   ============================================ */

.answer-area {
    margin: 30px 0;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .welcome-title,
    .page-title,
    .complete-title,
    .reward-title {
        font-size: 32px;
    }

    .question-content {
        font-size: 20px;
    }

    .three-inputs {
        flex-direction: column;
    }

    .number-input-wrapper {
        max-width: 100%;
    }

    .help-buttons {
        flex-direction: column;
    }

    .help-btn {
        width: 100%;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .validation-area {
        flex-direction: column;
    }

    .validation-area .btn {
        width: 100%;
    }
}

/* ============================================
   Accessibility
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
