/* ===================== 番茄专注钟 ===================== */

.pd-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }

.pd-panel {
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 16px;
    padding: 26px 24px;
}

/* ---- 计时环 ---- */
.pd-timer { position: relative; max-width: 300px; margin: 0 auto; }
.pd-ring { width: 100%; display: block; transform: rotate(-90deg); }
.pd-ring-track { fill: none; stroke: var(--c-border, #e2e8f0); stroke-width: 12; }
.pd-ring-bar {
    fill: none; stroke: url(#pdGrad); stroke-width: 12; stroke-linecap: round;
    stroke-dasharray: 804.25; stroke-dashoffset: 0;
    transition: stroke-dashoffset .4s linear;
}
.pd-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px;
}
.pd-phase { font-size: 14px; font-weight: 800; color: var(--c-text-muted, #64748b); }
.pd-time { font-size: 46px; font-weight: 900; color: var(--c-text, #0f172a); font-variant-numeric: tabular-nums; line-height: 1.1; }
.pd-round { font-size: 12px; color: var(--c-text-muted, #94a3b8); }
.pd-msg { text-align: center; font-size: 13px; color: var(--c-text-muted, #64748b); margin: 14px auto 0; min-height: 20px; max-width: 320px; }

.pd-controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pd-controls .btn { min-width: 76px; }

.pd-settings {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
    margin-top: 16px; padding: 12px 14px;
    background: var(--c-surface-soft, #f8fafc);
    border-radius: 12px;
}
.pd-field { display: flex; align-items: center; gap: 6px; }
.pd-field label { font-size: 12px; color: var(--c-text-muted, #64748b); font-weight: 600; }
.pd-field select {
    padding: 6px 10px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 8px;
    background: var(--c-surface, #fff);
    color: var(--c-text, #0f172a);
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.pd-today {
    display: flex; justify-content: center; gap: 22px;
    margin-top: 16px;
    font-size: 13px; color: var(--c-text-muted, #64748b);
}
.pd-today b { color: var(--c-text, #0f172a); font-size: 15px; }

/* ---- 任务清单 ---- */
.pd-task-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.pd-task-head h2 { font-size: 17px; font-weight: 800; color: var(--c-text, #0f172a); margin: 0; }
.pd-task-note { font-size: 12px; color: var(--c-text-muted, #94a3b8); }

.pd-add { display: flex; gap: 8px; margin-bottom: 12px; }
.pd-input {
    flex: 1; min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 10px;
    background: var(--c-surface, #fff);
    color: var(--c-text, #0f172a);
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pd-input:focus { border-color: var(--c-primary, #0066ff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary, #0066ff) 15%, transparent); }
.pd-add-btn {
    flex-shrink: 0;
    width: 42px;
    border: none;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #f97316, #f43f5e);
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}
.pd-add-btn:hover { transform: scale(1.05); filter: brightness(1.06); }

.pd-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.pd-task {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 12px;
    background: var(--c-surface-soft, #f8fafc);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 10px;
    transition: border-color .15s ease;
}
.pd-task.is-active { border-color: var(--c-primary, #0066ff); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-primary, #0066ff) 12%, transparent); }
.pd-task.is-done .pd-task-text { text-decoration: line-through; color: var(--c-text-muted, #94a3b8); }
.pd-task-check {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border-radius: 7px;
    border: 2px solid var(--c-border, #cbd5e1);
    background: var(--c-surface, #fff);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: transparent;
    transition: all .15s ease;
}
.pd-task-check:hover { border-color: var(--c-primary, #0066ff); }
.pd-task.is-done .pd-task-check { background: #22c55e; border-color: #22c55e; color: #fff; }
.pd-task-text { flex: 1; min-width: 0; font-size: 14px; color: var(--c-text, #0f172a); word-break: break-word; }
.pd-task-flag {
    flex-shrink: 0;
    font-size: 11px; font-weight: 700;
    color: var(--c-primary, #0066ff);
    background: color-mix(in srgb, var(--c-primary, #0066ff) 10%, transparent);
    padding: 3px 8px; border-radius: 99px;
    cursor: pointer;
}
.pd-task-del {
    flex-shrink: 0;
    border: none; background: none;
    font-size: 15px; color: var(--c-text-muted, #94a3b8);
    cursor: pointer; padding: 2px 4px;
    border-radius: 6px;
    transition: color .15s ease, background .15s ease;
}
.pd-task-del:hover { color: #ef4444; background: #fef2f2; }

.pd-task-empty { text-align: center; padding: 30px 10px; color: var(--c-text-muted, #94a3b8); }
.pd-task-empty .emoji { font-size: 34px; margin-bottom: 8px; }
.pd-task-empty p { font-size: 13px; margin: 0; }
.pd-task-tip { margin-top: 12px; font-size: 12px; color: var(--c-text-muted, #94a3b8); text-align: center; }

@media (max-width: 860px) {
    .pd-layout { grid-template-columns: 1fr; }
}

/* ===================== 暗黑模式适配 ===================== */
:root[data-theme="dark"] .pd-task-del:hover { background: rgba(239, 68, 68, .14); }
:root[data-theme="dark"] .pd-task-check { border-color: #475569; }
:root[data-theme="dark"] .pd-task-empty .emoji { filter: brightness(1.1); }
