/* =========================================================
   Tiengtrungthaythang LMS – design system
   Mọi style được gói trong .ttt để không đụng theme / wp-admin
   ========================================================= */

.ttt {
  --brand: #e5484d;
  --brand-2: #f59e0b;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --brand-ink: color-mix(in srgb, var(--brand) 80%, #000);
  --bg: #f6f4f1;
  --bg-2: #efebe6;
  --surface: #ffffff;
  --surface-2: #faf8f6;
  --line: #e9e4de;
  --line-2: #ddd6ce;
  --ink: #1f1a17;
  --ink-2: #5c534c;
  --ink-3: #958b82;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --shadow-sm: 0 1px 2px rgba(31, 26, 23, .06), 0 1px 1px rgba(31, 26, 23, .04);
  --shadow: 0 6px 24px -8px rgba(31, 26, 23, .14), 0 2px 6px -2px rgba(31, 26, 23, .06);
  --shadow-lg: 0 24px 60px -18px rgba(31, 26, 23, .28);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --zh: "Noto Serif SC", "Songti SC", "STKaiti", "KaiTi", serif;
  --zh-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
.ttt[data-theme="dark"] {
  --bg: #121011;
  --bg-2: #1a1718;
  --surface: #1d1a1b;
  --surface-2: #242022;
  --line: #2f2a2c;
  --line-2: #3b3537;
  --ink: #f4efec;
  --ink-2: #c4bab4;
  --ink-3: #8a807a;
  --ok-soft: rgba(22, 163, 74, .16);
  --warn-soft: rgba(217, 119, 6, .16);
  --bad-soft: rgba(220, 38, 38, .16);
  --info-soft: rgba(37, 99, 235, .18);
  --violet-soft: rgba(124, 58, 237, .18);
  --brand-soft: color-mix(in srgb, var(--brand) 18%, transparent);
  --shadow: 0 6px 24px -8px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}
.ttt *, .ttt *::before, .ttt *::after { box-sizing: border-box; }
.ttt h1, .ttt h2, .ttt h3, .ttt h4, .ttt p { margin: 0; color: inherit; font-family: inherit; letter-spacing: normal; text-transform: none; }
.ttt h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.ttt h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.ttt h3 { font-size: 16px; font-weight: 700; }
.ttt :where(a) { color: var(--brand); text-decoration: none; }
.ttt :where(svg[aria-hidden]) { width: 1.15em; height: 1.15em; flex: none; }
.ttt-crumb svg { width: 14px; height: 14px; opacity: .6; }
.ttt img { max-width: 100%; display: block; }
.ttt img.emoji, .ttt img.wp-smiley { display: inline !important; width: 1em !important; height: 1em !important; margin: 0 .05em !important; vertical-align: -.1em !important; border: 0 !important; box-shadow: none !important; background: none !important; padding: 0 !important; }
.ttt button { font-family: inherit; cursor: pointer; }
.ttt input, .ttt select, .ttt textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
.ttt ::selection { background: var(--brand); color: #fff; }
.ttt .zh { font-family: var(--zh); }
.ttt .zhs { font-family: var(--zh-sans); }
.ttt .muted { color: var(--ink-3); }
.ttt .small { font-size: 13px; }
.ttt .tiny { font-size: 12px; }
.ttt .bold { font-weight: 700; }
.ttt .center { text-align: center; }
.ttt .row { display: flex; align-items: center; gap: 12px; }
.ttt .row.wrap { flex-wrap: wrap; }
.ttt .row.between { justify-content: space-between; }
.ttt .row.top { align-items: flex-start; }
.ttt .col { display: flex; flex-direction: column; gap: 12px; }
.ttt .grow { flex: 1; min-width: 0; }
.ttt .gap-sm { gap: 6px; }
.ttt .gap-lg { gap: 20px; }
.ttt .mt { margin-top: 16px; }
.ttt .mt-sm { margin-top: 8px; }
.ttt .mt-lg { margin-top: 28px; }
.ttt .mb { margin-bottom: 16px; }
.ttt .hide { display: none !important; }
.ttt .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttt .grid { display: grid; gap: 16px; }
.ttt .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ttt .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ttt .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ttt .g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ttt .g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .ttt .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ttt .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .ttt .g2, .ttt .g3 { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .ttt .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---------- Boot ---------- */
body.ttt-canvas { margin: 0; background: #f6f4f1; min-height: 100vh; }
.ttt-boot { min-height: 60vh; display: grid; place-items: center; }
.ttt-spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(229, 72, 77, .18); border-top-color: #e5484d; animation: ttt-spin .8s linear infinite; }
@keyframes ttt-spin { to { transform: rotate(360deg); } }

/* ---------- Shell ---------- */
.ttt.ttt-full { min-height: 100vh; min-height: 100dvh; }
.ttt-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: inherit; }
.ttt-in-admin { margin: 0 0 0 -20px; min-height: calc(100vh - 32px); }
.ttt-in-admin .ttt-shell { min-height: calc(100vh - 32px); }
.ttt-in-admin .ttt-side { top: 32px; height: calc(100vh - 32px); }
.ttt-embedded .ttt-shell { min-height: 80vh; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }

.ttt-side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; z-index: 20;
}
.ttt-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.ttt-logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  font-family: var(--zh); font-weight: 900; font-size: 22px; box-shadow: 0 8px 20px -8px var(--brand);
}
.ttt-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ttt-brand-name { font-weight: 800; font-size: 15px; line-height: 1.2; letter-spacing: -.01em; }
.ttt-brand-sub { font-size: 11.5px; color: var(--ink-3); }
.ttt-nav-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.ttt-nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink-2); font-weight: 600; font-size: 14.5px; position: relative; transition: background .2s, color .2s;
}
.ttt-nav a svg { width: 20px; height: 20px; flex: none; }
.ttt-nav a:hover { background: var(--surface-2); color: var(--ink); }
.ttt-nav a.active { background: var(--brand-soft); color: var(--brand); }
.ttt-nav a.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.ttt-nav .count { margin-left: auto; background: var(--brand); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 8px; font-weight: 700; }
.ttt-side-foot { margin-top: auto; padding-top: 16px; }
.ttt-mode-switch {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; border-radius: 14px; border: 1px dashed var(--line-2);
  background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13.5px;
}
.ttt-mode-switch:hover { border-color: var(--brand); color: var(--brand); }

.ttt-main { min-width: 0; display: flex; flex-direction: column; }
.ttt-top {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.ttt-in-admin .ttt-top { top: 32px; }
.ttt-top.scrolled { border-bottom-color: var(--line); }
.ttt-top-title { font-weight: 700; font-size: 15px; color: var(--ink-2); }
.ttt-page { padding: 8px 28px 48px; max-width: 1280px; width: 100%; margin: 0 auto; }
.ttt-page.narrow { max-width: 880px; }
.ttt-iconbtn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); transition: all .2s;
}
.ttt-iconbtn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); transform: translateY(-1px); }
.ttt-iconbtn svg { width: 19px; height: 19px; }
.ttt-iconbtn .dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.ttt-xp-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; }
.ttt-xp-pill .fire { font-size: 16px; }
.ttt-menu-btn { display: none; }

/* bottom nav mobile */
.ttt-bottom { display: none; }
@media (max-width: 900px) {
  .ttt-shell { grid-template-columns: 1fr; }
  .ttt-side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: var(--shadow-lg); }
  .ttt-in-admin .ttt-side { top: 46px; height: calc(100vh - 46px); }
  .ttt.side-open .ttt-side { transform: none; }
  .ttt.side-open .ttt-scrim { opacity: 1; pointer-events: auto; }
  .ttt-menu-btn { display: grid; }
  .ttt-top { padding: 12px 16px; }
  .ttt-page { padding: 4px 16px 110px; }
  .ttt-bottom {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 30; padding: 6px;
    background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg);
    padding-bottom: calc(6px + env(safe-area-inset-bottom) * .5);
  }
  .ttt-bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0; border-radius: 14px; color: var(--ink-3); font-size: 10.5px; font-weight: 700; position: relative; }
  .ttt-bottom a svg { width: 21px; height: 21px; }
  .ttt-bottom a.active { color: var(--brand); background: var(--brand-soft); }
  .ttt-bottom .count { position: absolute; top: 2px; right: calc(50% - 20px); background: var(--brand); color: #fff; font-size: 9.5px; border-radius: 99px; padding: 0 5px; }
  .ttt .hide-m { display: none !important; }
}
.ttt-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 19; }

/* ---------- Page header ---------- */
.ttt-ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 22px; }
.ttt-ph p { color: var(--ink-3); margin-top: 4px; }
.ttt-crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; flex-wrap: wrap; }
.ttt-crumb a { color: var(--ink-3); font-weight: 600; }
.ttt-crumb a:hover { color: var(--brand); }

/* ---------- Card ---------- */
.ttt-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); min-width: 0; }
.ttt-card.pad-0 { padding: 0; overflow: hidden; }
.ttt-card.hover { transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; cursor: pointer; }
.ttt-card.hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.ttt-card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ttt-card-h h3 { display: flex; align-items: center; gap: 8px; }
.ttt-card-h h3 svg { width: 18px; height: 18px; color: var(--brand); }
.ttt-sep { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- Buttons ---------- */
.ttt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 14.5px; line-height: 1;
  background: var(--brand); color: #fff; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; white-space: nowrap;
  box-shadow: 0 6px 16px -8px var(--brand); position: relative; overflow: hidden; text-decoration: none !important;
}
.ttt-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -10px var(--brand); color: #fff; }
.ttt-btn:active { transform: translateY(0) scale(.98); }
.ttt-btn svg { width: 18px; height: 18px; flex: none; }
.ttt-btn[disabled], .ttt-btn.loading { opacity: .55; pointer-events: none; }
.ttt-btn.loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ttt-spin .7s linear infinite; }
.ttt-btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-sm); }
.ttt-btn.ghost:hover { border-color: var(--line-2); color: var(--ink); }
.ttt-btn.soft { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.ttt-btn.soft:hover { color: var(--brand); }
.ttt-btn.plain { background: transparent; color: var(--ink-2); box-shadow: none; }
.ttt-btn.plain:hover { background: var(--surface-2); color: var(--ink); }
.ttt-btn.danger { background: var(--bad); box-shadow: 0 6px 16px -8px var(--bad); }
.ttt-btn.danger.soft { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.ttt-btn.ok { background: var(--ok); box-shadow: 0 6px 16px -8px var(--ok); }
.ttt-btn.dark { background: var(--ink); color: var(--bg); box-shadow: none; }
.ttt-btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.ttt-btn.xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 5px; }
.ttt-btn.xs svg, .ttt-btn.sm svg { width: 15px; height: 15px; }
.ttt-btn.lg { height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.ttt-btn.icon { width: 42px; padding: 0; }
.ttt-btn.sm.icon { width: 34px; }
.ttt-btn.xs.icon { width: 28px; }
.ttt-btn.block { width: 100%; }
.ttt-btn .ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .45); transform: scale(0); animation: ttt-ripple .6s ease-out; pointer-events: none; }
@keyframes ttt-ripple { to { transform: scale(3); opacity: 0; } }

/* ---------- Chips ---------- */
.ttt-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.ttt-chip svg { width: 13px; height: 13px; }
.ttt-chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.ttt-chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.ttt-chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.ttt-chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.ttt-chip.violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.ttt-chip.brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.ttt-chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- Forms ---------- */
.ttt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ttt-field > label, .ttt-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ttt-field .hint { font-size: 12px; color: var(--ink-3); }
.ttt-input, .ttt-select, .ttt-textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  transition: border-color .2s, box-shadow .2s; outline: none; box-shadow: none; margin: 0; max-width: none;
}
.ttt-textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.ttt-input:focus, .ttt-select:focus, .ttt-textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.ttt-input.sm, .ttt-select.sm { height: 36px; font-size: 14px; border-radius: 10px; padding: 0 10px; }
.ttt-select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23958b82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.ttt-input.zh, .ttt-textarea.zh { font-family: var(--zh-sans); font-size: 17px; }
.ttt-input-wrap { position: relative; }
.ttt-input-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.ttt-input-wrap .ttt-input { padding-left: 40px; }
.ttt-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; user-select: none; }
.ttt-check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.ttt-switch { position: relative; width: 44px; height: 26px; flex: none; }
.ttt-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.ttt-switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background .25s; cursor: pointer; }
.ttt-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .3s var(--spring); }
.ttt-switch input:checked + span { background: var(--brand); }
.ttt-switch input:checked + span::after { transform: translateX(18px); }
.ttt-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ttt-form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .ttt-form-grid { grid-template-columns: 1fr; } }
.ttt-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.ttt-colors button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); transition: transform .2s var(--spring); }
.ttt-colors button.on { box-shadow: 0 0 0 2px var(--ink); transform: scale(1.12); }

/* ---------- Tabs / segmented ---------- */
.ttt-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 14px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ttt-tabs::-webkit-scrollbar { display: none; }
.ttt-tabs button { border: 0; background: transparent; height: 36px; padding: 0 16px; border-radius: 10px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; transition: all .2s; }
.ttt-tabs button svg { width: 16px; height: 16px; }
.ttt-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.ttt-tabs button .n { background: var(--line); border-radius: 99px; padding: 0 7px; font-size: 11px; }
.ttt-tabs button.on .n { background: var(--brand); color: #fff; }

/* ---------- Table ---------- */
.ttt-table-wrap { overflow-x: auto; border-radius: var(--r); }
.ttt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.ttt-table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.ttt-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ttt-table tr:last-child td { border-bottom: 0; }
.ttt-table tbody tr { transition: background .15s; }
.ttt-table tbody tr:hover { background: var(--surface-2); }
.ttt-table tr.click { cursor: pointer; }
.ttt-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Avatar ---------- */
.ttt-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none; letter-spacing: -.02em; }
.ttt-av.sm { width: 30px; height: 30px; font-size: 12px; }
.ttt-av.lg { width: 72px; height: 72px; font-size: 26px; }
.ttt-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ttt-person .n { font-weight: 700; line-height: 1.25; }
.ttt-person .s { font-size: 12.5px; color: var(--ink-3); }

/* ---------- Stats ---------- */
.ttt-stat { position: relative; overflow: hidden; }
.ttt-stat .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; }
.ttt-stat .ic svg { width: 22px; height: 22px; }
.ttt-stat .v { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ttt-stat .l { color: var(--ink-3); font-size: 13px; font-weight: 600; margin-top: 2px; }
.ttt-stat .bgicon { position: absolute; right: -10px; bottom: -18px; font-size: 84px; opacity: .06; font-family: var(--zh); font-weight: 900; pointer-events: none; }
.tone-brand .ic { background: var(--brand-soft); color: var(--brand); }
.tone-ok .ic { background: var(--ok-soft); color: var(--ok); }
.tone-warn .ic { background: var(--warn-soft); color: var(--warn); }
.tone-info .ic { background: var(--info-soft); color: var(--info); }
.tone-violet .ic { background: var(--violet-soft); color: var(--violet); }
@media (max-width: 480px) { .ttt-stat { padding: 14px; } .ttt-stat .v { font-size: 22px; } .ttt-stat .ic { width: 36px; height: 36px; margin-bottom: 10px; } }

/* ---------- Progress ---------- */
.ttt-bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.ttt-bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); width: 0; transition: width 1s var(--ease); }
.ttt-bar.ok > i { background: var(--ok); }
.ttt-bar.thin { height: 5px; }
.ttt-ring { position: relative; display: inline-grid; place-items: center; }
.ttt-ring svg { transform: rotate(-90deg); }
.ttt-ring circle { fill: none; stroke-linecap: round; }
.ttt-ring .track { stroke: var(--bg-2); }
.ttt-ring .val { stroke: var(--brand); transition: stroke-dashoffset 1.2s var(--ease); }
.ttt-ring .lbl { position: absolute; text-align: center; line-height: 1.1; }

/* ---------- Hero (dashboard) ---------- */
.ttt-hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 28px; color: #fff;
  background: radial-gradient(1200px 400px at 110% -40%, rgba(255, 255, 255, .25), transparent 60%), linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 60%, var(--brand-2)) 100%);
  box-shadow: 0 24px 50px -24px var(--brand);
}
.ttt-hero h1 { color: #fff; }
.ttt-hero p { color: rgba(255, 255, 255, .88); }
.ttt-hero .deco { position: absolute; right: 24px; bottom: -36px; font-family: var(--zh); font-size: 180px; font-weight: 900; line-height: 1; opacity: .13; pointer-events: none; animation: ttt-float 6s ease-in-out infinite; }
.ttt-hero .ttt-btn { background: #fff; color: var(--brand); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .4); }
.ttt-hero .ttt-btn.glass { background: rgba(255, 255, 255, .18); color: #fff; border: 1px solid rgba(255, 255, 255, .35); box-shadow: none; }
.ttt-hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 22px; }
.ttt-hero-stats .v { font-size: 26px; font-weight: 800; }
.ttt-hero-stats .l { font-size: 12.5px; opacity: .85; }
.ttt-level-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .25); overflow: hidden; margin-top: 8px; max-width: 360px; }
.ttt-level-bar i { display: block; height: 100%; background: #fff; border-radius: inherit; transition: width 1.2s var(--ease); }
@keyframes ttt-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(2deg); } }

/* ---------- Lists ---------- */
.ttt-list { display: flex; flex-direction: column; }
.ttt-li { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px dashed var(--line); min-width: 0; }
.ttt-li:last-child { border-bottom: 0; }
.ttt-li.click { cursor: pointer; border-radius: 12px; padding: 12px; margin: 0 -8px; border-bottom: 0; transition: background .15s; }
.ttt-li.click:hover { background: var(--surface-2); }
.ttt-li .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.ttt-li .ic svg { width: 20px; height: 20px; }
.ttt-li .t { font-weight: 700; line-height: 1.3; }
.ttt-li .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Empty / skeleton ---------- */
.ttt-empty { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.ttt-empty .e { font-size: 44px; margin-bottom: 8px; filter: saturate(1.2); animation: ttt-float 5s ease-in-out infinite; display: inline-block; }
.ttt-empty h3 { color: var(--ink); margin-bottom: 4px; }
.ttt-skel { background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: ttt-shimmer 1.4s ease infinite; border-radius: 12px; }
@keyframes ttt-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Animations ---------- */
.ttt .fx-up { animation: ttt-up .55s var(--ease) both; }
.ttt .fx-in { animation: ttt-in .4s ease both; }
.ttt .fx-pop { animation: ttt-pop .5s var(--spring) both; }
.ttt .stagger > * { animation: ttt-up .55s var(--ease) both; }
.ttt .stagger > *:nth-child(1) { animation-delay: .02s; } .ttt .stagger > *:nth-child(2) { animation-delay: .06s; }
.ttt .stagger > *:nth-child(3) { animation-delay: .1s; } .ttt .stagger > *:nth-child(4) { animation-delay: .14s; }
.ttt .stagger > *:nth-child(5) { animation-delay: .18s; } .ttt .stagger > *:nth-child(6) { animation-delay: .22s; }
.ttt .stagger > *:nth-child(7) { animation-delay: .26s; } .ttt .stagger > *:nth-child(8) { animation-delay: .3s; }
.ttt .stagger > *:nth-child(n+9) { animation-delay: .34s; }
@keyframes ttt-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ttt-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ttt-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes ttt-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.ttt .shake { animation: ttt-shake .5s; }
@media (prefers-reduced-motion: reduce) { .ttt *, .ttt *::before, .ttt *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Modal / toast ---------- */
.ttt-modal-bg { position: fixed; inset: 0; z-index: 100000; background: rgba(20, 14, 12, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: ttt-in .2s ease; }
.ttt-modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: ttt-modal .35s var(--spring); border: 1px solid var(--line); }
.ttt-modal.wide { max-width: 820px; }
.ttt-modal.xwide { max-width: 1100px; }
.ttt-modal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.ttt-modal-b { padding: 22px; overflow-y: auto; }
.ttt-modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); flex-wrap: wrap; }
@keyframes ttt-modal { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
.ttt-toasts { position: fixed; z-index: 100001; right: 20px; top: 20px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.ttt-toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); animation: ttt-toast .45s var(--spring); max-width: 380px; }
.ttt-toast.ok { background: var(--ok); color: #fff; }
.ttt-toast.bad { background: var(--bad); color: #fff; }
.ttt-toast.out { animation: ttt-toast-out .3s ease forwards; }
@keyframes ttt-toast { from { opacity: 0; transform: translateX(40px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes ttt-toast-out { to { opacity: 0; transform: translateX(40px); } }
@media (max-width: 640px) { .ttt-toasts { left: 12px; right: 12px; top: 12px; } }
.ttt-xp-float { position: fixed; z-index: 100002; pointer-events: none; font-weight: 900; font-size: 22px; color: var(--brand-2); text-shadow: 0 2px 8px rgba(0, 0, 0, .2); animation: ttt-xpf 1.4s var(--ease) forwards; }
@keyframes ttt-xpf { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 20% { opacity: 1; transform: translateY(0) scale(1.15); } 100% { opacity: 0; transform: translateY(-80px) scale(1); } }
.ttt-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100003; }

/* ---------- Dropdown ---------- */
.ttt-pop { position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; width: 360px; max-width: calc(100vw - 24px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); animation: ttt-modal .3s var(--spring); overflow: hidden; }
.ttt-pop-h { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.ttt-pop-b { max-height: 420px; overflow-y: auto; }
.ttt-noti { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .15s; }
.ttt-noti:hover { background: var(--surface-2); }
.ttt-noti.unread { background: var(--brand-soft); }
.ttt-noti .b { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; margin-top: 7px; }
.ttt-noti:not(.unread) .b { background: transparent; }
.ttt-noti .t { font-weight: 700; font-size: 14px; line-height: 1.35; }
.ttt-noti .s { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.ttt-noti .d { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.ttt-usermenu a, .ttt-usermenu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 16px; color: var(--ink); font-weight: 600; font-size: 14px; background: none; border: 0; text-align: left; }
.ttt-usermenu a:hover, .ttt-usermenu button:hover { background: var(--surface-2); }
.ttt-usermenu svg { width: 18px; height: 18px; color: var(--ink-3); }

/* ---------- Login ---------- */
.ttt-login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1.1fr 1fr; }
.ttt-login-art { position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; background: radial-gradient(800px 500px at 0% 0%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(150deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #2a0f10)); }
.ttt-login-art h1 { color: #fff; font-size: 40px; max-width: 520px; }
.ttt-login-art p { color: rgba(255, 255, 255, .85); max-width: 460px; font-size: 16px; margin-top: 12px; }
.ttt-floaters span { position: absolute; font-family: var(--zh); font-weight: 900; color: rgba(255, 255, 255, .12); animation: ttt-float 7s ease-in-out infinite; user-select: none; }
.ttt-login-feat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-width: 520px; position: relative; }
.ttt-login-feat div { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 16px; padding: 14px; font-weight: 600; font-size: 14px; backdrop-filter: blur(6px); }
.ttt-login-feat b { display: block; font-size: 22px; margin-bottom: 4px; }
.ttt-login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--bg); }
.ttt-login-card { width: 100%; max-width: 400px; }
.ttt-login-card h2 { font-size: 28px; font-weight: 800; }
@media (max-width: 900px) { .ttt-login { grid-template-columns: 1fr; } .ttt-login-art { min-height: 260px; padding: 28px; } .ttt-login-art h1 { font-size: 28px; } .ttt-login-feat { display: none; } }

/* ---------- Course / lesson cards ---------- */
.ttt-course { position: relative; overflow: hidden; padding: 0; }
.ttt-course-cover { height: 120px; position: relative; display: flex; align-items: flex-end; padding: 16px; color: #fff; overflow: hidden; }
.ttt-course-cover::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 160px at 100% 0%, rgba(255, 255, 255, .35), transparent 60%); }
.ttt-course-cover .big { position: absolute; right: 12px; top: -8px; font-family: var(--zh); font-size: 96px; font-weight: 900; opacity: .2; line-height: 1; transition: transform .6s var(--ease); }
.ttt-card.hover:hover .ttt-course-cover .big { transform: scale(1.1) rotate(-6deg); }
.ttt-course-cover .lvl { position: relative; background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .35); padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.ttt-course-body { padding: 16px; }
.ttt-lesson-row { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); transition: all .25s var(--ease); cursor: pointer; }
.ttt-lesson-row:hover { transform: translateX(4px); border-color: var(--line-2); box-shadow: var(--shadow); }
.ttt-lesson-num { width: 52px; height: 52px; border-radius: 16px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--bg-2); color: var(--ink-2); position: relative; }
.ttt-lesson-num.done { background: var(--ok); color: #fff; }
.ttt-lesson-num.cur { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.ttt-path { display: flex; flex-direction: column; gap: 10px; position: relative; }

/* lesson page */
.ttt-lesson-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.ttt-action-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .ttt-action-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ttt-lesson-hero { grid-template-columns: 1fr; } }
.ttt-tile { border-radius: var(--r); padding: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: all .25s var(--ease); position: relative; overflow: hidden; text-align: left; display: block; width: 100%; color: var(--ink); }
.ttt-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.ttt-tile .em { font-size: 30px; display: block; margin-bottom: 10px; transition: transform .4s var(--spring); }
.ttt-tile:hover .em { transform: scale(1.2) rotate(-8deg); }
.ttt-tile .t { font-weight: 800; font-size: 15px; }
.ttt-tile .s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.ttt-tile .chk { position: absolute; right: 12px; top: 12px; }

/* vocab grid */
.ttt-vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 42%), 1fr)); gap: 12px; }
.ttt-vword { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-align: center; transition: all .25s var(--ease); cursor: pointer; position: relative; }
.ttt-vword:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.ttt-vword .h { font-family: var(--zh); font-size: 34px; font-weight: 700; line-height: 1.25; }
.ttt-vword .p { color: var(--brand); font-weight: 600; font-size: 14px; }
.ttt-vword .m { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.ttt-vword .spk { position: absolute; right: 8px; top: 8px; opacity: 0; transition: opacity .2s; }
.ttt-vword:hover .spk { opacity: 1; }

/* ---------- Fullscreen overlay (player) ---------- */
.ttt-overlay { position: fixed; inset: 0; z-index: 99999; background: var(--bg); display: flex; flex-direction: column; animation: ttt-in .25s ease; }
.ttt-overlay-h { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ttt-overlay-h .title { font-weight: 800; flex: 1; min-width: 0; }
.ttt-overlay-b { flex: 1; min-height: 0; position: relative; overflow: auto; }
.ttt-overlay-f { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.ttt-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.ttt-toggle.on { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.ttt-toggle svg { width: 15px; height: 15px; }

/* slides */
.ttt-stage { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; overflow: hidden; }
.ttt-slide { width: min(1080px, 100%); aspect-ratio: 16 / 9; max-height: 100%; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); position: relative; overflow: hidden; display: flex; flex-direction: column; padding: clamp(18px, 4vw, 48px); container-type: inline-size; }
@media (max-width: 760px) { .ttt-slide { aspect-ratio: auto; height: 100%; border-radius: 20px; } }
.ttt-slide.in-next { animation: ttt-slide-in-r .5s var(--ease) both; }
.ttt-slide.in-prev { animation: ttt-slide-in-l .5s var(--ease) both; }
@keyframes ttt-slide-in-r { from { opacity: 0; transform: translateX(60px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ttt-slide-in-l { from { opacity: 0; transform: translateX(-60px) scale(.97); } to { opacity: 1; transform: none; } }
.ttt-slide .s-title { font-size: clamp(18px, 3cqi, 30px); font-weight: 800; letter-spacing: -.01em; margin-bottom: 2.4cqi; display: flex; align-items: center; gap: 12px; }
.ttt-slide .s-title::before { content: ""; width: 6px; height: 1.1em; border-radius: 4px; background: linear-gradient(var(--brand), var(--brand-2)); }
.ttt-slide .s-body { flex: 1; min-height: 0; overflow-y: auto; }
.ttt-slide .s-audio { position: absolute; left: clamp(12px, 2.4cqi, 28px); bottom: clamp(10px, 2cqi, 22px); z-index: 3; display: flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--brand); }
.ttt-slide .s-audio audio { height: 34px; width: min(300px, 60cqi); }
.ttt-slide:has(.s-audio) .s-body { padding-bottom: 52px; }
.ttt-slide .s-corner { position: absolute; right: -2cqi; bottom: -6cqi; font-family: var(--zh); font-weight: 900; font-size: 26cqi; opacity: .04; pointer-events: none; line-height: 1; }
.s-cover { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 1.2cqi; background: radial-gradient(60% 60% at 50% 40%, var(--brand-soft), transparent 70%); margin: calc(-1 * clamp(18px, 4vw, 48px)); padding: clamp(18px, 4vw, 48px); }
.s-cover .hz { font-family: var(--zh); font-size: clamp(56px, 13cqi, 150px); font-weight: 900; line-height: 1.1; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; cursor: pointer; animation: ttt-pop .8s var(--spring) both .1s; }
.s-cover .py { font-size: clamp(18px, 3cqi, 30px); color: var(--ink-2); font-weight: 600; }
.s-cover .tt { font-size: clamp(20px, 3.6cqi, 38px); font-weight: 800; }
.s-cover .nt { color: var(--ink-3); font-size: clamp(14px, 1.8cqi, 18px); }
.s-word { display: grid; grid-template-columns: auto 1fr; gap: 4cqi; align-items: center; height: 100%; }
.s-word .card3d { width: clamp(150px, 30cqi, 320px); aspect-ratio: 1; border-radius: 24px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-soft), transparent), var(--surface-2); border: 2px solid var(--line); position: relative; cursor: pointer; }
.s-word .card3d .hz { font-family: var(--zh); font-weight: 900; font-size: clamp(56px, 12cqi, 140px); line-height: 1; }
.s-word .card3d::after { content: ""; position: absolute; inset: 12px; border: 1.5px dashed var(--line-2); border-radius: 16px; pointer-events: none; background: linear-gradient(var(--line) 0 0) center/1px 100% no-repeat, linear-gradient(var(--line) 0 0) center/100% 1px no-repeat; opacity: .6; }
.s-word .py { font-size: clamp(22px, 4cqi, 42px); font-weight: 700; color: var(--brand); }
.s-word .mn { font-size: clamp(18px, 3cqi, 30px); font-weight: 700; margin-top: .5cqi; }
.s-word .pos { display: inline-block; margin-top: 1cqi; }
.s-word .ex { margin-top: 3cqi; padding: 2cqi 2.4cqi; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.s-word .ex .z { font-family: var(--zh); font-size: clamp(18px, 2.8cqi, 28px); font-weight: 700; cursor: pointer; }
.s-word .ex .p { color: var(--ink-2); font-size: clamp(13px, 1.8cqi, 17px); }
.s-word .ex .v { color: var(--ink-3); font-size: clamp(13px, 1.8cqi, 17px); font-style: italic; }
@media (max-width: 760px) { .s-word { grid-template-columns: 1fr; justify-items: center; text-align: center; align-content: center; } }
.s-text { font-size: clamp(15px, 2.3cqi, 24px); line-height: 1.7; }
.s-text .formula { display: inline-block; margin-bottom: 2cqi; padding: 1.2cqi 2.4cqi; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 700; box-shadow: 0 10px 24px -14px var(--brand); }
.s-text mark { background: color-mix(in srgb, var(--brand-2) 30%, transparent); color: inherit; padding: 0 4px; border-radius: 4px; }
.s-text .exs { margin-top: 2cqi; display: grid; gap: 1.2cqi; }
.s-text .exs > div { padding: 1.2cqi 2cqi; border-left: 4px solid var(--brand); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.s-text .exs .z { font-family: var(--zh); font-weight: 700; font-size: 1.15em; cursor: pointer; }
.s-text .exs .p { color: var(--ink-2); font-size: .85em; }
.s-text .exs .v { color: var(--ink-3); font-size: .85em; }
.s-dialog { display: flex; flex-direction: column; gap: 1.6cqi; }
.s-line { display: flex; gap: 14px; align-items: flex-start; animation: ttt-up .5s var(--ease) both; }
.s-line.r { flex-direction: row-reverse; text-align: right; }
.s-line .who { width: clamp(34px, 5cqi, 52px); height: clamp(34px, 5cqi, 52px); border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; font-size: clamp(13px, 1.8cqi, 18px); }
.s-line .bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 1.2cqi 2cqi; max-width: 78%; cursor: pointer; transition: transform .2s; }
.s-line .bubble:hover { transform: scale(1.02); }
.s-line.r .bubble { background: var(--brand-soft); border-color: transparent; }
.s-line .z { font-family: var(--zh); font-size: clamp(18px, 2.9cqi, 30px); font-weight: 700; line-height: 1.4; }
.s-line .p { color: var(--ink-2); font-size: clamp(12px, 1.7cqi, 17px); }
.s-line .v { color: var(--ink-3); font-size: clamp(12px, 1.7cqi, 16px); font-style: italic; }
.s-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 20cqi, 200px), 1fr)); gap: 1.4cqi; }
.s-words > div { padding: 1.4cqi; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; cursor: pointer; transition: all .2s; animation: ttt-pop .45s var(--spring) both; }
.s-words > div:hover { border-color: var(--brand); transform: translateY(-2px); }
.s-words .z { font-family: var(--zh); font-size: clamp(22px, 3.6cqi, 38px); font-weight: 700; }
.s-words .p { color: var(--brand); font-weight: 600; font-size: clamp(12px, 1.6cqi, 16px); }
.s-words .v { color: var(--ink-2); font-size: clamp(12px, 1.5cqi, 15px); }
.s-image { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.s-image img { max-height: 80%; border-radius: 18px; object-fit: contain; box-shadow: var(--shadow); }
.s-video { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 100%; border-radius: 18px; overflow: hidden; background: #000; }
.s-video iframe, .s-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ttt .no-py .py-t, .ttt .no-py .p, .ttt .no-py .py { visibility: hidden; }
.ttt .no-vi .v, .ttt .no-vi .vi-t, .ttt .no-vi .mn { visibility: hidden; }
.ttt-dots { display: flex; gap: 5px; flex: 1; justify-content: center; flex-wrap: wrap; overflow: hidden; max-height: 24px; }
.ttt-dots i { width: 8px; height: 8px; border-radius: 99px; background: var(--line-2); transition: all .3s var(--ease); cursor: pointer; }
.ttt-dots i.on { width: 26px; background: var(--brand); }
.ttt-dots i.seen { background: color-mix(in srgb, var(--brand) 40%, var(--line-2)); }
.ttt-slide-progress { position: absolute; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .4s var(--ease); z-index: 2; }

/* flashcards */
.ttt-fc-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; min-height: 100%; padding: 24px 16px; }
.ttt-fc { width: min(460px, 100%); aspect-ratio: 4 / 5; perspective: 1400px; cursor: pointer; position: relative; }
.ttt-fc-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .7s var(--spring); }
.ttt-fc.flipped .ttt-fc-inner { transform: rotateY(180deg); }
.ttt-fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; overflow: hidden; }
.ttt-fc-face::before { content: ""; position: absolute; inset: 0; background: radial-gradient(80% 50% at 50% 0%, var(--brand-soft), transparent 70%); pointer-events: none; }
.ttt-fc-back { transform: rotateY(180deg); }
.ttt-fc .hz { font-family: var(--zh); font-weight: 900; font-size: clamp(64px, 18vw, 120px); line-height: 1.1; position: relative; }
.ttt-fc .hz.long { font-size: clamp(40px, 11vw, 72px); }
.ttt-fc .py { font-size: 26px; font-weight: 700; color: var(--brand); position: relative; }
.ttt-fc .mn { font-size: 22px; font-weight: 700; margin-top: 6px; position: relative; }
.ttt-fc .ex { margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--surface-2); width: 100%; position: relative; }
.ttt-fc .ex .z { font-family: var(--zh); font-size: 20px; font-weight: 700; }
.ttt-fc .hint { position: absolute; bottom: 16px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.ttt-fc .tools { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; z-index: 2; }
.ttt-fc.swipe-l { animation: ttt-swl .45s var(--ease) forwards; }
.ttt-fc.swipe-r { animation: ttt-swr .45s var(--ease) forwards; }
.ttt-fc.enter { animation: ttt-pop .45s var(--spring) both; }
@keyframes ttt-swl { to { transform: translateX(-120%) rotate(-14deg); opacity: 0; } }
@keyframes ttt-swr { to { transform: translateX(120%) rotate(14deg); opacity: 0; } }
.ttt-rate { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(560px, 100%); }
.ttt-rate button { border: 0; border-radius: 16px; padding: 10px 6px; font-weight: 800; font-size: 14px; color: #fff; transition: transform .15s var(--spring); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ttt-rate button:hover { transform: translateY(-3px) scale(1.03); }
.ttt-rate button small { font-weight: 600; opacity: .85; font-size: 11px; }
.ttt-rate .r1 { background: #ef4444; } .ttt-rate .r2 { background: #f59e0b; } .ttt-rate .r3 { background: #22c55e; } .ttt-rate .r4 { background: #3b82f6; }
.ttt-know { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: min(460px, 100%); }
.ttt-kbd { display: inline-block; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); font-size: 11px; font-weight: 700; color: var(--ink-3); background: var(--surface); line-height: 18px; }

/* quiz */
.ttt-quiz { width: min(640px, 100%); margin: 0 auto; padding: 24px 16px; }
.ttt-quiz-q { text-align: center; padding: 30px 20px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px; position: relative; overflow: hidden; }
.ttt-quiz-q .hz { font-family: var(--zh); font-size: 64px; font-weight: 900; line-height: 1.2; }
.ttt-quiz-q .mn { font-size: 26px; font-weight: 800; }
.ttt-quiz-timer { position: absolute; left: 0; bottom: 0; height: 5px; background: linear-gradient(90deg, var(--ok), var(--brand-2), var(--bad)); background-size: 300% 100%; }
.ttt-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .ttt-opts { grid-template-columns: 1fr; } }
.ttt-opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; font-size: 16px; text-align: left; color: var(--ink); transition: all .18s var(--ease); width: 100%; }
.ttt-opt:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ttt-opt .k { width: 30px; height: 30px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--bg-2); font-size: 13px; color: var(--ink-2); font-weight: 800; }
.ttt-opt .zh { font-size: 22px; }
.ttt-opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.ttt-opt.sel .k { background: var(--brand); color: #fff; }
.ttt-opt.right { border-color: var(--ok); background: var(--ok-soft); }
.ttt-opt.right .k { background: var(--ok); color: #fff; }
.ttt-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.ttt-opt.wrong .k { background: var(--bad); color: #fff; }
.ttt-opt[disabled] { cursor: default; transform: none; }
.ttt-combo { font-weight: 900; color: var(--brand-2); animation: ttt-pop .4s var(--spring); }

/* ---------- Assignment ---------- */
.ttt-take { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .ttt-take { grid-template-columns: 1fr; } .ttt-take-side { order: -1; position: static !important; } }
.ttt-take-side { position: sticky; top: 84px; }
.ttt-qnav { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ttt-qnav button { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; color: var(--ink-2); transition: all .2s; }
.ttt-qnav button.done { background: var(--brand); color: #fff; border-color: transparent; }
.ttt-qnav button.ok { background: var(--ok); color: #fff; border-color: transparent; }
.ttt-qnav button.bad { background: var(--bad); color: #fff; border-color: transparent; }
.ttt-qnav button.part { background: var(--warn); color: #fff; border-color: transparent; }
.ttt-qnav button.pend { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.ttt-q { scroll-margin-top: 90px; }
.ttt-q-h { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ttt-q-n { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; font-weight: 800; background: var(--ink); color: var(--bg); font-size: 14px; }
.ttt-q-prompt { font-weight: 700; font-size: 16px; line-height: 1.5; white-space: pre-line; }
.ttt-q-type { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.ttt-listen { display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-weight: 700; border: 0; margin-bottom: 14px; }
.ttt-listen .pl { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.ttt-listen.playing .pl { animation: ttt-pulse 1s infinite; }
@keyframes ttt-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 50%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.ttt-q-img { max-height: 260px; border-radius: 14px; margin-bottom: 14px; }
.ttt-fill { font-size: 18px; line-height: 2.4; font-family: var(--zh-sans); }
.ttt-fill input { display: inline-block; width: 120px; height: 38px; border: 0; border-bottom: 2.5px solid var(--brand); background: var(--brand-soft); border-radius: 8px 8px 0 0; text-align: center; font-size: 17px; font-family: var(--zh-sans); padding: 0 8px; margin: 0 4px; outline: none; color: var(--ink); }
.ttt-fill input:focus { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.ttt-fill .ans-ok { color: var(--ok); font-weight: 700; } .ttt-fill .ans-bad { color: var(--bad); text-decoration: line-through; }
.ttt-order-line { min-height: 64px; border: 2px dashed var(--line-2); border-radius: 16px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; transition: border-color .2s; }
.ttt-order-line.has { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }
.ttt-order-bank { display: flex; flex-wrap: wrap; gap: 8px; min-height: 48px; }
.ttt-tok { padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-family: var(--zh-sans); font-size: 18px; font-weight: 600; box-shadow: 0 3px 0 var(--line-2); transition: transform .15s var(--spring), opacity .2s; color: var(--ink); }
.ttt-tok:hover { transform: translateY(-2px); }
.ttt-tok.used { opacity: .25; pointer-events: none; }
.ttt-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.ttt-match .colm { display: flex; flex-direction: column; gap: 10px; }
.ttt-mitem { padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; text-align: left; color: var(--ink); transition: all .2s; display: flex; align-items: center; gap: 10px; min-height: 52px; font-size: 15px; }
.ttt-mitem .zh { font-size: 20px; }
.ttt-mitem.pick { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); transform: scale(1.02); }
.ttt-mitem .tag { margin-left: auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; flex: none; }
.ttt-tf { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 420px; }
.ttt-rec { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.ttt-rec-btn { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -10px var(--brand); transition: transform .2s var(--spring); }
.ttt-rec-btn svg { width: 26px; height: 26px; }
.ttt-rec-btn:hover { transform: scale(1.06); }
.ttt-rec-btn.on { background: var(--bad); animation: ttt-pulse 1.2s infinite; }
.ttt-wave { display: flex; align-items: center; gap: 3px; height: 32px; }
.ttt-wave i { width: 4px; border-radius: 4px; background: var(--brand); animation: ttt-wave 1s ease-in-out infinite; }
@keyframes ttt-wave { 0%, 100% { height: 6px; } 50% { height: 28px; } }
.ttt-read-text { font-family: var(--zh); font-size: 24px; font-weight: 700; line-height: 1.6; padding: 14px 18px; border-radius: 16px; background: var(--brand-soft); margin-bottom: 12px; }
.ttt-timer { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ttt-timer.low { color: var(--bad); border-color: var(--bad); animation: ttt-pulse 1s infinite; }
.ttt-save-ind { font-size: 12.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.ttt-result-q { border-left: 5px solid var(--line); }
.ttt-result-q.ok { border-left-color: var(--ok); }
.ttt-result-q.bad { border-left-color: var(--bad); }
.ttt-result-q.part { border-left-color: var(--warn); }
.ttt-result-q.pend { border-left-color: var(--violet); }
.ttt-ans-box { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.ttt-ans-box.zh { font-family: var(--zh-sans); font-size: 17px; }
.ttt-ans-key { padding: 12px 14px; border-radius: 12px; background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 70%, var(--ink)); }
.ttt-teacher-cmt { padding: 12px 14px; border-radius: 12px; background: var(--info-soft); color: color-mix(in srgb, var(--info) 60%, var(--ink)); display: flex; gap: 10px; }
.ttt-score-big { font-size: 56px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }

/* grading */
.ttt-grade-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-2); margin-top: 12px; }
.ttt-grade-box .ttt-input { width: 90px; text-align: center; font-weight: 800; font-size: 16px; }

/* matrix */
.ttt-matrix td, .ttt-matrix th { text-align: center; }
.ttt-matrix td:first-child, .ttt-matrix th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.ttt-cell { display: inline-grid; place-items: center; min-width: 44px; height: 30px; padding: 0 8px; border-radius: 9px; font-size: 12px; font-weight: 800; }
.st-todo { background: var(--bg-2); color: var(--ink-3); }
.st-in_progress { background: var(--info-soft); color: var(--info); }
.st-submitted { background: var(--violet-soft); color: var(--violet); }
.st-graded { background: var(--ok-soft); color: var(--ok); }
.st-overdue { background: var(--bad-soft); color: var(--bad); }

/* heatmap */
.ttt-heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; overflow-x: auto; padding-bottom: 6px; }
.ttt-heat i { width: 12px; height: 12px; border-radius: 3px; background: var(--bg-2); }
.ttt-heat i.l1 { background: color-mix(in srgb, var(--brand) 25%, var(--bg-2)); }
.ttt-heat i.l2 { background: color-mix(in srgb, var(--brand) 50%, var(--bg-2)); }
.ttt-heat i.l3 { background: color-mix(in srgb, var(--brand) 75%, var(--bg-2)); }
.ttt-heat i.l4 { background: var(--brand); }

/* badges */
.ttt-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ttt-badge { text-align: center; padding: 18px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); transition: transform .3s var(--spring); }
.ttt-badge:hover { transform: translateY(-4px) rotate(-1deg); }
.ttt-badge .i { font-size: 40px; display: inline-grid; place-items: center; width: 68px; height: 68px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff8e1, #fde68a); box-shadow: 0 8px 20px -10px #f59e0b, inset 0 -4px 0 rgba(0, 0, 0, .06); margin-bottom: 8px; }
.ttt-badge.locked { opacity: .55; }
.ttt-badge.locked .i { filter: grayscale(1); background: var(--bg-2); box-shadow: none; }
.ttt-badge .n { font-weight: 800; font-size: 14px; }
.ttt-badge .d { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* leaderboard */
.ttt-podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; max-width: 620px; margin: 0 auto 24px; }
.ttt-pod { text-align: center; }
.ttt-pod .blk { border-radius: 18px 18px 8px 8px; margin-top: 10px; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: #fff; }
.ttt-pod.p1 .blk { height: 130px; background: linear-gradient(#fbbf24, #f59e0b); }
.ttt-pod.p2 .blk { height: 96px; background: linear-gradient(#cbd5e1, #94a3b8); }
.ttt-pod.p3 .blk { height: 74px; background: linear-gradient(#fdba74, #c2410c); }
.ttt-pod .crown { font-size: 28px; animation: ttt-float 3s ease-in-out infinite; display: inline-block; }
.ttt-rankrow.me { background: var(--brand-soft) !important; }
.ttt-rank { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--bg-2); color: var(--ink-2); font-size: 13px; }

/* charts */
.ttt-chart { width: 100%; height: auto; display: block; overflow: visible; }
.ttt-chart .bar { fill: var(--brand); transition: opacity .2s; }
.ttt-chart .bar:hover { opacity: .8; }
.ttt-chart .bar.today { fill: var(--brand-2); }
.ttt-chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.ttt-chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; }
.ttt-chart .bar-grow { transform-origin: bottom; transform-box: fill-box; animation: ttt-grow .9s var(--ease) both; }
@keyframes ttt-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* calendar */
.ttt-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ttt-cal .dh { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 6px 0; }
.ttt-cal .d { min-height: 92px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 6px; font-size: 12px; overflow: hidden; }
.ttt-cal .d.out { opacity: .4; }
.ttt-cal .d.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.ttt-cal .d .n { font-weight: 800; margin-bottom: 4px; }
.ttt-cal .ev { display: block; padding: 2px 6px; border-radius: 6px; margin-bottom: 3px; font-weight: 700; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--brand-soft); color: var(--brand); cursor: pointer; }
.ttt-cal .ev.due { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 760px) { .ttt-cal .d { min-height: 54px; } .ttt-cal .ev { font-size: 0; height: 6px; padding: 0; } }
.ttt-session { display: flex; gap: 16px; align-items: center; }
.ttt-date-box { width: 60px; flex: none; text-align: center; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.ttt-date-box .m { background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 0; text-transform: uppercase; }
.ttt-date-box .d { font-size: 22px; font-weight: 900; padding: 4px 0; }

/* ---------- Editor ---------- */
.ttt-editor { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .ttt-editor { grid-template-columns: 1fr; } }
.ttt-slide-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 220px); overflow-y: auto; padding: 4px; }
.ttt-slide-thumb { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; transition: all .15s; text-align: left; width: 100%; color: var(--ink); }
.ttt-slide-thumb:hover { border-color: var(--line-2); }
.ttt-slide-thumb.on { border-color: var(--brand); background: var(--brand-soft); }
.ttt-slide-thumb.drag-over { border-style: dashed; border-color: var(--brand); }
.ttt-slide-thumb .n { width: 26px; height: 26px; border-radius: 8px; background: var(--bg-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
.ttt-slide-thumb .ty { font-size: 11px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; }
.ttt-slide-thumb .tt { font-weight: 700; font-size: 13.5px; }
.ttt-preview-box { border-radius: 20px; background: var(--bg-2); padding: 14px; position: relative; }
.ttt-preview-box .ttt-slide { box-shadow: var(--shadow); width: 100%; }
.ttt-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ttt-type-grid button { padding: 16px 12px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); text-align: left; transition: all .2s var(--ease); color: var(--ink); }
.ttt-type-grid button:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.ttt-type-grid .em { font-size: 26px; display: block; margin-bottom: 6px; }
.ttt-type-grid .t { font-weight: 800; font-size: 14px; }
.ttt-type-grid .s { font-size: 12px; color: var(--ink-3); }
.ttt-cards-table input { border: 1px solid transparent; background: transparent; border-radius: 8px; height: 36px; padding: 0 8px; width: 100%; min-width: 80px; outline: none; color: var(--ink); }
.ttt-cards-table input:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.ttt-cards-table input.zh { font-family: var(--zh-sans); font-size: 18px; font-weight: 600; }
.ttt-cards-table td { padding: 4px 6px; }
.ttt-qb { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-bottom: 14px; overflow: hidden; transition: box-shadow .2s; }
.ttt-qb:focus-within { box-shadow: 0 0 0 3px var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.ttt-qb-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ttt-qb-b { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ttt-opt-edit { display: flex; align-items: center; gap: 8px; }
.ttt-opt-edit .mark { width: 34px; height: 34px; flex: none; border-radius: 10px; border: 2px solid var(--line-2); background: var(--surface); display: grid; place-items: center; font-weight: 800; color: var(--ink-3); }
.ttt-opt-edit .mark.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.ttt-sticky-bar { position: sticky; bottom: 12px; z-index: 10; margin-top: 18px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
@media (max-width: 900px) { .ttt-sticky-bar { bottom: 92px; } }
.ttt-dirty { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
.ttt-help { padding: 12px 14px; border-radius: 12px; background: var(--info-soft); color: color-mix(in srgb, var(--info) 70%, var(--ink)); font-size: 13px; line-height: 1.6; }
.ttt-help code { background: rgba(255, 255, 255, .6); padding: 1px 5px; border-radius: 5px; font-size: 12.5px; }
.ttt-stroke { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.ttt-stroke > div { width: 150px; height: 150px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); position: relative; }
.ttt-stroke > div::before { content: ""; position: absolute; inset: 0; background: linear-gradient(var(--line) 0 0) center/1px 100% no-repeat, linear-gradient(var(--line) 0 0) center/100% 1px no-repeat; }

/* scrollbars */
.ttt ::-webkit-scrollbar { width: 10px; height: 10px; }
.ttt ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
.ttt ::-webkit-scrollbar-track { background: transparent; }

/* ---------- Bài tập tương tác (HTML nhúng) ---------- */
.ttt-html-q { display: flex; flex-direction: column; gap: 10px; }
.ttt-html-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ttt-html-q iframe { width: 100%; border: 1px solid var(--line); border-radius: 16px; background: #fff; display: block; }
.ttt-html-wrong { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-height: 420px; overflow: auto; }
.ttt-html-wrong > div { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; }
@media (max-width: 760px) { .ttt-html-q iframe { height: 80vh !important; } }
.ttt-take:has(.ttt-html-q) { grid-template-columns: 1fr; }
.ttt-take:has(.ttt-html-q) .ttt-take-side { position: static; }

/* Giao bài tập */
.ttt-step-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 800; flex: none; }
.ttt-pick { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 600; background: var(--surface); user-select: none; }
.ttt-pick:hover { border-color: var(--brand); }
.ttt-pick.on { border-color: var(--brand); background: var(--brand-soft); }
.ttt-pick input { width: 17px; height: 17px; accent-color: var(--brand); margin: 0; }
.ttt-assign-bar { position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.ttt-howto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 10px; }
.ttt-howto > div { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
@media (max-width: 900px) { .ttt-assign-bar { bottom: calc(84px + env(safe-area-inset-bottom) * .5); padding: 10px 14px; } }
