/* 添加深色主题变量 */
:root {
    --bg-color: white;
    --text-color: #333;
    --card-bg: white;
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --section-bg: #f8f9fa;
    --border-color: #e9ecef;
    --input-bg: white;
    --input-border: #ced4da;
    --input-text: #495057;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-bg: #6c757d;
    --progress-bg: #e9ecef;
    --instruction-bg: #f8f9fa;
    --instruction-text: #495057;
}

/* 深色主题变量 */
[data-theme="dark"] {
    --bg-color: #1a1a2e;
    --text-color: #e0e0e0;
    --card-bg: #16213e;
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    --section-bg: #0f3460;
    --border-color: #1e3a5f;
    --input-bg: #1e3a5f;
    --input-border: #2d4a7a;
    --input-text: #c9d1d9;
    --primary-gradient: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    --secondary-bg: #4a5568;
    --progress-bg: #2d3748;
    --instruction-bg: #0f3460;
    --instruction-text: #c9d1d9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--text-color);
}

.container {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    padding: 40px;
    width: 100%;
    max-width: 800px;
    position: relative;
}

/* 主题切换按钮样式 */
.theme-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-btn {
    background: var(--section-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

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

.theme-icon {
    font-size: 16px;
}

h1 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 30px;
    font-size: 2.5em;
}

.settings {
    background: var(--section-bg);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.setting-group {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.setting-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

input[type="text"], select {
    width: 100%;
    padding: 12px;
    background: var(--input-bg);
    border: 2px solid var(--input-border);
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
    color: var(--input-text);
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: #667eea;
}

/* 时间预设按钮样式 */
.time-presets {
    margin-top: 15px;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.preset-btn {
    padding: 10px 20px;
    background: var(--section-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 80px;
}

.preset-btn:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.preset-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
}

/* 测试按钮样式 */
.test-btn {
    padding: 6px 12px;
    background: var(--section-bg);
    border: 2px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.test-btn:hover {
    background: var(--border-color);
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    margin-right: 8px;
}

small {
    display: block;
    margin-top: 5px;
    color: var(--input-text);
    opacity: 0.8;
}

.timer-display {
    text-align: center;
    margin: 40px 0;
}

.time {
    font-size: 5em;
    font-weight: bold;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    margin-bottom: 20px;
}

.progress {
    height: 10px;
    background: var(--progress-bg);
    border-radius: 5px;
    margin: 30px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.3s ease;
}

.percentage {
    font-size: 1.2em;
    color: var(--text-color);
    font-weight: 600;
    opacity: 0.8;
}

.stats {
    text-align: center;
    margin: 30px 0;
    font-size: 1.1em;
    color: var(--text-color);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.btn {
    padding: 15px 30px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

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

.btn-secondary {
    background: var(--secondary-bg);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

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

.instructions {
    background: var(--instruction-bg);
    padding: 25px;
    border-radius: 10px;
    margin-top: 40px;
    border: 1px solid var(--border-color);
}

.instructions h3 {
    color: var(--text-color);
    margin-bottom: 15px;
}

.instructions ul {
    list-style: none;
}

.instructions li {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--instruction-text);
}

.instructions li:before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* 深色主题下的特殊调整 */
[data-theme="dark"] .instructions li:before {
    color: #7c3aed;
}

[data-theme="dark"] input[type="checkbox"],
[data-theme="dark"] input[type="radio"] {
    filter: brightness(0.8);
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .time {
        font-size: 3em;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .preset-buttons {
        flex-direction: column;
    }
    
    .theme-switcher {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 20px;
        text-align: right;
    }
}