:root {
    --primary-color: #ff6b6b;
    --primary-dark: #ee5a52;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #f7fafc;
    --card-bg: #ffffff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --work-color: #ff6b6b;
    --short-break-color: #4ecdc4;
    --long-break-color: #95e1d3;
}

[data-theme="dark"] {
    --text-color: #e2e8f0;
    --text-light: #a0aec0;
    --bg-color: #1a202c;
    --card-bg: #2d3748;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow);
    position: relative;
    transition: background 0.3s ease;
}

.theme-toggle-container {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.theme-toggle-btn {
    background: var(--card-bg);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.theme-toggle-btn:hover {
    transform: scale(1.1) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

h1 {
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-light);
    margin-bottom: 40px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* 计时器部分 */
.timer-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.mode-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.mode-btn {
    background: var(--card-bg);
    border: 3px solid transparent;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.mode-btn.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
}

.mode-icon {
    font-size: 2rem;
}

.mode-label {
    font-weight: 600;
    color: var(--text-color);
}

.mode-time {
    font-size: 0.9rem;
    color: var(--text-light);
}

.timer-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.timer-circle {
    position: relative;
    width: 300px;
    height: 300px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.05);
    stroke-width: 8;
}

.progress-ring-progress {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.timer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-text {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
}

.timer-mode-label {
    font-size: 1.2rem;
    color: var(--text-light);
    margin-top: 10px;
}

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

.control-btn {
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    color: var(--text-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.reset-btn {
    border-color: var(--text-light);
}

.btn-icon {
    font-size: 1.3rem;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.stat-item {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    font-size: 2rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 侧边栏 */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.task-section,
.settings-section,
.history-section {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--text-color);
}

.add-task {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-task input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.add-task input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.add-task button {
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-task button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

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

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: var(--bg-color);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.task-item:hover {
    transform: translateX(5px);
}

.task-item.completed {
    opacity: 0.6;
    border-left-color: var(--text-light);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.task-text {
    flex: 1;
    color: var(--text-color);
}

.task-item.completed .task-text {
    text-decoration: line-through;
}

.task-pomodoro {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.task-delete {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.task-delete:hover {
    opacity: 1;
    transform: scale(1.2);
}

.empty-message {
    text-align: center;
    color: var(--text-light);
    padding: 20px;
    font-style: italic;
}

.setting-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

.setting-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--text-color);
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.time-settings {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.time-setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-setting-item label {
    color: var(--text-light);
    font-size: 0.9rem;
}

.time-setting-item input {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.time-setting-item input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-color);
    border-radius: 8px;
    font-size: 0.9rem;
}

.history-time {
    color: var(--text-light);
}

.history-mode {
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.history-mode.work {
    background: rgba(255, 107, 107, 0.2);
    color: var(--work-color);
}

.history-mode.break {
    background: rgba(78, 205, 196, 0.2);
    color: var(--short-break-color);
}

.clear-btn {
    width: 100%;
    background: var(--text-light);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: var(--text-color);
    transform: translateY(-2px);
}

/* 滚动条样式 */
.task-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
    width: 8px;
}

.task-list::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

.task-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .mode-selector {
        grid-template-columns: 1fr;
    }
    
    .timer-text {
        font-size: 3rem;
    }
    
    .stats {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 动画 */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.timer-circle.pulse {
    animation: pulse 2s infinite;
}

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

.task-item,
.history-item {
    animation: fadeIn 0.3s ease;
}
