/* ======================================================================
 *  儿童任务分解器 /tool/task-breaker
 *  依赖 calc-common.css 变量与公共类，支持黑夜模式。
 * ====================================================================== */

.tb-seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}
.tb-seg button {
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text-sub);
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
}
.tb-seg button:hover { border-color: #ff8a3d; color: #ff8a3d; }
.tb-seg button.is-active {
    background: linear-gradient(135deg, rgba(255, 138, 61, 0.16), rgba(255, 159, 67, 0.07));
    border-color: rgba(255, 138, 61, 0.55);
    color: #e06a1a;
}

/* ---------- 模板卡片 ---------- */
.tb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
}
.tb-card {
    border: 1.5px solid var(--c-border);
    border-radius: 14px;
    background: var(--c-surface-soft);
    padding: 14px 8px 11px;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.16s ease;
}
.tb-card:hover {
    border-color: #ff8a3d;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.tb-card-icon { font-size: 28px; line-height: 1; }
.tb-card-name { font-size: 13px; font-weight: 700; color: var(--c-text); text-align: center; line-height: 1.4; }
.tb-card-meta { font-size: 11px; color: var(--c-text-muted); }

/* ---------- 步骤区 ---------- */
.tb-steps-box {
    margin-top: 16px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 138, 61, 0.3);
    background: linear-gradient(135deg, rgba(255, 138, 61, 0.06), rgba(255, 159, 67, 0.03));
    animation: calcFade 0.25s ease;
}
.tb-steps-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tb-steps-head h3 { font-size: 15px; font-weight: 800; color: var(--c-text); }
.tb-mini { height: 30px; padding: 0 12px; font-size: 12px; }
.tb-progress-track { height: 9px; border-radius: 99px; background: var(--c-surface-soft); border: 1px solid var(--c-border); overflow: hidden; margin-bottom: 14px; }
.tb-progress-track i {
    display: block; height: 100%; width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, #ff8a3d, #ffb020);
    transition: width 0.3s ease;
}
.tb-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tb-step {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    transition: all 0.2s ease;
}
.tb-check {
    flex: none;
    width: 30px; height: 30px;
    border-radius: 10px;
    border: 2px solid var(--c-border);
    background: var(--c-surface-soft);
    cursor: pointer;
    font-family: inherit;
    display: grid;
    place-items: center;
    padding: 0;
    transition: all 0.15s ease;
}
.tb-check-num { font-size: 13px; font-weight: 800; color: var(--c-text-muted); }
.tb-check:hover { border-color: #ff8a3d; }
.tb-check.is-on { background: #34c759; border-color: #34c759; }
.tb-check.is-on .tb-check-num { color: #fff; }
.tb-check.is-on .tb-check-num::before { content: '✓'; }
.tb-check.is-on .tb-check-num { font-size: 0; }
.tb-check.is-on .tb-check-num::before { font-size: 15px; }
.tb-step-txt { font-size: 13.5px; line-height: 1.7; color: var(--c-text); padding-top: 4px; }
.tb-step.is-done { background: rgba(52, 199, 89, 0.07); border-color: rgba(52, 199, 89, 0.3); }
.tb-step.is-done .tb-step-txt { color: var(--c-text-muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.tb-done { text-align: center; padding: 18px 10px 4px; animation: calcFade 0.3s ease; }
.tb-done-emoji { font-size: 40px; margin-bottom: 6px; }
.tb-done p { font-size: 14px; font-weight: 700; color: #1f9d43; }

/* ---------- AI ---------- */
.tb-ai-lead { font-size: 13px; line-height: 1.85; color: var(--c-text-sub); margin-bottom: 12px; }
.tb-ai-row { display: flex; gap: 10px; }
.tb-ai-row input {
    flex: 1; min-width: 0; 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;
}
.tb-ai-row input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.tb-tips {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(124, 92, 255, 0.07);
    border: 1px solid rgba(124, 92, 255, 0.25);
}
.tb-tips h4 { font-size: 13px; font-weight: 800; margin-bottom: 6px; color: var(--c-text); }
.tb-tips ul { padding-left: 18px; margin: 0; }
.tb-tips li { font-size: 12.5px; line-height: 1.8; color: var(--c-text-sub); }

/* ---------- 右侧方法卡 ---------- */
.tb-why h3 { font-size: 14.5px; font-weight: 800; margin: 14px 0 7px; }
.tb-why h3:first-child { margin-top: 0; }
.tb-why p, .tb-why li { font-size: 13px; line-height: 1.85; color: var(--c-text-sub); }
.tb-why b { color: var(--c-text); }
.tb-why ol { padding-left: 20px; }
.tb-saycard {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
}
.tb-saycard p { margin: 3px 0; }
.tb-saycard p:first-child { color: #e0342b; }
.tb-saycard p:last-child { color: #1f9d43; font-weight: 700; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .tb-seg { grid-template-columns: 1fr; }
    .tb-ai-row { flex-direction: column; }
    .tb-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
}

/* ---------- 黑夜模式 ---------- */
[data-theme="dark"] .tb-seg button { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .tb-seg button.is-active { background: rgba(255, 138, 61, 0.18); border-color: rgba(255, 138, 61, 0.55); color: #ffb84d; }
[data-theme="dark"] .tb-card { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .tb-steps-box { background: rgba(255, 138, 61, 0.08); border-color: rgba(255, 138, 61, 0.3); }
[data-theme="dark"] .tb-step { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .tb-step.is-done { background: rgba(52, 199, 89, 0.12); }
[data-theme="dark"] .tb-check { background: rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .tb-step.is-done .tb-step-txt { color: var(--c-text-muted); }
[data-theme="dark"] .tb-ai-row input { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .tb-tips { background: rgba(124, 92, 255, 0.12); border-color: rgba(124, 92, 255, 0.3); }
[data-theme="dark"] .tb-saycard { background: rgba(255, 255, 255, 0.03); }
[data-theme="dark"] .tb-saycard p:first-child { color: #ff9a94; }
[data-theme="dark"] .tb-saycard p:last-child { color: #4ede78; }
