/* ==========================================================
   汉字笔顺 · 样式（朱红金褐，纸白底，与平台视觉一致）
   ========================================================== */
.bh-container { box-sizing: border-box; width: min(var(--brand-content-width), calc(100% - 32px)); margin: 0 auto; padding: 0 0 60px; }

/* ---------- 输入面板 ---------- */
.bh-panel {
    position: relative; padding: 22px 24px 20px; margin: 8px 0 22px; border-radius: 12px;
    background: radial-gradient(ellipse 80% 100% at 12% 0%, rgba(184,58,43,.045), transparent 60%), linear-gradient(168deg,#fbf6ec,#f4e9d6);
    border: 1px solid rgba(139,105,20,.22); box-shadow: 0 8px 26px rgba(60,50,35,.06);
}
.bh-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.bh-section-title { font-family: var(--brand-title-font); font-size: 22px; font-weight: 400; letter-spacing: 4px; color: #5b4c37; position: relative; padding-left: 14px; margin: 0; }
.bh-section-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 20px; border-radius: 2px; background: linear-gradient(180deg, #b83a2b, #8b6914); }
.bh-section-sub { font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }

.bh-searchrow { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; flex-wrap: wrap; }
.bh-input {
    flex: 1; min-width: 220px; padding: 12px 16px; font-family: inherit; font-size: 15px;
    color: var(--text-primary); background: #fffdf8;
    border: 1.5px solid rgba(139,105,20,.25); border-radius: 10px; outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.bh-input:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px rgba(139,105,20,.08); }
.bh-btn {
    font-family: var(--brand-title-font); font-size: 16px; letter-spacing: 3px; cursor: pointer;
    padding: 11px 26px; border: none; border-radius: 10px; color: #fff;
    background: linear-gradient(135deg,#b83a2b,#922c21); box-shadow: 0 5px 16px rgba(184,58,43,.24);
    transition: transform .2s, box-shadow .2s;
}
.bh-btn:hover { transform: translateY(-2px); box-shadow: 0 9px 22px rgba(184,58,43,.32); }
.bh-btn:active { transform: translateY(0); }

/* ---------- 常用字表 ---------- */
.bh-lexicon { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; flex-wrap: wrap; }
.bh-lex-label { flex: none; font-size: 12.5px; color: var(--accent-gold); letter-spacing: 2px; padding-top: 7px; }
.bh-lex-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.bh-lex-chip {
    font-family: var(--brand-title-font); font-size: 17px; line-height: 1; cursor: pointer;
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    color: #5b4c37; background: #fffdf8; border: 1px solid rgba(139,105,20,.24); border-radius: 8px;
    transition: all .18s;
}
.bh-lex-chip:hover { color: #b83a2b; border-color: rgba(184,58,43,.5); background: #fff6ee; transform: translateY(-1px); }
.bh-lex-chip.on { color: #fff; background: linear-gradient(140deg,#b83a2b,#922c21); border-color: transparent; box-shadow: 0 4px 12px rgba(184,58,43,.28); }

.bh-note { font-size: 12.5px; line-height: 1.9; color: var(--text-muted); margin: 4px 0 0; letter-spacing: .3px; }

/* ---------- 字卡列表 ---------- */
.bh-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.bh-card {
    position: relative; padding: 18px 18px 16px; border-radius: 12px; background: #fffdf8;
    border: 1px solid rgba(139,105,20,.22); box-shadow: 0 8px 26px rgba(60,50,35,.06);
    display: flex; flex-direction: column; align-items: center;
}
.bh-card::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(139,105,20,.12); border-radius: 8px; pointer-events: none; }

.bh-card-head { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 12px; padding-left: 4px; }
.bh-big {
    font-family: var(--brand-title-font); font-size: 40px; line-height: 1; color: #3a3025; letter-spacing: 2px;
    width: 58px; height: 58px; display: inline-flex; align-items: center; justify-content: center;
    background: radial-gradient(ellipse at 30% 20%, #fff8ee, #f6ead6); border-radius: 10px;
    border: 1px solid rgba(139,105,20,.2);
}
.bh-meta { display: flex; flex-direction: column; gap: 3px; }
.bh-pinyin { font-size: 16px; color: #b83a2b; letter-spacing: 1px; font-family: 'Noto Serif SC', 'STSong', serif; }
.bh-count { font-size: 12.5px; color: var(--text-muted); letter-spacing: .5px; }
.bh-count b { font-size: 15px; color: #8b6914; }

/* ---------- 动画舞台 ---------- */
.bh-stage {
    position: relative; width: 260px; height: 260px; max-width: 100%;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px; background: #fffdf8;
    border: 1px solid rgba(139,105,20,.16);
}
.bh-stage svg { position: relative; z-index: 1; display: block; }
.bh-stage.bh-quiz { cursor: crosshair; }
.bh-stage.bh-grid::before {
    content: ''; position: absolute; inset: 14px; z-index: 0; pointer-events: none; border-radius: 4px;
    border: 1.5px solid rgba(184,58,43,.30);
    background:
        linear-gradient(to right, transparent calc(50% - .6px), rgba(184,58,43,.30) calc(50% - .6px), rgba(184,58,43,.30) calc(50% + .6px), transparent calc(50% + .6px)),
        linear-gradient(to bottom, transparent calc(50% - .6px), rgba(184,58,43,.30) calc(50% - .6px), rgba(184,58,43,.30) calc(50% + .6px), transparent calc(50% + .6px)),
        linear-gradient(45deg, transparent calc(50% - .5px), rgba(184,58,43,.20) calc(50% - .5px), rgba(184,58,43,.20) calc(50% + .5px), transparent calc(50% + .5px)),
        linear-gradient(-45deg, transparent calc(50% - .5px), rgba(184,58,43,.20) calc(50% - .5px), rgba(184,58,43,.20) calc(50% + .5px), transparent calc(50% + .5px));
}
.bh-loading, .bh-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 0 12px; }

/* ---------- 工具条 ---------- */
.bh-tools { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: center; margin: 14px 0 0; }
.bh-tool {
    font-family: inherit; font-size: 13px; letter-spacing: .5px; cursor: pointer;
    padding: 7px 13px; border-radius: 18px; color: #6b5a42; background: #fffdf8;
    border: 1.5px solid rgba(139,105,20,.26);
    transition: all .2s;
}
.bh-tool:hover:not(:disabled) { background: rgba(139,105,20,.08); color: #4a3d2c; transform: translateY(-1px); }
.bh-tool:disabled { opacity: .42; cursor: not-allowed; }
.bh-tool-quiz { color: #fff; background: linear-gradient(135deg,#b83a2b,#922c21); border-color: transparent; box-shadow: 0 4px 12px rgba(184,58,43,.22); }
.bh-tool-quiz:hover:not(:disabled) { background: linear-gradient(135deg,#c64534,#a33326); color: #fff; }
.bh-speed { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); letter-spacing: .5px; }
.bh-speed select {
    font-family: inherit; font-size: 13px; padding: 6px 8px; border-radius: 8px; color: #6b5a42;
    background: #fffdf8; border: 1.5px solid rgba(139,105,20,.26); outline: none; cursor: pointer;
}
.bh-speed select:focus { border-color: var(--accent-gold); }

/* ---------- 测验进度条 ---------- */
.bh-quizbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
    width: 100%; margin: 12px 0 0; padding: 9px 12px; border-radius: 10px;
    background: linear-gradient(168deg,#f8f0e2,#f4e9d6); border: 1px solid rgba(139,105,20,.18);
    font-size: 12.5px; letter-spacing: .5px;
}
.bh-quiz-progress { color: #6b5a42; }
.bh-quiz-ok { color: #2f7d4f; }
.bh-quiz-err { color: #b83a2b; }
.bh-quiz-msg { color: #8b6914; font-weight: 700; }

@media (max-width: 640px) {
    .bh-panel { padding: 18px 16px 16px; }
    .bh-list { grid-template-columns: 1fr; }
    .bh-stage { width: 240px; height: 240px; }
    .bh-tool { padding: 6px 11px; font-size: 12.5px; }
}