@import url('./calc-common.css');

/* ======================================================================
 *  久坐提醒拉伸操 /css/tools/stretch-timer.css
 * ====================================================================== */

/* ---------- 倒计时环 ---------- */
.st-timer-card { text-align: center; }
.st-ring-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 6px auto 18px;
}
.st-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.st-ring circle {
    fill: none;
    stroke-width: 12;
    stroke-linecap: round;
}
.st-ring-bg { stroke: var(--c-surface-soft); }
[data-theme="dark"] .st-ring-bg { stroke: rgba(255, 255, 255, 0.07); }
.st-ring-fg {
    stroke: var(--c-primary);
    transition: stroke-dashoffset 0.45s linear, stroke 0.3s ease;
}
.st-ring-wrap.is-done .st-ring-fg { stroke: #34c759; }
.st-ring-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}
.st-time {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
}
.st-status { font-size: 12.5px; color: var(--c-text-muted); font-weight: 600; }
.st-ring-wrap.is-running .st-status { color: var(--c-primary); }

/* ---------- 下次拉伸预告 ---------- */
.st-preview { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.st-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface-soft);
    font-size: 13px;
}
.st-preview-item .no {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: var(--c-primary);
}
.st-preview-item b { color: var(--c-text); font-weight: 700; }
.st-preview-item small { margin-left: auto; color: var(--c-text-muted); white-space: nowrap; }

/* ---------- 动作库 ---------- */
.st-lib {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}
.st-ex {
    display: flex;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    background: var(--c-surface-soft);
    transition: border-color 0.16s ease, transform 0.16s ease;
}
.st-ex:hover { border-color: var(--c-primary); transform: translateY(-2px); }
.st-ex-fig {
    flex: none;
    width: 96px;
    height: 96px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-bg-card);
    display: grid;
    place-items: center;
}
.st-ex-fig svg { width: 84px; height: 84px; }
.st-ex-fig .fg {
    fill: none;
    stroke: var(--c-text-sub);
    stroke-width: 4.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.st-ex-fig circle.fg { fill: none; }
.st-ex-fig .arr {
    fill: none;
    stroke: #0a7fc0;
    color: #0a7fc0;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 6 5;
    animation: stDash 1.6s linear infinite;
}
@keyframes stDash { to { stroke-dashoffset: -22; } }
.st-ex-body { min-width: 0; }
.st-ex-body > b { display: block; font-size: 14px; color: var(--c-text); margin-bottom: 4px; }
.st-ex-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    color: #0a7fc0;
    background: rgba(0, 150, 220, 0.10);
    margin-bottom: 7px;
}
.st-ex-body p {
    margin: 0;
    font-size: 12px;
    line-height: 1.75;
    color: var(--c-text-sub);
}
.st-ex-body p em { font-style: normal; color: var(--c-text-muted); }

[data-theme="dark"] .st-ex,
[data-theme="dark"] .st-preview-item { background: rgba(255, 255, 255, 0.03); }
[data-theme="dark"] .st-ex-fig { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .st-ex-fig .fg { stroke: #9aa5b8; }
[data-theme="dark"] .st-ex-fig .arr { stroke: #58bdf0; color: #58bdf0; }
[data-theme="dark"] .st-ex-tag { background: rgba(0, 150, 220, 0.16); color: #58bdf0; }

/* ---------- 到时提醒浮层 ---------- */
.st-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: stOvIn 0.22s ease;
}
@keyframes stOvIn { from { opacity: 0; } to { opacity: 1; } }
.st-overlay-card {
    width: 100%;
    max-width: 560px;
    max-height: 86vh;
    overflow-y: auto;
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
    padding: 24px;
    animation: stCardIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes stCardIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.st-overlay-head { text-align: center; margin-bottom: 14px; }
.st-overlay-title { font-size: 20px; font-weight: 800; color: var(--c-text); margin-bottom: 6px; }
.st-overlay-head p { margin: 0; font-size: 13px; color: var(--c-text-sub); }
.st-overlay-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.st-overlay-list .st-ex { background: var(--c-surface-soft); }
.st-overlay-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.st-overlay-btns .btn { flex: 1 1 200px; }

@media (max-width: 620px) {
    .st-ring-wrap { width: 180px; height: 180px; }
    .st-time { font-size: 32px; }
    .st-lib { grid-template-columns: 1fr; }
    .st-overlay-card { padding: 18px; }
}
