/* 专注计时器（番茄钟）样式 */

/* 全屏容器 */
.pomo-fullscreen {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    overflow: hidden;
}

/* 顶部栏 */
.pomo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.back-btn-wrap {
    position: relative;
}

.back-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    cursor: pointer;
    z-index: 1;
}

.back-overlay.active {
    display: block;
}

.pomo-header .back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.pomo-header .back-btn:hover {
    color: var(--primary-color);
}

.pomo-header .title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #6b7280;
}

.pomo-header .header-actions {
    display: flex;
    gap: 0.5rem;
}

.pomo-header .action-btn {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pomo-header .action-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* 主区域 */
.pomo-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    gap: 1.5rem;
    overflow: hidden;
}

/* 今日统计 */
.today-stats {
    display: flex;
    gap: 2rem;
}

.today-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-light);
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
}

.today-stat i {
    color: #f59e0b;
}

.today-stat span {
    font-weight: 700;
    color: var(--text-color);
}

/* 阶段标签 */
.phase-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    padding: 0.25rem;
}

.phase-tab {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-light);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.phase-tab.active {
    color: white;
}

.phase-tab.active[data-phase="focus"] {
    background: #ef4444;
}

.phase-tab.active[data-phase="break"] {
    background: #22c55e;
}

.phase-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 计时器环 */
.timer-area {
    position: relative;
}

.timer-ring {
    position: relative;
    width: 260px;
    height: 260px;
}

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

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 8;
}

.ring-progress {
    fill: none;
    stroke: #ef4444;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.ring-progress.break {
    stroke: #22c55e;
}

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

.timer-time {
    font-size: 4rem;
    font-weight: 700;
    color: var(--text-color);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    letter-spacing: 2px;
}

.timer-phase {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* 控制按钮 */
.timer-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ctrl-btn {
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn.primary {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    gap: 0.3rem;
    border-radius: 2rem;
    padding: 0 1.5rem;
    width: auto;
    min-width: 160px;
    height: 56px;
}

.ctrl-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(239, 68, 68, 0.6);
}

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

.ctrl-btn.primary.running {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.ctrl-btn.primary.running:hover {
    box-shadow: 0 6px 30px rgba(245, 158, 11, 0.6);
}

.ctrl-btn.primary.break-phase {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4);
}

.ctrl-btn.primary.break-phase:hover {
    box-shadow: 0 6px 30px rgba(34, 197, 94, 0.6);
}

.ctrl-btn.secondary {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1.2rem;
}

.ctrl-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

/* 番茄进度点 */
.pomo-dots {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.pomo-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.pomo-dot.done {
    background: #ef4444;
    border-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.pomo-dot.current {
    border-color: #f59e0b;
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
}

.pomo-dot-divider {
    width: 2px;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 0.25rem;
}

/* 提示文字 */
.pomo-tip {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ==================== 弹窗通用 ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3 i {
    color: var(--primary-color);
}

.close-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-color);
}

/* 设置表单 */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.setting-row label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.option-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.opt-btn {
    flex: 1;
    min-width: 70px;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: transparent;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.opt-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

/* 记录 */
.record-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.summary-card {
    text-align: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

.summary-card .val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.summary-card .lbl {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.record-list {
    margin-bottom: 1rem;
    max-height: 250px;
    overflow-y: auto;
}

.empty-record {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.record-item .record-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.record-item .record-data {
    text-align: right;
    font-size: 0.85rem;
}

.record-item .record-data .count {
    color: #ef4444;
    font-weight: 600;
}

.record-item .record-data .mins {
    color: var(--text-light);
    margin-left: 0.5rem;
}

.btn-primary, .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.4);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    width: 100%;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* 完成弹窗 */
.done-box {
    text-align: center;
    padding: 2rem;
}

.done-icon {
    font-size: 4rem;
    color: #22c55e;
    margin-bottom: 1rem;
}

.done-icon.break-done {
    color: #ef4444;
}

.done-title {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.done-desc {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* ==================== 响应式 ==================== */
@media (max-width: 480px) {
    .timer-ring {
        width: 220px;
        height: 220px;
    }

    .timer-time {
        font-size: 3.2rem;
    }

    .today-stats {
        gap: 1rem;
    }

    .today-stat {
        font-size: 0.85rem;
        padding: 0.4rem 0.75rem;
    }

    .ctrl-btn.primary {
        min-width: 140px;
        height: 50px;
        font-size: 1.3rem;
    }

    .ctrl-btn.secondary {
        width: 42px;
        height: 42px;
    }
}

@media (max-height: 650px) {
    .pomo-main {
        gap: 1rem;
        padding: 1rem;
    }

    .timer-ring {
        width: 200px;
        height: 200px;
    }

    .timer-time {
        font-size: 3rem;
    }

    .pomo-tip {
        display: none;
    }
}
