/* Tailwind CSS CDN */
@import url('https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css');

/* Custom Variables */
:root {
    --primary-red: #FF6B6B;
    --primary-teal: #4ECDC4;
    --primary-yellow: #FFE66D;
    --bg-cream: #FFF9E6;
    --bg-white: #FFFFFF;
    --bg-light-blue: #F0F8FF;
    --text-dark: #2D3436;
    --text-gray: #636E72;
    --text-white: #FFFFFF;
    --success: #00B894;
    --error: #E74C3C;
    --warning: #F39C12;
    --purple: #9B59B6;
    --font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-cream) 0%, var(--bg-light-blue) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Page System */
.page {
    display: none;
    min-height: 100vh;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

.container {
    max-width: 500px;
    margin: 0 auto;
}

/* ========== HOME PAGE ========== */
.header {
    text-align: center;
    padding: 30px 0;
}

.title-wrapper {
    position: relative;
}

.main-title {
    font-size: 42px;
    font-weight: 700;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.title-char {
    display: inline-block;
    font-size: 56px;
    color: var(--primary-red);
    animation: bounce 1s ease infinite;
    text-shadow: 3px 3px 0 var(--primary-yellow);
}

.title-char:nth-child(2) {
    animation-delay: 0.1s;
    color: var(--primary-teal);
}

.title-text {
    color: var(--text-dark);
}

.title-text.adventure {
    color: var(--primary-teal);
    display: block;
    width: 100%;
    font-size: 36px;
}

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

.mascot {
    font-size: 48px;
    margin-top: 10px;
    animation: float 3s ease-in-out infinite;
}

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

/* Status Panel */
.status-panel {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.status-item {
    flex: 1;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 15px;
}

.status-item.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.status-item.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-item.clickable:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.status-item.progress-item {
    flex-basis: 100%;
}

.status-icon {
    font-size: 28px;
    margin-bottom: 5px;
}

.status-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 3px;
}

.status-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-teal), var(--success));
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 14px;
    color: var(--text-gray);
}

/* Mode Selection */
.mode-selection {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.mode-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

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

.sequential-btn {
    background: linear-gradient(135deg, var(--primary-teal) 0%, #45B7AA 100%);
    color: white;
}

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

.timed-btn {
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 100%);
    color: white;
}

.boss-btn {
    background: linear-gradient(135deg, #E74C3C 0%, #C0392B 100%);
    color: white;
}

.btn-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border-radius: 15px;
}

.btn-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.btn-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 3px;
}

.btn-desc {
    font-size: 14px;
    opacity: 0.9;
}

.btn-arrow {
    font-size: 24px;
    opacity: 0.7;
}

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 25px;
    border: none;
    background: var(--bg-white);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.nav-icon {
    font-size: 28px;
}

.nav-text {
    font-size: 14px;
    color: var(--text-gray);
}

.reset-btn:hover {
    background: #fff0f0;
}

/* ========== QUIZ PAGE ========== */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    border: none;
    background: var(--bg-white);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-gray);
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.back-btn:hover {
    background: #f5f5f5;
    transform: translateX(-3px);
}

.quiz-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.mode-tag {
    font-size: 12px;
    padding: 3px 10px;
    background: var(--primary-teal);
    color: white;
    border-radius: 10px;
}

.round-info {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.score-display {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background: linear-gradient(135deg, var(--primary-yellow), #FFD93D);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    box-shadow: 0 3px 10px rgba(255,230,109,0.4);
}

.score-icon {
    font-size: 20px;
}

/* Quiz Progress */
.quiz-progress {
    margin-bottom: 25px;
}

.quiz-progress-bar {
    height: 10px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-teal), var(--success));
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 10%;
}

/* Question Area */
.question-area {
    margin-bottom: 10px;
}

.question-card {
    background: var(--bg-white);
    border-radius: 25px;
    padding: 20px 15px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    text-align: center;
    animation: popIn 0.4s ease;
}

@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.question-text {
    font-size: 48px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.question-text .num {
    color: var(--primary-red);
    background: linear-gradient(135deg, #fff0f0, #ffe8e8);
    padding: 10px 20px;
    border-radius: 15px;
}

.question-text .operator {
    color: var(--primary-teal);
}

.question-text .equals {
    color: var(--text-gray);
}

.answer-placeholder {
    color: var(--primary-yellow);
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Feedback Area */
.feedback-area {
    height: 40px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-area.show {
    opacity: 1;
}

.feedback-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
}

.feedback-area.correct .feedback-content {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: var(--success);
}

.feedback-area.wrong .feedback-content {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: var(--error);
}

.feedback-icon {
    font-size: 24px;
}

/* Answer Area */
.answer-area {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.answer-input {
    flex: 1;
    padding: 18px 20px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    outline: none;
    font-family: inherit;
    transition: all 0.3s ease;
}

.answer-input:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 4px rgba(78, 205, 196, 0.2);
}

.submit-btn {
    padding: 18px 30px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-teal), #45B7AA);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(78, 205, 196, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.5);
}

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

.submit-icon {
    font-size: 20px;
}

/* Numpad */
.numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.numpad-btn {
    padding: 20px;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    background: var(--bg-white);
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    touch-action: manipulation;
}

.numpad-btn:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
}

.numpad-btn:active {
    transform: translateY(0);
    background: #eeeeee;
}

.numpad-btn.clear-btn {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: var(--text-dark);
}

.numpad-btn.delete-btn {
    background: linear-gradient(135deg, #fab1a0, #e17055);
    color: white;
}

/* ========== LOTTERY PAGE ========== */
.lottery-header {
    text-align: center;
    padding: 20px 0;
}

.lottery-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.lottery-subtitle {
    font-size: 16px;
    color: var(--text-gray);
}

.lottery-chances {
    font-size: 18px;
    color: var(--primary-red);
    font-weight: 600;
    margin-top: 10px;
}

.lottery-chances span {
    font-size: 24px;
    color: var(--primary-teal);
}

/* Slot Machine Container */
.slot-machine {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin: 20px auto;
}

.slot-frame {
    position: relative;
    background: linear-gradient(145deg, #1A1A2E, #16213E);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 
        0 10px 40px rgba(0,0,0,0.4),
        inset 0 2px 10px rgba(255,215,0,0.1),
        0 0 30px rgba(255,107,53,0.2);
    border: 4px solid #FFD700;
}

.slot-window {
    width: 200px;
    height: 100px;
    overflow: hidden;
    background: linear-gradient(180deg, #0F0F23, #1A1A2E);
    border-radius: 12px;
    border: 3px solid #333;
    box-shadow: inset 0 5px 20px rgba(0,0,0,0.5);
    position: relative;
}

.slot-window::before,
.slot-window::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 25px;
    z-index: 10;
    pointer-events: none;
}

.slot-window::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(15,15,35,0.9), transparent);
}

.slot-window::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(15,15,35,0.9), transparent);
}

.slot-reel {
    display: flex;
    flex-direction: column;
    transition: transform 0.1s linear;
}

.slot-reel.spinning {
    transition: none;
}

.slot-reel.stopping {
    transition: transform 1s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.slot-item {
    width: 200px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.slot-item-icon {
    font-size: 40px;
    line-height: 1;
}

.slot-item-name {
    font-size: 16px;
    font-weight: 600;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.slot-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    color: #E63946;
    text-shadow: 0 0 10px rgba(230,57,70,0.8);
    animation: indicatorPulse 1s ease-in-out infinite;
}

.slot-indicator.left {
    left: -5px;
}

.slot-indicator.right {
    right: -5px;
}

@keyframes indicatorPulse {
    0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateY(-50%) scale(0.9); }
}

.slot-btn {
    padding: 15px 50px;
    font-size: 20px;
    font-weight: 700;
    color: #1A1A2E;
    background: linear-gradient(145deg, #FFD700, #FF6B35);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 
        0 5px 20px rgba(255,107,53,0.4),
        0 0 30px rgba(255,215,0,0.3);
    transition: all 0.3s ease;
    font-family: inherit;
}

.slot-btn:hover {
    transform: scale(1.05);
    box-shadow: 
        0 8px 30px rgba(255,107,53,0.5),
        0 0 40px rgba(255,215,0,0.4);
}

.slot-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.slot-btn.spinning .slot-btn-text {
    animation: btnPulse 0.5s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 中奖闪烁效果 */
.slot-frame.winning {
    animation: winningGlow 0.3s ease-in-out 5;
}

@keyframes winningGlow {
    0%, 100% { 
        box-shadow: 
            0 10px 40px rgba(0,0,0,0.4),
            inset 0 2px 10px rgba(255,215,0,0.1),
            0 0 30px rgba(255,107,53,0.2);
    }
    50% { 
        box-shadow: 
            0 10px 40px rgba(0,0,0,0.4),
            inset 0 2px 10px rgba(255,215,0,0.3),
            0 0 60px rgba(255,215,0,0.6),
            0 0 100px rgba(255,107,53,0.4);
    }
}

/* Prize Result */
.prize-result {
    text-align: center;
    padding: 20px;
    display: none;
}

.prize-result.show {
    display: block;
    animation: slideUp 0.5s ease;
}

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

.prize-result-content {
    background: linear-gradient(135deg, var(--primary-yellow), #FFD93D);
    padding: 25px;
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(255,230,109,0.4);
}

.result-icon {
    font-size: 60px;
    display: block;
    margin-bottom: 10px;
    animation: celebrateBounce 0.6s ease infinite;
}

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

.result-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-dark);
}

.continue-btn, .home-btn {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    margin: 5px;
    transition: all 0.3s ease;
}

.continue-btn {
    background: linear-gradient(135deg, var(--primary-teal), #45B7AA);
    color: white;
}

.home-btn {
    background: var(--bg-white);
    color: var(--text-gray);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.continue-btn:hover, .home-btn:hover {
    transform: translateY(-2px);
}

/* ========== RECORDS PAGE ========== */
.records-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.records-title {
    font-size: 24px;
    font-weight: 700;
    flex: 1;
    text-align: center;
    margin-right: 70px;
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.stat-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-teal);
    display: block;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-gray);
}

/* Prizes Section */
.prizes-section {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.prizes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.empty-prizes {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-gray);
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
}

.prize-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    animation: fadeInLeft 0.3s ease;
}

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

.prize-item-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.prize-item-info {
    flex: 1;
}

.prize-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    display: block;
}

.prize-item-time {
    font-size: 12px;
    color: var(--text-gray);
}

/* ========== MODALS ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 25px;
    padding: 30px;
    max-width: 350px;
    width: 100%;
    text-align: center;
    animation: modalPop 0.4s ease;
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    70% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-content.celebration {
    background: linear-gradient(135deg, #fff9e6, #fff);
    position: relative;
    overflow: hidden;
}

.modal-content.failed {
    background: linear-gradient(135deg, #f0f4f8, #e8ecf0);
    position: relative;
    overflow: hidden;
}

.modal-content.failed .confetti {
    display: none;
}

.modal-content.failed .modal-icon {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background-image: 
        radial-gradient(circle, var(--primary-red) 2px, transparent 2px),
        radial-gradient(circle, var(--primary-teal) 2px, transparent 2px),
        radial-gradient(circle, var(--primary-yellow) 2px, transparent 2px);
    background-size: 40px 40px, 60px 60px, 80px 80px;
    background-position: 0 0, 20px 30px, 40px 10px;
    animation: confettiMove 2s linear infinite;
    opacity: 0.3;
}

@keyframes confettiMove {
    from { background-position: 0 0, 20px 30px, 40px 10px; }
    to { background-position: 40px 40px, 60px 70px, 120px 50px; }
}

.modal-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.modal-text {
    font-size: 16px;
    color: var(--text-gray);
    margin-bottom: 20px;
    line-height: 1.6;
}

.lottery-notice {
    background: linear-gradient(135deg, var(--primary-yellow), #FFD93D);
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
    animation: pulse 1.5s ease infinite;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.modal-btn.cancel-btn {
    background: #f0f0f0;
    color: var(--text-gray);
}

.modal-btn.confirm-btn {
    background: linear-gradient(135deg, var(--error), #c0392b);
    color: white;
}

.modal-btn.primary-btn {
    background: linear-gradient(135deg, var(--primary-teal), #45B7AA);
    color: white;
}

.modal-btn.secondary-btn {
    background: var(--bg-white);
    color: var(--text-gray);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.modal-btn.tertiary-btn {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    color: var(--text-gray);
    font-size: 14px;
}

.modal-btn:hover {
    transform: translateY(-2px);
}

/* ========== RESPONSIVE ========== */

/* 小屏手机优化 (iPhone 12 Pro 等，宽度 <= 430px) */
@media (max-width: 430px) {
    .page {
        padding: 10px 15px;
    }
    
    .container {
        max-width: 100%;
    }
    
    /* 首页标题 */
    .header {
        padding: 10px 0;
    }
    
    .main-title {
        font-size: 28px;
    }
    
    .title-char {
        font-size: 36px;
    }
    
    .title-text.adventure {
        font-size: 24px;
    }
    
    .mascot {
        font-size: 32px;
        margin-top: 5px;
    }
    
    /* 首页状态区 */
    .status-panel {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .status-item {
        padding: 6px;
        min-width: 70px;
    }
    
    .status-icon {
        font-size: 18px;
    }
    
    .status-label {
        font-size: 10px;
    }
    
    .status-value {
        font-size: 16px;
    }
    
    /* 模式选择按钮 */
    .mode-selection {
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .mode-btn {
        padding: 12px;
    }
    
    .btn-icon {
        font-size: 24px;
    }
    
    .btn-title {
        font-size: 15px;
    }
    
    .btn-desc {
        font-size: 11px;
    }
    
    /* 底部导航 */
    .bottom-nav {
        gap: 15px;
    }
    
    .nav-btn {
        padding: 8px 16px;
    }
    
    .nav-icon {
        font-size: 20px;
    }
    
    .nav-text {
        font-size: 12px;
    }
    
    /* 答题页面 */
    .quiz-header {
        padding: 8px 12px;
        margin-bottom: 10px;
    }
    
    .question-card {
        padding: 15px;
        margin-bottom: 10px;
    }
    
    .question-text {
        font-size: 26px;
    }
    
    .feedback-area {
        height: auto;
        min-height: 0;
        margin-bottom: 5px;
    }
    
    .answer-area {
        justify-content: center;
        margin-bottom: 12px;
    }
    
    .answer-input {
        font-size: 18px;
        padding: 10px 12px;
        width: 90px;
        flex: none;
    }
    
    .answer-input::placeholder {
        font-size: 14px;
    }
    
    .submit-btn {
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .submit-icon {
        font-size: 14px;
    }
    
    /* 数字键盘 */
    .numpad {
        gap: 8px;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .numpad-btn {
        padding: 10px;
        font-size: 18px;
    }
    
    /* 抽奖页面 */
    .lottery-header {
        padding: 15px 0;
    }
    
    .lottery-title {
        font-size: 22px;
    }
    
    .lottery-subtitle {
        font-size: 14px;
    }
    
    .lottery-chances {
        font-size: 16px;
    }
    
    .lottery-chances span {
        font-size: 20px;
    }
    
    .wheel-container {
        width: 260px;
        height: 260px;
    }
    
    .spin-btn {
        width: 70px;
        height: 70px;
    }
    
    .spin-text {
        font-size: 16px;
    }
    
    /* 弹窗 */
    .modal-content {
        padding: 25px 20px;
        margin: 20px;
        max-width: calc(100% - 40px);
    }
    
    .modal-icon {
        font-size: 50px;
    }
    
    .modal-title {
        font-size: 22px;
    }
    
    .modal-text {
        font-size: 14px;
    }
    
    .modal-buttons {
        gap: 10px;
    }
    
    .modal-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* 更小屏幕 (宽度 <= 360px) */
@media (max-width: 360px) {
    .main-title {
        font-size: 28px;
    }
    
    .title-char {
        font-size: 36px;
    }
    
    .question-text {
        font-size: 28px;
    }
    
    .numpad-btn {
        padding: 10px;
        font-size: 20px;
    }
    
    .wheel-container {
        width: 240px;
        height: 240px;
    }
}

/* Hide number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ========== 限时挑战模式样式 ========== */

/* 时长选择按钮 */
.time-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.time-option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.time-option-btn:hover {
    border-color: var(--primary-teal);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(78, 205, 196, 0.3);
}

.time-option-btn .time-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-teal);
}

.time-option-btn .time-unit {
    font-size: 14px;
    color: var(--text-gray);
}

/* 计时器显示 */
.timer-display {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #9B59B6, #8E44AD);
    border-radius: 12px;
    color: white;
    font-weight: 600;
}

.timer-display.warning {
    background: linear-gradient(135deg, var(--primary-red), #E55A5A);
    animation: timerShake 0.5s ease-in-out infinite;
}

@keyframes timerShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.timer-icon {
    font-size: 18px;
}

.timer-display .timer-value {
    font-size: 20px;
    min-width: 30px;
    text-align: center;
}

.timer-display .timer-unit {
    font-size: 12px;
}

/* ========== Boss战模式样式 ========== */

/* Boss选择列表 */
.boss-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.boss-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: var(--bg-white);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: inherit;
}

.boss-option:hover {
    border-color: var(--primary-red);
    transform: translateX(5px);
    background: #fff5f5;
}

.boss-option .boss-emoji {
    font-size: 36px;
}

.boss-info {
    display: flex;
    flex-direction: column;
}

.boss-option .boss-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
}

.boss-option .boss-desc {
    font-size: 12px;
    color: var(--text-gray);
}

/* Boss战斗区域 */
.boss-area {
    text-align: center;
    padding: 10px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 20px;
    color: white;
}

.boss-character {
    margin-bottom: 5px;
}

.boss-emoji-large {
    font-size: 50px;
    display: block;
    animation: bossFloat 2s ease-in-out infinite;
}

.boss-emoji-large.hit {
    animation: bossHit 0.3s ease !important;
}

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

@keyframes bossHit {
    0% { transform: scale(1); }
    50% { transform: scale(0.8); filter: brightness(2); }
    100% { transform: scale(1); }
}

.boss-name-display {
    font-size: 18px;
    font-weight: 600;
    display: block;
    margin-top: 5px;
}

/* Boss血条 */
.boss-hp-bar {
    width: 80%;
    height: 16px;
    background: #1a252f;
    border-radius: 10px;
    margin: 0 auto 3px;
    position: relative;
    overflow: hidden;
    border: 2px solid #4a5568;
}

.boss-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #E74C3C, #C0392B);
    border-radius: 12px;
    transition: width 0.3s ease;
    width: 100%;
}

.boss-hp-fill.low {
    background: linear-gradient(90deg, #F39C12, #E67E22);
    animation: hpPulse 0.5s ease infinite;
}

@keyframes hpPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.boss-hp-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Boss计时器 */
.boss-timer {
    font-size: 16px;
    color: #a0aec0;
}

.boss-timer.warning {
    color: var(--primary-red);
    animation: timerShake 0.5s ease-in-out infinite;
}

.boss-timer-icon {
    margin-right: 5px;
}

/* ========== 移动端答题页面优化 ========== */
/* Boss战页面紧凑布局，内容从顶部开始排列 */
#quiz-page .container {
    padding: 10px 15px;
    box-sizing: border-box;
}

/* 数字键盘固定间距 */
#quiz-page .numpad {
    margin-top: 15px;
}
