:root {
  --bg: #FAFAFB;
  --panel: #FFFFFF;
  --text: #0A0A0F;
  --muted: #6E6E7A;
  --soft: #A8A8B5;
  --line: rgba(15,15,25,.08);
  --brand: #7C5CFF;
  --cyan: #5EE0FF;
  --shadow: 0 18px 50px rgba(31,42,68,.08);
}
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
.container { width: min(1200px, calc(100vw - 64px)); margin: 0 auto; }
.nav { position: sticky; top: 0; z-index: 50; }
.nav::before {
  content: "";
  position: absolute;
  inset: 0 50%;
  width: 100vw;
  transform: translateX(-50%);
  height: 64px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(15,15,25,.06);
}
.nav-inner { position: relative; height: 64px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; border-radius: 7px; background: linear-gradient(135deg,var(--brand),var(--cyan)); box-shadow: 0 8px 20px rgba(124,92,255,.28); }
.nav-links { display: flex; gap: 6px; flex: 1; }
.nav-links a { position: relative; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); background: #F4F4F7; }
.nav-links a.active { color: var(--brand); }
.nav-links a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -21px; height: 2px; border-radius: 2px; background: var(--brand); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.btn { height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 16px; border-radius: 9px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.btn-primary { background: #0A0A0F; color: #fff; border-color: transparent; }
.icon-btn { width: 36px; padding: 0; color: var(--muted); }
.hero { padding: 42px 0 28px; }
.hero-kicker { color: var(--muted); font: 700 12px/1.2 "SF Mono",Consolas,monospace; letter-spacing: .08em; }
.hero-title { margin-top: 18px; font-size: clamp(42px, 7vw, 86px); line-height: .98; letter-spacing: -.05em; font-weight: 900; }
.gradient-text { color: transparent; background: linear-gradient(135deg,#7C5CFF,#5EE0FF); -webkit-background-clip: text; background-clip: text; }
.hero-desc { margin-top: 18px; max-width: 480px; color: var(--muted); font-size: 16px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 28px 0 16px; }
.section-head h1, .section-head h2 { font-size: 40px; line-height: 1.12; letter-spacing: -.035em; }
.section-head p { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.km-canvas { position: relative; min-height: 488px; padding: 58px 48px 46px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.km-grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(15,15,25,.04) 1px,transparent 1px),linear-gradient(90deg,rgba(15,15,25,.04) 1px,transparent 1px); background-size: 32px 32px; }
.km-svg { position: relative; z-index: 2; width: min(100%, 1280px); max-height: 360px; overflow: visible; }
.km-link { stroke: #7F8EA8; stroke-width: 1.15; stroke-dasharray: 4 4; fill: none; opacity: .72; }
.km-node { cursor: pointer; transform-origin: center; transform-box: fill-box; animation: node-breathe 4s ease-in-out infinite; }
.km-node-rect { fill: #fff; stroke: rgba(96,129,168,.34); stroke-width: 1; filter: drop-shadow(0 8px 14px rgba(31,42,68,.08)); transition: stroke .2s, stroke-width .2s, fill .2s; }
.km-node.current .km-node-rect { stroke: var(--brand); stroke-width: 2; fill: rgba(124,92,255,.04); }
.km-node.domain-selected .km-node-rect { stroke: var(--domain-color); stroke-width: 2.2; fill: rgba(255,255,255,.98); }
.km-node.domain-selected { filter: drop-shadow(0 0 14px var(--domain-glow)); }
.km-node-port { fill: #6E747C; stroke: #fff; stroke-width: .5; }
.km-node.domain-selected .km-node-port { fill: var(--domain-color); }
.km-node-text { fill: #1F2937; font-size: 14px; font-weight: 700; }
.km-node-sub { fill: #718096; font-size: 10.5px; }
.km-legend { position: absolute; top: 16px; right: 32px; z-index: 4; display: flex; gap: 12px; align-items: center; padding: 10px 16px; border: 1px solid rgba(96,129,168,.14); border-radius: 12px; background: rgba(255,255,255,.9); box-shadow: 0 10px 24px rgba(31,42,68,.08); color: #718096; font-size: 12px; }
.km-legend strong { color: #3F3F4A; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 5px; }
@keyframes node-breathe { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.05); } }
.resource-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin: 18px 0 24px; }
.resource-card { position: relative; min-height: 132px; display: flex; gap: 18px; padding: 18px; border: 1px solid rgba(15,15,25,.07); border-radius: 12px; background: linear-gradient(180deg,#FFF,#FDFDFF); box-shadow: 0 1px 0 rgba(15,15,25,.03); transition: transform .2s, box-shadow .2s, border-color .2s; overflow: hidden; }
.resource-card:hover { transform: translateY(-3px); border-color: rgba(124,92,255,.18); box-shadow: 0 14px 32px rgba(31,42,68,.09); }
.resource-cover { width: 78px; height: 96px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; color: #fff; font-weight: 800; text-align: center; box-shadow: inset 0 1px 0 rgba(255,255,255,.28),0 10px 20px rgba(31,42,68,.12); }
.resource-cover small { display: block; margin-bottom: 10px; font: 700 9px/1 "SF Mono",Consolas,monospace; letter-spacing: .12em; opacity: .86; }
.g-purple { background: linear-gradient(135deg,#7C5CFF,#5EE0FF); }
.g-pink { background: linear-gradient(135deg,#FF7AC6,#FFD56B); }
.g-green { background: linear-gradient(135deg,#4ADE80,#5EE0FF); }
.g-warm { background: linear-gradient(135deg,#FB923C,#FF7AC6); }
.g-cyan { background: linear-gradient(135deg,#5EE0FF,#7C5CFF); }
.g-yellow { background: linear-gradient(135deg,#FFD56B,#FB923C); }
.resource-info { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.resource-title { font-size: 16px; font-weight: 800; line-height: 1.28; }
.resource-desc { color: #9A9AA8; font-size: 13px; line-height: 1.55; }
.tools-shell { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 22px; padding-top: 24px; }
.side-panel { position: sticky; top: 84px; height: fit-content; padding: 18px; }
.side-panel button { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 700; text-align: left; }
.side-panel button.active, .side-panel button:hover { color: #1D4ED8; background: #EEF4FF; }
.tool-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 18px; }
.tool-search input { height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; outline: none; }
.category-section { margin-bottom: 22px; padding: 22px; }
.section-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.section-subnav button { padding: 7px 12px; border-radius: 999px; background: #F8FAFC; color: #64748B; font-weight: 700; }
.section-subnav button.active { color: #1D4ED8; background: #EEF4FF; }
.tools-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.tool-card { min-height: 112px; display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; background: linear-gradient(180deg,#fff,#F8FAFC); border: 1px solid rgba(99,116,152,.13); box-shadow: 0 10px 28px rgba(15,23,42,.055); }
.tool-logo { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; color: #fff; font-weight: 900; font-size: 13px; background: linear-gradient(135deg,#2F6BFF,#8B5CF6); }
.tool-info strong { display: block; font-size: 15px; }
.tool-info p { margin-top: 6px; color: #748195; font-size: 12px; line-height: 1.5; }
.tool-meta { display: grid; justify-items: end; gap: 10px; color: #94A3B8; }
.tag { padding: 4px 8px; border-radius: 999px; background: #F1F5F9; font-size: 11px; font-weight: 800; }
.node-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 22px; padding: 24px 0; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); }
.tab { padding: 14px 0; color: var(--muted); font-weight: 800; }
.tab.active { color: var(--brand); }
.tab-panel { padding: 22px 0; }
.lesson-list, .resource-list { display: grid; gap: 10px; }
.lesson-row, .resource-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.muted { color: var(--muted); }
.footer { margin-top: 42px; padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.public-beta-banner { position: relative; z-index: 60; padding: 7px 16px; text-align: center; background: #fff7d6; border-bottom: 1px solid #ead99b; color: #684f00; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.public-site-footer { margin-top: 42px; padding: 24px max(20px, calc((100vw - 1200px) / 2)); border-top: 1px solid rgba(31,35,40,.14); background: #f6f8fa; color: #57606a; font-size: 12px; line-height: 1.7; }
.public-site-footer-inner { display: grid; gap: 10px; }
.public-site-footer-inner strong { color: #24292f; margin-right: 6px; }
.public-site-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.public-site-footer a { color: #0969da; text-decoration: none; }
.public-site-footer a:hover { text-decoration: underline; }

/* Home: migrated from v2-light-concept */
.home-page { background: #FAFAFB; }
.home-bg { position: fixed; inset: 64px 0 auto 0; height: 220px; pointer-events: none; background: radial-gradient(ellipse at 18% 0%,rgba(124,92,255,.18),transparent 56%),radial-gradient(ellipse at 78% 0%,rgba(94,224,255,.14),transparent 52%),linear-gradient(rgba(15,15,25,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(15,15,25,.035) 1px,transparent 1px); background-size: auto,auto,64px 64px,64px 64px; opacity: .9; }
.home-hero { position: relative; padding: 34px 0 48px; }
.hero-grid { display: grid; grid-template-columns: minmax(0,1fr) 1.24fr; gap: 52px; align-items: end; }
.home-page .hero-title { font-size: clamp(56px, 7vw, 88px); }
.hero-actions { display: flex; gap: 12px; margin-top: 24px; }
.entry-bento { display: grid; grid-template-columns: 1.1fr .9fr; gap: 14px; }
.entry-card { min-height: 178px; position: relative; padding: 24px; border-radius: 18px; background: rgba(255,255,255,.88); border: 1px solid var(--line); box-shadow: 0 18px 46px rgba(31,42,68,.07); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s; }
.entry-card:hover { transform: translateY(-3px); border-color: rgba(124,92,255,.18); box-shadow: 0 24px 56px rgba(31,42,68,.11); }
.entry-large { grid-row: span 2; min-height: 370px; }
.entry-index { display: block; color: #A0A0AC; font: 800 12px/1.2 "SF Mono",Consolas,monospace; letter-spacing: .08em; margin-bottom: 20px; }
.entry-card strong { display: block; font-size: 34px; line-height: 1.1; letter-spacing: -.04em; }
.entry-card p { margin-top: 12px; color: var(--muted); }
.entry-line { position: absolute; right: 24px; bottom: 24px; width: 260px; height: 150px; background: linear-gradient(135deg,transparent 45%,rgba(124,92,255,.32) 46%,transparent 47%),linear-gradient(45deg,transparent 45%,rgba(94,224,255,.28) 46%,transparent 47%); border-radius: 18px; opacity: .7; }
.home-map-section { margin-top: 20px; }
.section-head.compact h2 { font-size: 32px; }

/* Tools page: migrated from design/v2/tools.html */
.tools-page { --tool-line: rgba(99,116,152,.14); background: #F8FAFC; }
.progress-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 100; background: linear-gradient(90deg,#7C5CFF,#5EE0FF,#FF7AC6); }
.page-shell { display: grid; grid-template-columns: 260px minmax(0,1fr); min-height: 100vh; }
.side-rail { position: sticky; top: 0; height: 100vh; z-index: 70; padding: 22px 16px; overflow-y: auto; background: rgba(255,255,255,.92); backdrop-filter: blur(20px) saturate(160%); border-right: 1px solid var(--tool-line); box-shadow: 16px 0 40px rgba(15,23,42,.04); }
.rail-toggle { position: absolute; right: 14px; top: 28px; width: 34px; height: 34px; border-radius: 12px; color: #64748B; background: #F8FAFC; border: 1px solid var(--tool-line); }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 58px 0 28px; }
.side-brand strong { display: block; font-size: 18px; }
.side-brand small { display: block; margin-top: 3px; color: #8390A3; font-size: 12px; }
.rail-group { margin-bottom: 22px; }
.rail-title { margin: 0 0 8px 10px; color: #94A3B8; font: 800 11px/1 "SF Mono",Consolas,monospace; letter-spacing: .08em; }
.rail-link { width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; padding: 10px 12px; border-radius: 14px; color: #536175; font-weight: 800; text-align: left; transition: background .18s, color .18s, transform .18s; }
.rail-link:hover, .rail-link.active { color: #1D4ED8; background: #EEF4FF; transform: translateX(2px); }
.rail-icon { width: 22px; text-align: center; }
.rail-card { margin-top: 20px; padding: 16px; border-radius: 20px; color: #fff; background: radial-gradient(circle at 20% 10%,rgba(255,255,255,.35),transparent 28%),linear-gradient(145deg,#1D4ED8,#7C3AED); overflow: hidden; position: relative; }
.rail-card p { margin-top: 8px; color: rgba(255,255,255,.76); font-size: 12px; }
.rail-card a { margin-top: 14px; display: inline-flex; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.18); font-size: 12px; font-weight: 800; }
.main { min-width: 0; }
.tools-topbar { position: sticky; top: 0; z-index: 60; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 0 32px; background: rgba(255,255,255,.72); backdrop-filter: blur(16px) saturate(180%); border-bottom: 1px solid rgba(15,15,25,.06); }
.top-nav { display: flex; gap: 28px; }
.top-nav a { position: relative; color: #6E6E7A; font-size: 14px; font-weight: 700; }
.top-nav a.active { color: #1D4ED8; }
.top-nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -23px; height: 2px; border-radius: 2px; background: #7C5CFF; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions .icon-btn, .login-btn, .primary-btn { height: 38px; display: inline-grid; place-items: center; padding: 0 16px; border-radius: 12px; background: #fff; border: 1px solid var(--tool-line); font-weight: 800; }
.top-actions .icon-btn { width: 38px; padding: 0; color: #64748B; }
.primary-btn { color: #fff; background: #0A0A0F; border-color: transparent; }
.tools-hero { position: relative; min-height: 490px; display: grid; place-items: center; overflow: hidden; background: #061126; border-bottom: 1px solid rgba(255,255,255,.08); }
.hero-network { position: absolute; inset: 0; opacity: .82; }
.network-line { fill: none; stroke-width: 1.3; opacity: .58; stroke-dasharray: 8 10; }
.network-line--purple { stroke: #8B5CF6; }
.network-line--blue { stroke: #24D6FF; }
.network-node, .network-pulse { fill: rgba(247,248,255,.9); filter: drop-shadow(0 0 10px rgba(79,114,255,.55)); }
.network-pulse { fill: #24D6FF; }
.network-pulse--two { fill: #B56CFF; }
.tools-hero-copy { position: relative; z-index: 2; width: min(880px, calc(100vw - 360px)); text-align: center; padding: 40px 0; }
.tools-hero h1 { display: grid; gap: 2px; color: #fff; font-size: clamp(52px, 8vw, 112px); line-height: .88; letter-spacing: -.065em; font-weight: 950; }
.tools-hero h1 span { color: #8B5CF6; }
.tools-hero h1 em { font-style: normal; color: transparent; background: linear-gradient(90deg,#8B5CF6,#24D6FF,#FF6AC8); -webkit-background-clip: text; background-clip: text; }
.tools-hero p { margin: 22px auto 0; max-width: 640px; color: rgba(226,232,240,.74); }
.search-box { margin: 24px auto 0; max-width: 780px; height: 58px; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 7px; border-radius: 22px; background: rgba(4,8,23,.68); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 20px 58px rgba(0,0,0,.32), inset 0 0 0 1px rgba(255,255,255,.05); backdrop-filter: blur(18px); }
.search-box input { height: 100%; padding: 0 16px; border: 0; outline: 0; color: #fff; background: transparent; font-size: 15px; }
.search-box button { width: 44px; height: 44px; border-radius: 16px; color: #fff; background: linear-gradient(135deg,#2F6BFF,#8B5CF6); font-weight: 900; }
.hot-keys { margin-top: 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.hot-keys button { padding: 7px 12px; border-radius: 999px; color: rgba(226,232,240,.82); background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); font-size: 12px; font-weight: 800; }
.workflow-showcase, .latest-panel, .directory { width: min(1180px, calc(100vw - 320px)); margin: 32px auto; }
.workflow-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.workflow-card { min-height: 150px; padding: 18px; border-radius: 20px; color: #fff; background: linear-gradient(145deg,#101A3D,#18295D); border: 1px solid rgba(255,255,255,.09); box-shadow: 0 20px 42px rgba(15,23,42,.14); }
.workflow-card__top { display: flex; justify-content: space-between; align-items: center; }
.popular-badge { padding: 5px 8px; border-radius: 999px; color: #C7D2FE; background: rgba(124,92,255,.18); font-size: 11px; font-weight: 900; }
.workflow-card h2 { margin-top: 14px; font-size: 18px; }
.workflow-card p { margin-top: 6px; min-height: 38px; color: rgba(226,232,240,.68); font-size: 12px; }
.tool-chain { display: flex; align-items: center; gap: 7px; margin-top: 12px; overflow: hidden; }
.tool-item { display: grid; justify-items: center; gap: 5px; color: #D9DEF5; font-size: 10px; font-weight: 800; white-space: nowrap; }
.tool-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#2F6BFF,#8B5CF6); }
.chain-arrow { width: 10px; height: 1px; background: rgba(255,255,255,.32); }
.latest-panel { padding: 20px 0; }
.marquee-wrap { overflow: hidden; }
.marquee-track { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 14px; }
.latest-card { min-height: 112px; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: #fff; border: 1px solid rgba(99,116,152,.14); box-shadow: 0 12px 28px rgba(15,23,42,.06); }
.tool-brand-logo { width: 46px; height: 46px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: #fff; border: 1px solid rgba(99,116,152,.14); box-shadow: 0 10px 20px rgba(15,23,42,.08); overflow: hidden; }
.tool-brand-logo img { width: 28px; height: 28px; object-fit: contain; }
.tool-brand-fallback { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: #fff; font-weight: 900; background: linear-gradient(135deg,#2F6BFF,#8B5CF6); }
.category-section { position: relative; scroll-margin-top: 90px; padding: 24px; border-radius: 28px; background: rgba(255,255,255,.88); border: 1px solid var(--tool-line); box-shadow: 0 20px 60px rgba(15,23,42,.08); }
.tools-page .tools-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.tools-page .tool-card { grid-template-columns: 46px minmax(0,1fr) auto; background: linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,250,252,.92)); }
.tools-page .tool-card:hover { transform: translateY(-3px); border-color: rgba(47,107,255,.24); box-shadow: 0 18px 40px rgba(15,23,42,.1); }
@media (max-width: 900px) {
  .container { width: min(100vw - 40px, 1200px); }
  .nav-links { display: none; }
  .resource-grid, .tools-grid { grid-template-columns: 1fr; }
  .tools-shell, .node-layout { grid-template-columns: 1fr; }
  .km-canvas { justify-content: flex-start; overflow-x: auto; }
  .km-svg { min-width: 1120px; }
  .hero-grid, .page-shell { grid-template-columns: 1fr; }
  .side-rail { position: relative; height: auto; }
  .tools-hero-copy, .workflow-showcase, .latest-panel, .directory { width: min(100vw - 40px, 1180px); }
  .workflow-grid, .tools-page .tools-grid { grid-template-columns: 1fr; }
  .entry-bento { grid-template-columns: 1fr; }
}
