/* ======================================================================
 *  study-timer —— 番茄学习计时器独立样式
 *  依赖：home.css + tool-detail.css
 * ====================================================================== */

/* ---- 卡片 ---- */
.st-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}
.st-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 18px;
}

/* ---- Hero 区 ---- */
.st-hero {
    text-align: center;
    padding: 28px 24px 24px;
}

/* 模式切换 */
.st-modes {
    display: inline-flex;
    background: var(--c-surface-soft);
    border-radius: 28px;
    padding: 4px;
    margin-bottom: 22px;
}
.st-mode {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-sub);
    background: transparent;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.st-mode:hover { color: var(--c-text); }
.st-mode.active {
    color: #fff;
    background: var(--st-mode-color, #e74c3c);
}
.st-mode-focus.active { --st-mode-color: #e74c3c; background: #e74c3c; }
.st-mode-short.active { --st-mode-color: #27ae60; background: #27ae60; }
.st-mode-long.active { --st-mode-color: #16a085; background: #16a085; }

/* 环形进度 */
.st-timer-ring {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 22px;
}
.st-ring-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.st-ring-bg {
    fill: none;
    stroke: var(--c-border);
    stroke-width: 10;
}
.st-ring-fg {
    fill: none;
    stroke: var(--st-mode-color, #e74c3c);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
    /* 圆周长 = 2πr = 2π×90 = 565.48 */
}
.st-timer-ring[data-mode="focus"] .st-ring-fg { stroke: #e74c3c; }
.st-timer-ring[data-mode="short"] .st-ring-fg { stroke: #27ae60; }
.st-timer-ring[data-mode="long"]  .st-ring-fg { stroke: #16a085; }

.st-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.st-display {
    font-size: 52px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--c-text);
    line-height: 1;
    letter-spacing: -0.03em;
}
.st-mode-label {
    font-size: 13px;
    color: var(--c-text-sub);
    margin-top: 6px;
    font-weight: 600;
}

/* 控制按钮 */
.st-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.st-btn {
    padding: 10px 22px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.16s ease;
    border: 1px solid transparent;
}
.st-btn-primary {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}
.st-btn-primary:hover { background: #c0392b; border-color: #c0392b; }
.st-btn-secondary {
    background: var(--c-surface-soft);
    color: var(--c-text);
    border-color: var(--c-border);
}
.st-btn-secondary:hover { border-color: #e74c3c; color: #e74c3c; }
.st-btn-ghost {
    background: transparent;
    color: var(--c-text-sub);
    border-color: var(--c-border);
}
.st-btn-ghost:hover { color: var(--c-text); border-color: var(--c-primary); }
.st-btn:active { transform: scale(0.97); }

/* 统计 */
.st-stat-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}
.st-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.st-stat-num {
    font-size: 26px;
    font-weight: 900;
    color: #e74c3c;
    line-height: 1;
}
.st-stat-label {
    font-size: 12px;
    color: var(--c-text-sub);
    margin-top: 4px;
}

/* ---- 设置表单 ---- */
.st-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.st-field { display: flex; flex-direction: column; gap: 6px; }
.st-field-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-sub);
}
.st-form input[type="number"] {
    width: 100%;
    height: 43px;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.st-form input[type="number"]:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2);
}
.st-form input[type="number"]::-webkit-outer-spin-button,
.st-form input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.st-form input[type="number"] { -moz-appearance: textfield; }

/* 选项行（checkbox） */
.st-option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 14px;
    padding: 14px 16px;
    background: var(--c-surface-soft);
    border-radius: 12px;
}
.st-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-text);
    cursor: pointer;
    user-select: none;
}
.st-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #e74c3c;
}

/* 按钮区 */
.st-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.st-note {
    font-size: 12px;
    color: var(--c-text-sub);
    line-height: 1.6;
    margin: 0;
}

/* ---- 今日统计 ---- */
.st-today-chart {
    padding: 14px;
    background: var(--c-surface-soft);
    border-radius: 12px;
    min-height: 80px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    align-items: center;
}
.st-chart-empty {
    color: var(--c-text-sub);
    font-size: 13px;
    text-align: center;
    width: 100%;
}
.st-tomato {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
    animation: tomatoPop 0.3s ease;
}
.st-tomato.st-long { background: #16a085; }
.st-tomato.st-short { background: #27ae60; }
@keyframes tomatoPop {
    from { transform: scale(0); }
    to   { transform: scale(1); }
}

/* 本周概览 */
.st-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.st-week-day {
    text-align: center;
    padding: 8px 4px;
    border-radius: 10px;
    background: var(--c-surface-soft);
}
.st-week-day.st-today {
    background: color-mix(in srgb, #e74c3c 20%, transparent);
    border: 1px solid color-mix(in srgb, #e74c3c 30%, transparent);
}
.st-week-day-name {
    font-size: 11px;
    color: var(--c-text-sub);
    font-weight: 600;
}
.st-week-day-num {
    font-size: 16px;
    font-weight: 800;
    color: var(--c-text);
    margin-top: 2px;
}
.st-week-day.st-today .st-week-day-num { color: #e74c3c; }

/* ---- 免责 ---- */
.st-disclaim {
    font-size: 13px;
    color: var(--c-text-sub);
    line-height: 1.8;
    padding: 14px 18px;
    background: var(--c-surface-soft);
    border: 1px solid color-mix(in srgb, #e74c3c 25%, transparent);
    border-radius: var(--radius-md);
}
.st-disclaim b { color: var(--c-text); }

/* ---- 简介区 ---- */
.st-info-block { margin-bottom: 24px; }

/* ---- 响应式 ---- */
@media (max-width: 640px) {
    .st-timer-ring { width: 180px; height: 180px; }
    .st-display { font-size: 40px; }
    .st-form { grid-template-columns: 1fr; }
    .st-week-row { gap: 4px; }
    .st-week-day { padding: 6px 2px; }
    .st-modes { flex-wrap: wrap; justify-content: center; }
    .st-mode { padding: 6px 14px; font-size: 12px; }
    .st-stat-row { gap: 16px; }
    .st-stat-num { font-size: 22px; }
}
