* {
    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;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

header p {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 25px;
    background: #ecf0f1;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mode-btn:hover {
    background: #d5dbdb;
}

.mode-btn.active {
    background: #e74c3c;
    color: white;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.mode-btn.active[data-mode="shortBreak"] {
    background: #27ae60;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.mode-btn.active[data-mode="longBreak"] {
    background: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.timer-display {
    position: relative;
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

.progress-ring-bg {
    fill: none;
    stroke: #ecf0f1;
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: #e74c3c;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 879.646; /* 2 * π * 140 */
    stroke-dashoffset: 879.646;
    transition: stroke-dashoffset 1s ease-in-out;
}

.progress-ring-fill.short-break {
    stroke: #27ae60;
}

.progress-ring-fill.long-break {
    stroke: #3498db;
}

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

.time-display {
    font-size: 4rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.mode-label {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.stats {
    font-size: 0.9rem;
    color: #95a5a6;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.control-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.start-btn {
    background: #27ae60;
    color: white;
}

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

.start-btn.pause {
    background: #f39c12;
}

.start-btn.pause:hover {
    background: #e67e22;
}

.reset-btn {
    background: #95a5a6;
    color: white;
}

.reset-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.statistics {
    display: flex;
    justify-content: space-around;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.settings-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.settings-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.settings-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
}

.settings-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-panel h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.setting-item label {
    color: #7f8c8d;
}

.setting-item input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.save-settings-btn {
    width: 100%;
    padding: 0.75rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.save-settings-btn:hover {
    background: #2980b9;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
    }
    
    .time-display {
        font-size: 3rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .statistics {
        flex-direction: column;
        gap: 1rem;
    }
}

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

.timer-content.pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2c3e50;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #27ae60;
}

.notification.info {
    background: #3498db;
}