:root {
  --bg: #0f1117; --sidebar-bg: #16181f; --panel-bg: #1c1e28;
  --card-bg: #22253a; --accent: #6ee7b7; --accent2: #818cf8;
  --accent3: #f472b6; --text: #e2e8f0; --muted: #8892a4;
  --border: #2a2d3e; --code-bg: #12131a;
  --sidebar-w: 270px; --header-h: 58px;
  --green: #4ade80; --yellow: #fbbf24;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Sora', sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.7; }
header { position: fixed; top: 0; left: 0; right: 0; height: var(--header-h); background: var(--sidebar-bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 16px; padding: 0 24px; z-index: 200; }
header .logo { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: -0.5px; white-space: nowrap; }
header .logo span { color: var(--accent2); }
header .tagline { color: var(--muted); font-size: 13px; }
header .search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 6px 14px; }
header .search input { background: none; border: none; outline: none; color: var(--text); font-family: 'Sora', sans-serif; font-size: 13px; width: 200px; }
header .search input::placeholder { color: var(--muted); }
header .search svg { color: var(--muted); }
.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; }
aside { position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--sidebar-w); background: var(--sidebar-bg); border-right: 1px solid var(--border); overflow-y: auto; z-index: 100; transition: transform 0.3s ease; }
aside::-webkit-scrollbar { width: 4px; }
aside::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.sidebar-section { padding: 20px 0 8px; }
.sidebar-section-title { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; padding: 0 20px 8px; }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 8px 20px; cursor: pointer; color: var(--muted); font-size: 13.5px; font-weight: 500; border-left: 3px solid transparent; transition: all 0.15s; text-decoration: none; }
.sidebar-item:hover { color: var(--text); background: rgba(110,231,183,.05); }
.sidebar-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(110,231,183,.08); }
.sidebar-item .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.sidebar-submenu { margin-left: 20px; }
.sidebar-submenu-item { display: flex; align-items: center; gap: 10px; padding: 6px 20px; cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 500; border-left: 3px solid transparent; transition: all 0.15s; text-decoration: none; }
.sidebar-submenu-item:hover { color: var(--text); background: rgba(110,231,183,.05); }
.sidebar-submenu-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(110,231,183,.08); }
.sidebar-submenu-item .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
main { margin-left: var(--sidebar-w); margin-top: var(--header-h); padding: 40px 48px; max-width: 100%; min-height: calc(100vh - var(--header-h)); animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h1 { font-size: 32px; font-weight: 700; color: #fff; margin-bottom: 8px; letter-spacing: -0.5px; }
h1 .accent { color: var(--accent); }
.subtitle { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
h2 { font-size: 20px; font-weight: 700; color: #fff; margin: 36px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h3 { font-size: 16px; font-weight: 700; color: var(--accent2); margin: 24px 0 10px; }
p { color: var(--text); margin-bottom: 14px; }
.box { border-radius: 10px; padding: 18px 22px; margin: 20px 0; border-left: 4px solid; }
.box.green  { background: rgba(74,222,128,.07); border-color: var(--green); }
.box.purple { background: rgba(129,140,248,.07); border-color: var(--accent2); }
.box.pink   { background: rgba(244,114,182,.07); border-color: var(--accent3); }
.box.yellow { background: rgba(251,191,36,.07); border-color: var(--yellow); }
.box-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.box.green  .box-title { color: var(--green); }
.box.purple .box-title { color: var(--accent2); }
.box.pink   .box-title { color: var(--accent3); }
.box.yellow .box-title { color: var(--yellow); }
.box p { margin: 0; font-size: 14px; }
.code-block { background: var(--code-bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 20px 0; }
.code-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--panel-bg); border-bottom: 1px solid var(--border); }
.code-lang { font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.copy-btn { font-size: 11px; color: var(--muted); background: none; border: none; cursor: pointer; font-family: 'Sora', sans-serif; padding: 2px 8px; border-radius: 4px; transition: all .15s; }
.copy-btn:hover { background: var(--border); color: var(--text); }
pre { padding: 18px 20px; overflow-x: auto; font-size: 13.5px; font-family: 'JetBrains Mono', monospace; line-height: 1.6; }
pre::-webkit-scrollbar { height: 4px; }
pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.kw  { color: #c792ea; } .str { color: #c3e88d; } .cm  { color: #546e7a; font-style: italic; }
.fn  { color: #82aaff; } .num { color: #f78c6c; } .cls { color: #ffcb6b; }
.tbl-wrap { overflow-x: auto; margin: 20px 0; border-radius: 10px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--panel-bg); }
th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--muted); }
td { padding: 12px 16px; font-size: 13.5px; border-top: 1px solid var(--border); }
tr:hover td { background: rgba(255,255,255,.02); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; margin: 24px 0; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: border-color .2s; }
.card:hover { border-color: var(--accent2); }
.card-icon { font-size: 26px; margin-bottom: 10px; }
.card h4 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.card p { font-size: 13px; color: var(--muted); margin: 0; }
.steps { counter-reset: step; margin: 20px 0; }
.step { display: flex; gap: 16px; margin-bottom: 20px; }
.step-num { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background: var(--accent2); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.step-content h4 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.step-content p  { font-size: 13.5px; color: var(--muted); margin: 0; }
.quiz { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin: 28px 0; }
.quiz h3 { color: var(--yellow); margin: 0 0 16px; font-size: 15px; }
.quiz-q { font-size: 15px; font-weight: 600; color: #fff; margin-bottom: 14px; }
.quiz-opts { display: flex; flex-direction: column; gap: 8px; }
.quiz-opt { padding: 10px 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); font-size: 14px; color: var(--text); background: var(--card-bg); transition: all .15s; text-align: left; }
.quiz-opt:hover { border-color: var(--accent2); color: var(--accent2); }
.quiz-opt.correct { border-color: var(--green); background: rgba(74,222,128,.1); color: var(--green); }
.quiz-opt.wrong   { border-color: var(--accent3); background: rgba(244,114,182,.1); color: var(--accent3); }
.quiz-feedback { margin-top: 12px; font-size: 13.5px; font-weight: 600; min-height: 20px; }
.nav-footer { display: flex; justify-content: space-between; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.nav-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600; border: 1px solid var(--border); background: var(--card-bg); color: var(--text); transition: all .15s; text-decoration: none; font-family: 'Sora', sans-serif; }
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn.disabled { opacity: .3; pointer-events: none; }
.progress-bar { position: fixed; bottom: 0; left: var(--sidebar-w); right: 0; height: 3px; background: var(--border); z-index: 300; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .3s; }
.formula { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 16px 22px; margin: 16px 0; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--yellow); text-align: center; letter-spacing: 0.5px; }

/* Flow Diagram Styles */
.flow-diagram { display: flex; align-items: center; gap: 16px; margin: 16px 0; flex-wrap: wrap; }
.flow-diagram.vertical { flex-direction: column; align-items: stretch; }
.flow-step { display: flex; align-items: center; gap: 12px; }
.flow-input { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 14px; font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text); }
.flow-arrow { color: var(--muted); font-size: 18px; }
.flow-arrow-down { color: var(--muted); font-size: 18px; text-align: center; margin: 4px 0; }
.flow-output { display: flex; gap: 8px; flex-wrap: wrap; }
.vector { background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent); }
.flow-layer { display: flex; align-items: center; gap: 12px; }
.layer-name { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 120px; }
.layer-box { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 14px; font-size: 12px; color: var(--text); }
.probs { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }
.prob-bar { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 4px; padding: 6px 12px; font-size: 12px; color: var(--text); position: relative; overflow: hidden; }
.prob-bar::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); background: var(--accent); opacity: 0.2; }
.generation-flow { display: flex; flex-wrap: wrap; gap: 6px; }
.gen-token { background: var(--panel-bg); border: 1px solid var(--border); border-radius: 4px; padding: 4px 10px; font-size: 13px; color: var(--muted); }
.gen-token.accent-token { border-color: var(--accent); color: var(--accent); }
.caption { font-size: 12px; color: var(--muted); margin-top: 8px; font-style: italic; }
.box.blue { background: rgba(96,165,250,.07); border-color: #60a5fa; }
.box.blue .box-title { color: #60a5fa; }
.box.gray { background: rgba(136,146,164,.07); border-color: var(--muted); }
.box.gray .box-title { color: var(--muted); }

@media (max-width: 100%) {
  .menu-toggle { display: block; }
  aside { transform: translateX(-100%); }
  aside.open { transform: none; }
  main { margin-left: 0; padding: 24px 20px; }
  .progress-bar { left: 0; }
}
