/* ======================================================================
 *  笔画数查询字典 /tool/bihua-count
 *  依赖 home.css 全局变量 + tool-detail.css 公共类 + calc-common.css 布局
 * ====================================================================== */

[hidden] { display: none !important; }

/* ---------- 查询输入行 ---------- */
.bh-input-row {
    display: flex;
    gap: 10px;
}
.bh-char-input {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 18px !important;
    font-weight: 800;
    letter-spacing: 0.05em;
}
.bh-look-btn { flex: none; height: 43px; padding: 0 18px; white-space: nowrap; }

/* ---------- 画数标签 ---------- */
.bh-stroke-tabs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}
.bh-stroke-tab {
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft);
    color: var(--c-text-sub);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.14s ease;
    padding: 0;
}
.bh-stroke-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.bh-stroke-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;
}
.bh-stroke-tab small { font-size: 10px; font-weight: 600; color: var(--c-text-muted); }

/* ---------- 数笔画小测 ---------- */
.bh-quiz-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.10), rgba(255, 149, 0, 0.04));
    border: 1px solid rgba(255, 149, 0, 0.30);
}
.bh-quiz-char {
    flex: none;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: var(--c-text);
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: 12px;
}
.bh-quiz-main { flex: 1; min-width: 0; }
.bh-quiz-q { font-size: 13px; font-weight: 700; color: var(--c-text-sub); margin-bottom: 8px; }
.bh-quiz-ops { display: flex; gap: 8px; }
.bh-quiz-input { width: 86px !important; flex: none; text-align: center; }
.bh-quiz-btn { flex: none; height: 38px; padding: 0 14px; font-size: 13px; white-space: nowrap; }
.bh-quiz-score { font-size: 12px; font-weight: 700; color: var(--c-text-muted); margin-top: 8px; }
.bh-quiz-score b { color: #e8842a; }

/* ---------- 字典卡 ---------- */
.bh-card-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}
.bh-big-char {
    flex: none;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 800;
    line-height: 1;
    color: var(--c-text);
    background: linear-gradient(135deg, rgba(0, 150, 220, 0.10), rgba(0, 150, 220, 0.04));
    border: 1px solid rgba(0, 150, 220, 0.30);
    border-radius: 16px;
}
.bh-card-main { flex: 1; min-width: 0; }
.bh-card-title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.bh-card-sub { font-size: 12.5px; color: var(--c-text-sub); margin-top: 4px; }
.bh-card-sub b { color: #0a7fc0; }

/* ---------- 笔顺要点 ---------- */
.bh-order {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    font-size: 13px;
    line-height: 1.8;
    color: var(--c-text-sub);
    margin-bottom: 14px;
}
.bh-order b { color: var(--c-text); }
.bh-order .lbl {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--c-text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.04em;
}

/* ---------- 组词徽章 ---------- */
.bh-word-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.bh-word-badges span {
    padding: 5px 13px;
    border-radius: 99px;
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-sub);
}

/* ---------- AI 补充区 ---------- */
.bh-ai-extra {
    margin-top: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 150, 220, 0.08), rgba(0, 168, 168, 0.05));
    border: 1px solid rgba(0, 150, 220, 0.25);
    font-size: 13px;
    line-height: 1.8;
    color: var(--c-text-sub);
}
.bh-ai-extra .lbl {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--c-text-muted);
    margin-bottom: 3px;
    letter-spacing: 0.04em;
}
.bh-ai-conf { font-size: 11.5px; font-weight: 800; }
.bh-ai-conf--high { color: #1f9d43; }
.bh-ai-conf--medium { color: #d98a00; }
.bh-ai-conf--low { color: #e0447c; }

.bh-actions { display: flex; gap: 10px; }
.bh-actions .btn { flex: none; }

/* ---------- AI 查询状态 ---------- */
.bh-ai-status { font-size: 12.5px; line-height: 1.6; margin-top: 8px; }
.bh-ai-status.is-ok { color: #1f9d43; font-weight: 700; }
.bh-ai-status.is-err { color: #e0447c; font-weight: 700; }

/* ---------- 分册字表 ---------- */
.bh-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
    gap: 8px;
}
.bh-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    font-weight: 700;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.14s ease;
    padding: 0;
}
.bh-cell:hover {
    border-color: var(--c-primary);
    color: #0a7fc0;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.bh-cell.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;
}

/* ---------- 小测判分反馈 ---------- */
.bh-quiz-feedback {
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.6;
}
.bh-quiz-feedback.is-ok { color: #1f9d43; }
.bh-quiz-feedback.is-err { color: #e0447c; }

/* ---------- 响应式 ---------- */
@media (max-width: 620px) {
    .bh-stroke-tabs { grid-template-columns: repeat(4, 1fr); }
    .bh-quiz-row { flex-direction: column; align-items: stretch; text-align: center; }
    .bh-quiz-char { margin: 0 auto; }
    .bh-quiz-ops { justify-content: center; flex-wrap: wrap; }
    .bh-card-head { flex-direction: column; text-align: center; }
    .bh-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}

/* ---------- 黑夜模式 ---------- */
[data-theme="dark"] .bh-stroke-tab { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .bh-stroke-tab.active { color: #58bdf0; }
[data-theme="dark"] .bh-quiz-row {
    background: rgba(255, 149, 0, 0.12);
    border-color: rgba(255, 149, 0, 0.32);
}
[data-theme="dark"] .bh-quiz-char { background: rgba(255, 255, 255, 0.05); }
[data-theme="dark"] .bh-big-char {
    background: rgba(0, 150, 220, 0.14);
    border-color: rgba(0, 150, 220, 0.32);
}
[data-theme="dark"] .bh-card-sub b { color: #58bdf0; }
[data-theme="dark"] .bh-order,
[data-theme="dark"] .bh-word-badges span,
[data-theme="dark"] .bh-cell { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .bh-cell:hover { color: #58bdf0; }
[data-theme="dark"] .bh-cell.active {
    background: rgba(0, 150, 220, 0.14);
    color: #58bdf0;
}
[data-theme="dark"] .bh-ai-extra {
    background: rgba(0, 150, 220, 0.12);
    border-color: rgba(0, 150, 220, 0.30);
}
[data-theme="dark"] .bh-ai-status.is-ok,
[data-theme="dark"] .bh-quiz-feedback.is-ok { color: #4ede78; }
[data-theme="dark"] .bh-ai-status.is-err,
[data-theme="dark"] .bh-quiz-feedback.is-err { color: #ff7ab0; }
[data-theme="dark"] .bh-ai-conf--high { color: #4ede78; }
[data-theme="dark"] .bh-ai-conf--medium { color: #ffb84d; }
[data-theme="dark"] .bh-ai-conf--low { color: #ff7ab0; }
[data-theme="dark"] .bh-quiz-score b { color: #ffb84d; }
