@font-face {
  font-family: 'MaShanZheng';
  src: url('../fonts/MaShanZheng-subset.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'InstrumentSans';
  src: url('../fonts/InstrumentSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'InstrumentSans';
  src: url('../fonts/InstrumentSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'InstrumentSerif';
  src: url('../fonts/InstrumentSerif-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'InstrumentSerif';
  src: url('../fonts/InstrumentSerif-Italic.ttf') format('truetype');
  font-style: italic;
  font-display: swap;
}


/* ==========================================================================
   Theme tokens — 3 套主题，通过 <html data-theme="..."> 切换（theme.js）。
   配色均取自上海电气 logo 的蓝 / 绿双色：
     classic · 经典米白（默认）— 暖米白底，蓝主绿辅
     ocean   · 澄净蓝       — 冷白蓝底，深蓝主色
     forest  · 青翠绿       — 淡青绿底，绿主蓝辅
   ========================================================================== */
:root,
:root[data-theme="classic"] {
  /* Warm cream background */
  --bg: #f5f3ee;
  --bg2: #ecebe3;
  --surface: #faf9f5;
  --ink: #1a1a1a;
  --ink2: #2a2a2a;
  --muted: #6b6b66;
  --muted2: #9a9a93;
  --rule: #d9d6cc;
  --rule-soft: #e4e1d8;
  /* Brand: blue is primary, green is interactive/accent (mirrors logo halves) */
  --brand: #1565c0;                    /* 上海电气 blue */
  --brand-ink: #0d4a96;
  --brand-soft: #dbe9f8;
  --accent: #00a651;                   /* 上海电气 green */
  --accent-soft: #d6f1e2;
  --accent-ink: #007a3c;
  --warn: #e58a2a;
  --blue: #3a6ed8;
  --purple: #8b5cf6;
  --pink: #d96aa6;
  /* Derived tokens — RGB triplets for rgba() composition + component colors */
  --bg-rgb: 245, 243, 238;
  --brand-rgb: 21, 101, 192;
  --accent-rgb: 0, 166, 81;
  --danger-rgb: 220, 38, 38;
  --card-border: #e5e3d8;
  --illu-bg: #f3efe5;
  --illu-bg-featured: #e8eef7;
  --fav: #e5a32b;
  --fav-soft: #fff8eb;
}

:root[data-theme="ocean"] {
  /* Cool paper white with a blue cast; deep brand blue leads */
  --bg: #f0f5fa;
  --bg2: #e2ebf4;
  --surface: #fafcfe;
  --ink: #152630;
  --ink2: #2a3a45;
  --muted: #5b6d79;
  --muted2: #93a4af;
  --rule: #cfdce7;
  --rule-soft: #dde7f0;
  --brand: #0d4a96;
  --brand-ink: #0a3a79;
  --brand-soft: #d7e6f6;
  --accent: #00a651;
  --accent-soft: #d3efe0;
  --accent-ink: #007a3c;
  --warn: #e58a2a;
  --blue: #3a6ed8;
  --purple: #8b5cf6;
  --pink: #d96aa6;
  --bg-rgb: 240, 245, 250;
  --brand-rgb: 13, 74, 150;
  --accent-rgb: 0, 166, 81;
  --danger-rgb: 220, 38, 38;
  --card-border: #d6e1ea;
  --illu-bg: #e9f0f6;
  --illu-bg-featured: #dce9f5;
  --fav: #e5a32b;
  --fav-soft: #fdf3e0;
}

:root[data-theme="forest"] {
  /* Light mint; green takes the primary role, blue becomes the accent */
  --bg: #eff6f1;
  --bg2: #e1eee5;
  --surface: #f9fcfa;
  --ink: #17271d;
  --ink2: #2a3a30;
  --muted: #5c6f62;
  --muted2: #94a399;
  --rule: #d1ded5;
  --rule-soft: #dfe9e2;
  --brand: #00a651;
  --brand-ink: #007a3c;
  --brand-soft: #d6f1e2;
  --accent: #1565c0;
  --accent-soft: #dbe9f8;
  --accent-ink: #0d4a96;
  --warn: #e58a2a;
  --blue: #3a6ed8;
  --purple: #8b5cf6;
  --pink: #d96aa6;
  --bg-rgb: 239, 246, 241;
  --brand-rgb: 0, 166, 81;
  --accent-rgb: 21, 101, 192;
  --danger-rgb: 220, 38, 38;
  --card-border: #d7e3da;
  --illu-bg: #e9f2ec;
  --illu-bg-featured: #deeee4;
  --fav: #e5a32b;
  --fav-soft: #fbf3e2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'InstrumentSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Gentle cross-fade when switching themes */
  transition: background .3s ease, color .3s ease;
  /* Hero canvas bleeds to 100vw — clip the resulting horizontal overflow */
  overflow-x: clip;
}

/* ---------- Top marquee ---------- */
.ticker {
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  overflow: hidden;
  font-size: 13px;
  color: var(--muted);
}
.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  padding: 9px 0;
  animation: ticker 45s linear infinite;
  will-change: transform;
}
.ticker-track span { padding: 0 22px; }
.ticker-track b { color: var(--ink); font-weight: 700; }
.ticker-track .dot { color: var(--muted2); margin: 0 4px; }
.ticker-track .ok { color: var(--accent-ink); }
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  border-bottom: 1px solid transparent;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}
.nav { display: flex; flex: 0 0 auto; gap: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.nav-tab {
  position: relative;
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s ease, background .15s ease;
}
.nav-tab:hover { color: var(--ink); background: var(--bg2); }
.nav-tab.active { color: var(--ink); font-weight: 700; background: var(--bg2); }
/* No underline — the active tab is identified by bg + bold text only. */
.top-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Theme switcher (top-right) ---------- */
.theme-switch { position: relative; }
.theme-switch-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--surface); color: var(--muted);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.theme-switch-btn:hover { color: var(--ink); border-color: var(--ink); }
.theme-switch-btn[aria-expanded="true"] { color: var(--brand); border-color: var(--brand); }
.theme-switch-btn svg { width: 16px; height: 16px; }
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 176px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, .14);
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.theme-menu.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.theme-option {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none; background: transparent;
  font-family: inherit; font-size: 13px; color: var(--ink);
  text-align: left; border-radius: 7px; cursor: pointer;
  transition: background .12s ease;
}
.theme-option:hover { background: var(--bg2); }
.theme-option:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
/* Mini swatch trio: brand / accent / page-bg of each theme */
.theme-swatches { display: inline-flex; flex: 0 0 auto; }
.theme-swatches i {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .10);
  margin-left: -4px;
}
.theme-swatches i:first-child { margin-left: 0; }
.theme-name { flex: 1; }
.theme-check { width: 14px; height: 14px; flex: 0 0 auto; color: var(--brand); opacity: 0; }
.theme-option.is-active { font-weight: 600; }
.theme-option.is-active .theme-check { opacity: 1; }

.btn {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--bg2); }
.btn.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.btn.primary:hover { background: #000; }
/* Account entry — neutral secondary button (not the primary brand action). */
.btn.admin {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--rule);
  font-weight: 600;
}
.btn.admin:hover {
  background: var(--bg2);
  border-color: var(--ink);
  color: var(--ink);
}
/* Logged-in state: avatar + username inline */
.btn.admin.is-logged-in {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
}
.btn.admin .admin-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Ghost button — outline only, transparent background. */
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
  font-weight: 600;
}
.btn.ghost:hover {
  background: var(--bg2);
  border-color: var(--ink);
}
.btn .arr { font-size: 11px; opacity: .9; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 72px 40px 48px;
  max-width: 1200px;
  margin: 0 auto;
  /* No overflow:hidden — the LineWaves canvas + fade bleed out to full
     viewport width; body overflow-x:clip prevents horizontal scroll. */
}

/* ==========================================================================
   Hero background — LineWaves (WebGL, react-bits 移植)
   Warped flowing line field; mouse raises nearby lines; theme-aware colors.
   Canvas and fade span the full viewport width (left = 容器中线 - 50vw).
   ========================================================================== */

.hero-lines {
  position: absolute;
  top: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  height: 100%;   /* 必须显式高度：canvas 是替换元素，否则按缓冲区固有高度溢出 hero */
  pointer-events: none;
  z-index: 0;
  opacity: .9;
}

/* Soft fade mask:
   1) Radial wash centred on the text block (title + lede) so the LineWaves
      field recedes behind the copy and never competes for readability.
   2) Long multi-stop gradients on all 4 edges blend the field softly into
      the page background — no visible boundary. */
.hero-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  width: 100vw;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 65% 62% at 30% 44%,
      var(--bg)    0%,
      var(--bg)   30%,
      rgba(var(--bg-rgb), .62) 52%,
      transparent 78%
    ),
    linear-gradient(180deg,
      var(--bg) 0%,
      rgba(var(--bg-rgb), .55) 12%,
      transparent 26%,
      transparent 48%,
      rgba(var(--bg-rgb), .78) 68%,
      var(--bg) 84%),
    linear-gradient(90deg,
      var(--bg) 0%,
      rgba(var(--bg-rgb), .5) 8%,
      transparent 22%,
      transparent 78%,
      rgba(var(--bg-rgb), .5) 92%,
      var(--bg) 100%);
}

/* Hero content sits above canvas */
.hero > *:not(.hero-lines):not(.hero-fade) { position: relative; z-index: 2; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  margin-bottom: 22px;
}
.hero-eyebrow .pulse {
  width: 6px; height: 6px; background: var(--accent);
  border-radius: 50%; display: inline-block;
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); }
  70% { box-shadow: 0 0 0 8px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}
/* AI typing cursor — a short horizontal dash that blinks. */
@keyframes ai-blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.ai-cursor {
  display: inline-block;
  width: 10px;
  height: 2px;
  margin-left: 3px;
  background: var(--accent);
  border-radius: 1px;
  /* 下沉到基线下方，像闪烁的下划线 */
  vertical-align: -2px;
  animation: ai-blink 1.05s steps(1, end) infinite;
}
.hero h1 {
  font-family: 'InstrumentSans', sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  max-width: 880px;
  margin-bottom: 18px;
}
.hero h1 em {
  /* 中文强调字：马善政书法体（子集 ~3KB），与无衬线正文形成设计感对比 */
  font-family: 'MaShanZheng', 'Songti SC', 'STSong', serif;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--accent-ink);
}
/* 渐变强调：蓝 → 绿（上海电气 logo 双色），粗体 */
.hero h1 em.grad {
  font-family: inherit;
  font-style: normal;
  font-weight: 700;
  letter-spacing: inherit;
  background: linear-gradient(92deg, var(--brand) 5%, var(--accent) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero .lede {
  color: var(--muted);
  font-size: 17px;
  max-width: 640px;
  margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Search bar ---------- */
.searchbar {
  margin-top: 36px;
  max-width: 720px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 14px 18px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.searchbar svg { flex: 0 0 18px; color: var(--brand); margin-right: 12px; }
.searchbar input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15px; color: var(--ink);
}
.searchbar input::placeholder { color: var(--muted2); }
.searchbar .kbd {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--rule); padding: 2px 7px;
  border-radius: 5px; background: var(--bg);
}

/* ---------- Border glow (React Bits–style) ---------- */
/* Each card uses a CSS conic-gradient that rotates to the pointer position,
   creating a moving spotlight on the border. No SVG path math needed. */
/* ---------- Border glow (simplified & reliable) ---------- */
/* Normal state: clean grey border, no shadow.
   Hover state: green border + soft green shadow + lift up. */
/* `.agent-card` base styles defined in the Agent grid section below
   (merged for clarity). */

/* ---------- Skills & Tools page ---------- */
.page { transition: opacity .25s ease; }
.page.is-hidden { display: none; }

/* Hero */
.skills-hero { margin-bottom: 28px; }
.skills-hero h2 {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}
.count-pill {
  font-family: 'InstrumentSerif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--brand-ink);
  font-size: 0.9em;
}
.skills-hero > p { color: var(--muted); font-size: 14.5px; max-width: 640px; margin-bottom: 24px; }

.skills-search {
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.skills-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .12);
}
.skills-search svg { color: var(--brand); flex: 0 0 18px; }
.skills-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 15px; color: var(--ink);
}
.skills-search input::placeholder { color: var(--muted2); }
.kbd {
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--rule); padding: 2px 7px;
  border-radius: 5px; background: var(--bg);
}

/* Toolbar */
.skills-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin: 28px 0 16px;
  /* Anchor for the absolute-positioned sort dropdown. */
  position: relative;
}
.skills-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg2); border-radius: 10px; }
.skills-tab {
  font-family: inherit; font-size: 14px; font-weight: 500;
  padding: 8px 16px; border: none; background: transparent;
  color: var(--muted); border-radius: 7px; cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.skills-tab:hover { color: var(--ink); }
.skills-tab.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.skills-controls { display: flex; gap: 8px; }
.ctrl-btn {
  font-family: inherit; font-size: 13px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.ctrl-btn:hover { border-color: var(--ink); }
.ctrl-btn svg { width: 14px; height: 14px; color: var(--muted); transition: transform .2s ease; }
.ctrl-btn[aria-expanded="true"] { border-color: var(--ink); }
.ctrl-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ==========================================================================
   Dropdown menu — robust pattern
   ==========================================================================
   - Container has class `is-open` set by JS, NOT the HTML `hidden` attribute
     (avoids the CSS specificity trap that made the menu show on load).
   - Positioned absolutely with the parent `.skills-toolbar` as its anchor.
   - Animated in/out with opacity + translateY. */
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 18px;
  z-index: 50;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, .14);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.dropdown.is-open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background .12s ease;
}
.dropdown-item:hover { background: var(--bg2); }
.dropdown-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.dropdown-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--muted2);
  flex: 0 0 auto;
  transition: background .12s ease, border-color .12s ease;
}
.dropdown-item.is-active { color: var(--ink); font-weight: 600; }
.dropdown-item.is-active .dropdown-dot {
  background: var(--brand);
  border-color: var(--brand);
  box-shadow: inset 0 0 0 2px var(--surface);
}

/* Grid */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .skills-grid { grid-template-columns: 1fr; }
}

/* Skill card */
.skill-card {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  cursor: pointer;
  transition:
    border-color .2s ease,
    box-shadow .25s ease;
}
/* No transform on hover — keeps the card edges perfectly aligned with the grid. */
.skill-card:hover {
  border-color: var(--accent);
  box-shadow:
    0 10px 24px -12px rgba(var(--accent-rgb), .22),
    0 3px 8px rgba(0, 0, 0, .04);
}

/* ==========================================================================
   Modals — Skill Detail + Chat
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.is-open { display: flex; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 14, .42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modal-fade .18s ease both;
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--rule);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .25);
  max-height: calc(100vh - 48px);
  overflow: auto;
  animation: modal-rise .22s cubic-bezier(.2, .8, .2, 1) both;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.modal-close:hover { background: var(--bg2); color: var(--ink); border-color: var(--rule); }
.modal-close svg { width: 16px; height: 16px; }

/* ==========================================================================
   Account Login & Workspace Modal
   ========================================================================== */
.admin-login-panel {
  width: 420px;
  max-width: 100%;
  padding: 32px 32px 26px;
}
.admin-login-head {
  text-align: center;
  margin-bottom: 22px;
}
.admin-login-mark {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.admin-login-mark svg { width: 26px; height: 26px; }
.admin-login-head h3 {
  font-family: 'InstrumentSans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
.admin-login-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-login-form[hidden],
.admin-login-head[hidden],
.admin-register-only[hidden],
.account-actions .btn[hidden] { display: none; }
.admin-login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-login-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink2);
}
.admin-login-label em {
  margin-left: 4px;
  color: var(--muted2);
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
}
.admin-login-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.admin-login-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12);
}
.admin-login-input svg {
  width: 16px; height: 16px;
  color: var(--muted);
  flex: 0 0 auto;
}
.admin-login-input input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 0;
  min-width: 0;
}
.admin-login-input input::placeholder { color: var(--muted2); }
/* Password reveal toggle */
.admin-login-eye {
  border: none;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color .15s ease, background .15s ease;
  flex: 0 0 auto;
}
.admin-login-eye:hover { color: var(--ink); background: var(--bg2); }
.admin-login-eye svg { width: 16px; height: 16px; }
.admin-login-eye .eye-off { display: none; }
.admin-login-eye[aria-pressed="true"] .eye-on  { display: none; }
.admin-login-eye[aria-pressed="true"] .eye-off { display: inline-block; }
.admin-login-error {
  font-size: 12.5px;
  color: var(--accent);
  background: rgba(var(--danger-rgb), 0.06);
  border: 1px solid rgba(var(--danger-rgb), 0.18);
  border-radius: 6px;
  padding: 8px 12px;
  line-height: 1.45;
}
.admin-login-error.is-success-msg {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.22);
}
.admin-login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  margin-top: -2px;
}
.admin-login-remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink2);
  cursor: pointer;
  user-select: none;
}
.admin-login-remember input { accent-color: var(--brand); }
.admin-auth-switch {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.admin-auth-switch:hover { text-decoration: underline; }
.admin-auth-switch:disabled { opacity: .6; cursor: wait; }
.admin-login-submit {
  width: 100%;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  margin-top: 4px;
}
.admin-login-submit svg { width: 14px; height: 14px; }
.admin-login-submit:disabled { opacity: .7; cursor: wait; }
.admin-login-hint {
  text-align: center;
  font-size: 11.5px;
  color: var(--muted2);
  margin: 4px 0 0;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
}
/* Success state when login completes */
.admin-login-panel.is-success .admin-login-head .admin-login-mark {
  background: rgba(var(--accent-rgb), 0.10);
  color: var(--accent);
}
.account-session {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.account-session[hidden] { display: none; }
.account-session-head { margin-bottom: 2px; }
.account-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.account-summary > div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg);
}
.account-summary span,
.account-invite-result > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}
.account-summary strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-members-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.account-members-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
}
.account-members-head span { color: var(--muted); font-size: 12px; }
.account-members {
  display: flex;
  max-height: 168px;
  margin: 0;
  padding: 0;
  overflow: auto;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 8px;
  list-style: none;
}
.account-members li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  color: var(--ink2);
  font-size: 12.5px;
}
.account-members li + li { border-top: 1px solid var(--rule); }
.account-members li.is-muted { color: var(--muted); }
.account-members .member-role {
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg2);
  color: var(--muted);
  font-size: 11px;
}
.account-invite-result {
  position: relative;
  padding: 10px 54px 10px 11px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 8px;
  background: rgba(var(--accent-rgb), 0.06);
}
.account-invite-result[hidden] { display: none; }
.account-invite-result code {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-invite-result button {
  position: absolute;
  top: 50%;
  right: 10px;
  padding: 4px 7px;
  transform: translateY(-50%);
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--surface);
  color: var(--brand);
  cursor: pointer;
}
.account-actions { display: flex; gap: 8px; }
.account-actions .btn { flex: 1 1 auto; justify-content: center; }
@media (max-width: 520px) {
  .account-summary { grid-template-columns: 1fr; }
}

/* ==========================================================================
   CAD Knowledge Assistant · Detail Modal
   ========================================================================== */
.cad-detail-panel {
  width: 720px;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  padding: 32px 36px 28px;
  display: flex;
  flex-direction: column;
}
.cad-detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}
.cad-detail-mark {
  width: 48px; height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cad-detail-mark svg { width: 24px; height: 24px; }
.cad-detail-head-text { flex: 1 1 auto; min-width: 0; }
.cad-detail-head-text h3 {
  font-family: 'InstrumentSans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}
.cad-detail-head-text p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.cad-detail-body {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  /* Reserve room so scrollbar sits inside */
  padding-right: 4px;
}
/* Section */
.cad-section { margin-bottom: 26px; }
.cad-section:last-child { margin-bottom: 0; }
.cad-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'InstrumentSans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}
.cad-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 20px;
  border-radius: 5px;
  background: var(--bg2);
  color: var(--ink2);
  font-size: 11px;
  font-weight: 700;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.5px;
}
.cad-section-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink2);
  margin: 0 0 12px;
}
.cad-section-list {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--ink2);
}
.cad-section-list li { margin-bottom: 6px; }
.cad-section-list li::marker { color: var(--muted); font-weight: 600; }
/* inline code in paragraph */
.cad-inline-code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg2);
  color: var(--ink);
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  border: 1px solid var(--rule);
}
/* Table */
.cad-table-wrap {
  margin: 8px 0 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.cad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.cad-table thead th {
  text-align: left;
  background: var(--bg2);
  color: var(--ink);
  font-weight: 600;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
}
.cad-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink2);
  vertical-align: top;
  line-height: 1.5;
}
.cad-table tbody tr:last-child td { border-bottom: none; }
.cad-table tbody tr:hover { background: var(--bg); }
.cad-table-key {
  font-weight: 600;
  color: var(--ink);
  width: 220px;
  white-space: nowrap;
}
/* Downloads */
.cad-downloads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}
.cad-download {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    transform .12s ease;
}
.cad-download:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 16px -6px rgba(var(--brand-rgb), .18);
  transform: translateY(-1px);
}
.cad-download-icon {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cad-download-icon--alt {
  background: rgba(229, 138, 42, .12);
  color: var(--warn);
}
.cad-download-icon svg { width: 18px; height: 18px; }
.cad-download-meta { flex: 1 1 auto; min-width: 0; }
.cad-download-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 3px;
}
.cad-download-sub {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: var(--muted);
  word-break: break-all;
  line-height: 1.3;
}
.cad-download-cta {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 600;
}
.cad-download:hover .cad-download-cta {
  background: var(--brand);
}
/* CAD card itself: tiny visual hint to differentiate from "立即体验" */

/* Responsive */
@media (max-width: 600px) {
  .cad-detail-panel { padding: 24px 18px 20px; }
  .cad-downloads { grid-template-columns: 1fr; }
  .cad-table-key { width: 140px; }
}

/* ---- Skill detail modal ---- */
.skill-modal-panel {
  width: 560px;
  max-width: 100%;
  padding: 32px 32px 24px;
}
.skill-modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-right: 36px;
}
.skill-modal-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex: 0 0 auto;
}
.skill-modal-meta h3 {
  font-family: 'InstrumentSans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.skill-modal-sub {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.skill-modal-sub .dot { color: var(--rule); }
.skill-modal-sub .skill-cat {
  background: var(--bg2);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.skill-modal-sub .star { color: var(--accent); }
.skill-modal-desc {
  color: var(--ink2);
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0 0 22px;
}
.skill-modal-section { margin-bottom: 18px; }
.skill-modal-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.skill-modal-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-modal-tags .tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg2);
  color: var(--muted);
  border-radius: 999px;
}
.skill-modal-prompt {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink2);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: 'InstrumentSans', sans-serif;
}
.skill-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
}
.skill-modal-foot .btn .arr { font-size: 12px; }

/* ---- Chat modal ---- */

.skill-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex: 0 0 44px;
}
.skill-body { min-width: 0; }
.skill-title-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.skill-title {
  font-size: 15px; font-weight: 700; color: var(--ink);
  letter-spacing: -0.005em;
}
.skill-meta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--muted);
}
.skill-meta .star { color: var(--fav); }
.skill-meta .dot { color: var(--muted2); margin: 0 2px; }
.skill-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* Card actions:
   - Download button (.js-dl): hidden by default, shown only on card hover.
   - Favorite button (.js-fav): same as download while NOT bookmarked.
     Once bookmarked (.faved), it stays visible always so users can see
     their bookmark state at a glance.
   Visual order in the DOM: download on the LEFT, favorite on the RIGHT. */
.skill-actions {
  display: flex; gap: 6px;
}
.skill-actions .icon-btn {
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.skill-card:hover .skill-actions .icon-btn,
.skill-actions .icon-btn.faved { opacity: 1; }
.icon-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--rule);
  background: var(--bg);
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.icon-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.icon-btn.faved { color: var(--fav); border-color: var(--fav); background: var(--fav-soft); }
.icon-btn.faved:hover { background: var(--fav); color: #fff; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 14px; height: 14px; }

/* Empty / no-result state */
.skills-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Section heading ---------- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px 80px;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 24px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: 'InstrumentSans', sans-serif;
  font-size: clamp(24px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-head h2 em {
  font-family: 'InstrumentSerif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--accent-ink);
}
.section-head p { color: var(--muted); font-size: 14px; max-width: 520px; }
.section-head .meta {
  font-size: 13px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 8px;
}
.section-head .meta .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}

/* ---------- Agent grid ---------- */
.agents {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
/* Merged `.agent-card`: layout + visual + hover states in one place. */
.agent-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .02);
  padding: 0;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color .2s ease,
    box-shadow .25s ease;
}
/* Hover: green border + soft green shadow — no transform to keep
   illustration edges aligned with card clipping. */
.agent-card:hover {
  border-color: var(--accent);
  box-shadow:
    0 14px 28px -12px rgba(var(--accent-rgb), .22),
    0 4px 10px rgba(0, 0, 0, .05);
}

/* ---------- Illustration header (replaces icon) ---------- */
/* Inset panel: padding lifts the illustration off the card borders; the
   themed tint + rounded corners live on the svg/img itself, so the gap
   shows the card surface and the artwork reads as a framed panel. */
.agent-illu {
  position: relative;
  height: 168px;
  padding: 12px 12px 0;
  overflow: hidden;
}
.agent-illu img,
.agent-illu svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: var(--illu-bg);
  border-radius: 10px;
  overflow: hidden;
}
.agent-card.featured .agent-illu img,
.agent-card.featured .agent-illu svg { background: var(--illu-bg-featured); }

.agent-body {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
}
.agent-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.agent-title .star {
  width: 14px; height: 14px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.27 5.82 22 7 14.14l-5-4.87 6.91-1.01z'/></svg>") center/contain no-repeat;
}

.agent-desc { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 14px; }
/* Bottom row: tag cluster on the left, arrow button on the right.
   align-items: center keeps the arrow vertically aligned with the tag row. */
.agent-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}
.agent-tags { display: flex; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow: hidden; }
.agent-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg2);
  color: var(--muted);
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
  min-width: 0;
}
/* Arrow button: circle in resting state, expands into a capsule with
   "立即体验" label on hover. Width animates; label fades in. */
.agent-arrow {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 11px; color: var(--muted);
  background: transparent;
  white-space: nowrap;
  overflow: hidden;
  transition:
    background .2s ease,
    color .2s ease,
    border-color .2s ease,
    width .2s ease,
    padding .2s ease;
}
.agent-arrow .arr-label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width .2s ease, opacity .2s ease, margin .2s ease;
  margin-left: 0;
}
.agent-arrow .arr-icon { display: inline-block; transition: transform .2s ease; }
.agent-card:hover .agent-arrow {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  padding: 0 10px 0 5px;            /* tight left padding; right gives the → room */
}
.agent-card:hover .agent-arrow .arr-label {
  /* Just wide enough for "立即体验" (4 chars at 11px ≈ 44px) plus a little slack. */
  max-width: 50px;
  opacity: 1;
  margin-left: 6px;                 /* space between text and the → */
}
.agent-card:hover .agent-arrow .arr-icon { transform: translateX(2px); }

/* Disabled arrow（未上线场景）：灰色禁用态，不再反转变色；
   hover 时按钮上方弹出提示气泡（文本取自 data-tooltip）。 */
.agent-arrow.is-disabled {
  position: relative;
  overflow: visible;               /* 默认 overflow:hidden 会裁掉气泡 */
  color: var(--muted2);
  cursor: not-allowed;
}
.agent-card:hover .agent-arrow.is-disabled {
  background: transparent;
  color: var(--muted2);
  border-color: var(--rule);
}
.agent-card:hover .agent-arrow.is-disabled .arr-icon { transform: none; }
.agent-arrow.is-disabled::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: -4px;
  padding: 6px 10px;
  background: var(--ink);
  color: var(--surface);
  font-size: 11px;
  line-height: 1;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.agent-arrow.is-disabled::before { /* 气泡小三角 */
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  right: 10px;
  border: 4px solid transparent;
  border-top-color: var(--ink);
  border-bottom: none;
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.agent-arrow.is-disabled:hover::after,
.agent-arrow.is-disabled:hover::before {
  opacity: 1;
  transform: translateY(0);
}

/* CAD card itself: tiny visual hint to differentiate from "立即体验" */
#agent-card-cad .agent-arrow .arr-icon { font-size: 14px; }
/* ---------- Welcome strip ---------- */
.welcome {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.welcome::after {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 240px; height: 240px;
  background: radial-gradient(circle at 30% 30%, rgba(var(--accent-rgb), .12), transparent 70%);
  pointer-events: none;
}
.welcome h3 {
  font-family: 'InstrumentSans', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}
.welcome h3 em {
  font-family: 'InstrumentSerif', serif;
  font-style: italic;
  color: var(--accent-ink);
  font-weight: 400;
}
.welcome p { color: var(--muted); font-size: 14.5px; }
.welcome .quotes { display: flex; flex-direction: column; gap: 10px; }
.welcome .quote {
  font-family: 'InstrumentSerif', serif;
  font-style: italic;
  font-size: 16px;
  color: var(--ink2);
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  line-height: 1.5;
}

/* ---------- Footer ---------- */
.foot {
  border-top: 1px solid var(--rule);
  padding: 28px 40px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted);
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 12px;
  background: transparent;
}
.foot a { color: var(--muted); text-decoration: none; margin-left: 18px; }
.foot a:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .topbar { padding: 16px 22px; }
  .hero { padding: 56px 22px 40px; }
  .section { padding: 16px 22px 60px; }
  .agents { grid-template-columns: 1fr 1fr; }
  .welcome { grid-template-columns: 1fr; }
  .foot { padding: 24px 22px; }
}
@media (max-width: 600px) {
  .agents { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}

/* ==========================================================================
   Agent Detail — 智能体详情页（agent-detail.js 渲染）
   ========================================================================== */
/* 详情页屏蔽了站点顶栏，顶部需要自己的留白 */
#agent-detail { padding-top: 36px; }

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 26px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.detail-back:hover { color: var(--ink); border-color: var(--ink); }
.detail-back svg { width: 14px; height: 14px; }

.detail-hero { margin-bottom: 40px; }
.detail-kicker {
  display: inline-block;
  padding: 4px 10px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.detail-hero h2 {
  font-size: clamp(30px, 3.6vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.detail-hero p { color: var(--muted); font-size: 16px; margin-bottom: 16px; }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.detail-section { margin-bottom: 48px; }
.detail-section > h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}
.sec-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 22px;
  border-radius: 6px;
  background: var(--bg2);
  color: var(--ink2);
  font-size: 11px;
  font-weight: 700;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: .5px;
}

/* ---- 01 核心能力：左文右图 ---- */
.detail-core {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 36px;
  align-items: center;
}
.detail-core-desc {
  color: var(--ink2);
  font-size: 14.5px;
  line-height: 1.75;
  margin-bottom: 20px;
}
.cap-list { list-style: none; display: flex; flex-direction: column; gap: 13px; }
.cap-item { display: flex; gap: 12px; align-items: flex-start; }
.cap-dot {
  flex: 0 0 auto;
  width: 8px; height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.cap-item b { font-size: 14px; font-weight: 700; display: block; margin-bottom: 2px; }
.cap-item p { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ---- 虚拟浏览器窗口（包裹卡片同款插图） ---- */
.mock-window {
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .14);
  overflow: hidden;
}
.mock-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--bg);
}
.mock-dots { display: inline-flex; gap: 6px; }
.mock-dots i { width: 9px; height: 9px; border-radius: 50%; }
.mock-dots i:nth-child(1) { background: #ff5f56; }
.mock-dots i:nth-child(2) { background: #ffbd2e; }
.mock-dots i:nth-child(3) { background: #27c93f; }
.mock-url {
  flex: 1;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--rule-soft);
  color: var(--muted2);
  font-size: 11px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-body { padding: 14px; }
.mock-body svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: var(--illu-bg);
}

/* ---- 02 场景功能 ---- */
.detail-modules {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.module-card {
  padding: 18px;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  transition: border-color .2s ease, box-shadow .25s ease;
}
.module-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px -12px rgba(var(--accent-rgb), .22);
}
.module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: var(--brand-soft);
  font-size: 18px;
}
.module-name { font-size: 14px; font-weight: 700; margin-bottom: 5px; }
.module-desc { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

/* ---- 03 最佳实践 ---- */
.practice-card {
  padding: 24px 26px;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 14px;
}
.practice-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.practice-head h4 { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.practice-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}
.flow-step {
  flex: 1 1 150px;
  min-width: 140px;
  position: relative;
  padding: 14px 14px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--bg);
}
.flow-step.user { border-color: var(--brand); background: var(--brand-soft); }
.flow-step.agent { border-color: var(--accent); background: var(--accent-soft); }
.flow-num {
  position: absolute;
  top: -10px; left: 12px;
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 10.5px;
  font-weight: 700;
}
.flow-actor {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-ink);
}
.flow-step.agent .flow-actor { color: var(--accent-ink); }
.flow-step p { font-size: 12.5px; color: var(--ink2); line-height: 1.5; }
.flow-arrow {
  align-self: center;
  color: var(--muted2);
  font-size: 15px;
  flex: 0 0 auto;
}

/* ==========================================================================
   案例回放抽屉（右侧滑入，对话形式）
   ========================================================================== */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}
.drawer.is-open { pointer-events: auto; }
.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 14, .42);
  opacity: 0;
  transition: opacity .25s ease;
}
.drawer.is-open .drawer-mask { opacity: 1; }
.drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 440px;
  max-width: 92vw;
  background: var(--bg);
  border-left: 1px solid var(--rule);
  box-shadow: -24px 0 48px -24px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.drawer.is-open .drawer-panel { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule-soft);
}
.drawer-kicker {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--accent-ink);
  text-transform: uppercase;
}
.drawer-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.4; }
.drawer-head .modal-close { position: static; flex: 0 0 auto; }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* 案例回放消息 */
.replay-msg {
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.replay-msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.replay-msg.assistant { align-self: flex-start; background: var(--bg2); color: var(--ink2); border-bottom-left-radius: 4px; }

@media (max-width: 960px) {
  .detail-core { grid-template-columns: 1fr; gap: 24px; }
  .detail-modules { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .detail-modules { grid-template-columns: 1fr; }
  .practice-head .btn { width: 100%; justify-content: center; }
}
