/* ==========================================================
   P0 第 2 批 22 个工具共用样式
   依赖：css/tools/calc-common.css、css/tools/adult-calc.css
   ========================================================== */

/* ---------- AI 生成结果的排版（ai-gen.js 用到） ---------- */
.ag-body { font-size: 13.5px; line-height: 1.9; color: var(--c-text); }
.ag-h {
    margin: 14px 0 6px;
    font-size: 13.5px;
    font-weight: 800;
    color: #0a7fc0;
    padding-left: 10px;
    border-left: 3px solid #0a7fc0;
}
.ag-h:first-child { margin-top: 0; }
.ag-p { margin: 0 0 8px; white-space: normal; word-break: break-word; }
[data-theme="dark"] .ag-h { color: #58bdf0; border-left-color: #58bdf0; }

/* ---------- 通用工具条 ---------- */
.b2-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}
.b2-bar .btn { flex: none; }
.b2-hint { font-size: 12.5px; color: var(--c-text-muted); line-height: 1.7; }

/* ---------- 清单 / 勾选块（验房清单、订阅审计条目） ---------- */
.b2-group { margin-bottom: 18px; }
.b2-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 8px;
}
.b2-group-head small { font-weight: 400; color: var(--c-text-muted); font-size: 12px; }
.b2-items { display: grid; gap: 8px; }
.b2-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.7;
    cursor: pointer;
    background: var(--c-surface);
    transition: background .15s, border-color .15s;
}
.b2-item:hover { border-color: rgba(0, 150, 220, .4); }
.b2-item input { margin-top: 3px; flex: none; width: 16px; height: 16px; accent-color: #0096dc; }
.b2-item .b2-mark { flex: none; width: 18px; text-align: center; font-size: 13px; }
.b2-item .b2-item-main { flex: 1; min-width: 0; }
.b2-item .b2-item-t { font-weight: 700; }
.b2-item .b2-item-d { display: block; font-size: 12px; color: var(--c-text-muted); margin-top: 2px; }
.b2-item.is-on { background: rgba(52, 199, 89, .1); border-color: rgba(52, 199, 89, .38); }
.b2-item.is-bad { background: rgba(224, 68, 124, .08); border-color: rgba(224, 68, 124, .32); }

/* ---------- 卡片网格（拼音表、Sight Words、动物叫声） ---------- */
.b2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.b2-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 62px;
    padding: 8px 4px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: transform .12s, border-color .15s, background .15s;
}
.b2-cell:hover { transform: translateY(-2px); border-color: rgba(0, 150, 220, .45); }
.b2-cell.is-on { background: rgba(0, 150, 220, .12); border-color: rgba(0, 150, 220, .45); }
.b2-cell.is-off { opacity: .45; }
.b2-cell .b2-cell-sub { font-size: 11.5px; font-weight: 500; color: var(--c-text-muted); }
.b2-cell--lg { min-height: 82px; font-size: 22px; }

/* ---------- 识字量测试 ---------- */
.b2-quiz {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 10px;
    margin: 14px 0;
}
.b2-quiz-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    border: 1px solid var(--c-border);
    border-radius: 14px;
    background: var(--c-surface);
    cursor: pointer;
    user-select: none;
    transition: transform .12s, background .15s, border-color .15s;
}
.b2-quiz-cell:hover { transform: scale(1.05); }
.b2-quiz-cell.is-on { background: rgba(52, 199, 89, .13); border-color: rgba(52, 199, 89, .45); }
.b2-quiz-cell.is-off { background: transparent; opacity: .4; }

/* ---------- 大号计数器（跳绳） ---------- */
.b2-counter {
    text-align: center;
    padding: 18px 10px 8px;
}
.b2-counter-num {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
}
.b2-counter-label { font-size: 13px; color: var(--c-text-muted); margin-top: 6px; }
.b2-counter-tap {
    margin-top: 14px;
    width: 100%;
    min-height: 130px;
    border-radius: 20px;
    border: 2px dashed var(--c-border);
    background: var(--c-surface-soft);
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text-muted);
    cursor: pointer;
}
.b2-counter-tap:active { background: rgba(0, 150, 220, .12); }

/* ---------- 可编辑表格（课程表） ---------- */
.b2-table-wrap { overflow-x: auto; margin-top: 12px; }
.b2-table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 12.5px; }
.b2-table th, .b2-table td {
    border: 1px solid var(--c-border);
    padding: 4px;
    text-align: center;
    vertical-align: middle;
}
.b2-table th { background: var(--c-surface-soft); font-weight: 800; padding: 8px 4px; }
.b2-table td input {
    width: 100%;
    min-width: 62px;
    border: 0;
    background: transparent;
    text-align: center;
    font-size: 12.5px;
    color: inherit;
    padding: 6px 2px;
    outline: none;
}
.b2-table td input:focus { background: rgba(0, 150, 220, .1); border-radius: 6px; }
.b2-table .b2-th-time { width: 66px; font-size: 11.5px; font-weight: 600; }

/* ---------- 订阅清单编辑器 ---------- */
.sa-list { display: grid; gap: 8px; }
.sa-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1fr 34px;
    gap: 8px;
    align-items: center;
}
.sa-del {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text-muted);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}
.sa-del:hover { color: #e0447c; border-color: rgba(224, 68, 124, .5); }
.sa-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}
.sa-tag--ok { background: rgba(52, 199, 89, .14); color: #1f9d43; }
.sa-tag--warn { background: rgba(255, 167, 38, .16); color: #b26a00; }
.sa-tag--bad { background: rgba(224, 68, 124, .13); color: #d02a6c; }
[data-theme="dark"] .sa-tag--ok { color: #4ede78; }
[data-theme="dark"] .sa-tag--warn { color: #ffb84d; }
[data-theme="dark"] .sa-tag--bad { color: #ff7ab0; }
@media (max-width: 620px) {
    .sa-row { grid-template-columns: 1fr 1fr; }
    .sa-row .sa-del { width: 100%; }
}

/* ---------- 打印 ---------- */
@media print {
    .detail-breadcrumb, .detail-tabs, .related, .back-to-top,
    .calc-card, .b2-bar, .calc-disclaim, .site-header, .site-footer, .b2-noprint { display: none !important; }
    .b2-cell, .b2-item, .b2-quiz-cell { break-inside: avoid; }
    .b2-print-only { display: block !important; }
}
.b2-print-only { display: none; }
