:root {
  --bg: #0c1626; --bg2: #12203a; --panel: #15243f; --line: #24375a; --text: #e8eef8; --mute: #8fa3c2;
  --acc: #ffb547; --acc2: #ff8a3d; --ok: #2fbf71; --bad: #ef5a5a; --link: #7cc4ff;
  --r: 12px; font-size: 15px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; color: var(--text);
  background: radial-gradient(1200px 600px at 50% -200px, #1b3358 0%, var(--bg) 60%) fixed, var(--bg); min-height: 100vh; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { background: #0e1a2e; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: -1px; }
mark { background: rgba(255, 181, 71, .22); color: var(--acc); border-radius: 4px; padding: 0 2px; font-weight: 600; }
.muted { color: var(--mute); } .small { font-size: .85rem; } .center { text-align: center; justify-content: center; }
.nowrap { white-space: nowrap; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 22px; padding: 10px 24px;
  background: rgba(10, 20, 36, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { color: var(--text); font-size: 1.35rem; white-space: nowrap; }
.logo b { color: var(--acc); }
.logo-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #1a1200; font-size: .8rem; margin-right: 4px; }
.logo:hover { text-decoration: none; }
.searchbar { flex: 1; max-width: 620px; display: flex; border: 1.5px solid #c9d6ea; border-radius: 10px; overflow: hidden; background: #0b1527; }
.searchbar input { border: 0; border-radius: 0; background: transparent; padding: 9px 14px; font-size: 1.02rem; }
.searchbar input:focus { outline: none; }
.searchbar button { border: 0; background: #22324f; padding: 0 16px; font-size: 1.3rem; cursor: pointer; }
.searchbar button:hover { background: var(--acc); color: #1a1200; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a { color: var(--mute); padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; background: #1a2b48; }
.tabs a.on { color: var(--text); background: #1f3456; }
.lang-btn { margin-left: -12px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--mute); font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.lang-btn:hover { color: var(--text); background: #1a2b48; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 2px; border-radius: 10px; background: var(--acc); color: #1a1200; font-size: .75rem; font-weight: 700; text-align: center; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #1a2b48; border-radius: 9px; padding: 8px 14px; cursor: pointer; white-space: nowrap; color: var(--text); }
.btn:hover { border-color: #3d5a8a; text-decoration: none; }
.btn.primary { background: linear-gradient(135deg, var(--acc), var(--acc2)); border-color: transparent; color: #1a1200; font-weight: 650; }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(239, 90, 90, .12); border-color: rgba(239, 90, 90, .45); color: #ffb3b3; }
.btn.ok { background: rgba(47, 191, 113, .15); border-color: rgba(47, 191, 113, .5); color: #9ff0c4; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.big { padding: 11px 22px; font-size: 1.05rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.row.end { justify-content: flex-end; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #1f3355; color: var(--mute); font-size: .78rem; border: 1px solid var(--line); }
.tag.bad { color: #ffb3b3; border-color: rgba(239, 90, 90, .45); }
.src-youtube { color: #ff8b8b; } .src-vimeo { color: #6fd3ff; } .src-dailymotion { color: #9db6ff; } .src-ted { color: #ff7a7a; }
.src-bilibili { color: #6cc9ff; } .src-twitch { color: #c4a3ff; } .src-mp4 { color: #9ff0c4; }

/* search layout */
.search-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; max-width: 1240px; margin: 22px auto; padding: 0 24px; }
.filters { background: rgba(18, 32, 58, .75); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; align-self: start; position: sticky; top: 74px; }
.f-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.f-head .link { font-size: .85rem; color: var(--mute); }
.f-lab { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin: 14px 0 6px; font-weight: 600; }
.f-hint { font-size: .78rem; color: var(--mute); margin: 2px 0 0 26px; }
.f-keys { margin-top: 16px; font-size: .75rem; color: var(--mute); }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; margin: 8px 0; }
.check input { width: 17px; height: 17px; accent-color: var(--acc); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #172845; border-radius: 99px; padding: 4px 11px; cursor: pointer; font-size: .85rem; }
.chip:hover { border-color: var(--acc); color: var(--acc); }
.chips.big { justify-content: center; margin: 22px 0; } .chips.big .chip { font-size: 1rem; padding: 7px 16px; }

.hero { text-align: center; padding: 60px 10px; }
.hero h1 { font-size: 2.3rem; line-height: 1.2; margin: 0 0 10px; }
.hero p { color: var(--mute); }
.stats { display: flex; gap: 28px; justify-content: center; margin: 26px 0; color: var(--mute); }
.stats b { color: var(--text); font-size: 1.3rem; margin-right: 4px; }
.empty { text-align: center; padding: 50px 20px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--mute); }
.empty h2 { color: var(--text); }

.qchip { display: inline-block; border: 1px solid #c9d6ea; border-radius: 99px; padding: 3px 13px; font-size: .9rem; margin-bottom: 12px; }
.stage-wrap { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 10px; }
.stage { aspect-ratio: 16 / 9; background: #000; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); position: relative; }
.nav { width: 46px; height: 46px; border-radius: 50%; border: 1px solid #c9d6ea; background: rgba(10, 20, 36, .6); font-size: 1.7rem; line-height: 1; cursor: pointer; }
.nav:hover { background: var(--acc); color: #1a1200; border-color: var(--acc); }
.player-box, .player-box iframe, .player-box video, .player-box > div { width: 100%; height: 100%; border: 0; display: block; }
.player-box video { background: #000; }
.player-note { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 10px; background: rgba(0, 0, 0, .75); font-size: .85rem; text-align: center; }
.ended { width: 100%; height: 100%; border: 0; background: radial-gradient(circle, #1b2c4a, #070d18); font-size: 1.1rem; cursor: pointer; }
.ended span { font-size: 2rem; display: block; margin-bottom: 6px; color: var(--acc); }

.caption { text-align: center; margin: 16px 60px 4px; }
.caption .line { font-size: 1.35rem; font-weight: 500; margin: 4px 0; }
.caption .ctx { color: var(--mute); font-size: .92rem; opacity: .75; }
.src-line { color: var(--mute); font-size: .8rem; margin-top: 8px; }
.actions { display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 12px 0 22px; }
.actions select { width: auto; }
.res-head { display: flex; justify-content: space-between; color: var(--mute); font-size: .8rem; letter-spacing: .08em; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.results { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow: auto; }
.results li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 14px; border-bottom: 1px solid rgba(36, 55, 90, .6); cursor: pointer; border-left: 3px solid transparent; }
.results li:hover { background: rgba(31, 52, 86, .45); }
.results li.on { background: rgba(31, 52, 86, .8); border-left-color: var(--acc); }
.r-meta { color: var(--mute); font-size: .8rem; white-space: nowrap; }
.star { color: var(--acc); }

/* pages */
.page { max-width: 1140px; margin: 26px auto; padding: 0 24px; }
.page.narrow { max-width: 780px; }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-head .row input { width: 200px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.c-word { font-size: 1.25rem; font-weight: 700; color: var(--acc); }
.c-mean { font-weight: 500; }
.c-text { color: #c7d3e6; font-size: .93rem; }
.c-note { font-size: .85rem; color: var(--mute); font-style: italic; }
.c-meta { font-size: .78rem; color: var(--mute); margin-top: auto; }
.c-act { display: flex; gap: 6px; }

.lib { width: 100%; border-collapse: collapse; margin-top: 12px; }
.lib th { text-align: left; color: var(--mute); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 8px; border-bottom: 1px solid var(--line); }
.lib td { padding: 12px 8px; border-bottom: 1px solid rgba(36, 55, 90, .6); vertical-align: top; }
.lib td .btn { margin-left: 4px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(3, 8, 16, .72); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: min(720px, 100%); max-height: 92vh; overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.modal-card h2 { margin-top: 0; }
.modal-x { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 1.8rem; cursor: pointer; color: var(--mute); }
.modal-stage { aspect-ratio: 16 / 9; background: #000; border-radius: 10px; overflow: hidden; position: relative; margin-bottom: 12px; }
.line.center { font-size: 1.15rem; }
.pick { line-height: 2.1; font-size: 1.1rem; background: #0e1a2e; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.tk { border: 1px solid transparent; background: none; border-radius: 6px; padding: 1px 3px; cursor: pointer; }
.tk:hover { border-color: var(--line); }
.tk.on { background: rgba(255, 181, 71, .22); color: var(--acc); font-weight: 650; }
.grid2 { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; }
.det { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #22385d; border: 1px solid #3d5a8a; padding: 10px 18px; border-radius: 10px; z-index: 60; }
.toast[hidden] { display: none; }
.foot { max-width: 1140px; margin: 40px auto 24px; padding: 14px 24px 0; border-top: 1px solid var(--line); color: var(--mute); font-size: .8rem; text-align: center; }
.loading { text-align: center; padding: 80px; color: var(--mute); }

/* practice */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.mode { text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.mode span:last-child { color: var(--mute); font-size: .84rem; }
.mode.on { border-color: var(--acc); background: #1e2f4f; }
.mode:disabled { opacity: .45; cursor: not-allowed; }
.m-ic { font-size: 1.3rem; }
.setup select { width: auto; margin-left: 6px; }
.warn { color: var(--acc); font-size: .9rem; }
.q-top { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: .9rem; }
.bar { flex: 1; height: 8px; background: #1a2b48; border-radius: 9px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width .3s; }
.q-stage { aspect-ratio: 16 / 9; max-width: 620px; margin: 16px auto 0; background: #000; border-radius: 12px; overflow: hidden; position: relative; }
.q-title { text-align: center; color: var(--mute); margin-top: 18px; }
.q-sent { text-align: center; font-size: 1.4rem; margin: 12px 0; line-height: 1.6; }
.q-sent.small { font-size: 1.05rem; color: #c7d3e6; }
.gap { display: inline-block; min-width: 70px; border-bottom: 2px solid var(--acc); color: var(--acc); letter-spacing: 1px; padding: 0 4px; }
.gap.ok { color: #9ff0c4; border-color: var(--ok); letter-spacing: 0; } .gap.bad { color: #ffb3b3; border-color: var(--bad); letter-spacing: 0; }
.ans { max-width: 300px; font-size: 1.1rem; text-align: center; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.opt { text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-size: 1.02rem; }
.opt:hover:not(:disabled) { border-color: var(--acc); }
.opt kbd { display: inline-block; min-width: 22px; margin-right: 10px; border-radius: 5px; background: #0e1a2e; color: var(--mute); text-align: center; font-size: .8rem; padding: 1px 4px; }
.opt.ok { border-color: var(--ok); background: rgba(47, 191, 113, .14); }
.opt.bad { border-color: var(--bad); background: rgba(239, 90, 90, .14); }
.fb { text-align: center; margin: 10px 0; min-height: 10px; }
.fb.ok { color: #9ff0c4; } .fb.bad { color: #ffb3b3; }
.fb-full { color: var(--text); font-size: 1.05rem; margin: 6px 0 2px; }
.built { min-height: 52px; border: 1.5px dashed var(--line); border-radius: 10px; padding: 10px; margin: 14px 0 10px; text-align: center; font-size: 1.15rem; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.w { display: inline-block; }
.btnw { border: 1px solid var(--line); background: #1a2b48; border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 1.05rem; }
.btnw:hover { border-color: var(--acc); }
.flash { margin: 22px auto; max-width: 520px; min-height: 200px; border-radius: 16px; background: linear-gradient(160deg, #1d3157, #152440); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; cursor: pointer; text-align: center; }
.f-front { font-size: 2rem; font-weight: 700; color: var(--acc); }
.f-back { font-size: 1.3rem; }
.result { text-align: center; padding: 30px 0 10px; }
.ring { --p: 0; width: 140px; height: 140px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--acc) calc(var(--p) * 1%), #1a2b48 0); }
.ring span { width: 112px; height: 112px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 1.8rem; font-weight: 700; }

/* lessons */
.units { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 16px 0; }
.unit { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; color: var(--text); }
.unit:hover { border-color: var(--acc); text-decoration: none; }
.unit h3 { margin: 0; font-size: 1.15rem; }
.u-top { display: flex; justify-content: space-between; align-items: center; }
.u-num { color: var(--acc); font-weight: 700; font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; }
.u-phr { font-size: .85rem; color: #c7d3e6; line-height: 1.5; }
.u-phr .none { color: var(--mute); opacity: .7; }
.u-cov { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--mute); }
.u-cov .bar { max-width: 110px; height: 6px; }
.ok-tag { color: #9ff0c4; border-color: rgba(47, 191, 113, .5); }
.none-tag { color: #ffb3b3; border-color: rgba(239, 90, 90, .45); }
.lesson .page-head h1 { margin: 6px 0; }
.cov { color: var(--mute); }
.cov b { color: var(--text); }
.phrs { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.phr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.phr-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.phr-head .c-mean { margin: 2px 0 4px; }
.phr-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.phr-stage { max-width: 720px; margin: 14px auto 0; }
.phr-stage .stage { box-shadow: none; }
.phr .caption { margin: 10px 0 0; }
.phr .caption .line { font-size: 1.15rem; }
.clip-list { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid rgba(36, 55, 90, .6); }
.clip-li { display: flex; justify-content: space-between; gap: 14px; padding: 8px 10px; border-bottom: 1px solid rgba(36, 55, 90, .6); cursor: pointer; border-left: 3px solid transparent; font-size: .93rem; }
.clip-li:hover { background: rgba(31, 52, 86, .45); }
.clip-li.on { background: rgba(31, 52, 86, .8); border-left-color: var(--acc); }
.noclip { margin-top: 10px; padding: 10px 12px; border: 1px dashed rgba(239, 90, 90, .45); border-radius: 9px; color: var(--mute); font-size: .9rem; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.m-col { display: flex; flex-direction: column; gap: 8px; }
.m-it { text-align: left; border: 1.5px solid var(--line); background: var(--panel); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.m-it:hover:not(:disabled) { border-color: var(--acc); }
.m-it.sel { border-color: var(--acc); background: #1e2f4f; }
.m-it.ok { border-color: var(--ok); background: rgba(47, 191, 113, .14); opacity: .75; }
.say { color: var(--acc); font-size: 1.6rem; }
.heard { min-height: 24px; margin: 6px 0; }
#mic.rec { background: linear-gradient(135deg, #ef5a5a, #ff8a3d); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .7; } }
.m-it.bad { border-color: var(--bad); background: rgba(239, 90, 90, .14); }

@media (max-width: 900px) {
  .phr-head { flex-direction: column; }
  .phr-side { align-items: flex-start; flex-direction: row; }
  .clip-li { flex-direction: column; gap: 2px; }
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .searchbar { order: 3; max-width: none; flex-basis: 100%; }
  .search-layout { grid-template-columns: 1fr; padding: 0 12px; }
  .filters { position: static; order: 2; }
  .top { position: static; }
  .tabs { margin-left: 0; overflow-x: auto; }
  .results li { flex-direction: column; gap: 2px; }
  .actions { gap: 6px; }
  .stage-wrap { grid-template-columns: 1fr; }
  .nav { display: none; }
  .caption { margin: 14px 0 4px; }
  .modes, .opts { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 1.6rem; }
}
