* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e74c3c;
    --primary-dark: #c0392b;
    --work-color: #e74c3c;
    --short-break-color: #27ae60;
    --long-break-color: #3498db;
    --bg-color: #ffffff;
    --card-bg: #f8f9fa;
    --text-color: #2d3436;
    --text-muted: #636e72;
    --border-color: #e9ecef;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    min-height: 100vh;
    color: var(--text-color);
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 30px;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.section-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 6px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon img {
    width: 20px;
    height: 20px;
}

.btn-icon:hover {
    background: #e9ecef;
}

/* 模式切换 */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* 当前任务显示 */
.current-task {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.2);
    border-radius: 25px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.current-task-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.current-task-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-stop-task {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.btn-stop-task:hover {
    opacity: 1;
}

.btn-stop-task img {
    width: 14px;
    height: 14px;
}

.mode-tab {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-muted);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.mode-tab:hover {
    background: #e9ecef;
}

.mode-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.mode-tab.active[data-mode="shortBreak"] {
    background: var(--short-break-color);
    border-color: var(--short-break-color);
}

.mode-tab.active[data-mode="longBreak"] {
    background: var(--long-break-color);
    border-color: var(--long-break-color);
}

/* 计时器 */
.timer-display {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.timer-circle {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--card-bg);
}

/* 进度环 */
.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    transform: rotate(-90deg);
    z-index: 10;
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(0, 0, 0, 0.08);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

/* 时间文字 */
.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.8rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: var(--text-color);
    z-index: 20;
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.btn-control {
    padding: 15px 50px;
    font-size: 1.1rem;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    background: var(--primary-color);
    color: white;
}

.btn-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.3);
}

.btn-control.btn-secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-control.btn-secondary:hover {
    background: #e9ecef;
    box-shadow: none;
}

/* 统计 */
.stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 任务清单 */
.tasks-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}

.tasks-section h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.task-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.task-input-wrapper input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: white;
    color: var(--text-color);
    font-size: 0.95rem;
}

.task-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.task-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.break-type-select {
    width: 80px;
    padding: 12px 8px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: white;
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
}

.break-type-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-add {
    width: 45px;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-add:hover {
    background: var(--primary-dark);
}

.task-list {
    list-style: none;
    max-height: 250px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 8px;
    transition: all 0.3s;
}

.task-item.active {
    border-color: var(--primary-color);
    background: rgba(231, 76, 60, 0.05);
    box-shadow: 0 2px 12px rgba(231, 76, 60, 0.15);
}

.task-item:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.task-item.active:hover {
    border-color: var(--primary-color);
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.task-content {
    flex: 1;
    min-width: 0;
}

.task-text {
    font-size: 0.95rem;
    display: block;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.task-break-type {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
}

.task-break-type.short {
    background: rgba(39, 174, 96, 0.15);
    color: var(--short-break-color);
}

.task-break-type.long {
    background: rgba(52, 152, 219, 0.15);
    color: var(--long-break-color);
}

.task-time {
    color: var(--text-muted);
}

.task-pomodoros {
    color: var(--primary-color);
}

/* 任务执行按钮 */
.btn-task-play {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-task-play:hover:not(.disabled) {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.btn-task-play.disabled {
    background: #ccc;
    cursor: pointer;
}

.btn-task-play img {
    width: 14px;
    height: 14px;
    filter: brightness(0) invert(1);
}

.task-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.task-delete img {
    width: 16px;
    height: 16px;
}

.task-item:hover .task-delete {
    opacity: 1;
}

.task-delete:hover {
    color: #e74c3c;
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settings-panel.active {
    display: flex;
}

.settings-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.settings-content h2 {
    margin-bottom: 25px;
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.btn-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close img {
    width: 20px;
    height: 20px;
}

.btn-close:hover {
    color: var(--text-color);
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.setting-group input,
.setting-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: white;
    color: var(--text-color);
    font-size: 1rem;
}

/* 音效选择器 */
.sound-select-wrapper {
    display: flex;
    gap: 10px;
}

.sound-select-wrapper select {
    flex: 1;
}

.btn-preview {
    width: 46px;
    height: 46px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-preview:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-preview:hover:not(:disabled) img {
    filter: brightness(0) invert(1);
}

.btn-preview:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-preview img {
    width: 20px;
    height: 20px;
}

.sound-desc {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.setting-group input:focus,
.setting-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-save {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: var(--primary-color);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.3s;
}

.btn-save:hover {
    background: var(--primary-dark);
}

/* 全屏模式 */
body.fullscreen .header,
body.fullscreen .tasks-section,
body.fullscreen .stats {
    display: none;
}

body.fullscreen .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

body.fullscreen .timer-circle {
    width: 350px;
    height: 350px;
}

body.fullscreen .timer-text {
    font-size: 5rem;
}

body.fullscreen .progress-ring {
    width: 350px;
    height: 350px;
}

/* 响应式 */
@media (max-width: 480px) {
    .timer-circle {
        width: 240px;
        height: 240px;
    }
    
    .timer-text {
        font-size: 3rem;
    }
    
    .progress-ring {
        width: 240px;
        height: 240px;
    }
    
    .btn-control {
        padding: 12px 35px;
    }
}

/* 友情链接 */
.footer-links {
    margin-top: 30px;
    padding: 15px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links .links-label {
    margin-right: 8px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary-color);
}
