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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

header {
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: #666;
    font-size: 1rem;
}

.timer-wrapper {
    margin-bottom: 40px;
}

.mode-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.timer-display {
    position: relative;
    margin: 30px 0;
}

.progress-ring {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 0 auto;
}

.progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

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

.progress-bar {
    fill: none;
    stroke: #667eea;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.3s ease, stroke 0.3s ease;
}

.progress-bar.work {
    stroke: #667eea;
}

.progress-bar.short-break {
    stroke: #4caf50;
}

.progress-bar.long-break {
    stroke: #2196f3;
}

.time-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    font-weight: 700;
    color: #333;
    font-variant-numeric: tabular-nums;
}

.separator {
    margin: 0 4px;
}

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

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

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

.status {
    margin-top: 20px;
}

#statusText {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

.settings {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.settings h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

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

.setting-item label {
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
}

.setting-item input {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    text-align: center;
    transition: border-color 0.3s ease;
}

.setting-item input:focus {
    outline: none;
    border-color: #667eea;
}

/* 工作计划样式 */
.work-plan {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.work-plan h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.plan-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #666;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

#savePlanBtn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

/* 历史记录样式 */
.history {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    color: #333;
    font-size: 1.2rem;
    margin: 0;
}

.btn-icon-only {
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    transition: all 0.3s ease;
}

.btn-icon-only:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.history-list {
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
}

.history-list.collapsed {
    display: none;
}

.history-item {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateX(4px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.history-item-title {
    font-weight: 600;
    color: #333;
    font-size: 1rem;
    flex: 1;
}

.history-item-date {
    color: #999;
    font-size: 0.85rem;
    white-space: nowrap;
    margin-left: 12px;
}

.history-item-note {
    color: #666;
    font-size: 0.9rem;
    margin-top: 8px;
    line-height: 1.5;
}

.history-item-meta {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #999;
}

.history-item-mode {
    padding: 4px 8px;
    background: #e3f2fd;
    border-radius: 4px;
    color: #1976d2;
}

.history-item-mode.short-break {
    background: #e8f5e9;
    color: #388e3c;
}

.history-item-mode.long-break {
    background: #e1f5fe;
    color: #0288d1;
}

.history-item-duration {
    color: #666;
}

.history-empty {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 0.95rem;
}

.delete-btn {
    background: #ff5252;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.delete-btn:hover {
    background: #ff1744;
    transform: scale(1.05);
}

/* 响应式设计 */
@media (max-width: 600px) {
    .container {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .progress-ring {
        width: 240px;
        height: 240px;
    }

    .time-text {
        font-size: 2.8rem;
    }

    .controls {
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .history-item-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .history-item-date {
        margin-left: 0;
        margin-top: 4px;
    }

    .history-item-meta {
        flex-wrap: wrap;
    }
}

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

.timer-display.running .progress-ring {
    animation: pulse 2s ease-in-out infinite;
}

