/* "Đề thi vào 10" exam player. Scoped under .bv-exam, uses site tokens from styles.css. */
.bv-exam { --bvx-ok: #0a7d72; --bvx-no: #dc3545; --bvx-warn: #b45309; }

/* ---- term archive: 50 numbered papers read best as a grid of tiles ---- */
.bv-exam-index { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.bv-exam-index__item { margin: 0; }
.bv-exam-index__link {
  display: flex; flex-direction: column; gap: .15rem; height: 100%; text-decoration: none;
  background: #fff; border: 1px solid var(--border, rgba(15,23,42,.1)); border-radius: 12px;
  padding: .7rem .8rem; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.bv-exam-index__link:hover { border-color: rgba(225,29,72,.45); box-shadow: var(--shadow, 0 8px 22px rgba(15,23,42,.08)); transform: translateY(-2px); }
.bv-exam-index__no { font-weight: 800; font-size: 1.02rem; color: var(--ink, #0f172a); }
/* Ten de THPT dai hon nhieu so voi "De so N" nen o rong hon va chu nho lai. */
.bv-exam-index__item.is-wide { grid-column: span 2; }
.bv-exam-index__item.is-wide .bv-exam-index__no { font-size: .92rem; line-height: 1.35; }
@media (max-width: 480px) { .bv-exam-index__item.is-wide { grid-column: span 1; } }
.bv-exam-index__meta { font-size: .78rem; color: var(--muted, rgba(15,23,42,.58)); }
.bv-exam-index__meta i { color: #e11d48; }
@media (prefers-color-scheme: dark) { .bv-exam-index__link { background: rgba(255,255,255,.04); } }
:root[data-theme="dark"] .bv-exam-index__link { background: rgba(255,255,255,.04); }

.bv-x-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted, rgba(15,23,42,.6)); margin-bottom: .85rem; }
.bv-x-crumbs a { color: var(--muted, rgba(15,23,42,.62)); text-decoration: none; }
.bv-x-crumbs a:hover { color: var(--brand, #2f6fed); text-decoration: underline; }
.bv-x-crumbs > span { opacity: .5; }
.bv-x-crumbs__here { color: var(--ink, #0f172a); font-weight: 600; }

/* ---- header ---- */
.bv-x-head { margin-bottom: 1rem; }
.bv-x-head__badges { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .6rem; }
.bv-x-level {
  display: inline-flex; align-items: center; font-size: .78rem; font-weight: 800; letter-spacing: .04em;
  padding: .25rem .7rem; border-radius: 999px; color: #fff;
  background: linear-gradient(135deg, #e11d48, #f97316);
}
.bv-x-title { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; margin: 0 0 .25rem; line-height: 1.3; }
.bv-x-subtitle { color: var(--muted, rgba(15,23,42,.6)); font-size: .93rem; margin: 0; }

/* ---- lời dẫn trước đề ---- */
.bv-x-intro {
  display: flex; gap: .85rem; align-items: flex-start;
  border: 1px solid rgba(225,29,72,.22); border-left: 4px solid #e11d48; border-radius: 14px;
  background: linear-gradient(120deg, rgba(225,29,72,.07), rgba(249,115,22,.05));
  padding: .95rem 1.1rem; margin: 0 0 1.1rem;
}
.bv-x-intro__icon {
  flex: 0 0 auto; width: 2.3rem; height: 2.3rem; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e11d48, #f97316); color: #fff; font-size: 1.15rem;
}
.bv-x-intro__body { min-width: 0; }
.bv-x-intro__lead { margin: 0; font-size: .93rem; line-height: 1.6; }
.bv-x-intro__tip { margin: .45rem 0 0; font-size: .86rem; line-height: 1.55; color: var(--muted, rgba(15,23,42,.68)); }
.bv-x-intro__tip i { color: #b45309; }
@media (max-width: 576px) {
  .bv-x-intro { gap: .6rem; padding: .8rem .85rem; border-radius: 12px; }
  .bv-x-intro__icon { width: 1.9rem; height: 1.9rem; font-size: 1rem; }
  .bv-x-intro__lead { font-size: .89rem; }
  .bv-x-intro__tip { font-size: .82rem; }
}

.bv-x-notes { margin-bottom: 1rem; }
.bv-x-notes p {
  margin: 0 0 .4rem; font-size: .86rem; line-height: 1.5; color: var(--bvx-warn);
  background: rgba(180,83,9,.07); border: 1px solid rgba(180,83,9,.2); border-radius: 10px; padding: .5rem .7rem;
}

/* ---- sticky control bar ---- */
.bv-x-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .55rem .8rem; margin: 0 0 .8rem;
  background: color-mix(in srgb, #fff 92%, transparent); backdrop-filter: blur(8px);
  border: 1px solid var(--border, rgba(15,23,42,.12)); border-radius: 12px;
}
.bv-x-bar__timer { display: inline-flex; align-items: center; gap: .35rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink, #0f172a); }
.bv-x-bar__timer.is-low { color: var(--bvx-no); }
.bv-x-bar__count { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.bv-x-bar__label { font-weight: 500; color: var(--muted, rgba(15,23,42,.6)); margin-left: .25rem; }
.bv-x-bar__submit { margin-left: auto; }

/* ---- answer sheet ---- */
.bv-x-sheet { border: 1px solid var(--border, rgba(15,23,42,.12)); border-radius: 12px; padding: .5rem .8rem; margin-bottom: 1.2rem; }
.bv-x-sheet > summary { cursor: pointer; font-weight: 700; font-size: .9rem; }
.bv-x-sheet > summary i { color: var(--brand, #2f6fed); }
.bv-x-sheet__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr)); gap: .35rem; margin-top: .7rem; }
.bv-x-cell {
  display: flex; align-items: center; justify-content: center; min-height: 2.2rem;
  border: 1px solid var(--border, rgba(15,23,42,.14)); border-radius: 8px;
  font-size: .82rem; font-weight: 700; text-decoration: none; color: var(--muted, rgba(15,23,42,.6));
}
.bv-x-cell.is-done { background: rgba(47,111,237,.1); border-color: rgba(47,111,237,.4); color: var(--brand, #2f6fed); }
.bv-x-cell.is-right { background: rgba(10,125,114,.12); border-color: rgba(10,125,114,.45); color: var(--bvx-ok); }
.bv-x-cell.is-wrong { background: rgba(220,53,69,.1); border-color: rgba(220,53,69,.45); color: var(--bvx-no); }

/* ---- parts ---- */
.bv-xpart { margin-bottom: 2rem; }
.bv-xpart__head { display: flex; align-items: baseline; gap: .6rem; border-bottom: 1px solid var(--border, rgba(15,23,42,.1)); padding-bottom: .45rem; margin-bottom: .6rem; }
.bv-xpart__title { font-size: 1.1rem; font-weight: 800; margin: 0; }
.bv-xpart__range { margin-left: auto; font-size: .8rem; font-weight: 700; color: var(--muted, rgba(15,23,42,.55)); white-space: nowrap; }
.bv-xpart__vi { font-size: .9rem; margin: 0 0 .3rem; color: var(--ink, #0f172a); }
.bv-xpart__en { font-size: .82rem; margin: 0 0 .8rem; color: var(--muted, rgba(15,23,42,.58)); font-style: italic; line-height: 1.5; }

.bv-xpassage {
  background: var(--soft, rgba(15,23,42,.04)); border: 1px solid var(--border, rgba(15,23,42,.1));
  border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1rem;
}
.bv-xpassage p { margin: 0 0 .6rem; font-size: .93rem; line-height: 1.7; }
.bv-xpassage p:last-child { margin-bottom: 0; }

.bv-xnotice {
  background: #fffbeb; border: 1px solid rgba(180,83,9,.25); border-radius: 12px;
  padding: .8rem 1rem; margin-bottom: .7rem;
}
.bv-xnotice p { margin: 0 0 .3rem; font-size: .92rem; line-height: 1.6; font-weight: 600; }
.bv-xnotice p:last-child { margin-bottom: 0; }

.bv-xfig { margin: 0 0 .8rem; }
.bv-xfig img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border, rgba(15,23,42,.1)); }

/* ---- questions ---- */
.bv-xqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.bv-xq { scroll-margin-top: 4.5rem; border: 1px solid var(--border, rgba(15,23,42,.1)); border-radius: 12px; padding: .85rem 1rem; }
.bv-xq.is-right { border-color: rgba(10,125,114,.35); background: rgba(10,125,114,.03); }
.bv-xq.is-wrong { border-color: rgba(220,53,69,.4); background: rgba(220,53,69,.03); }
.bv-xq__stem { display: flex; gap: .5rem; font-size: .95rem; line-height: 1.6; margin-bottom: .6rem; }
.bv-xq__no { font-weight: 800; color: var(--brand, #2f6fed); flex: 0 0 auto; }
.bv-xq__blank { color: var(--muted, rgba(15,23,42,.55)); font-size: .88rem; }

/* Câu sắp xếp câu / đoạn hội thoại: mỗi ý xuống dòng riêng, dấu a/b/c in đậm để
   không lẫn với chữ trong câu. */
.bv-xq__lead { display: block; }
.bv-xq__seq { display: block; margin: .5rem 0 .1rem; padding-left: .7rem; border-left: 2px solid var(--border, rgba(15,23,42,.12)); }
.bv-xq__seq-item { display: flex; gap: .45rem; padding: .18rem 0; }
.bv-xq__seq-key { flex: 0 0 1.15rem; font-weight: 800; color: var(--brand, #2f6fed); }
.bv-xq__seq-txt { flex: 1 1 auto; }

/* Phương án chỉ là dãy dấu ("b – a – c"): đậm chữ cái, nhạt dấu nối. */
.bv-xopt__seq-key { font-weight: 800; letter-spacing: .02em; }
.bv-xopt__seq-sep { color: var(--muted, rgba(15,23,42,.45)); }

.bv-xopts { display: grid; gap: .35rem; }
@media (min-width: 640px) { .bv-xopts { grid-template-columns: 1fr 1fr; } }
.bv-xopt {
  display: flex; align-items: flex-start; gap: .5rem; cursor: pointer;
  padding: .45rem .6rem; border: 1px solid transparent; border-radius: 9px;
  font-size: .92rem; line-height: 1.5;
}
.bv-xopt:hover { background: var(--soft, rgba(15,23,42,.04)); }
.bv-xopt input { margin-top: .25rem; flex: 0 0 auto; }
.bv-xopt__key { font-weight: 800; color: var(--muted, rgba(15,23,42,.55)); flex: 0 0 auto; }
.bv-xopt.is-answer { background: rgba(10,125,114,.1); border-color: rgba(10,125,114,.4); }
.bv-xopt.is-answer .bv-xopt__key { color: var(--bvx-ok); }
.bv-xopt.is-picked-wrong { background: rgba(220,53,69,.09); border-color: rgba(220,53,69,.4); }
.bv-xopt.is-picked-wrong .bv-xopt__key { color: var(--bvx-no); }

.bv-xfb { margin-top: .55rem; font-size: .87rem; line-height: 1.55; }
.bv-xfb.is-ok { color: var(--bvx-ok); font-weight: 700; }
.bv-xfb.is-no { color: var(--bvx-no); }
.bv-xfb__note { display: block; margin-top: .25rem; color: var(--muted, rgba(15,23,42,.6)); font-size: .82rem; font-style: italic; }

/* ---- lời giải chi tiết (đề THPT) ---- */
.bv-xsol { margin-top: .5rem; border-top: 1px dashed var(--border, rgba(15,23,42,.15)); padding-top: .45rem; }
.bv-xsol > summary { cursor: pointer; font-size: .84rem; font-weight: 700; color: var(--brand, #2f6fed); list-style: none; }
.bv-xsol > summary::-webkit-details-marker { display: none; }
.bv-xsol > summary::before { content: "▸ "; }
.bv-xsol[open] > summary::before { content: "▾ "; }
.bv-xsol__body {
  margin-top: .4rem; font-size: .86rem; line-height: 1.65; color: var(--ink, #0f172a);
  background: var(--soft, rgba(15,23,42,.04)); border-radius: 9px; padding: .6rem .75rem;
}
.bv-x-level--thpt { background: linear-gradient(135deg, #7c3aed, #2f6fed); }
.pill--ok { color: #0a7d72; border-color: rgba(10,125,114,.35); background: rgba(10,125,114,.08); }
.pill--warn { color: #b45309; border-color: rgba(180,83,9,.4); background: rgba(180,83,9,.1); }

/* "chỉ xem câu sai" */
.bv-x-only-wrong .bv-xq:not(.is-wrong) { display: none; }
.bv-xpart.is-hidden { display: none; }
.bv-x-only-wrong .bv-xpassage,
.bv-x-only-wrong .bv-xpart__en { display: none; }

/* ---- result ---- */
.bv-x-result { margin: 0 0 1.4rem; scroll-margin-top: 4.5rem; }
.bv-x-res {
  border: 1px solid var(--border, rgba(15,23,42,.12)); border-radius: 16px; padding: 1.1rem 1.2rem;
  background: linear-gradient(120deg, rgba(47,111,237,.06), rgba(0,184,169,.05));
}
.bv-x-result.is-good .bv-x-res { background: linear-gradient(120deg, rgba(10,125,114,.12), rgba(10,125,114,.04)); border-color: rgba(10,125,114,.3); }
.bv-x-result.is-low .bv-x-res { background: linear-gradient(120deg, rgba(220,53,69,.1), rgba(220,53,69,.03)); border-color: rgba(220,53,69,.3); }
.bv-x-res--err { color: var(--bvx-no); font-weight: 700; }
.bv-x-res__auto { font-size: .86rem; font-weight: 700; color: var(--bvx-warn); margin-bottom: .5rem; }
.bv-x-res__mark { display: flex; align-items: baseline; gap: .2rem; }
.bv-x-res__num { font-size: 2.6rem; font-weight: 900; line-height: 1; }
.bv-x-res__scale { font-size: 1.05rem; font-weight: 700; color: var(--muted, rgba(15,23,42,.55)); }
.bv-x-res__meta { font-size: .92rem; margin-top: .3rem; }
.bv-x-res__weak { font-size: .88rem; margin: .6rem 0 0; color: var(--bvx-warn); }

.bv-x-brk { list-style: none; margin: .9rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.bv-x-brk__row { display: grid; grid-template-columns: minmax(6.5rem, 1fr) 3fr auto; gap: .5rem; align-items: center; font-size: .84rem; }
.bv-x-brk__bar { background: rgba(15,23,42,.1); border-radius: 999px; height: .5rem; overflow: hidden; }
.bv-x-brk__bar i { display: block; height: 100%; background: var(--bvx-ok); border-radius: 999px; }
.bv-x-brk__row.is-weak .bv-x-brk__bar i { background: var(--bvx-no); }
.bv-x-brk__n { font-weight: 700; font-variant-numeric: tabular-nums; }
.bv-x-res__acts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }

/* ---- footer actions + history ---- */
.bv-x-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 1.4rem 0; }
.bv-x-saved { font-size: .85rem; color: var(--bvx-ok); font-weight: 600; }
.bv-x-history { margin-bottom: 1.5rem; }
.bv-x-history__h { font-size: 1rem; font-weight: 800; margin: 0 0 .5rem; }
.bv-x-history__h i { color: var(--brand, #2f6fed); }
.bv-x-history ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.bv-x-history li {
  display: flex; align-items: center; gap: .6rem; font-size: .85rem;
  border: 1px solid var(--border, rgba(15,23,42,.1)); border-radius: 9px; padding: .4rem .7rem;
}
.bv-x-history__d { color: var(--muted, rgba(15,23,42,.6)); font-variant-numeric: tabular-nums; }
.bv-x-history__s { margin-left: auto; font-weight: 800; }
.bv-x-history__q { color: var(--muted, rgba(15,23,42,.6)); font-variant-numeric: tabular-nums; }

/* ---- mobile: strip the extras, keep the paper ---- */
@media (max-width: 576px) {
  .bv-x-crumbs { display: none; }
  .bv-x-subtitle { display: none; }
  .bv-xpart__en { display: none; }
  .bv-xq { padding: .7rem .75rem; border-radius: 10px; }
  .bv-xpassage { padding: .75rem .8rem; }
  .bv-x-bar { padding: .5rem .6rem; gap: .5rem; }
  .bv-x-bar__label { display: none; }
  .bv-x-res__num { font-size: 2.2rem; }
  .bv-x-brk__row { grid-template-columns: minmax(5.5rem, 1fr) 2fr auto; font-size: .8rem; }
}
