/* ======================================================================
 *  24点计算器（求解器 + 出题器） twenty-four-points-solver.css
 *  依赖 calc-common.css 母版样式，仅补充本工具专属结构。
 * ====================================================================== */

/* ---------- 顶部大模式切换：求解 / 出题 ---------- */
.tfp-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}
.tfp-tab {
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text-sub);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.16s ease;
}
.tfp-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.tfp-tab.active {
    background: linear-gradient(135deg, rgba(0, 150, 220, 0.16), rgba(0, 150, 220, 0.08));
    border-color: rgba(0, 150, 220, 0.55);
    color: #0a7fc0;
}

/* ---------- 求解：数字格 ---------- */
.tfp-num-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
    gap: 8px;
}
.tfp-num-cell { min-width: 0; }
.tfp-num-cell.is-off { display: none; }
.tfp-num-cell .calc-input {
    padding: 0;
    height: 50px;
    text-align: center;
    font-size: 19px;
    font-weight: 800;
}
.tfp-num-cell .calc-input:disabled { opacity: .45; }

/* ---------- 求解：运算符勾选 ---------- */
.tfp-ops {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 6px;
    border-radius: 14px;
    transition: box-shadow .16s ease;
}
.tfp-ops.has-none {
    box-shadow: 0 0 0 2px dashed rgba(224, 68, 124, .55);
}
.tfp-op {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 0 7px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-surface-soft);
    color: var(--c-text-sub);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
    user-select: none;
}
.tfp-op:hover { border-color: var(--c-primary); }
.tfp-op input { width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer; }
.tfp-op:has(input:checked) {
    border-color: rgba(0, 150, 220, .6);
    background: rgba(0, 150, 220, .1);
    color: #0a7fc0;
    font-weight: 800;
}

/* 小按钮行 */
.tfp-btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.tfp-btn-row .btn { flex: 1 1 30%; min-width: 96px; }

/* ---------- 结果：hero ---------- */
.tfp-hero-nums {
    font-size: 15px;
    color: var(--c-text-sub);
    font-weight: 700;
    margin-bottom: 2px;
    word-break: break-all;
}
.tfp-hero-ops {
    font-size: 13px;
    color: var(--c-text-muted);
    margin-top: 2px;
    font-weight: 700;
    letter-spacing: .12em;
}
.calc-hero-num.tfp-ok { color: #1f9d43; }
.calc-hero-num.tfp-no { color: #e0447c; font-size: 32px; }

/* ---------- 结果：解法列表 ---------- */
.tfp-error {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
    color: #e0447c;
    background: rgba(224, 68, 124, .07);
    border: 1px dashed rgba(224, 68, 124, .35);
    margin-bottom: 14px;
}
.tfp-sol-list {
    list-style: none;
    margin: 0 0 12px;
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid var(--c-border);
    border-radius: 14px;
}
.tfp-sol-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--c-border);
}
.tfp-sol-row:last-child { border-bottom: none; }
.tfp-sol-idx {
    flex: none;
    width: 30px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--c-text-muted);
    text-align: right;
}
.tfp-sol-expr {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
    font-variant-numeric: tabular-nums;
    word-break: break-all;
}
.tfp-sol-copy {
    flex: none;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text-sub);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
}
.tfp-sol-copy:hover { border-color: var(--c-primary); color: var(--c-primary); }
.tfp-sol-copy.copied {
    border-color: rgba(31, 157, 67, .55);
    background: rgba(52, 199, 89, .1);
    color: #1f9d43;
}
.tfp-none-li {
    padding: 22px 18px !important;
    text-align: center;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--c-text-muted);
}
.tfp-trunc {
    font-size: 12.5px;
    color: var(--c-text-muted);
    text-align: center;
    margin: 0 0 10px;
}

/* ---------- 出题结果 ---------- */
.tfp-gen-section { margin: 4px 0 26px; }
.tfp-gen-section-head {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 14px;
}
.tfp-gen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}
.tfp-gen-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 16px;
}
.tfp-gen-card.is-unsolved { border-style: dashed; }
.tfp-gen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.tfp-gen-no { font-size: 13.5px; font-weight: 800; color: var(--c-text); }
.tfp-gen-tag {
    font-size: 11.5px;
    font-weight: 800;
    padding: 3px 11px;
    border-radius: 999px;
}
.tfp-gen-tag.tag-ok { color: #1f9d43; background: rgba(52, 199, 89, .12); }
.tfp-gen-tag.tag-no { color: var(--c-text-muted); background: var(--c-surface-soft); border: 1px solid var(--c-border); }
.tfp-gen-nums { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tfp-gen-num {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    font-size: 18px;
    font-weight: 800;
    color: var(--c-text);
}
.tfp-gen-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tfp-mini-btn {
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    background: var(--c-primary);
    color: #fff;
    transition: all .15s ease;
}
.tfp-mini-btn:hover { background: var(--c-primary-dark); }
.tfp-mini-btn.ghost {
    background: transparent;
    border: 1px solid var(--c-border);
    color: var(--c-text-sub);
}
.tfp-mini-btn.ghost:hover { border-color: var(--c-primary); color: var(--c-primary); background: transparent; }
.tfp-gen-ans {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 11px;
    background: rgba(0, 150, 220, .08);
    border: 1px solid rgba(0, 150, 220, .25);
    font-size: 13.5px;
    font-weight: 700;
    color: var(--c-text);
    line-height: 1.6;
    word-break: break-all;
    animation: calcFade .22s ease;
}
.tfp-gen-ans.no {
    background: rgba(224, 68, 124, .07);
    border-color: rgba(224, 68, 124, .3);
    color: #e0447c;
}
.tfp-gen-err {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
    color: #e0447c;
    background: rgba(224, 68, 124, .07);
    border: 1px dashed rgba(224, 68, 124, .35);
}

/* ---------- 黑夜模式 ---------- */
[data-theme="dark"] .tfp-tab.active { color: #58bdf0; }
[data-theme="dark"] .tfp-op:has(input:checked) { color: #58bdf0; }
[data-theme="dark"] .calc-hero-num.tfp-ok { color: #4ede78; }
[data-theme="dark"] .calc-hero-num.tfp-no { color: #ff7ab0; }
[data-theme="dark"] .tfp-error,
[data-theme="dark"] .tfp-gen-ans.no,
[data-theme="dark"] .tfp-gen-err {
    background: rgba(224, 68, 124, .13);
    border-color: rgba(224, 68, 124, .4);
    color: #ff7ab0;
}
[data-theme="dark"] .tfp-gen-tag.tag-ok { color: #4ede78; background: rgba(52, 199, 89, .14); }
[data-theme="dark"] .tfp-gen-ans {
    background: rgba(0, 150, 220, .14);
    border-color: rgba(0, 150, 220, .35);
}

/* ---------- 响应式 ---------- */
@media (max-width: 620px) {
    .tfp-num-cell .calc-input { height: 46px; font-size: 17px; }
    .calc-hero-num.tfp-no { font-size: 27px; }
}
