/* 健康守护应用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Microsoft YaHei', 'PingFang SC', sans-serif;
    line-height: 1.6;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    padding: 20px;
    animation: backgroundShift 20s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% { background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%); }
    50% { background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #4facfe 100%); }
    100% { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 50%, #667eea 100%); }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 15px 35px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 头部样式 */
header {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: headerShimmer 3s infinite;
}

@keyframes headerShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    background: linear-gradient(45deg, #fff, #f0f8ff, #fff);
    background-size: 200% 200%;
    animation: textGlow 2s ease-in-out infinite alternate;
    -webkit-background-clip: text;
    background-clip: text;
}

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

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 400;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* 主要内容区域 */
main {
    padding: 50px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(248, 250, 252, 0.5) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

/* 定时器区域 */
.timer-section {
    margin-bottom: 50px;
    text-align: center;
}

/* 大倒计时器 */
.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 40px auto;
    width: 100%;
}

.countdown-circle {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(79, 172, 254, 0.4), 0 10px 20px rgba(79, 172, 254, 0.2);
    position: relative;
    animation: countdownPulse 3s ease-in-out infinite;
    transition: background 0.5s ease;
}


.countdown-circle::before {
    content: '';
    position: absolute;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: inset 0 8px 20px rgba(0, 0, 0, 0.1), 0 4px 15px rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.countdown-text {
    position: relative;
    z-index: 2;
    text-align: center;
}

.countdown-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #4facfe;
    line-height: 1;
    margin-bottom: 8px;
}

.countdown-label {
    display: block;
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(79, 172, 254, 0.5);
    }
}

.status-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.status-item {
    text-align: center;
    padding: 25px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 1px 8px rgba(0, 0, 0, 0.06);
    min-width: 160px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.status-item:hover::before {
    left: 100%;
}

.status-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1);
}

.status-item .label {
    display: block;
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-item .status {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #6366f1;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.status-item .time {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: #10b981;
    text-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.status-item .count {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f59e0b;
    text-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 30px;
}

.btn {
    padding: 18px 35px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    min-width: 140px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.5), 0 5px 15px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #3730a3 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.5), 0 5px 15px rgba(99, 102, 241, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.5), 0 5px 15px rgba(239, 68, 68, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 50%, #0e7490 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.btn-info:hover:not(:disabled) {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.5), 0 5px 15px rgba(6, 182, 212, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn:active:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    transition: all 0.1s ease;
}

/* 游戏区域 */
.game-section {
    margin-bottom: 40px;
    text-align: center;
}

.game-section h2 {
    color: #4facfe;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.8) 100%);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.speed-control label {
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.speed-control input[type="range"] {
    width: 140px;
    height: 8px;
    border-radius: 10px;
    background: linear-gradient(to right, #10b981 0%, #06b6d4 50%, #6366f1 100%);
    outline: none;
    -webkit-appearance: none;
    position: relative;
    transition: all 0.3s ease;
}

.speed-control input[type="range"]:hover {
    transform: scaleY(1.2);
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4), 0 2px 8px rgba(102, 126, 234, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.speed-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6), 0 4px 15px rgba(102, 126, 234, 0.4);
}

.speed-control input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.speed-control input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.speed-control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.speed-control #speedValue {
    font-weight: 700;
    color: #667eea;
    min-width: 60px;
    text-align: center;
    font-size: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

.color-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.color-selector label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.color-selector select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.color-selector input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    background: white;
    padding: 2px;
}

.color-selector input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 8px;
}

.color-selector input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

.game-area {
    border: 3px solid #4facfe;
    border-radius: 15px;
    overflow: hidden;
    display: inline-block;
    box-shadow: 0 10px 30px rgba(79, 172, 254, 0.3);
}

#gameCanvas {
    display: block;
    background: #ffffff;
    cursor: pointer;
}

/* 设置区域 */
.settings-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    padding: 35px;
    border-radius: 25px;
    margin-bottom: 40px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.settings-section h3 {
    color: #6366f1;
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.setting-item {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.setting-item:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    cursor: pointer;
    font-weight: 600;
    color: #475569;
}

.setting-item input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #6366f1;
    cursor: pointer;
    transform: scale(1.2);
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9rem;
    background: rgba(248, 249, 250, 0.8);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }

    header {
        padding: 30px 15px;
    }

    h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px;
    }

    .countdown-circle {
        width: 150px;
        height: 150px;
    }

    .countdown-circle::before {
        width: 135px;
        height: 135px;
    }

    .countdown-number {
        font-size: 2rem;
    }

    .status-display {
        gap: 20px;
    }

    .status-item {
        min-width: 120px;
        padding: 15px;
    }

    .controls {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 200px;
    }

    .game-controls {
        flex-direction: column;
        align-items: center;
    }

    .speed-control {
        order: 2;
        margin-top: 10px;
    }

    .speed-control input[type="range"] {
        width: 120px;
    }
}

@media (max-width: 480px) {
    .status-display {
        flex-direction: column;
        align-items: center;
    }

    .status-item {
        width: 100%;
        max-width: 250px;
    }
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* 提醒动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}