/* ==========================================================
   识字闯关 · 样式（朱红金褐，纸白底，与平台视觉一致）
   数据来源：dhjz/hanzi-study（MIT）dataList.js，1249 个常用单字
   ========================================================== */
.sh-container { box-sizing: border-box; width: min(var(--brand-content-width), calc(100% - 32px)); margin: 0 auto; padding: 0 0 60px; }

/* ---------- 选项卡 ---------- */
.sh-tabs { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; }
.sh-tab {
    font-family: inherit; font-size: 14.5px; letter-spacing: 1.5px; cursor: pointer;
    padding: 9px 22px; border-radius: 999px; color: #6b5c46;
    background: rgba(255,253,248,.75); border: 1.5px solid rgba(139,105,20,.2);
    transition: all .22s;
}
.sh-tab:hover { border-color: rgba(139,105,20,.42); color: #5b4c37; }
.sh-tab.is-on {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg,#b83a2b,#922c21);
    box-shadow: 0 5px 16px rgba(184,58,43,.22);
}

/* ---------- 面板 ---------- */
.sh-panel {
    position: relative; padding: 22px 24px 20px; margin: 0 0 20px; 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);
}
.sh-sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.sh-sectitle { font-family: var(--brand-title-font); font-size: 22px; font-weight: 400; letter-spacing: 4px; color: #5b4c37; position: relative; padding-left: 14px; margin: 0; }
.sh-sectitle::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 4px; height: 20px; border-radius: 2px; background: linear-gradient(180deg, #b83a2b, #8b6914); }
.sh-secsub { font-size: 13px; color: var(--text-muted); letter-spacing: 1px; }

.sh-view { display: none; }
.sh-view.is-on { display: block; }

/* ---------- 按钮 ---------- */
.sh-btn {
    font-family: var(--brand-title-font); font-size: 16px; letter-spacing: 3px; cursor: pointer;
    padding: 10px 28px; 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, opacity .2s;
}
.sh-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(184,58,43,.3); }
.sh-btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.sh-btn-lg { font-size: 19px; letter-spacing: 6px; padding: 13px 44px; }
.sh-btn-ghost {
    background: transparent; color: #7a6b55;
    border: 1.5px solid rgba(139,105,20,.3); box-shadow: none;
}
.sh-btn-ghost:hover:not(:disabled) { border-color: var(--accent-gold); background: rgba(139,105,20,.06); transform: translateY(-1px); box-shadow: none; }

/* ---------- 设置区 ---------- */
.sh-setrow { display: flex; flex-direction: column; gap: 14px; margin: 0 0 20px; }
.sh-set { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sh-setlabel { font-size: 13px; color: #7a6b55; letter-spacing: 1.5px; min-width: 68px; }
.sh-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.sh-segbtn {
    font-family: inherit; font-size: 13.5px; letter-spacing: .5px; cursor: pointer;
    padding: 7px 16px; border-radius: 8px; color: #6b5c46;
    background: #fffdf8; border: 1.5px solid rgba(139,105,20,.2);
    transition: all .2s;
}
.sh-segbtn:hover { border-color: rgba(139,105,20,.5); color: #5b4c37; }
.sh-segbtn.is-on {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg,#8b6914,#6f5410);
    box-shadow: 0 4px 12px rgba(139,105,20,.24);
}
.sh-startrow { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.sh-hintline { font-size: 13px; color: var(--text-muted); }

/* ---------- 答题头 ---------- */
.sh-qhead { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 20px; flex-wrap: wrap; }
.sh-progress { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 200px; }
.sh-progress-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(139,105,20,.13); overflow: hidden; }
.sh-progress-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg,#b83a2b,#c9a227); transition: width .35s ease; }
.sh-progress-txt { font-size: 13px; color: #7a6b55; letter-spacing: 1px; white-space: nowrap; }
.sh-scorebox { display: flex; align-items: baseline; gap: 4px; }
.sh-score { font-family: var(--brand-title-font); font-size: 30px; color: #b83a2b; line-height: 1; }
.sh-score-unit { font-size: 13px; color: #7a6b55; }
.sh-streak {
    margin-left: 10px; font-size: 12.5px; padding: 3px 10px; border-radius: 999px;
    color: #fff; background: linear-gradient(135deg,#c9a227,#a8850f); letter-spacing: 1px;
}

/* ---------- 题干与选项 ---------- */
.sh-qstem {
    padding: 24px 20px; margin: 0 0 20px; border-radius: 12px; text-align: center;
    background: rgba(255,253,248,.85); border: 1px dashed rgba(139,105,20,.3);
}
.sh-stem-label { display: block; font-size: 12.5px; color: var(--text-muted); letter-spacing: 3px; margin: 0 0 14px; }
.sh-stem-pinyin {
    font-family: 'Times New Roman', Georgia, serif; font-size: 42px; letter-spacing: 2px;
    color: #b83a2b; line-height: 1.3;
}
.sh-stem-char {
    font-family: var(--brand-title-font); font-size: 68px; line-height: 1.1; color: #3a3025;
    letter-spacing: 6px;
}
.sh-stem-sent { font-size: 22px; line-height: 1.9; color: #3a3025; letter-spacing: 1.5px; }
.sh-stem-sent b { color: #b83a2b; font-weight: 400; font-size: 26px; letter-spacing: 2px; }
.sh-stem-sent em { font-style: normal; color: #b83a2b; letter-spacing: 4px; }

.sh-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0 0 16px; }
.sh-opts-zi { grid-template-columns: repeat(4, 1fr); margin-top: 20px; }
.sh-opt {
    display: flex; align-items: center; gap: 12px; cursor: pointer; text-align: left;
    padding: 16px 18px; border-radius: 10px; font-family: inherit;
    color: #3a3025; background: #fffdf8; border: 1.5px solid rgba(139,105,20,.22);
    transition: all .2s;
}
.sh-opt:hover:not(:disabled) { border-color: var(--accent-gold); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(139,105,20,.12); }
.sh-opt:disabled { cursor: default; }
.sh-opt-key {
    flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
    font-size: 12.5px; color: #8b7355; background: rgba(139,105,20,.1); letter-spacing: 0;
}
.sh-opt-txt { font-size: 21px; letter-spacing: 2px; }
.sh-opts-zi .sh-opt { flex-direction: column; gap: 6px; padding: 18px 8px; justify-content: center; }
.sh-opts-zi .sh-opt-txt { font-family: var(--brand-title-font); font-size: 42px; letter-spacing: 0; }
.sh-opt.is-right { border-color: #2f7d4f; background: linear-gradient(160deg,#f1f9f3,#e6f4ea); }
.sh-opt.is-right .sh-opt-key { color: #fff; background: #2f7d4f; }
.sh-opt.is-wrong { border-color: #b83a2b; background: linear-gradient(160deg,#fdf2f0,#f9e6e3); }
.sh-opt.is-wrong .sh-opt-key { color: #fff; background: #b83a2b; }

/* ---------- 判定条 ---------- */
.sh-judge {
    display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px;
    padding: 14px 18px; border-radius: 10px; font-size: 14.5px; line-height: 1.8;
    border-left: 4px solid #8b6914; background: rgba(255,253,248,.9);
}
.sh-judge.ok { border-left-color: #2f7d4f; background: linear-gradient(160deg,#f3faf5,#eaf6ee); }
.sh-judge.no { border-left-color: #b83a2b; background: linear-gradient(160deg,#fdf3f1,#f9e9e6); }
.sh-judge .sh-judge-mark { font-family: var(--brand-title-font); font-size: 20px; flex: none; }
.sh-judge.ok .sh-judge-mark { color: #2f7d4f; }
.sh-judge.no .sh-judge-mark { color: #b83a2b; }
.sh-judge .sh-judge-body { flex: 1; color: #4a4034; }
.sh-judge .sh-judge-body b { color: #b83a2b; font-weight: 400; font-size: 18px; letter-spacing: 1px; }
.sh-judge .sh-judge-body small { display: block; margin-top: 4px; color: #7a6b55; font-size: 12.5px; letter-spacing: .5px; }

.sh-qfoot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sh-lscore { margin-left: auto; font-size: 13px; color: #7a6b55; letter-spacing: 1px; }

/* ---------- 结算 ---------- */
.sh-reshead { text-align: center; padding: 12px 0 24px; }
.sh-restar { font-size: 30px; letter-spacing: 8px; color: #c9a227; }
.sh-restar .off { color: rgba(139,105,20,.22); }
.sh-resbig { font-family: var(--brand-title-font); font-size: 56px; line-height: 1.2; color: #b83a2b; margin: 10px 0 4px; }
.sh-ressub { font-size: 14px; color: #7a6b55; letter-spacing: 1.5px; }
.sh-resgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 22px 0; }
.sh-rescell {
    padding: 16px 12px; border-radius: 10px; text-align: center;
    background: rgba(255,253,248,.85); border: 1px solid rgba(139,105,20,.18);
}
.sh-rescell .n { font-family: var(--brand-title-font); font-size: 30px; color: #5b4c37; line-height: 1.2; }
.sh-rescell .n.g { color: #2f7d4f; }
.sh-rescell .n.r { color: #b83a2b; }
.sh-rescell .t { display: block; font-size: 12.5px; color: var(--text-muted); letter-spacing: 1.5px; margin-top: 4px; }
.sh-reswrong-title { font-size: 14px; color: #7a6b55; letter-spacing: 2px; margin: 0 0 12px; }

/* ---------- 听音识字 ---------- */
.sh-listen-ctrl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.sh-ratebox { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.sh-ratebox input[type=range] { width: 130px; accent-color: #b83a2b; }
.sh-rateval { font-size: 13px; color: #7a6b55; min-width: 38px; }
.sh-listen-body { text-align: center; padding: 26px 0 6px; }
.sh-ear {
    width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
    color: #8b7355; background: radial-gradient(circle at 35% 30%, #fffdf8, #f2e7d3);
    border: 1.5px solid rgba(139,105,20,.24);
}
.sh-ear svg { width: 40px; height: 40px; }
.sh-ear.is-on { color: #b83a2b; border-color: rgba(184,58,43,.45); animation: sh-pulse 1.1s ease-in-out infinite; }
@keyframes sh-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(184,58,43,.22); }
    50% { box-shadow: 0 0 0 14px rgba(184,58,43,0); }
}
.sh-listen-tip { font-size: 14px; color: #7a6b55; letter-spacing: 1.5px; margin: 0; min-height: 22px; }

/* ---------- 统计 ---------- */
.sh-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.sh-card {
    padding: 20px 16px; border-radius: 10px; text-align: center;
    background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(184,58,43,.05), transparent 70%), #fffdf8;
    border: 1px solid rgba(139,105,20,.18);
}
.sh-card .n { font-family: var(--brand-title-font); font-size: 34px; color: #5b4c37; line-height: 1.15; }
.sh-card .n.g { color: #2f7d4f; }
.sh-card .n.r { color: #b83a2b; }
.sh-card .t { display: block; font-size: 12.5px; color: var(--text-muted); letter-spacing: 1.5px; margin-top: 6px; }

.sh-ini { display: flex; flex-direction: column; gap: 8px; }
.sh-ini-row { display: flex; align-items: center; gap: 12px; }
.sh-ini-key {
    flex: none; width: 42px; height: 26px; border-radius: 6px; display: grid; place-items: center;
    font-family: 'Times New Roman', Georgia, serif; font-size: 15px; text-transform: uppercase;
    color: #5b4c37; background: rgba(139,105,20,.1);
}
.sh-ini-bar { flex: 1; height: 14px; border-radius: 999px; background: rgba(139,105,20,.12); overflow: hidden; }
.sh-ini-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg,#c9a227,#8b6914); transition: width .4s ease; }
.sh-ini-bar i.full { background: linear-gradient(90deg,#4c9c6b,#2f7d4f); }
.sh-ini-num { flex: none; font-size: 12.5px; color: #7a6b55; min-width: 84px; text-align: right; letter-spacing: .5px; }

.sh-wrong { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 0 0 16px; }
.sh-wrong-item {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px;
    background: rgba(255,253,248,.9); border: 1px solid rgba(139,105,20,.18);
}
.sh-wrong-item .c { font-family: var(--brand-title-font); font-size: 32px; color: #3a3025; line-height: 1; }
.sh-wrong-item .m { flex: 1; min-width: 0; }
.sh-wrong-item .m .py { font-family: 'Times New Roman', Georgia, serif; font-size: 13px; color: #b83a2b; letter-spacing: .5px; }
.sh-wrong-item .m .ex { font-size: 12.5px; color: #7a6b55; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-wrong-item .k {
    flex: none; font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
    color: #fff; background: #b83a2b; letter-spacing: .5px;
}
.sh-empty { text-align: center; padding: 34px 0; font-size: 14px; color: var(--text-muted); letter-spacing: 1.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
    .sh-panel { padding: 18px 16px 16px; }
    .sh-sectitle { font-size: 19px; letter-spacing: 2px; }
    .sh-opts { grid-template-columns: 1fr; }
    .sh-opts-zi { grid-template-columns: repeat(2, 1fr); }
    .sh-stem-pinyin { font-size: 34px; }
    .sh-stem-char { font-size: 54px; }
    .sh-stem-sent { font-size: 18px; }
    .sh-btn-lg { font-size: 17px; letter-spacing: 4px; padding: 12px 30px; }
    .sh-resbig { font-size: 44px; }
    .sh-ratebox { margin-left: 0; }
}
@media print {
    .sh-tabs, .sh-qfoot, .sh-startrow, .sh-listen-ctrl { display: none !important; }
    .sh-panel { break-inside: avoid; }
}
