/* 知学 · 高校 AI 学习平台 — 浅色高校智慧学习 SaaS */
/* ============ Design Tokens ============ */
:root {
  /* 基础色板 — 浅色高校 SaaS */
  --bg-0: #f6f8fb;
  --bg-1: #eef3f8;
  --bg-2: #e8eef7;
  --surface-1: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef4ff;
  --elev: #ffffff;

  /* 边框 / 描边 */
  --border-1: #e2e8f0;
  --border-2: #cbd5e1;
  --border-3: #94a3b8;

  /* 文本层级 */
  --text-1: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-4: #94a3b8;

  /* 强调色 */
  --cyan: #14b8a6;
  --cyan-soft: #ccfbf1;
  --cyan-glow: rgba(20,184,166,.22);
  --violet: #2563eb;
  --violet-soft: #dbeafe;
  --violet-glow: rgba(37,99,235,.22);
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --amber-glow: rgba(245,158,11,.24);
  --pink: #db2777;
  --pink-soft: #fce7f3;
  --pink-glow: rgba(219,39,119,.18);

  /* 品牌主色（默认强调） */
  --accent: var(--violet);
  --accent-soft: var(--violet-soft);
  --accent-glow: var(--violet-glow);

  /* 状态色 */
  --ok: #16a34a;
  --warn: #f59e0b;
  --err: #dc2626;

  /* 字体 */
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

  /* 字号阶梯 */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-3xl: 34px;

  /* 间距体系（8px 基准） */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  /* 阴影（分层） */
  --sh-1: 0 1px 2px rgba(15,23,42,.06);
  --sh-2: 0 8px 22px rgba(15,23,42,.08);
  --sh-3: 0 18px 48px rgba(15,23,42,.14);
  --sh-card: 0 1px 2px rgba(15,23,42,.04), 0 10px 28px rgba(15,23,42,.07);

  /* 动效 */
  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 320ms;
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* 布局 */
  --sidebar-w: 256px;
  --content-max: 1180px;
}

/* ============ Reset / Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02","cv03","cv04","ss01";
  letter-spacing: .1px;
  overflow: hidden;
}
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent-soft); color: var(--text-1); }

/* 滚动条 */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: var(--r-full); border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--border-3); background-clip: padding-box; }

/* 背景画布 */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: .14;
}

/* ============ App Shell ============ */
.app-shell {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  background:
    radial-gradient(980px 520px at 76% -10%, rgba(37,99,235,.10), transparent 62%),
    radial-gradient(720px 420px at 2% 100%, rgba(20,184,166,.09), transparent 58%),
    var(--bg-0);
}

/* ============ Sidebar ============ */
.sidebar {
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.88);
  border-right: 1px solid var(--border-1);
  padding: var(--sp-5) var(--sp-3) var(--sp-4);
  overflow-y: auto;
  backdrop-filter: blur(16px);
}
.brand {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-2) var(--sp-5);
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.brand:focus-visible { outline: 2px solid var(--portal-green); outline-offset: 4px; }
.brand:hover .brand-name { color: var(--portal-green-dark); }
.brand-mark {
  width: 36px; height: 36px; flex: none;
  border-radius: 11px;
  background:
    radial-gradient(circle at 32% 28%, #eff6ff, transparent 55%),
    linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 8px 20px rgba(37,99,235,.22), inset 0 1px 0 rgba(255,255,255,.55);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 8px;
  border-radius: 6px;
  background: rgba(255,255,255,.92);
  box-shadow: inset 0 0 0 2px rgba(37,99,235,.18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: var(--fs-lg); font-weight: 800; letter-spacing: .4px; }
.brand-sub { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: var(--sp-5); flex: 1; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title {
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-4);
  padding: 0 var(--sp-3) var(--sp-2);
}
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%;
  padding: 9px var(--sp-3);
  background: transparent; border: 0;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: var(--fs-md); font-weight: 500;
  text-align: left;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-item:hover { background: var(--surface-2); color: var(--text-1); }
.nav-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-icon { display: inline-flex; color: var(--text-3); transition: color var(--t-fast) var(--ease); }
.nav-icon svg { width: 19px; height: 19px; }
.nav-item:hover .nav-icon { color: var(--violet); }
.nav-label { flex: 1; }
.nav-bar {
  position: absolute; left: -4px; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 3px; height: 18px; border-radius: var(--r-full);
  background: var(--accent);
  transition: transform var(--t-base) var(--ease);
}
.nav-item.is-active { background: var(--violet-soft); color: var(--violet); }
.nav-item.is-active .nav-icon { color: var(--accent); }
.nav-item.is-active .nav-bar { transform: translateY(-50%) scaleY(1); box-shadow: none; }
.nav-item[data-accent="cyan"].is-active { --accent: var(--cyan); --accent-glow: var(--cyan-glow); }
.nav-item[data-accent="violet"].is-active { --accent: var(--violet); --accent-glow: var(--violet-glow); }
.nav-item[data-accent="amber"].is-active { --accent: var(--amber); --accent-glow: var(--amber-glow); }
.nav-item[data-accent="pink"].is-active { --accent: var(--pink); --accent-glow: var(--pink-glow); }

.sidebar-footer { padding-top: var(--sp-4); }
.sidebar-card {
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.sidebar-card-title { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); }
.sidebar-card-meta { font-size: var(--fs-xs); color: var(--text-3); }
.quota-bar { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.quota-fill {
  display: block; height: 100%; border-radius: var(--r-full);
  background: linear-gradient(90deg, var(--cyan), var(--violet));
}

/* ============ Content / Topbar ============ */
.content {
  position: relative;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.content[data-accent="cyan"]   { --accent: var(--cyan);   --accent-soft: var(--cyan-soft);   --accent-glow: var(--cyan-glow); }
.content[data-accent="violet"] { --accent: var(--violet); --accent-soft: var(--violet-soft); --accent-glow: var(--violet-glow); }
.content[data-accent="amber"]  { --accent: var(--amber);  --accent-soft: var(--amber-soft);  --accent-glow: var(--amber-glow); }
.content[data-accent="pink"]   { --accent: var(--pink);   --accent-soft: var(--pink-soft);   --accent-glow: var(--pink-glow); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  background: rgba(246,248,251,.82);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border-1);
}
.topbar-titles { min-width: 0; }
.page-title {
  font-size: var(--fs-xl); font-weight: 700; letter-spacing: .2px;
  line-height: 1.2; color: var(--text-1);
}
.page-desc { font-size: var(--fs-base); color: var(--text-3); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-3); flex: none; }

.search-box {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 280px; max-width: 36vw;
  padding: 0 var(--sp-3);
  height: 38px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-icon { display: inline-flex; width: 16px; height: 16px; flex: none; color: var(--text-3); }
.search-icon::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.search-input {
  flex: 1; min-width: 0; height: 100%;
  background: transparent; border: 0; outline: none;
  color: var(--text-1); font-size: var(--fs-md);
}
.search-input::placeholder { color: var(--text-4); }

/* ============ Buttons ============ */
.btn {
  position: relative;
  overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: 38px; padding: 0 var(--sp-4);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: var(--fs-md); font-weight: 600; letter-spacing: .2px;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -58%;
  width: 42%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.34), transparent);
  opacity: 0;
  transform: skewX(-18deg);
  transition: transform .48s linear, opacity .18s linear;
  pointer-events: none;
}
.btn:hover::after {
  opacity: 1;
  transform: translateX(350%) skewX(-18deg);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; }
.btn-icon svg { width: 16px; height: 16px; }
.btn-primary {
  color: #ffffff;
  background: linear-gradient(180deg, #3b82f6, var(--violet));
  box-shadow: 0 8px 18px rgba(37,99,235,.22), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(37,99,235,.26), inset 0 1px 0 rgba(255,255,255,.35); transform: translateY(-1px); }
.btn-ghost {
  color: var(--violet);
  background: var(--surface-1);
  border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--violet-soft); border-color: rgba(37,99,235,.28); transform: translateY(-1px); }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-base); font-weight: 600; }
.btn-soft {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: transparent;
}
.btn-soft:hover { background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-glow), 0 4px 14px var(--accent-glow); }
.btn-line {
  color: var(--text-2);
  background: var(--surface-1);
  border-color: var(--border-2);
}
.btn-line:hover { color: var(--violet); border-color: rgba(37,99,235,.30); background: var(--violet-soft); }

/* 通用 icon 包装 */
.icon { display: inline-flex; align-items: center; justify-content: center; }
.icon svg { width: 18px; height: 18px; }

/* ============ View Layout ============ */
.view {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-6) var(--sp-8);
  display: flex; flex-direction: column; gap: var(--sp-6);
  animation: viewIn var(--t-slow) var(--ease);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 分区标题 */
.section-head {
  display: flex; align-items: flex-start; gap: var(--sp-3);
}
.section-head[data-accent="cyan"]   { --accent: var(--cyan); }
.section-head[data-accent="violet"] { --accent: var(--violet); }
.section-head[data-accent="amber"]  { --accent: var(--amber); }
.section-head[data-accent="pink"]   { --accent: var(--pink); }
.section-tick {
  width: 4px; height: 30px; margin-top: 2px; border-radius: var(--r-full);
  background: var(--accent);
}
.section-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: .2px; }
.section-sub { font-size: var(--fs-base); color: var(--text-3); margin-top: 2px; }

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--sp-6);
  padding: var(--sp-7) var(--sp-7);
  border-radius: var(--r-xl);
  background:
    linear-gradient(135deg, rgba(37,99,235,.12), transparent 45%),
    linear-gradient(300deg, rgba(20,184,166,.10), transparent 48%),
    var(--surface-1);
  border: 1px solid var(--border-2);
  box-shadow: var(--sh-card);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(37,99,235,.10) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .5;
  mask-image: linear-gradient(120deg, #000, transparent 70%);
}
.hero-glow {
  position: absolute; top: -120px; right: -80px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.16), transparent 65%);
  filter: blur(20px); pointer-events: none;
}
.hero-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
.hero-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 5px var(--sp-3);
  font-size: var(--fs-sm); font-weight: 600; letter-spacing: .3px;
  color: var(--violet);
  background: var(--violet-soft);
  border: 1px solid rgba(37,99,235,.18);
  border-radius: var(--r-full);
}
.badge-icon svg { width: 14px; height: 14px; }
.hero-title { font-size: var(--fs-3xl); font-weight: 800; line-height: 1.18; letter-spacing: 0; }
.hero-desc { font-size: var(--fs-lg); color: var(--text-2); max-width: 46ch; line-height: 1.6; }
.hero-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-2); }
.hero-stats {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3);
  align-content: center;
}
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-4);
  background: rgba(255,255,255,.72);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.stat:hover { border-color: var(--border-2); background: var(--surface-1); }
.stat-value { font-family: var(--font-mono); font-size: var(--fs-2xl); font-weight: 600; color: var(--text-1); letter-spacing: 0; }
.stat-unit { font-size: var(--fs-md); color: var(--text-3); margin-left: 3px; font-weight: 500; }
.stat-label { font-size: var(--fs-sm); color: var(--text-3); }

/* ============ Entry Cards (首页三大入口) ============ */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-4);
}
.entry-card {
  position: relative; overflow: hidden; text-align: left;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.entry-card[data-accent="cyan"]   { --accent: var(--cyan);   --accent-soft: var(--cyan-soft);   --accent-glow: var(--cyan-glow); }
.entry-card[data-accent="violet"] { --accent: var(--violet); --accent-soft: var(--violet-soft); --accent-glow: var(--violet-glow); }
.entry-card[data-accent="amber"]  { --accent: var(--amber);  --accent-soft: var(--amber-soft);  --accent-glow: var(--amber-glow); }
.entry-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity var(--t-base) var(--ease);
}
.entry-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-glow);
  box-shadow: 0 16px 36px rgba(15,23,42,.10), 0 0 0 1px var(--accent-glow);
}
.entry-card:hover::before { opacity: 1; }
.entry-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.entry-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: var(--r-md);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
}
.entry-icon svg { width: 24px; height: 24px; }
.entry-name { font-size: var(--fs-lg); font-weight: 700; }
.entry-desc { font-size: var(--fs-base); color: var(--text-3); line-height: 1.6; flex: 1; }
.entry-foot { display: flex; align-items: center; justify-content: space-between; padding-top: var(--sp-2); border-top: 1px solid var(--border-1); }
.entry-count { font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); font-family: var(--font-mono); }
.entry-arrow { color: var(--accent); transition: transform var(--t-base) var(--ease); }
.entry-arrow svg { width: 18px; height: 18px; }
.entry-card:hover .entry-arrow { transform: translateX(4px); }

/* ============ Panel ============ */
.panel {
  display: flex; flex-direction: column; gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
}

/* ============ Trend List ============ */
.trend-list { display: flex; flex-direction: column; }
.trend-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto 64px;
  align-items: center; gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--r-sm);
  border-bottom: 1px solid var(--border-1);
  transition: background var(--t-fast) var(--ease);
}
.trend-row:last-child { border-bottom: 0; }
.trend-row:hover { background: var(--surface-2); }
.trend-rank {
  font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 600;
  color: var(--text-3); text-align: center;
}
.trend-row:nth-child(1) .trend-rank,
.trend-row:nth-child(2) .trend-rank,
.trend-row:nth-child(3) .trend-rank { color: var(--cyan); }
.trend-main { display: flex; flex-direction: column; min-width: 0; }
.trend-name { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 600; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-desc { font-size: var(--fs-sm); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trend-lang { font-size: var(--fs-sm); color: var(--text-2); }
.trend-stars { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: var(--fs-base); color: var(--text-2); }
.trend-star { color: var(--amber); }
.trend-star svg { width: 14px; height: 14px; }
.trend-delta {
  font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600;
  color: var(--ok); text-align: right;
}

/* ============ Demo Route ============ */
.demo-route-panel { padding: var(--sp-5); }
.demo-route-list {
  display: flex; flex-direction: column; gap: var(--sp-3);
  margin-top: var(--sp-4);
}
.demo-route-step {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.demo-route-step.is-active {
  border-color: var(--cyan-glow);
  background: linear-gradient(90deg, var(--cyan-soft), rgba(255,255,255,.92));
  box-shadow: 0 0 0 1px var(--cyan-glow);
}
.demo-route-step.is-done { background: var(--surface-2); }
.demo-route-index {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  color: var(--cyan); background: var(--cyan-soft);
  border: 1px solid var(--cyan-glow); font-weight: 800;
}
.demo-route-step.is-done .demo-route-index {
  color: var(--ok); background: rgba(22,163,74,.10); border-color: rgba(22,163,74,.22);
}
.demo-route-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.demo-route-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.demo-route-top h3 { font-size: var(--fs-lg); font-weight: 800; color: var(--text-1); }
.demo-route-top span { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.demo-route-main p { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; }
.demo-route-actions {
  display: flex; justify-content: flex-end; gap: var(--sp-3);
  margin-top: var(--sp-4); padding-top: var(--sp-4);
  border-top: 1px solid var(--border-1);
}

/* ============ Card Grid + Card System ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}
.card-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}
.card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.card[data-accent="cyan"]   { --accent: var(--cyan);   --accent-soft: var(--cyan-soft);   --accent-glow: var(--cyan-glow); }
.card[data-accent="violet"] { --accent: var(--violet); --accent-soft: var(--violet-soft); --accent-glow: var(--violet-glow); }
.card[data-accent="amber"]  { --accent: var(--amber);  --accent-soft: var(--amber-soft);  --accent-glow: var(--amber-glow); }
.card[data-accent="pink"]   { --accent: var(--pink);   --accent-soft: var(--pink-soft);   --accent-glow: var(--pink-glow); }
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-glow);
  box-shadow: 0 16px 34px rgba(15,23,42,.10), 0 0 0 1px var(--accent-glow);
}
.course-card { cursor: pointer; padding-top: 0; }

.card-top { display: flex; align-items: center; gap: var(--sp-3); }
.card-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 42px; height: 42px; border-radius: var(--r-md);
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-glow);
}
.card-avatar svg { width: 22px; height: 22px; }
.card-heading { flex: 1; min-width: 0; }
.card-name { font-size: var(--fs-lg); font-weight: 700; letter-spacing: .1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { font-size: var(--fs-sm); color: var(--text-3); }
.card-score, .card-rating {
  display: inline-flex; align-items: center; gap: 3px; flex: none;
  font-family: var(--font-mono); font-size: var(--fs-base); font-weight: 600;
  color: var(--accent);
  padding: 3px 9px; border-radius: var(--r-full);
  background: var(--accent-soft); border: 1px solid var(--accent-glow);
}
.card-rating svg { width: 13px; height: 13px; color: var(--amber); }
.card-desc { font-size: var(--fs-base); color: var(--text-2); line-height: 1.6; flex: 1; }

/* spec 行（模型） */
.spec-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-4); padding: var(--sp-3) 0; border-top: 1px solid var(--border-1); border-bottom: 1px solid var(--border-1); }
.spec { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.spec-k { font-size: var(--fs-sm); color: var(--text-3); }
.spec-v { font-size: var(--fs-base); color: var(--text-1); font-weight: 500; }
.spec-v.mono { font-family: var(--font-mono); letter-spacing: 1px; }

/* meta 行（智能体/课程） */
.meta-line { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.meta-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--r-full);
  font-size: var(--fs-sm); color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border-1);
}
.chip-icon { display: inline-flex; color: var(--text-3); }
.chip-icon svg { width: 13px; height: 13px; }

/* tags */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 3px 9px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 500; letter-spacing: .3px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
}

/* card actions */
.card-actions { display: flex; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-2); }
.card-actions .btn { flex: 1; }

/* flow 步骤（工作流） */
.flow-track { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: var(--sp-3); background: var(--bg-1); border: 1px solid var(--border-1); border-radius: var(--r-md); }
.flow-step {
  padding: 5px 11px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-1);
  background: var(--surface-3); border: 1px solid var(--border-2);
}
.flow-arrow { display: inline-flex; color: var(--amber); opacity: .7; }
.flow-arrow svg { width: 15px; height: 15px; }

/* 课程 banner */
.course-video {
  margin: 0 calc(-1 * var(--sp-5));
  border-bottom: 1px solid var(--border-1);
  background: var(--surface-2);
}
.course-video-screen {
  position: relative; min-height: 138px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(20,184,166,.18), rgba(47,107,255,.10)),
    radial-gradient(160px 100px at 75% 20%, rgba(240,107,168,.18), transparent 70%),
    #eef6ff;
}
.course-video-screen.course-cover-ai {
  background:
    radial-gradient(130px 90px at 78% 24%, rgba(0,199,88,.32), transparent 70%),
    linear-gradient(135deg, #e8fff1 0%, #dff2ff 52%, #eef2ff 100%);
}
.course-video-screen.course-cover-lab {
  background:
    radial-gradient(140px 90px at 78% 24%, rgba(47,128,237,.30), transparent 72%),
    linear-gradient(135deg, #e0f2fe 0%, #e9fff3 56%, #f5f3ff 100%);
}
.course-video-screen::after {
  content: "";
  position: absolute; right: 18px; top: 24px;
  width: 88px; height: 70px; border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.58)),
    repeating-linear-gradient(0deg, transparent 0 12px, rgba(15,23,42,.10) 12px 13px);
  box-shadow: 0 14px 26px rgba(15,23,42,.10);
  transform: rotate(-8deg);
  z-index: 0;
  pointer-events: none;
}
.course-video-screen::before {
  content: "";
  position: absolute; inset: 18px;
  border: 1px solid rgba(100,116,139,.18);
  border-radius: var(--r-md);
  background:
    linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.55) 1px, transparent 1px);
  background-size: 36px 36px;
  z-index: 0;
  pointer-events: none;
}
.course-video-play {
  position: relative; z-index: 1;
  width: 48px; height: 48px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: var(--pink); border: 1px solid rgba(255,255,255,.7);
  box-shadow: 0 14px 28px rgba(240,107,168,.28);
}
.course-video[data-playing="true"] .course-video-play { background: var(--ok); }
.course-video-play-icon svg { width: 20px; height: 20px; }
.course-video-caption {
  position: absolute; left: var(--sp-3); bottom: var(--sp-3); z-index: 1;
  display: flex; flex-direction: column; gap: 2px;
  color: var(--text-1);
}
.course-cover-info {
  position: absolute; left: var(--sp-3); top: var(--sp-3); z-index: 1;
  display: flex; flex-direction: column; gap: 3px;
  max-width: calc(100% - 120px);
  color: var(--text-1);
}
.course-cover-info strong {
  font-size: var(--fs-lg); font-weight: 900;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.course-cover-info span { color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; }
.course-video-caption strong { font-size: var(--fs-sm); }
.course-video-caption span { font-size: var(--fs-xs); color: var(--text-3); }
.course-video-controls {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: var(--sp-2); padding: 8px var(--sp-3);
  background: rgba(255,255,255,.78);
}
.course-video-bar {
  height: 6px; overflow: hidden; border-radius: 999px;
  background: var(--border-1);
}
.course-video-bar span {
  display: block; width: 0%; height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  transition: width var(--t-fast) linear;
}
.course-video-time { font-size: var(--fs-xs); color: var(--text-3); }
.course-info-strip {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  padding: 8px 10px;
  color: var(--text-2);
  background: #f8fbff;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}
.course-info-strip strong { color: var(--portal-green-dark); font-family: var(--font-mono); }
.course-banner {
  position: relative;
  height: 96px; margin: 0 calc(-1 * var(--sp-5)) 0;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border-1);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background:
    radial-gradient(120px 80px at 80% 30%, var(--pink-glow), transparent 70%),
    linear-gradient(135deg, rgba(240,107,168,.16), rgba(139,124,255,.10)),
    var(--surface-2);
  overflow: hidden;
}
.course-banner-icon { color: var(--pink); opacity: .85; }
.course-banner-icon svg { width: 38px; height: 38px; }
.level-badge {
  position: absolute; top: var(--sp-3); right: var(--sp-3); z-index: 3;
  min-width: 44px; padding: 4px 9px; border-radius: var(--r-full);
  box-sizing: border-box; text-align: center;
  font-size: var(--fs-xs); font-weight: 600; color: var(--pink);
  background: rgba(255,255,255,.82); border: 1px solid var(--pink-glow);
  backdrop-filter: blur(6px);
}

.sandbox-course-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--sp-3); padding: 6px 10px;
  color: var(--cyan); background: var(--cyan-soft);
  border: 1px solid var(--cyan-glow); border-radius: var(--r-full);
  font-size: var(--fs-sm); font-weight: 700;
}

/* ============ Teaching Resources ============ */
.resource-workbench {
  display: grid; grid-template-columns: 210px minmax(0, 1fr);
  gap: var(--sp-5); align-items: start;
}
.resource-sidebar {
  display: flex; flex-direction: column; gap: var(--sp-2);
  position: sticky; top: var(--sp-4);
}
.resource-filter {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3);
  color: var(--text-2); background: var(--surface-1);
  border: 1px solid var(--border-1); border-radius: var(--r-md);
  text-align: left; font-size: var(--fs-sm); font-weight: 700;
}
.resource-filter strong {
  color: var(--text-3); font-size: var(--fs-xs);
}
.resource-filter.is-active {
  color: var(--cyan); background: var(--cyan-soft); border-color: var(--cyan-glow);
}
.resource-main { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.resource-summary-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.resource-summary-pill {
  padding: 5px 10px; border-radius: var(--r-full);
  color: var(--text-2); background: var(--surface-1);
  border: 1px solid var(--border-1); font-size: var(--fs-sm); font-weight: 700;
}
.resource-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--sp-4);
}
.resource-card {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
}
.resource-card-head { display: flex; justify-content: space-between; gap: var(--sp-2); align-items: center; }
.resource-kind,
.resource-action-chip {
  display: inline-flex; align-items: center;
  padding: 4px 8px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 800;
}
.resource-kind { color: var(--cyan); background: var(--cyan-soft); border: 1px solid var(--cyan-glow); }
.resource-action-chip { color: var(--violet); background: var(--violet-soft); border: 1px solid var(--violet-glow); }
.resource-meta-row,
.resource-modal-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.resource-meta-row span,
.resource-modal-meta span {
  padding: 3px 7px;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
}
.resource-title { font-size: var(--fs-lg); font-weight: 800; color: var(--text-1); }
.resource-desc { color: var(--text-2); font-size: var(--fs-base); line-height: 1.6; min-height: 48px; }
.resource-preview-box {
  min-height: 72px; padding: var(--sp-3);
  color: var(--text-2); background: #fbfdff;
  border: 1px solid var(--border-1); border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.65;
}
.resource-modal-preview {
  padding: var(--sp-4);
  color: var(--text-1); background: #fbfdff;
  border: 1px solid var(--border-1); border-radius: var(--r-md);
  line-height: 1.75;
}

/* ============ Logs ============ */
.log-panel { padding: var(--sp-3); }
.log-list { display: flex; flex-direction: column; }
.log-row {
  display: grid; grid-template-columns: 78px 64px 140px 1fr; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--r-sm);
  border-bottom: 1px solid var(--border-1);
  transition: background var(--t-fast) var(--ease);
}
.log-row:last-child { border-bottom: 0; }
.log-row:hover { background: var(--surface-2); }
.log-time { font-size: var(--fs-sm); color: var(--text-3); }
.log-level {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 0; width: 56px; border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
}
.log-row[data-level="info"] .log-level { color: var(--cyan); background: var(--cyan-soft); }
.log-row[data-level="warn"] .log-level { color: var(--warn); background: var(--amber-soft); }
.log-row[data-level="error"] .log-level { color: var(--err); background: rgba(244,115,107,.15); }
.log-source { font-size: var(--fs-base); font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-msg { font-size: var(--fs-base); color: var(--text-1); }

/* ============ Demo MVP Workbenches ============ */
.demo-workbench { display: flex; flex-direction: column; gap: var(--sp-5); }
.demo-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-5); align-items: start; }
.demo-side { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.compact-panel { padding: var(--sp-4); }
.demo-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.demo-panel-head.compact { align-items: center; }
.demo-title { font-size: var(--fs-lg); font-weight: 750; color: var(--text-1); }
.demo-sub { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.6; }
.status-pill {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  padding: 4px 10px; border-radius: var(--r-full);
  color: var(--violet); background: var(--violet-soft); border: 1px solid var(--violet-glow);
  font-size: var(--fs-xs); font-weight: 700;
}
.model-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.model-choice-card {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3);
  text-align: left;
  color: var(--text-2);
  background: #fbfdff;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.model-choice-card:hover,
.model-choice-card.is-active {
  border-color: var(--cyan);
  background: #f7fdff;
  box-shadow: 0 10px 28px rgba(14, 165, 233, .12);
}
.model-choice-top {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.model-choice-top strong {
  color: var(--text-1);
  font-size: var(--fs-md);
  font-weight: 800;
  overflow-wrap: anywhere;
}
.model-choice-top em {
  color: var(--cyan);
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.model-choice-desc {
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.model-choice-note {
  color: var(--violet);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.4;
}
.model-choice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}
.model-choice-tags i {
  padding: 3px 7px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-full);
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 700;
}
.demo-label { display: block; margin-bottom: var(--sp-2); font-size: var(--fs-sm); font-weight: 700; color: var(--text-2); }
.demo-input {
  width: 100%; min-height: 118px; resize: vertical;
  padding: var(--sp-3) var(--sp-4);
  color: var(--text-1); background: #fbfdff;
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  outline: none; font: inherit; line-height: 1.65;
}
.demo-input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-soft); }
.prompt-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.prompt-chip {
  padding: 6px 10px; border-radius: var(--r-full);
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border-1);
  font-size: var(--fs-sm); font-weight: 600;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.prompt-chip:hover { color: var(--violet); background: var(--violet-soft); border-color: var(--violet-glow); }
.demo-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }
.demo-output-panel { padding: var(--sp-4); }
.demo-output {
  margin: 0; min-height: 180px; white-space: pre-wrap; overflow-wrap: anywhere;
  padding: var(--sp-4); color: var(--text-1); background: #fbfdff;
  border: 1px solid var(--border-1); border-radius: var(--r-md);
  font-family: var(--font-sans); font-size: var(--fs-md); line-height: 1.75;
}
.api-note {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--sp-4); color: var(--text-2);
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.6;
}
.api-note strong { color: #c2410c; }
.agent-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.agent-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.agent-tab,
.workflow-tab {
  text-align: left; padding: var(--sp-3);
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.agent-tab strong,
.workflow-tab strong { display: block; color: var(--text-1); font-size: var(--fs-md); margin-bottom: 2px; }
.agent-tab span,
.workflow-tab span { display: block; color: var(--text-3); font-size: var(--fs-sm); line-height: 1.5; }
.agent-tab:hover,
.workflow-tab:hover { transform: translateY(-1px); border-color: var(--violet-glow); }
.agent-tab.is-active { background: var(--violet-soft); border-color: var(--violet-glow); }
.workflow-tab.is-active { background: var(--amber-soft); border-color: var(--amber-glow); }
.chat-panel { min-width: 0; padding: var(--sp-4); }
.chat-box {
  display: flex; flex-direction: column; gap: var(--sp-3);
  min-height: 280px; max-height: 420px; overflow: auto;
  margin-top: var(--sp-3); padding: var(--sp-3);
  background: var(--surface-2); border: 1px solid var(--border-1); border-radius: var(--r-md);
}
.chat-line { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: var(--sp-2); align-items: flex-start; }
.chat-role {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 800;
  background: var(--surface-1); border: 1px solid var(--border-1); color: var(--text-3);
}
.chat-bubble {
  padding: 9px 12px; border-radius: var(--r-md);
  background: var(--surface-1); border: 1px solid var(--border-1);
  color: var(--text-2); line-height: 1.7;
}
.chat-user .chat-role { color: var(--violet); background: var(--violet-soft); border-color: var(--violet-glow); }
.chat-user .chat-bubble { color: var(--text-1); border-color: var(--violet-glow); }
.chat-assistant .chat-role { color: var(--cyan); background: var(--cyan-soft); border-color: var(--cyan-glow); }
.chat-input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-3); margin-top: var(--sp-3); align-items: end; }
.chat-input { min-height: 74px; }

.workflow-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.workflow-runner { padding: var(--sp-4); }
.demo-flow-track { margin-top: var(--sp-4); }
.workflow-result-panel { padding: var(--sp-4); }
.workflow-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-3); }
.workflow-result {
  padding: var(--sp-4); background: var(--surface-2);
  border: 1px solid var(--border-1); border-radius: var(--r-md);
}
.workflow-result h4 { margin: 0 0 var(--sp-2); font-size: var(--fs-md); color: var(--text-1); }
.workflow-result p { color: var(--text-2); line-height: 1.7; }
.workflow-result-locked {
  background:
    linear-gradient(135deg, rgba(255,247,237,.88), rgba(255,255,255,.94)),
    var(--surface-2);
  border-color: rgba(245,158,11,.26);
}
.workflow-result-lock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.workflow-result-lock-head h4 { margin: 0; }
.workflow-result-lock-head span {
  flex: none;
  padding: 3px 8px;
  border-radius: var(--r-full);
  color: #a16207;
  background: rgba(245,158,11,.12);
  font-size: var(--fs-xs);
  font-weight: 800;
}
.workflow-result-placeholder {
  margin-bottom: var(--sp-3);
  color: #7a8798;
}
.workflow-result-body {
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid rgba(245,158,11,.20);
}
.workflow-result-body p { margin: 0; }
.workflow-result-revealed {
  border-color: rgba(245,158,11,.34);
  background: #fffaf0;
}

.record-summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: var(--sp-3); align-items: stretch;
}
.record-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-4); background: var(--surface-1);
  border: 1px solid var(--border-1); border-radius: var(--r-md); box-shadow: var(--sh-1);
}
.record-stat strong { font-size: var(--fs-xl); color: var(--text-1); line-height: 1.1; }
.record-stat span { font-size: var(--fs-sm); color: var(--text-3); }

/* ============ Sandbox ============ */
.sandbox-workbench { display: flex; flex-direction: column; gap: var(--sp-5); }
.sandbox-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--sp-5); align-items: stretch;
  padding: var(--sp-5);
  background:
    radial-gradient(420px 180px at 20% 0%, rgba(20,184,166,.16), transparent 70%),
    linear-gradient(135deg, rgba(20,184,166,.10), rgba(37,99,235,.08)),
    var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
}
.sandbox-hero-main { display: flex; flex-direction: column; gap: var(--sp-3); justify-content: center; min-width: 0; }
.sandbox-title { font-size: var(--fs-2xl); font-weight: 800; color: var(--text-1); }
.sandbox-copy { max-width: 68ch; color: var(--text-2); font-size: var(--fs-md); line-height: 1.7; }
.sandbox-status-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4);
  background: rgba(255,255,255,.78);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
}
.sandbox-status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-4); box-shadow: 0 0 0 4px rgba(148,163,184,.16);
}
.sandbox-status-dot[data-status="ready"],
.sandbox-status-dot[data-status="done"] { background: var(--ok); box-shadow: 0 0 0 4px rgba(52,211,153,.12); }
.sandbox-status-dot[data-status="running"] { background: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-soft); }
.sandbox-status-dot[data-status="error"] { background: var(--err); box-shadow: 0 0 0 4px rgba(244,115,107,.12); }
.sandbox-status-dot[data-status="reclaimed"] { background: var(--warn); box-shadow: 0 0 0 4px var(--amber-soft); }
.sandbox-status-label { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.sandbox-status-card strong { display: block; margin-top: 2px; font-size: var(--fs-lg); color: var(--text-1); }
.sandbox-env-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
  padding: var(--sp-3);
}
.sandbox-env-item {
  display: flex; align-items: center; gap: var(--sp-3);
  min-width: 0;
  padding: var(--sp-3);
  background: #fbfdff;
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
}
.sandbox-env-item div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sandbox-env-item strong { color: var(--text-1); font-size: var(--fs-base); }
.sandbox-env-item span { color: var(--text-3); font-size: var(--fs-xs); }
.sandbox-mini-meter {
  width: 68px; height: 8px; flex: none;
  overflow: hidden;
  border-radius: var(--r-full);
  background: var(--bg-1);
  border: 1px solid var(--border-1);
}
.sandbox-mini-meter span {
  display: block; height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--ok));
}
.sandbox-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--sp-5); align-items: start; }
.sandbox-side { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.sandbox-editor-panel,
.sandbox-output-panel,
.sandbox-quota-panel,
.sandbox-snapshot-panel { padding: var(--sp-4); }
.sandbox-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}
.sandbox-panel-head.compact { margin-bottom: var(--sp-3); }
.sandbox-panel-title { font-size: var(--fs-lg); font-weight: 700; color: var(--text-1); }
.sandbox-panel-sub,
.sandbox-output-meta { font-size: var(--fs-sm); color: var(--text-3); }
.sandbox-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: flex-end; }
.sandbox-editor {
  width: 100%; min-height: 430px; resize: vertical;
  padding: var(--sp-4);
  color: var(--text-1);
  background: #fbfdff;
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  outline: none;
  font-size: var(--fs-base);
  line-height: 1.65;
  tab-size: 2;
}
.sandbox-editor:focus { border-color: var(--cyan-glow); box-shadow: 0 0 0 3px var(--cyan-soft); }
.quota-row { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border-1); }
.quota-row:last-of-type { border-bottom: 0; }
.quota-row-top { display: flex; justify-content: space-between; gap: var(--sp-3); color: var(--text-2); font-size: var(--fs-sm); }
.quota-row-top strong { color: var(--text-1); font-size: var(--fs-sm); }
.quota-meter { height: 7px; overflow: hidden; border-radius: var(--r-full); background: var(--bg-1); border: 1px solid var(--border-1); }
.quota-meter span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.sandbox-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-top: var(--sp-3); }
.sandbox-kpis span {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-3);
  color: var(--text-3); background: var(--surface-2);
  border: 1px solid var(--border-1); border-radius: var(--r-sm);
  font-size: var(--fs-xs);
}
.sandbox-kpis strong { color: var(--text-1); font-size: var(--fs-xl); line-height: 1.1; }
.snapshot-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.snapshot-empty {
  padding: var(--sp-4);
  color: var(--text-3); background: var(--surface-2);
  border: 1px dashed var(--border-2); border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.6;
}
.snapshot-item {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--r-md);
}
.snapshot-timeline-item {
  position: relative;
  grid-template-columns: auto 1fr auto;
}
.snapshot-timeline-dot {
  position: relative; z-index: 1;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px var(--cyan-soft);
}
.snapshot-timeline-item::before {
  content: "";
  position: absolute; left: 17px; top: -8px; bottom: -8px;
  width: 1px;
  background: var(--border-1);
}
.snapshot-timeline-item:first-child::before { top: 50%; }
.snapshot-timeline-item:last-child::before { bottom: 50%; }
.snapshot-item div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.snapshot-item strong { color: var(--text-1); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snapshot-item span { color: var(--text-3); font-size: var(--fs-xs); }
.sandbox-cleanup { width: 100%; justify-content: center; }
.sandbox-output {
  min-height: 180px; max-height: 300px; overflow: auto;
  padding: var(--sp-3);
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--r-md);
}
.sandbox-empty { color: #94a3b8; font-size: var(--fs-sm); padding: var(--sp-2); }
.sandbox-output-line {
  display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: var(--sp-3);
  padding: 6px var(--sp-2);
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: var(--fs-sm);
}
.sandbox-output-line:last-child { border-bottom: 0; }
.sandbox-output-kind {
  color: #94a3b8; text-transform: uppercase; font-size: var(--fs-xs); font-weight: 700;
}
.sandbox-output-text { color: #dbeafe; white-space: pre-wrap; overflow-wrap: anywhere; }
.sandbox-output-line[data-kind="system"] .sandbox-output-kind,
.sandbox-output-line[data-kind="result"] .sandbox-output-kind { color: var(--cyan); }
.sandbox-output-line[data-kind="warn"] .sandbox-output-kind { color: var(--warn); }
.sandbox-output-line[data-kind="error"] .sandbox-output-kind,
.sandbox-output-line[data-kind="error"] .sandbox-output-text { color: var(--err); }

/* ============ Placeholder ============ */
.placeholder {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: var(--sp-4); padding: var(--sp-8) var(--sp-6);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
}
.placeholder[data-accent="cyan"]   { --accent: var(--cyan);   --accent-soft: var(--cyan-soft);   --accent-glow: var(--cyan-glow); }
.placeholder[data-accent="violet"] { --accent: var(--violet); --accent-soft: var(--violet-soft); --accent-glow: var(--violet-glow); }
.placeholder[data-accent="amber"]  { --accent: var(--amber);  --accent-soft: var(--amber-soft);  --accent-glow: var(--amber-glow); }
.placeholder-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: var(--r-lg);
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-glow);
}
.placeholder-icon svg { width: 32px; height: 32px; }
.placeholder-title { font-size: var(--fs-2xl); font-weight: 700; }
.placeholder-list { display: flex; flex-direction: column; gap: var(--sp-2); max-width: 52ch; }
.placeholder-item { display: flex; align-items: flex-start; gap: var(--sp-3); font-size: var(--fs-md); color: var(--text-2); text-align: left; line-height: 1.6; }
.placeholder-item .dot { width: 6px; height: 6px; margin-top: 9px; flex: none; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.placeholder-cta { margin-top: var(--sp-2); }

/* ============ Empty State ============ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  padding: var(--sp-8) var(--sp-4); text-align: center;
}
.empty-icon { color: var(--text-4); }
.empty-icon svg { width: 32px; height: 32px; }
.empty-text { font-size: var(--fs-md); color: var(--text-3); }

/* ============ Modal ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-5);
  background: rgba(15,23,42,.32);
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity var(--t-base) var(--ease);
}
.modal-overlay[hidden] { display: none; }
.modal-overlay.is-open { opacity: 1; }
.modal {
  position: relative; width: 100%; max-width: 540px; max-height: 86vh; overflow-y: auto;
  padding: var(--sp-6);
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  transform: translateY(12px) scale(.98); opacity: 0;
  transition: transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}
.modal-overlay.is-open .modal { transform: translateY(0) scale(1); opacity: 1; }
.modal-close {
  position: absolute; top: var(--sp-4); right: var(--sp-4);
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1; color: var(--text-3);
  background: var(--surface-3); border: 1px solid var(--border-2);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.modal-close:hover { color: var(--text-1); background: var(--elev); }
.modal-body { display: flex; flex-direction: column; gap: var(--sp-4); }
.modal-head { display: flex; flex-direction: column; gap: var(--sp-1); padding-right: 40px; }
.modal-head[data-accent="cyan"]   { --accent: var(--cyan); }
.modal-head[data-accent="violet"] { --accent: var(--violet); }
.modal-head[data-accent="amber"]  { --accent: var(--amber); }
.modal-head[data-accent="pink"]   { --accent: var(--pink); }
.modal-eyebrow { font-size: var(--fs-sm); font-weight: 600; letter-spacing: .4px; color: var(--accent); }
.modal-title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: 0; }
.modal-desc { font-size: var(--fs-md); color: var(--text-2); line-height: 1.65; }
.modal-subhead { font-size: var(--fs-md); font-weight: 700; color: var(--text-1); margin-top: var(--sp-1); }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); }
.kv { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3); background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--r-sm); }
.kv-k { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: .3px; }
.kv-v { font-size: var(--fs-base); font-weight: 600; color: var(--text-1); }
.modal-steps { display: flex; flex-direction: column; gap: var(--sp-2); }
.modal-step { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3); background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--r-sm); font-size: var(--fs-md); color: var(--text-1); }
.modal-step-no { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; flex: none; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-3); padding-top: var(--sp-2); }

.course-player-modal {
  max-width: 1120px;
  padding: var(--sp-5);
}
.course-player-shell { display: flex; flex-direction: column; gap: var(--sp-4); }
.course-player-head { padding-right: 48px; }
.course-player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-4);
  align-items: stretch;
}
.course-player-main,
.course-player-side {
  min-width: 0;
}
.course-player-stage {
  overflow: hidden;
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  background: #0f172a;
  box-shadow: 0 18px 40px rgba(15,23,42,.16);
}
.course-player-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
.course-player-screen {
  position: relative;
  min-height: 380px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background:
    radial-gradient(360px 220px at 72% 28%, rgba(20,184,166,.28), transparent 70%),
    radial-gradient(280px 180px at 20% 78%, rgba(47,128,237,.26), transparent 70%),
    linear-gradient(135deg, #0f172a, #18324a 54%, #102b32);
}
.course-player-stage.course-cover-lab .course-player-screen {
  background:
    radial-gradient(360px 220px at 76% 24%, rgba(47,128,237,.34), transparent 72%),
    radial-gradient(280px 180px at 18% 76%, rgba(20,184,166,.30), transparent 70%),
    linear-gradient(135deg, #0f172a, #12324a 54%, #0d3431);
}
.course-player-visual {
  position: relative;
  width: min(52%, 430px);
  height: 220px;
}
.course-player-orbit {
  position: absolute; inset: 12px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  transform: rotate(-12deg);
}
.course-player-board {
  position: absolute; inset: 32px 44px;
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.28) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.20) 1px, transparent 1px),
    rgba(255,255,255,.12);
  background-size: 28px 28px;
  border: 1px solid rgba(255,255,255,.30);
  box-shadow: 0 24px 60px rgba(0,0,0,.26);
}
.course-player-node {
  position: absolute;
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,.56));
  box-shadow: 0 18px 30px rgba(0,0,0,.18);
}
.course-player-node.node-a { left: 34px; top: 52px; }
.course-player-node.node-b { right: 42px; bottom: 46px; }
.course-player-primary {
  position: absolute; z-index: 2;
  width: 70px; height: 70px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--portal-green), #2f80ed);
  border: 2px solid rgba(255,255,255,.82);
  box-shadow: 0 18px 40px rgba(0,0,0,.24);
}
.course-player-stage[data-player-running="true"] .course-player-primary {
  background: linear-gradient(135deg, var(--ok), var(--cyan));
}
.course-player-caption {
  position: absolute; left: var(--sp-4); bottom: var(--sp-4);
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: rgba(15,23,42,.58);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(10px);
}
.course-player-caption strong { font-size: var(--fs-md); }
.course-player-caption span { color: rgba(255,255,255,.76); font-size: var(--fs-sm); }
.course-player-controls {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto minmax(120px, 160px) auto auto;
  gap: var(--sp-2);
  align-items: center;
  padding: 10px;
  background: #111827;
  color: #e5e7eb;
}
.player-btn,
.player-quality {
  min-height: 34px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255,255,255,.14);
  color: #f8fafc;
  background: rgba(255,255,255,.08);
  font-size: var(--fs-sm);
  font-weight: 700;
}
.player-quality { color: #111827; background: #fff; }
.player-range,
.player-volume input {
  width: 100%;
  accent-color: var(--portal-green);
}
.player-volume {
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr);
  align-items: center;
  gap: 6px;
  color: #cbd5e1;
  font-size: var(--fs-xs);
}
.course-player-meta {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  margin-top: var(--sp-3);
}
.course-player-meta span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-full);
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  font-size: var(--fs-sm);
}
.course-player-side {
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  background: #f8fbff;
}
.course-player-side h3 {
  font-size: var(--fs-lg);
  font-weight: 800;
  color: var(--text-1);
}
.course-outline-list {
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.course-outline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: var(--sp-2);
  padding: 10px;
  text-align: left;
  border: 1px solid var(--border-1);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--text-1);
}
.course-outline-item:hover {
  border-color: var(--pink-glow);
  background: #fff8fb;
}
.course-outline-item span:last-child {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.course-outline-item strong {
  font-size: var(--fs-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.course-outline-item em {
  color: var(--text-3);
  font-style: normal;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.course-player-side-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
  margin-top: auto;
}

/* ============ Toast ============ */
.toast-stack { position: fixed; right: var(--sp-5); bottom: var(--sp-5); z-index: 200; display: flex; flex-direction: column; gap: var(--sp-2); }
.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  min-width: 240px; max-width: 360px;
  padding: 12px var(--sp-4);
  background: var(--elev);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  color: var(--text-1); font-size: var(--fs-md); font-weight: 500;
  transform: translateX(120%); opacity: 0;
  transition: transform var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}
.toast.is-show { transform: translateX(0); opacity: 1; }
.toast-icon { display: inline-flex; flex: none; color: var(--text-2); }
.toast-icon svg { width: 18px; height: 18px; }
.toast-ok { border-color: rgba(52,211,153,.35); }
.toast-ok .toast-icon { color: var(--ok); }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .demo-grid,
  .agent-layout,
  .resource-workbench { grid-template-columns: 1fr; }
  .resource-sidebar { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agent-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .record-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .record-summary .btn { grid-column: 1 / -1; }
  .sandbox-hero,
  .sandbox-grid { grid-template-columns: 1fr; }
  .sandbox-env-strip { grid-template-columns: 1fr 1fr; }
  .sandbox-side { display: grid; grid-template-columns: 1fr 1fr; }
  .sandbox-cleanup { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 72px; }
  .brand-text, .nav-label, .nav-group-title, .sidebar-footer { display: none; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-item { justify-content: center; }
  .topbar { padding: var(--sp-4); }
  .search-box { width: 180px; }
  .view { padding: var(--sp-5) var(--sp-4) var(--sp-7); }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .workflow-tabs,
  .agent-list,
  .resource-sidebar,
  .record-summary { grid-template-columns: 1fr; }
  .model-choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-route-step { grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
  .demo-route-step .btn { grid-column: 2; justify-self: start; }
  .sandbox-side { grid-template-columns: 1fr; }
  .sandbox-env-strip { grid-template-columns: 1fr; }
  .sandbox-editor { min-height: 360px; }
  .course-player-layout { grid-template-columns: 1fr; }
  .course-player-screen { min-height: 280px; }
  .course-player-controls {
    grid-template-columns: auto minmax(120px, 1fr) auto;
  }
  .player-volume,
  .player-quality,
  .course-player-controls [data-player-fullscreen] {
    grid-column: span 1;
  }
}
@media (max-width: 560px) {
  .topbar-actions .search-box { display: none !important; }
  .hero-actions,
  .demo-route-actions { flex-direction: column; align-items: stretch; width: 100%; }
  .kv-grid { grid-template-columns: 1fr; }
  .model-choice-grid { grid-template-columns: 1fr; }
  .trend-row { grid-template-columns: 24px 1fr auto; }
  .trend-lang, .trend-delta { display: none; }
  .sandbox-hero { padding: var(--sp-4); }
  .sandbox-status-card { grid-template-columns: auto 1fr; }
  .sandbox-panel-head { align-items: flex-start; flex-direction: column; }
  .sandbox-env-item { align-items: flex-start; }
  .sandbox-actions { width: 100%; justify-content: stretch; }
  .sandbox-actions .btn { flex: 1; }
  .sandbox-output-line { grid-template-columns: 1fr; gap: 2px; }
  .demo-panel-head,
  .chat-input-row { grid-template-columns: 1fr; display: grid; }
  .demo-actions .btn { flex: 1; }
  .modal-overlay { padding: var(--sp-3); }
  .course-player-modal { padding: var(--sp-4); }
  .course-player-screen { min-height: 210px; }
  .course-player-visual { width: 76%; height: 160px; }
  .course-player-primary { width: 56px; height: 56px; }
  .course-player-controls { grid-template-columns: 1fr 1fr; }
  .course-player-controls .player-range,
  .course-player-controls [data-player-time] {
    grid-column: 1 / -1;
  }
  .player-volume { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .bg-canvas { display: none; }
}

/* ============ Portal Homepage Overrides ============ */
:root {
  --portal-green: #00c758;
  --portal-green-dark: #00a84c;
  --portal-bg: #f4f4f4;
  --portal-line: #e8e8e8;
  --content-max: 1180px;
}
body {
  background:
    radial-gradient(540px 320px at 12% 18%, rgba(0,199,88,.08), transparent 68%),
    radial-gradient(520px 300px at 86% 12%, rgba(47,128,237,.08), transparent 70%),
    var(--portal-bg);
  overflow: auto;
}
.bg-canvas {
  display: block;
  opacity: .22;
  mix-blend-mode: multiply;
}
.app-shell {
  display: block;
  min-height: 100vh;
  height: auto;
  background: transparent;
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--portal-line);
  box-shadow: 0 2px 8px rgba(15,23,42,.05);
}
.site-header-inner {
  max-width: var(--content-max);
  height: 58px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-5);
}
.site-header .brand {
  padding: 0; flex: none; gap: 9px;
}
.site-header .brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--portal-green), #2f80ed);
  box-shadow: none;
}
.site-header .brand-mark::after {
  inset: 8px 7px 7px 9px;
  border-radius: 3px;
}
.site-header .brand-name {
  color: #253858; font-size: 18px; letter-spacing: 0;
}
.site-header .brand-sub {
  font-size: 11px; color: #718096;
}
.site-header .nav {
  flex: 1;
  display: flex; flex-direction: row; align-items: center; gap: 4px;
  min-width: 0; overflow: hidden;
}
.site-header .nav-group {
  display: flex; flex-direction: row; align-items: center; gap: 4px;
}
.site-header .nav-group-title,
.site-header .nav-icon,
.site-header .nav-bar { display: none; }
.site-header .nav-item {
  width: auto; height: 58px;
  padding: 0 8px;
  border-radius: 0;
  color: #333;
  font-size: 13px; font-weight: 500;
  white-space: nowrap;
}
.site-header .nav-item:hover {
  color: var(--portal-green-dark);
  background: transparent;
}
.site-header .nav-item.is-active {
  color: var(--portal-green-dark);
  background: transparent;
  font-weight: 700;
}
.site-header .nav-label {
  display: inline;
  flex: none;
}
.site-header .topbar-actions {
  gap: 10px; flex: none;
}
.site-header .search-box {
  width: 230px; max-width: 24vw; height: 32px;
  border-radius: 999px; border-color: #ccf4dd;
  background: #fff;
}
.site-header .search-box:focus-within {
  border-color: var(--portal-green);
  box-shadow: 0 0 0 3px rgba(0,199,88,.10);
}
.site-header .btn {
  height: 32px; border-radius: 999px;
  font-size: 13px;
}
.btn-primary {
  background: var(--portal-green);
  box-shadow: none;
}
.btn-primary:hover {
  background: var(--portal-green-dark);
  box-shadow: none;
}
.btn-line:hover,
.btn-ghost:hover {
  color: var(--portal-green-dark);
  background: #eafff2;
  border-color: #baf0cf;
}
.content {
  height: auto;
  overflow: visible;
}
.topbar {
  position: relative; top: auto; z-index: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 22px var(--sp-4) 0;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
}
body.is-home .topbar { display: none; }
.view {
  max-width: var(--content-max);
  padding: 24px var(--sp-4) 56px;
  gap: 20px;
}

.portal-home {
  display: flex; flex-direction: column; gap: 18px;
}
.student-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(234, 255, 242, .92), rgba(234, 243, 255, .92)),
    #fff;
  border: 1px solid #dcefe7;
}
.student-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(47,128,237,.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0,199,88,.08) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,.55), transparent 80%);
  pointer-events: none;
}
.student-hero::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -28%;
  width: 26%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.52), transparent);
  transform: skewX(-18deg);
  animation: studentSweep 8s ease-in-out infinite;
  pointer-events: none;
}
.student-hero-main {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.student-hero h2 {
  margin: 0;
  color: #102033;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.16;
  letter-spacing: 0;
}
.student-hero p {
  max-width: 62ch;
  margin: 0;
  color: #526071;
  font-size: 15px;
  line-height: 1.8;
}
.student-task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.student-task-card,
.student-path-step,
.student-scenario-button {
  position: relative;
  overflow: hidden;
  border: 1px solid #dbe7ef;
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.student-task-card {
  min-height: 138px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.student-task-card:hover,
.student-path-step:hover,
.student-scenario-button:hover {
  transform: translateY(-2px);
  border-color: #9bdcba;
  box-shadow: 0 14px 30px rgba(15,23,42,.10);
}
.student-task-card::before,
.student-path-step::before,
.student-scenario-button::before,
.student-assist-card::before,
.student-outcome-card::before,
.student-activity-item::before,
.student-focus-card::before,
.student-metric::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--portal-green), #2f80ed, #14b8a6);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .32s linear;
  pointer-events: none;
}
.student-task-card:hover::before,
.student-path-step:hover::before,
.student-scenario-button:hover::before,
.student-assist-card:hover::before,
.student-outcome-card:hover::before,
.student-activity-item:hover::before,
.student-focus-card:hover::before,
.student-metric:hover::before {
  transform: scaleX(1);
}
.student-task-icon {
  width: 32px;
  height: 32px;
  color: var(--portal-green-dark);
  background: #eafff2;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
}
.student-task-icon svg { width: 18px; height: 18px; }
.student-task-card strong,
.student-path-step strong,
.student-scenario-button strong {
  color: #111827;
  font-size: 15px;
}
.student-task-card span,
.student-path-step p,
.student-scenario-button span {
  margin: 0;
  color: #657286;
  font-size: 13px;
  line-height: 1.55;
}
.student-today-card {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 18px;
  border: 1px solid #cbe7d7;
  border-radius: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 38px rgba(15,23,42,.08);
}
.student-today-card::before {
  content: "";
  display: block;
  height: 72px;
  margin: -4px -4px 0;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255,255,255,.68) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.68) 1px, transparent 1px),
    linear-gradient(135deg, #dffcf0, #eaf3ff 54%, #fff7d6);
  background-size: 18px 18px, 18px 18px, auto;
  border: 1px solid #e1edf4;
}
.student-card-label {
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--portal-green-dark);
  background: #eafff2;
  font-size: 12px;
  font-weight: 800;
}
.student-today-card h3,
.student-section-title h2,
.student-course-intro h2,
.student-scenario-strip h2,
.student-sandbox-intro h2 {
  margin: 0;
  color: #111827;
}
.student-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}
.student-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--portal-green), #2f80ed);
}
.student-today-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.student-today-meta span,
.student-course-kpis span,
.student-sandbox-steps span {
  padding: 5px 8px;
  border-radius: 6px;
  color: #4b5563;
  background: #f4f7fa;
  font-size: 12px;
  font-weight: 700;
}
.student-path,
.student-course-intro,
.student-scenario-strip,
.student-sandbox-intro {
  padding: 20px;
}
.student-momentum {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.student-metric {
  position: relative;
  overflow: hidden;
  padding: 15px 16px;
  display: grid;
  gap: 5px;
  min-height: 112px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  transition: transform .18s linear, border-color .18s linear, box-shadow .18s linear;
}
.student-metric:hover {
  transform: translateY(-2px);
  border-color: #b9dff0;
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
}
.student-metric::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 12px;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0,199,88,.14), rgba(47,128,237,.14));
  transform: rotate(8deg);
}
.student-metric span {
  color: #657286;
  font-size: 13px;
  font-weight: 800;
}
.student-metric strong {
  color: #102033;
  font-size: 26px;
  line-height: 1.05;
}
.student-metric em {
  color: #7a8798;
  font-style: normal;
  font-size: 12px;
}
.student-metric-bar {
  height: 6px;
  margin-top: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf3f8;
}
.student-metric-bar b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--portal-green), #2f80ed);
  transition: filter .25s linear, transform .25s linear;
}
.student-metric:hover .student-metric-bar b {
  filter: brightness(1.08);
  transform: translateX(2px);
}
.student-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.student-section-title span,
.student-course-intro p,
.student-scenario-strip p,
.student-sandbox-intro p {
  margin: 6px 0 0;
  color: #657286;
  font-size: 14px;
  line-height: 1.7;
}
.student-path-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.student-path-step {
  min-height: 128px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.student-path-step .mono {
  color: #2f80ed;
  font-weight: 900;
}
.student-assist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.student-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 16px;
}
.student-focus-card {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  padding: 0;
  overflow: hidden;
  transition: transform .2s linear, border-color .2s linear, box-shadow .2s linear;
}
.student-focus-card:hover {
  transform: translateY(-2px);
  border-color: #b8e4d3;
  box-shadow: 0 16px 34px rgba(15,23,42,.10);
}
.student-focus-cover {
  position: relative;
  min-height: 238px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.34) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.34) 1px, transparent 1px),
    linear-gradient(135deg, #0f82d8, #16b57a);
  background-size: 24px 24px, 24px 24px, auto;
}
.student-focus-card:hover .student-focus-cover {
  animation: studentGridDrift 9s linear infinite;
}
.student-focus-cover::before {
  content: "";
  position: absolute;
  inset: 24px 24px auto;
  height: 112px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.55);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.58));
  box-shadow: 0 20px 38px rgba(0,50,92,.18);
}
.focus-screen {
  position: absolute;
  left: 48px;
  right: 42px;
  bottom: 42px;
  height: 58px;
  border-radius: 12px;
  background: rgba(255,255,255,.82);
  transform: perspective(260px) rotateX(56deg);
  box-shadow: 0 22px 34px rgba(0,44,86,.22);
}
.focus-line {
  position: absolute;
  left: 48px;
  right: 54px;
  height: 7px;
  border-radius: 999px;
  background: rgba(47,128,237,.42);
}
.line-a { top: 62px; }
.line-b { top: 84px; right: 96px; background: rgba(0,199,88,.48); }
.focus-chip {
  position: absolute;
  right: 44px;
  top: 108px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #075038;
  background: #ffe66b;
  font-weight: 900;
  box-shadow: 0 15px 28px rgba(0,45,72,.18);
}
.student-focus-body {
  padding: 22px 22px 20px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.student-focus-body h2 {
  margin: 0;
  color: #102033;
  font-size: 24px;
  line-height: 1.25;
}
.student-focus-body p {
  margin: 0;
  color: #657286;
  line-height: 1.75;
}
.student-focus-tags,
.student-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.student-focus-tags span {
  padding: 5px 8px;
  border-radius: 6px;
  color: #4b5563;
  background: #f4f7fa;
  font-size: 12px;
  font-weight: 800;
}
.student-activity-card {
  padding: 18px;
}
.student-section-title.compact {
  margin-bottom: 10px;
}
.student-activity-list {
  display: grid;
  gap: 9px;
}
.student-activity-item {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px;
  border: 1px solid #e2ebf2;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.student-activity-item:hover {
  transform: translateX(2px);
  border-color: #a8d8ef;
  background: #f8fcff;
}
.student-activity-item span {
  color: #2f80ed;
  font-size: 12px;
  font-weight: 900;
}
.student-activity-item strong {
  color: #102033;
  font-size: 14px;
}
.student-activity-item em {
  color: var(--portal-green-dark);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}
.student-assist-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 170px;
  transition: transform .18s linear, border-color .18s linear, box-shadow .18s linear;
}
.student-assist-card:hover {
  transform: translateY(-2px);
  border-color: #b9dff0;
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
}
.student-assist-card h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 18px;
}
.student-assist-card p {
  margin: 0;
  color: #657286;
  line-height: 1.7;
}
.student-course-intro,
.student-scenario-strip,
.student-sandbox-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}
.student-course-kpis,
.student-sandbox-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.student-course-kpis strong {
  color: var(--portal-green-dark);
  font-size: 20px;
  margin-right: 4px;
}
.student-scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}
.student-scenario-button {
  min-height: 88px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.student-outcome {
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(239,249,255,.94)),
    #fff;
}
.student-outcome-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.student-outcome-card {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 15px;
  border: 1px solid #dce8f2;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.student-outcome-card:hover {
  transform: translateY(-2px);
  border-color: #8fcff2;
  box-shadow: 0 14px 30px rgba(15,23,42,.09);
}
.student-outcome-card strong {
  color: #102033;
  font-size: 16px;
}
.student-outcome-card span {
  color: #657286;
  font-size: 13px;
  line-height: 1.65;
}
.student-library-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(244,253,248,.96), rgba(239,248,255,.94)),
    #fff;
}
.student-library-intro h2 {
  margin: 0;
  color: #111827;
}
.student-library-intro p {
  margin: 6px 0 0;
  color: #657286;
  font-size: 14px;
  line-height: 1.7;
}
.student-library-kpis {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 360px;
}
.student-library-kpis span {
  padding: 6px 9px;
  border-radius: 6px;
  color: #4b5563;
  background: #f4f7fa;
  font-size: 12px;
  font-weight: 800;
}
.student-library-kpis strong {
  color: var(--portal-green-dark);
  font-size: 20px;
  margin-right: 4px;
}
@keyframes studentSweep {
  0%, 58% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  68% { opacity: .8; }
  100% { transform: translateX(520%) skewX(-18deg); opacity: 0; }
}
@keyframes studentGridDrift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 24px 0, 0 24px, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn::after,
  .student-task-card::before,
  .student-path-step::before,
  .student-scenario-button::before,
  .student-assist-card::before,
  .student-outcome-card::before,
  .student-activity-item::before,
  .student-focus-card::before,
  .student-metric::before {
    display: none;
  }
  .student-focus-card:hover .student-focus-cover,
  .student-hero::after {
    animation: none;
  }
}
.portal-home .panel,
.portal-category.panel,
.portal-login.panel,
.portal-live-card.panel,
.portal-course-card.panel,
.portal-rank.panel,
.partner-strip.panel {
  border-radius: 8px;
  box-shadow: none;
  border-color: #eeeeee;
}
.portal-hero {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 200px;
  gap: 16px;
  min-height: 300px;
}
.portal-category {
  padding: 14px 12px;
  gap: 0;
}
.portal-category-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 0 8px;
  border-bottom: 1px solid #f0f0f0;
}
.portal-category-head strong { font-size: 14px; }
.portal-category-head span { color: var(--portal-green-dark); font-size: 12px; }
.portal-category-row {
  width: 100%;
  display: grid; grid-template-columns: auto 1fr; column-gap: 7px;
  padding: 9px 0;
  color: #333; background: transparent; border: 0;
  text-align: left;
}
.portal-category-row strong {
  grid-column: 2; font-size: 13px; font-weight: 700;
}
.portal-category-row span:last-child {
  grid-column: 2; color: #8a8f99; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.portal-category-row:hover strong { color: var(--portal-green-dark); }
.hot-dot {
  grid-row: 1 / span 2;
  align-self: center;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff7a1a;
}
.portal-banner {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  border-radius: 8px;
  background: #0a5ed9;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 18px 38px rgba(15,86,180,.13);
}
.portal-banner::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.20), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 46%);
  pointer-events: none;
}
.portal-banner::after {
  content: "";
  position: absolute; right: 18px; bottom: 16px;
  width: 210px; height: 60px;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.34) 0 8px, transparent 8px 22px);
  opacity: .18;
  transform: skewX(-18deg);
  pointer-events: none;
}
.portal-banner-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.portal-eyebrow {
  display: inline-flex; align-items: center;
  color: rgba(255,255,255,.92);
  font-size: 13px; font-weight: 800;
  text-shadow: 0 2px 6px rgba(0,0,0,.16);
}
.portal-banner h2 {
  display: flex; flex-direction: column; gap: 2px;
  max-width: 12.5em;
  color: #fff;
  font-size: 40px; line-height: 1.16; letter-spacing: 0;
  text-shadow: 0 4px 12px rgba(0,54,110,.28);
}
.portal-banner p {
  max-width: 38em;
  color: rgba(255,255,255,.92); font-size: 18px; font-weight: 700; line-height: 1.65;
  text-shadow: 0 2px 8px rgba(0,54,110,.22);
}
.portal-banner-actions { display: flex; gap: 10px; }
.portal-banner .btn-primary {
  height: 42px;
  padding: 0 22px;
  color: #00542a;
  background: linear-gradient(180deg, #ffe66b, #ffc400);
  border: 1px solid rgba(255,255,255,.66);
  box-shadow: 0 10px 22px rgba(73,44,0,.16);
}
.portal-banner .btn-primary:hover { background: linear-gradient(180deg, #fff08a, #ffd129); }
.portal-banner-visual {
  position: relative; z-index: 2; min-height: 230px;
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}
.portal-banner-visual:focus-visible { outline: 3px solid rgba(255,255,255,.72); outline-offset: 4px; }
.portal-banner-track {
  height: 100%;
  display: flex;
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.portal-banner-slide {
  position: relative;
  flex: 0 0 100%;
  min-height: 300px;
  display: grid; grid-template-columns: minmax(0, 1fr) 330px;
  align-items: center;
  padding: 36px 56px;
  background:
    linear-gradient(110deg, rgba(255,255,255,.10) 0 1px, transparent 1px 36px),
    linear-gradient(135deg, #332d51 0%, #0a5ed9 36%, #0789cb 66%, #19bcae 100%);
}
.portal-banner-slide::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,.18), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 48%);
  pointer-events: none;
}
.slide-agents {
  background:
    linear-gradient(110deg, rgba(255,255,255,.10) 0 1px, transparent 1px 36px),
    linear-gradient(135deg, #25305f 0%, #3569de 42%, #18a7cd 100%);
}
.slide-sandbox {
  background:
    linear-gradient(110deg, rgba(255,255,255,.10) 0 1px, transparent 1px 36px),
    linear-gradient(135deg, #2b3155 0%, #0f82d8 46%, #00b894 100%);
}
.slide-library {
  background:
    linear-gradient(110deg, rgba(255,255,255,.10) 0 1px, transparent 1px 36px),
    linear-gradient(135deg, #343052 0%, #0478c8 42%, #31c48d 100%);
}
.portal-ai-visual {
  position: relative;
  width: 300px; height: 230px;
  animation: heroFloat 5.6s ease-in-out infinite;
}
.ai-panel {
  position: absolute; top: 20px;
  width: 104px; height: 132px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(217,247,255,.72));
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 18px 28px rgba(2,71,122,.18);
  transform: skewY(24deg);
}
.ai-panel-left { left: 4px; }
.ai-panel-right { right: 0; transform: skewY(-24deg); }
.ai-base {
  position: absolute; left: 46px; right: 28px; bottom: 16px;
  height: 74px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e7f9ff, #8adbf3 48%, #3d9dff);
  box-shadow: 0 24px 34px rgba(0,70,126,.26);
  transform: perspective(360px) rotateX(58deg) rotateZ(-9deg);
}
.ai-cube {
  position: absolute; left: 88px; top: 62px;
  width: 118px; height: 96px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(191,255,230,.92), rgba(54,191,255,.75));
  border: 1px solid rgba(255,255,255,.68);
  box-shadow: 0 18px 34px rgba(0,72,128,.22), inset 0 0 28px rgba(255,255,255,.42);
}
.slide-agents .ai-cube { background: linear-gradient(145deg, rgba(222,235,255,.94), rgba(111,181,255,.78)); }
.slide-sandbox .ai-cube { background: linear-gradient(145deg, rgba(209,250,229,.94), rgba(20,184,166,.78)); }
.slide-library .ai-cube { background: linear-gradient(145deg, rgba(255,247,237,.94), rgba(251,191,36,.76)); }
.ai-cube i {
  position: absolute; inset: 25px 34px;
  border-radius: 10px;
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 0 0 4px rgba(0,183,255,.24);
}
.ai-cube b {
  position: absolute; left: 46px; top: 43px;
  width: 28px; height: 7px; border-radius: 999px;
  background: #ffc400;
  box-shadow: 0 14px 0 rgba(0,199,88,.65);
}
.ai-chip {
  position: absolute;
  width: 42px; height: 12px; border-radius: 999px;
  background: rgba(255,255,255,.78);
  box-shadow: inset 0 0 0 2px rgba(47,128,237,.28);
}
.ai-chip-a { left: 62px; bottom: 36px; transform: rotate(-12deg); }
.ai-chip-b { right: 40px; bottom: 52px; transform: rotate(16deg); }
.hero-arrow {
  position: absolute; top: 50%; z-index: 4;
  width: 48px; height: 48px; margin-top: -24px;
  border: 0;
  border-radius: 50%;
  background: rgba(0,76,153,.38);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.hero-arrow::before {
  content: "";
  position: absolute; inset: 15px 17px;
  border-top: 5px solid rgba(255,255,255,.86);
  border-left: 5px solid rgba(255,255,255,.86);
}
.hero-arrow-left { left: 14px; }
.hero-arrow-left::before { transform: rotate(-45deg); }
.hero-arrow-right { right: 14px; }
.hero-arrow-right::before { transform: rotate(135deg); }
.hero-dots {
  position: absolute; right: 28px; bottom: 22px; z-index: 4;
  display: flex; align-items: center; gap: 9px;
}
.hero-dots button {
  width: 8px; height: 8px; padding: 0;
  border: 0; border-radius: 999px;
  background: rgba(255,255,255,.75);
}
.hero-dots button.is-active {
  width: 22px;
  background: #fff;
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.portal-login {
  align-items: center; justify-content: center; text-align: center;
  padding: 24px 16px;
}
.portal-avatar {
  width: 62px; height: 62px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 16px, transparent 17px),
    radial-gradient(circle at 50% 90%, #fff 0 28px, transparent 29px),
    #e5e7eb;
}
.portal-login h3 { font-size: 16px; }
.portal-login p { color: #7b8492; font-size: 13px; line-height: 1.7; }
.portal-login .btn { width: 100%; }
.partner-strip {
  min-height: 56px;
  padding: 0 18px;
  display: flex; flex-direction: row; align-items: center; gap: 34px;
  color: #6b7280;
  overflow: hidden;
}
.partner-strip span {
  flex: none; color: #333; font-weight: 700;
}
.partner-strip strong {
  color: #526179; font-size: 14px; font-weight: 800;
  white-space: nowrap;
}
.portal-section {
  display: flex; flex-direction: column; gap: 12px;
}
.portal-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.portal-section-head h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; font-weight: 800; color: #1f2937;
}
.portal-section-head h2::before {
  content: "";
  width: 5px; height: 22px; border-radius: 999px;
  background: linear-gradient(180deg, var(--portal-green), #2f80ed);
  box-shadow: 0 6px 14px rgba(0,199,88,.22);
}
.portal-tabs {
  display: flex; align-items: center; gap: 24px;
  color: #4b5563; font-size: 13px;
}
.portal-tabs span.is-active {
  color: var(--portal-green-dark); font-weight: 800;
}
.portal-live-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.portal-live-card {
  position: relative;
  align-items: flex-start;
  padding: 18px 16px 14px;
  min-height: 132px;
  text-align: left;
  overflow: hidden;
  border-color: #e2edf3;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,252,255,.98)),
    #fff;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.portal-live-card::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 4px;
  background: linear-gradient(90deg, var(--live-accent, var(--portal-green)), rgba(47,128,237,.74));
}
.portal-live-card::after {
  content: "";
  position: absolute; right: 14px; top: 16px;
  width: 58px; height: 58px; border-radius: 16px;
  border: 1px solid rgba(255,255,255,.72);
  background:
    linear-gradient(90deg, rgba(255,255,255,.82) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.82) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255,255,255,.36), rgba(255,255,255,.12));
  background-size: 14px 14px, 14px 14px, auto;
  opacity: .72;
}
.portal-live-card:hover {
  transform: translateY(-3px);
  border-color: var(--live-border, #bcebd0);
  box-shadow: 0 16px 34px rgba(15,23,42,.11);
}
.portal-live-card.live-agents { --live-accent: #00c758; --live-soft: #e8fff1; --live-border: #b7efcf; }
.portal-live-card.live-sandbox { --live-accent: #2f80ed; --live-soft: #eaf3ff; --live-border: #bdd8ff; }
.portal-live-card.live-workflows { --live-accent: #f59e0b; --live-soft: #fff7df; --live-border: #fde4a8; }
.portal-live-card.live-library { --live-accent: #14b8a6; --live-soft: #e7fffb; --live-border: #b5eee6; }
.live-badge {
  position: relative; z-index: 1;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--live-soft, #eafff2);
  color: var(--live-accent, var(--portal-green-dark));
  font-size: 11px; font-weight: 700;
}
.live-time {
  position: absolute; z-index: 1; right: 15px; top: 17px;
  color: var(--live-accent, var(--portal-green));
  font-size: 12px; font-weight: 800;
}
.portal-live-card strong {
  position: relative; z-index: 1;
  margin-top: 4px; padding-right: 34px;
  font-size: 15px; line-height: 1.45; color: #111827;
}
.live-source {
  position: relative; z-index: 1;
  color: #6b7280; font-size: 12px;
}
.live-foot {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; margin-top: auto; padding-top: 10px;
  border-top: 1px solid rgba(226,232,240,.9);
}
.live-foot em,
.live-foot i {
  font-style: normal; font-size: 12px; font-weight: 800;
}
.live-foot em { color: #64748b; }
.live-foot i { color: var(--live-accent, var(--portal-green)); }
.portal-course-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
}
.portal-course-card {
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-color: #e2edf3;
  background: #fff;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.portal-course-card:hover {
  transform: translateY(-4px);
  border-color: var(--course-border, #b7efcf);
  box-shadow: 0 18px 38px rgba(15,23,42,.12);
}
.portal-course-card.course-courses { --course-accent: #00c758; --course-soft: #e8fff1; --course-border: #b7efcf; }
.portal-course-card.course-sandbox { --course-accent: #14b8a6; --course-soft: #e7fffb; --course-border: #b5eee6; }
.portal-course-card.course-models { --course-accent: #2f80ed; --course-soft: #eaf3ff; --course-border: #bdd8ff; }
.portal-course-card.course-agents { --course-accent: #f06ba8; --course-soft: #fff0f7; --course-border: #f7c9df; }
.portal-course-cover {
  position: relative;
  height: 128px;
  display: flex; align-items: flex-end;
  padding: 12px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.55) 1px, transparent 1px),
    linear-gradient(135deg, var(--course-soft, #e8fff1), rgba(47,128,237,.16));
  background-size: 24px 24px, 24px 24px, auto;
}
.portal-course-cover::before {
  content: "";
  position: absolute; inset: 14px 14px auto auto;
  width: 86px; height: 54px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.7);
  background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.46));
  box-shadow: 0 14px 28px rgba(15,23,42,.10);
  transform: rotate(-5deg);
}
.portal-course-cover::after {
  content: "";
  position: absolute; left: 18px; top: 20px;
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, var(--course-accent, var(--portal-green)), #2f80ed);
  box-shadow: 0 14px 26px rgba(15,23,42,.12);
}
.course-cover-mark {
  position: absolute; left: 31px; top: 33px; z-index: 1;
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid rgba(255,255,255,.88);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.18);
}
.course-cover-lines {
  position: absolute; right: 31px; top: 31px; z-index: 1;
  width: 50px; height: 28px;
  background:
    linear-gradient(#94a3b8, #94a3b8) 0 0 / 100% 2px no-repeat,
    linear-gradient(#cbd5e1, #cbd5e1) 0 12px / 78% 2px no-repeat,
    linear-gradient(#cbd5e1, #cbd5e1) 0 24px / 58% 2px no-repeat;
  opacity: .75;
}
.portal-course-cover span {
  position: relative; z-index: 2;
  padding: 4px 9px; border-radius: 4px;
  color: #fff; background: var(--course-accent, var(--portal-green));
  font-weight: 800; font-size: 12px;
  box-shadow: 0 8px 18px rgba(15,23,42,.14);
}
.portal-course-body {
  display: flex; flex-direction: column; gap: 9px;
  padding: 13px 14px 16px;
}
.portal-course-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.portal-course-tags span {
  padding: 2px 6px; border-radius: 4px;
  color: var(--portal-green-dark); background: #eafff2;
  font-size: 11px; font-weight: 700;
}
.portal-course-card h3 {
  font-size: 15px; color: #111827;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.portal-course-card p {
  min-height: 42px;
  color: #6b7280; font-size: 12px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.portal-course-meta {
  display: flex; gap: 6px; flex-wrap: wrap;
  color: #64748b; font-size: 12px;
}
.portal-course-meta em {
  font-style: normal;
  padding: 2px 7px; border-radius: 999px;
  background: #f7fafc; border: 1px solid #e5edf4;
}
.portal-course-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding-top: 9px; margin-top: 2px;
  border-top: 1px solid #edf2f7;
  color: #64748b; font-size: 12px;
}
.portal-course-foot strong {
  color: var(--course-accent, var(--portal-green));
  font-family: var(--font-mono); font-size: 15px;
}
.portal-course-foot i {
  color: var(--course-accent, var(--portal-green));
  font-style: normal; font-weight: 800;
}
.portal-rank-wrap {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
}
.portal-rank {
  padding: 18px;
  background: linear-gradient(180deg, #fffaf0, #fff);
}
.portal-rank-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.portal-rank-head h2 { color: #f97316; font-size: 18px; }
.portal-rank-head span { color: #f97316; font-size: 12px; font-weight: 800; }
.portal-rank-list {
  display: flex; flex-direction: column; gap: 10px;
}
.portal-rank-list li {
  display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: center;
  color: #374151; font-size: 13px;
}
.portal-rank-list strong { color: #ff4d4f; }

@media (max-width: 1100px) {
  .site-header-inner { gap: 14px; }
  .portal-hero { grid-template-columns: 180px minmax(0, 1fr); }
  .portal-login { display: none; }
  .portal-course-grid,
  .portal-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .site-header-inner {
    height: auto; min-height: 58px;
    flex-wrap: wrap;
    padding: 10px var(--sp-4);
  }
  .site-header .brand-text { display: flex; }
  .site-header .nav-label { display: inline; }
  .site-header .nav {
    order: 3; flex-basis: 100%;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .site-header .nav::-webkit-scrollbar { display: none; }
  .site-header .nav-group { flex: 0 0 auto; }
  .site-header .nav-item { height: 38px; padding: 0 9px; }
  .site-header .search-box { width: 220px; max-width: 42vw; }
  .portal-hero { grid-template-columns: 1fr; }
  .portal-category { display: none; }
  .portal-banner-slide { grid-template-columns: 1fr; padding: 28px 34px; }
  .portal-banner-visual { min-height: 170px; }
  .portal-ai-visual { width: min(100%, 360px); height: 178px; transform: scale(.9); }
  .partner-strip { gap: 18px; overflow-x: auto; }
}
@media (max-width: 560px) {
  .site-header .topbar-actions { width: 100%; }
  .site-header .search-box { display: flex !important; width: 100%; max-width: none; }
  .view { padding: 16px 12px 44px; }
  .portal-home { gap: 14px; }
  .portal-banner { min-height: auto; }
  .portal-banner-slide { min-height: 310px; padding: 26px 18px 58px; }
  .portal-banner h2 { font-size: 25px; }
  .portal-banner p { font-size: 13px; line-height: 1.7; }
  .portal-banner-actions,
  .portal-section-head { align-items: stretch; flex-direction: column; }
  .portal-banner-actions .btn { width: 100%; }
  .portal-banner-visual { display: none; }
  .hero-arrow { width: 38px; height: 38px; margin-top: -19px; }
  .hero-arrow::before { inset: 12px 14px; border-width: 4px; }
  .hero-dots { right: 18px; bottom: 18px; }
  .partner-strip {
    min-height: auto;
    padding: 12px;
    flex-wrap: wrap;
    gap: 8px;
    overflow: visible;
  }
  .partner-strip span { width: 100%; }
  .partner-strip strong {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 12px;
  }
  .portal-tabs { gap: 14px; overflow-x: auto; }
  .portal-live-card { min-height: 96px; }
  .portal-course-cover { height: 96px; }
  .portal-course-grid,
  .portal-live-grid,
  .portal-rank-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .site-header-inner { padding: 10px 12px; }
  .site-header .brand { width: 100%; justify-content: flex-start; }
  .site-header .nav { margin: 0 -4px; }
  .site-header .nav-item { font-size: 12px; padding: 0 8px; }
  .portal-banner h2 { font-size: 22px; }
  .portal-section-head h2 { font-size: 20px; }
}

@media (max-width: 980px) {
  .student-hero,
  .student-course-intro,
  .student-scenario-strip,
  .student-sandbox-intro,
  .student-library-intro {
    grid-template-columns: 1fr;
  }
  .student-task-grid,
  .student-path-grid,
  .student-outcome-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .student-momentum {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .student-home-grid,
  .student-focus-card {
    grid-template-columns: 1fr;
  }
  .student-focus-body {
    padding: 0 20px 20px;
  }
  .student-focus-cover {
    min-height: 180px;
  }
  .student-assist-grid {
    grid-template-columns: 1fr;
  }
  .student-course-kpis,
  .student-sandbox-steps,
  .student-library-kpis {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .student-hero,
  .student-path,
  .student-course-intro,
  .student-scenario-strip,
  .student-sandbox-intro,
  .student-outcome,
  .student-library-intro {
    padding: 16px;
  }
  .student-task-grid,
  .student-path-grid,
  .student-scenario-grid,
  .student-outcome-grid {
    grid-template-columns: 1fr;
  }
  .student-momentum {
    grid-template-columns: 1fr;
  }
  .student-focus-actions .btn {
    width: 100%;
  }
  .student-activity-item {
    grid-template-columns: 42px 1fr;
  }
  .student-activity-item em {
    grid-column: 2;
  }
  .student-section-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .student-hero h2 {
    font-size: 28px;
  }
}

/* ===== Home portal: traditional course-platform layout ===== */
body.is-home .view {
  padding-top: 18px;
  padding-bottom: 0;
}

.portal-home {
  gap: 28px;
}

.home-portal-hero {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 210px;
  gap: 12px;
  min-width: 0;
  align-items: stretch;
}

.home-category-panel,
.home-profile-card,
.home-capability-strip,
.home-weekly-plan,
.home-rank-column,
.home-review-card,
.home-course-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
}

.home-category-panel {
  min-width: 0;
  padding: 12px 10px 10px;
}

.home-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 8px 8px;
  border-bottom: 1px solid #ededed;
}

.home-category-head strong {
  color: #20252d;
  font-size: 14px;
}

.home-category-head span {
  color: #00a84c;
  font-size: 11px;
}

.home-category-row {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-bottom: 1px solid #f2f2f2;
  background: transparent;
  color: #4b5563;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.home-category-row:last-child { border-bottom: 0; }
.home-category-row:hover { color: #00a84c; background: #f1fff7; }
.home-category-row:focus-visible { outline: 2px solid #00c758; outline-offset: -2px; }

.home-category-row > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-category-row strong {
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-category-row em {
  overflow: hidden;
  color: #9aa1ab;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-category-row i {
  flex: none;
  padding: 1px 4px;
  border-radius: 3px;
  background: #fff1e8;
  color: #f97316;
  font-size: 10px;
  font-style: normal;
}

.home-category-row b {
  flex: none;
  color: #b7bdc6;
  font-size: 18px;
  font-weight: 400;
}

.home-portal-hero .portal-banner {
  min-width: 0;
  min-height: 310px;
  border-radius: 6px;
  box-shadow: none;
}

.home-portal-hero .portal-banner-slide {
  min-height: 310px;
  padding: 34px 38px;
}

.home-portal-hero .portal-banner h2 {
  max-width: 440px;
  font-size: 30px;
  line-height: 1.2;
}

.home-portal-hero .portal-banner p {
  max-width: 430px;
  font-size: 13px;
  line-height: 1.75;
}

.home-profile-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 16px;
  text-align: center;
}

.home-profile-avatar {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border: 7px solid #eff2f5;
  border-radius: 50%;
  background: #dfe5eb;
  color: #6b7280;
  font-size: 22px;
  font-weight: 800;
}

.home-profile-kicker,
.home-plan-label {
  color: #00a84c;
  font-size: 11px;
  font-weight: 700;
}

.home-profile-card h3 {
  margin: 5px 0 4px;
  color: #20252d;
  font-size: 15px;
}

.home-profile-card > p {
  width: 100%;
  overflow: hidden;
  margin: 0 0 12px;
  color: #77808d;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-profile-progress,
.home-plan-meter {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f3;
}

.home-profile-progress span,
.home-plan-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #00c758;
}

.home-profile-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin: 7px 0 14px;
  color: #8b93a0;
  font-size: 11px;
}

.home-profile-meta strong { color: #00a84c; }
.home-profile-card > .btn { width: 100%; min-height: 34px; }

.home-profile-links {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 9px;
}

.home-profile-links button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: #697180;
  font-size: 11px;
  cursor: pointer;
}

.home-profile-links button + button { border-left: 1px solid #eceff2; }
.home-profile-links button:hover { color: #00a84c; }

.home-capability-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 68px;
  overflow: hidden;
}

.home-capability-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid #ececec;
  background: transparent;
  color: #28313d;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.home-capability-item:last-child { border-right: 0; }
.home-capability-item:hover { background: #f3fff8; }

.home-capability-icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9fff2;
  color: #00a84c;
}

.home-capability-icon svg { width: 17px; height: 17px; }

.home-capability-item > span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.home-capability-item strong {
  overflow: hidden;
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-capability-item em {
  overflow: hidden;
  color: #949ba5;
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.home-schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.home-schedule-grid .portal-live-card {
  min-height: 116px;
  border-radius: 6px;
  box-shadow: none;
}

.home-weekly-plan {
  min-width: 0;
  padding: 20px 22px;
  background: #eff9ff;
  border-color: #d7ebf8;
}

.home-weekly-plan h3 {
  margin: 6px 0;
  color: #233143;
  font-size: 18px;
}

.home-weekly-plan > p {
  margin: 0 0 14px;
  color: #6d7a89;
  font-size: 12px;
  line-height: 1.7;
}

.home-plan-steps {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin: 12px 0 16px;
}

.home-plan-steps span {
  position: relative;
  padding-left: 16px;
  color: #718093;
  font-size: 11px;
}

.home-plan-steps span::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 8px;
  height: 8px;
  border: 1px solid #aeb9c6;
  border-radius: 50%;
  background: #fff;
}

.home-plan-steps span.is-done { color: #00a84c; }
.home-plan-steps span.is-done::before { border-color: #00c758; background: #00c758; }

.home-course-row,
.home-featured-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.home-course-card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  color: #26303b;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(24, 34, 48, .04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.home-course-card:hover {
  transform: translateY(-3px);
  border-color: #cfd8e3;
  box-shadow: 0 10px 24px rgba(24, 34, 48, .11);
}

.home-course-card:focus-visible { outline: 2px solid #00c758; outline-offset: 2px; }

/* ===== Campus polish: restrained light and motion ===== */
.site-header {
  isolation: isolate;
}
.site-header::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,199,88,.42), rgba(47,128,237,.28), transparent);
  opacity: .8;
  transform-origin: center;
  animation: headerSignal 8s ease-in-out infinite;
  pointer-events: none;
}
.site-header .brand-mark {
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.site-header .brand:hover .brand-mark {
  transform: translateY(-1px) rotate(-2deg);
  box-shadow: 0 8px 18px rgba(0,168,76,.18), 0 0 0 4px rgba(0,199,88,.07);
}
.site-header .nav-item::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 9px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--portal-green), #2f80ed);
  transition: left 220ms ease, right 220ms ease, opacity 220ms ease;
  opacity: 0;
}
.site-header .nav-item:hover::after,
.site-header .nav-item.is-active::after {
  left: 20%;
  right: 20%;
  opacity: 1;
}
.portal-home {
  position: relative;
}
.portal-home::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 12%;
  width: 76%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,199,88,.28), rgba(47,128,237,.24), transparent);
  pointer-events: none;
}
.section-tick {
  box-shadow: 0 0 0 rgba(0,199,88,0);
  animation: sectionTickPulse 5.5s ease-in-out infinite;
}
.card::after {
  content: "";
  position: absolute;
  left: 14%;
  right: 14%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent, var(--portal-green)), transparent);
  opacity: 0;
  transform: scaleX(.45);
  transition: transform 240ms ease, opacity 240ms ease;
  pointer-events: none;
}
.card:hover::after,
.card:focus-within::after {
  opacity: .82;
  transform: scaleX(1);
}
.portal-banner-slide::after {
  content: "";
  position: absolute;
  top: -34%;
  left: -18%;
  width: 9%;
  height: 168%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-18deg);
  animation: bannerLightSweep 9s ease-in-out infinite;
  pointer-events: none;
}
.portal-live-card,
.portal-course-card,
.home-weekly-plan,
.home-review-card,
.home-rank-column {
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease, background-color 220ms ease;
}
.portal-live-card:hover,
.portal-course-card:hover,
.home-weekly-plan:hover,
.home-review-card:hover,
.home-rank-column:hover {
  box-shadow: 0 12px 26px rgba(24,34,48,.08), 0 0 0 1px rgba(0,199,88,.08);
}
.home-capability-item {
  position: relative;
  overflow: hidden;
}
.home-capability-item::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--portal-green), transparent);
  transform: scaleX(.2);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}
.home-capability-item:hover::after {
  transform: scaleX(1);
  opacity: .8;
}
@keyframes headerSignal {
  0%, 100% { transform: scaleX(.72); opacity: .38; }
  50% { transform: scaleX(1); opacity: .86; }
}
@keyframes sectionTickPulse {
  0%, 100% { opacity: .72; box-shadow: 0 0 0 rgba(0,199,88,0); }
  50% { opacity: 1; box-shadow: 0 0 12px rgba(0,199,88,.16); }
}
@keyframes bannerLightSweep {
  0%, 56% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  66% { opacity: .9; }
  100% { transform: translateX(1380%) skewX(-18deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header::after,
  .portal-banner-slide::after,
  .section-tick {
    animation: none;
    box-shadow: none;
  }
}

.home-course-cover {
  position: relative;
  height: 118px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 18px;
  color: var(--cover-ink, #174267);
  background: var(--cover-bg, #dff2ff);
}

.home-course-cover::before,
.home-course-cover::after,
.home-course-art::before,
.home-course-art::after {
  content: "";
  position: absolute;
}

.home-course-cover::before {
  right: -28px;
  bottom: -44px;
  width: 130px;
  height: 130px;
  border: 18px solid var(--cover-accent, #2f80ed);
  border-radius: 50%;
  opacity: .28;
}

.home-course-cover::after {
  right: 22px;
  top: 24px;
  width: 46px;
  height: 46px;
  border: 10px solid rgba(255,255,255,.72);
  transform: rotate(18deg);
}

.home-course-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 3px;
  background: rgba(255,255,255,.9);
  color: var(--cover-accent, #2f80ed);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.home-course-cover > strong {
  position: relative;
  z-index: 2;
  max-width: 72%;
  margin-top: 28px;
  font-size: 25px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.home-course-art {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-course-art::before {
  right: 18px;
  bottom: 17px;
  width: 72px;
  height: 6px;
  border-radius: 99px;
  background: var(--cover-accent, #2f80ed);
  box-shadow: 0 -14px 0 rgba(255,255,255,.62), 0 -28px 0 rgba(255,255,255,.35);
  transform: rotate(-8deg);
}

.home-course-art::after {
  left: 18px;
  bottom: 14px;
  width: 30px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,.72);
  box-shadow: 38px 0 0 rgba(255,255,255,.44);
}

.tone-1 { --cover-bg: #dff3ff; --cover-ink: #174267; --cover-accent: #2f80ed; }
.tone-2 { --cover-bg: #dff8e9; --cover-ink: #145b39; --cover-accent: #00a84c; }
.tone-3 { --cover-bg: #fff0e4; --cover-ink: #7a3b1d; --cover-accent: #f97316; }
.tone-4 { --cover-bg: #fff7cf; --cover-ink: #66520d; --cover-accent: #e0a800; }
.tone-5 { --cover-bg: #e9e8ff; --cover-ink: #3f3d77; --cover-accent: #6d63d8; }
.tone-6 { --cover-bg: #dff8f5; --cover-ink: #155a55; --cover-accent: #14a89a; }

.home-course-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 11px;
}

.home-course-tags {
  display: flex;
  gap: 5px;
  min-height: 20px;
}

.home-course-tags i {
  padding: 2px 5px;
  border-radius: 3px;
  background: #effbf4;
  color: #00a84c;
  font-size: 9px;
  font-style: normal;
}

.home-course-card h3 {
  min-height: 40px;
  margin: 6px 0 4px;
  color: #27313d;
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-course-card p {
  min-height: 48px;
  margin: 0;
  color: #818997;
  font-size: 10px;
  line-height: 1.6;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.home-course-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  color: #98a0aa;
  font-size: 9px;
}

.home-course-foot em { font-style: normal; }
.home-course-foot strong { color: #00a84c; font-weight: 600; }

.home-rank-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.home-rank-column { padding: 14px 16px 10px; }

.home-rank-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #ededed;
}

.home-rank-title h3 { margin: 0; color: #f97316; font-size: 16px; }
.home-rank-title span { color: #d1d5db; font-size: 11px; font-weight: 700; }
.home-rank-column ol { margin: 0; padding: 0; list-style: none; }

.home-rank-column li {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 55px;
  border-bottom: 1px solid #f2f2f2;
}

.home-rank-column li:last-child { border-bottom: 0; }
.home-rank-column li > strong { color: #ff4d4f; font-size: 14px; }

.home-rank-thumb {
  width: 54px;
  height: 36px;
  border-radius: 3px;
  background: var(--cover-bg, #dff2ff);
  box-shadow: inset -14px -10px 0 var(--cover-accent, #2f80ed);
}

.home-rank-column li p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #3a4350;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-rank-column li em {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #a2a8b1;
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.home-review-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-review-card {
  min-width: 0;
  padding: 16px;
}

.home-review-head {
  display: flex;
  align-items: center;
  gap: 9px;
}

.home-review-head > span {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e9fff2;
  color: #00a84c;
  font-weight: 800;
}

.home-review-head p {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.home-review-head strong { color: #313b47; font-size: 12px; }
.home-review-head em { color: #00a84c; font-size: 9px; font-style: normal; }

.home-review-card blockquote {
  margin: 12px 0 0;
  color: #5f6875;
  font-size: 11px;
  line-height: 1.75;
}

.home-footer {
  width: 100vw;
  margin-top: 16px;
  margin-left: calc(50% - 50vw);
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 24px 48px;
  padding: 34px max(24px, calc((100vw - var(--content-max)) / 2));
  background: #242628;
  color: #d8dde3;
}

.home-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-footer-brand .brand-mark { width: 36px; height: 36px; }
.home-footer-brand strong { display: block; color: #fff; font-size: 20px; }
.home-footer-brand p { margin: 3px 0 0; color: #9ca3ad; font-size: 11px; }

.home-footer-links {
  display: flex;
  gap: 8px 24px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-footer-links button {
  border: 0;
  background: transparent;
  color: #cbd1d8;
  font-size: 11px;
  cursor: pointer;
}

.home-footer-links button:hover { color: #37d97e; }

.home-footer-note {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid #36393d;
  color: #858d97;
  font-size: 10px;
}

@media (max-width: 1100px) {
  .home-portal-hero { grid-template-columns: 180px minmax(0, 1fr); }
  .home-profile-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr 180px;
    grid-template-rows: auto auto;
    gap: 5px 16px;
    text-align: left;
  }
  .home-profile-avatar { grid-row: 1 / 3; margin: 0; }
  .home-profile-kicker { align-self: end; }
  .home-profile-card h3 { grid-column: 2; margin: 0; }
  .home-profile-card > p,
  .home-profile-progress,
  .home-profile-meta,
  .home-profile-links { display: none; }
  .home-profile-card > .btn { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .home-capability-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-capability-item:nth-child(3) { border-right: 0; }
  .home-capability-item:nth-child(-n + 3) { border-bottom: 1px solid #ececec; }
  .home-course-row,
  .home-featured-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-review-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .home-portal-hero { grid-template-columns: 1fr; }
  .home-category-panel { display: none; }
  .home-portal-hero .portal-banner-slide { padding: 30px 34px; }
  .home-schedule-layout { grid-template-columns: 1fr; }
  .home-weekly-plan { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; align-items: center; }
  .home-weekly-plan > p,
  .home-plan-meter,
  .home-plan-steps { grid-column: 1; }
  .home-weekly-plan > .btn { grid-column: 2; grid-row: 1 / 5; }
  .home-rank-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body.is-home .view { padding-top: 12px; }
  .portal-home { gap: 20px; }
  .home-portal-hero .portal-banner-slide { min-height: 300px; padding: 24px 18px 54px; }
  .home-profile-card {
    grid-template-columns: 52px 1fr;
    padding: 14px;
  }
  .home-profile-avatar { width: 52px; height: 52px; border-width: 5px; font-size: 18px; }
  .home-profile-card > .btn { grid-column: 1 / -1; grid-row: auto; margin-top: 8px; }
  .home-capability-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-capability-item:nth-child(3) { border-right: 1px solid #ececec; }
  .home-capability-item:nth-child(2n) { border-right: 0; }
  .home-capability-item:nth-child(-n + 4) { border-bottom: 1px solid #ececec; }
  .home-schedule-grid,
  .home-course-row,
  .home-featured-grid,
  .home-review-grid { grid-template-columns: 1fr; }
  .home-weekly-plan { display: block; }
  .home-weekly-plan > .btn { width: 100%; }
  .home-course-card { display: grid; grid-template-columns: 132px minmax(0, 1fr); }
  .home-course-cover { height: 100%; min-height: 150px; padding: 12px; }
  .home-course-cover > strong { font-size: 18px; }
  .home-course-card h3 { min-height: auto; }
  .home-course-card p { min-height: 32px; -webkit-line-clamp: 2; }
  .home-footer { grid-template-columns: 1fr; padding-top: 28px; padding-bottom: 28px; }
  .home-footer-links { justify-content: flex-start; }
}

@media (max-width: 420px) {
  .home-capability-item { padding: 10px; }
  .home-capability-icon { width: 30px; height: 30px; }
  .home-course-card { grid-template-columns: 112px minmax(0, 1fr); }
  .home-course-cover { min-height: 148px; }
  .home-course-copy { padding: 10px; }
  .home-course-tags { display: none; }
  .home-rank-column { padding: 12px; }
}

/* ===== Account entry and lightweight student account flow ===== */
.account-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: none;
}
.site-header .btn-auth {
  min-width: 52px;
  padding: 0 13px;
}
.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  max-width: 136px;
  padding: 0 10px 0 5px;
  color: #253858;
  background: #fff;
  border: 1px solid #ccebd9;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.account-chip:hover {
  color: var(--portal-green-dark);
  border-color: var(--portal-green);
  background: #f1fff7;
}
.account-chip:focus-visible {
  outline: 2px solid var(--portal-green);
  outline-offset: 2px;
}
.account-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  color: #fff;
  background: linear-gradient(135deg, var(--portal-green), #2f80ed);
  border-radius: 50%;
  font-size: 11px;
}
.account-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-modal {
  max-width: 520px;
  padding: 28px;
  border-radius: 8px;
}
.account-modal-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.account-modal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 42px;
}
.account-modal-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: none;
}
.account-modal-brand strong {
  display: block;
  color: #172b4d;
  font-size: 20px;
  line-height: 1.35;
}
.account-modal-brand p {
  margin-top: 3px;
  color: var(--text-3);
  font-size: 12px;
}
.account-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  background: #f2f5f8;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.account-mode-tab {
  height: 36px;
  color: #64748b;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}
.account-mode-tab:hover { color: var(--portal-green-dark); }
.account-mode-tab.is-active {
  color: var(--portal-green-dark);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.10);
}
.account-mode-tab:focus-visible {
  outline: 2px solid var(--portal-green);
  outline-offset: -2px;
}
.account-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.account-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.account-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}
.account-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--text-1);
  background: #fbfdff;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  outline: none;
  font: inherit;
  font-weight: 500;
}
.account-field input::placeholder { color: var(--text-4); }
.account-field input:focus {
  border-color: var(--portal-green);
  box-shadow: 0 0 0 3px rgba(0,199,88,.10);
}
.account-agreement {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
}
.account-agreement input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--portal-green);
}
.account-form-message {
  display: none;
  margin: -3px 0;
  padding: 8px 10px;
  color: #b42318;
  background: #fff3f2;
  border: 1px solid #ffd5d2;
  border-radius: 6px;
  font-size: 12px;
}
.account-form-message.is-show { display: block; }
.account-submit { width: 100%; height: 42px; }
.account-submit:disabled { cursor: wait; opacity: .68; }
.account-password-tip {
  color: var(--text-4);
  font-size: 11px;
  text-align: center;
}
.account-profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-right: 40px;
}
.account-profile-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  flex: none;
  color: #fff;
  background: linear-gradient(135deg, var(--portal-green), #2f80ed);
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
}
.account-profile-head span { color: var(--portal-green-dark); font-size: 11px; font-weight: 800; }
.account-profile-head h2 { margin: 1px 0 0; color: #172b4d; font-size: 22px; }
.account-profile-head p { color: var(--text-3); font-size: 12px; }
.account-profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.account-profile-note {
  padding: 10px 12px;
  color: var(--text-3);
  background: #f8fafc;
  border: 1px solid var(--border-1);
  border-radius: 6px;
  font-size: 12px;
}

@media (max-width: 1100px) {
  .site-header .search-box { width: 190px; }
  .site-header .btn-auth { min-width: 48px; padding: 0 10px; }
}

@media (max-width: 620px) {
  .site-header .topbar-actions {
    order: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    gap: 8px;
  }
  .site-header .search-box {
    width: 100%;
    max-width: none;
  }
  .account-actions { gap: 6px; }
  .site-header .btn-auth { height: 32px; min-width: 48px; padding: 0 9px; }
  .account-field-grid { grid-template-columns: 1fr; }
  .account-modal { padding: 22px 18px; }
}

@media (max-width: 420px) {
  .site-header .brand { width: 100%; }
  .account-chip { max-width: 92px; }
  .account-modal-brand strong { font-size: 18px; }
  .account-modal-brand p { display: none; }
  .account-profile-grid { grid-template-columns: 1fr; }
  .account-modal .modal-actions { flex-direction: column-reverse; }
  .account-modal .modal-actions .btn { width: 100%; }
}

/* ===== AI workspace: focused single-column layout ===== */
.model-workbench .demo-main-panel {
  padding: 20px;
  border-color: #d7e7ef;
  box-shadow: 0 10px 28px rgba(15,23,42,.05);
}
.model-workbench-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.model-bypass-button { flex: none; }
.model-active-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 9px 12px;
  color: #526174;
  background: #f7fbfd;
  border: 1px solid #e2edf2;
  border-radius: 6px;
  font-size: 12px;
}
.model-active-line strong { color: #172b4d; font-size: 13px; }
.model-active-line em {
  padding: 3px 7px;
  color: #007d45;
  background: #eafff2;
  border-radius: 999px;
  font-style: normal;
  font-weight: 700;
}
.model-workbench .model-choice-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 20px;
}
.model-workbench .model-choice-card { min-height: 142px; }
.model-workbench .demo-input { min-height: 148px; }
.model-workbench .demo-output-panel {
  border-color: #d7e7ef;
  box-shadow: 0 8px 22px rgba(15,23,42,.04);
}

@media (max-width: 560px) {
  .model-workbench-toolbar { flex-direction: column; }
  .model-bypass-button { width: 100%; }
  .model-workbench .demo-main-panel { padding: 15px; }
}

/* ===== Agent exploration and workflow builder ===== */
.student-scenario-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.agent-list {
  max-height: 640px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}
.agent-tab small {
  display: block;
  margin-top: 5px;
  color: var(--portal-green-dark);
  font-size: 11px;
  font-weight: 700;
}
.agent-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  flex: none;
}
.agent-head-actions .status-pill { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-workbench .agent-layout { align-items: stretch; }
.agent-workbench .chat-panel {
  min-height: 640px;
  display: flex;
  flex-direction: column;
  border-color: #dce7ef;
  box-shadow: 0 9px 24px rgba(15,23,42,.05);
}
.agent-workbench .chat-box { flex: 1; max-height: 440px; }
.agent-workbench .chat-input-row { margin-top: 14px; }
.workflow-tabs { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.workflow-builder-panel { padding: 18px; border-color: #e7d9b7; box-shadow: 0 8px 22px rgba(15,23,42,.04); }
.workflow-builder-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.workflow-workbench .workflow-runner,
.workflow-workbench .workflow-result-panel {
  border-color: #dce7ef;
  box-shadow: 0 8px 22px rgba(15,23,42,.04);
}
.workflow-workbench .workflow-result-panel { min-height: 220px; }
.workflow-source-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, auto);
  align-items: center;
  gap: 12px 22px;
  padding: 18px;
  border-color: #d7e7df;
  background: linear-gradient(135deg, #f7fffa, #f7fbff);
  box-shadow: 0 8px 22px rgba(15,23,42,.04);
}
.workflow-source-panel h3 { margin: 5px 0 4px; color: var(--text-1); font-size: 18px; }
.workflow-source-panel p { margin: 0; color: var(--text-3); font-size: 13px; line-height: 1.65; }
.workflow-source-actions { display: grid; grid-template-columns: minmax(210px, 1fr) auto; gap: 8px; }
.workflow-source-actions select {
  min-width: 0;
  height: 40px;
  padding: 0 34px 0 11px;
  color: var(--text-1);
  background: #fff;
  border: 1px solid #cfdce5;
  border-radius: 6px;
  outline: none;
  font: inherit;
}
.workflow-source-actions select:focus { border-color: var(--portal-green); box-shadow: 0 0 0 3px rgba(0,199,88,.12); }
.workflow-source-current {
  grid-column: 1 / -1;
  padding-top: 10px;
  border-top: 1px solid rgba(148,163,184,.18);
  color: var(--portal-green-dark);
  font-size: 12px;
  font-weight: 800;
}
.workflow-runtime-grid { display: grid; grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr); gap: 16px; }
.workflow-runtime-grid > div { min-width: 0; }
.workflow-runtime-panel .demo-input { min-height: 280px; }
.workflow-code-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.workflow-code-head span { color: var(--text-4); font-size: 11px; text-align: right; }
.workflow-code-editor {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 14px;
  color: #d9fbe7;
  background: #13231d;
  border: 1px solid #29463a;
  border-radius: 6px;
  outline: none;
  font-size: 12px;
  line-height: 1.65;
  tab-size: 2;
}
.workflow-code-editor:focus { border-color: #28b779; box-shadow: 0 0 0 3px rgba(40,183,121,.14); }
.workflow-code-editor:disabled,
.workflow-runtime-panel .demo-input:disabled { opacity: .7; cursor: wait; }
.workflow-run-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px 12px;
  color: #166534;
  background: #effcf4;
  border: 1px solid #c7efd7;
  border-radius: 6px;
}
.workflow-run-summary strong { font-size: 14px; }
.workflow-run-summary span { color: #64748b; font-family: var(--font-mono); font-size: 12px; }
.workflow-execution-list { display: flex; flex-direction: column; gap: 9px; }
.workflow-execution-node {
  padding: 12px;
  border: 1px solid #e1e8ed;
  border-left: 3px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}
.workflow-execution-node[data-execution-status="running"] { border-left-color: #2f80ed; background: #f5f9ff; }
.workflow-execution-node[data-execution-status="done"] { border-left-color: #22a968; }
.workflow-execution-node[data-execution-status="warning"] { border-left-color: #e9a300; background: #fffdf5; }
.workflow-execution-node[data-execution-status="error"] { border-left-color: #e05252; background: #fff7f7; }
.workflow-execution-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.workflow-execution-head strong { color: var(--text-1); font-size: 13px; }
.workflow-execution-head em {
  padding: 3px 7px;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.workflow-execution-node[data-execution-status="running"] .workflow-execution-head em { color: #1d4ed8; background: #dbeafe; }
.workflow-execution-node[data-execution-status="done"] .workflow-execution-head em { color: #166534; background: #dcfce7; }
.workflow-execution-node[data-execution-status="warning"] .workflow-execution-head em { color: #92400e; background: #fef3c7; }
.workflow-execution-node[data-execution-status="error"] .workflow-execution-head em { color: #991b1b; background: #fee2e2; }
.workflow-execution-node > p { margin: 8px 0 0 38px; color: var(--text-4); font-size: 12px; }
.workflow-execution-node pre {
  max-height: 260px;
  margin: 9px 0 0 38px;
  padding: 10px 11px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #edf1f4;
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.65;
}
.workflow-palette {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: #fffaf0;
  border: 1px solid #f1e4c5;
  border-radius: 6px;
}
.workflow-palette > span { color: #8a6513; font-size: 12px; font-weight: 800; margin-right: 2px; }
.workflow-palette-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  color: #5f4b1b;
  background: #fff;
  border: 1px solid #ead8ac;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.workflow-palette-item:hover { transform: translateY(-1px); background: #fffdf6; border-color: #d3af5f; }
.workflow-palette-item i {
  padding: 2px 5px;
  color: #8a6513;
  background: #fff1c9;
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
}
.workflow-template-tip {
  margin-bottom: 14px;
  padding: 10px 12px;
  color: var(--text-3);
  background: #f8fafc;
  border: 1px solid var(--border-1);
  border-radius: 6px;
  font-size: 12px;
}
.workflow-node-list { display: flex; flex-direction: column; gap: 8px; }
.workflow-node-card {
  display: grid;
  grid-template-columns: 34px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid #e9e5da;
  border-radius: 6px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.workflow-node-card:hover { border-color: #d8bd7a; box-shadow: 0 5px 14px rgba(132,101,19,.08); transform: translateY(-1px); }
.workflow-node-index { color: #9b7b2c; font-size: 12px; font-weight: 800; }
.workflow-node-type {
  display: inline-flex;
  justify-content: center;
  min-width: 48px;
  padding: 4px 7px;
  color: #526174;
  background: #f1f5f9;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
}
.workflow-node-type-agent { color: #6d28d9; background: #f3e8ff; }
.workflow-node-type-model { color: #0f766e; background: #ccfbf1; }
.workflow-node-type-tool { color: #0369a1; background: #e0f2fe; }
.workflow-node-type-sandbox { color: #166534; background: #dcfce7; }
.workflow-node-type-output { color: #a16207; background: #fef3c7; }
.workflow-node-label,
.workflow-node-readonly { min-width: 0; color: var(--text-1); font-size: 13px; font-weight: 700; }
.workflow-node-label {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  background: #fbfdff;
  border: 1px solid var(--border-1);
  border-radius: 5px;
  outline: none;
  font: inherit;
}
.workflow-node-label:focus { border-color: #d3af5f; box-shadow: 0 0 0 3px rgba(211,175,95,.16); }
.workflow-node-controls { display: flex; gap: 4px; }
.workflow-node-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid var(--border-1);
  border-radius: 5px;
  font-size: 15px;
}
.workflow-node-controls button:hover { color: #8a6513; background: #fffaf0; border-color: #d8bd7a; }

@media (max-width: 980px) {
  .student-scenario-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-head-actions { justify-content: flex-start; }
  .agent-workbench .chat-panel { min-height: 560px; }
  .agent-list { max-height: none; }
  .workflow-source-panel,
  .workflow-runtime-grid { grid-template-columns: 1fr; }
  .workflow-source-actions { grid-template-columns: minmax(0, 1fr) auto; }
}

@media (max-width: 620px) {
  .student-scenario-grid { grid-template-columns: 1fr; }
  .workflow-builder-panel { padding: 14px; }
  .workflow-builder-actions { width: 100%; justify-content: stretch; }
  .workflow-builder-actions .btn { flex: 1; }
  .workflow-node-card { grid-template-columns: 28px auto minmax(0, 1fr); gap: 7px; }
  .workflow-node-controls { grid-column: 3; justify-content: flex-end; }
  .workflow-node-readonly { grid-column: 3; }
  .workflow-node-label { grid-column: 3; }
  .agent-head-actions { width: 100%; justify-content: stretch; }
  .agent-head-actions .status-pill { max-width: none; }
  .agent-head-actions .btn { flex: 1; }
  .agent-workbench .chat-panel { min-height: 0; padding: 14px; }
  .agent-workbench .chat-box { min-height: 240px; max-height: 360px; }
  .agent-workbench .chat-input-row .btn { width: 100%; }
  .workflow-palette { align-items: stretch; }
  .workflow-palette > span { width: 100%; }
  .workflow-palette-item { flex: 1 1 calc(50% - 8px); justify-content: flex-start; }
  .workflow-source-actions { grid-template-columns: 1fr; }
  .workflow-source-actions .btn { width: 100%; }
  .workflow-runtime-panel .demo-panel-head { display: grid; grid-template-columns: 1fr; }
  .workflow-runtime-panel .demo-panel-head .btn { width: 100%; }
  .workflow-runtime-panel .demo-input,
  .workflow-code-editor { min-height: 220px; }
  .workflow-code-head { display: block; }
  .workflow-code-head span { display: block; margin: -3px 0 7px; text-align: left; }
  .workflow-execution-node > p,
  .workflow-execution-node pre { margin-left: 0; }
}
