/* ===== 设计令牌：Linear 风格深色界面 ===== */
:root {
  --brand: #5e6ad2;
  --brand-hover: #6e79dd;
  --brand-dark: #4f5bc4;
  --brand-2: #8b93eb;
  --brand-rgb: 94, 106, 210;
  --brand-soft: rgba(94, 106, 210, .14);
  --accent: #8b93eb;
  --ink: #f7f8f8;
  --ink-2: #d3d6dc;
  --muted: #8a8f98;
  --muted-2: #62666e;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .15);
  --bg: #08090a;
  --surface: #0f1011;
  --surface-2: #151619;
  --card: #101113;
  --input: #0b0c0d;
  --ok: #4cb782;
  --warn: #e2a336;
  --danger: #eb6f6f;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 10px 30px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 60px -24px rgba(0, 0, 0, .8);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.025em; font-weight: 650; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: rgba(var(--brand-rgb), .38); }

/* ===== 通用 ===== */
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-10 { gap: 10px; } .gap-12 { gap: 12px; }
.gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 34px; padding: 0 13px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #1c1d21; border-color: var(--line-strong); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--brand); border-color: transparent; color: #fff; }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }

/* ===== 顶栏 ===== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(8, 9, 10, .82); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { height: 56px; display: flex; align-items: center; gap: 14px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14.5px; color: var(--ink); flex: none; white-space: nowrap; }
.logo:hover { color: var(--ink); }
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--brand); color: #fff;
}
.logo-mark svg { width: 16px; height: 16px; }
.logo-badge { font-size: 9px; font-weight: 700; letter-spacing: .06em; color: var(--brand-2); background: var(--brand-soft); padding: 2px 5px; border-radius: 3px; }
.nav { display: flex; align-items: stretch; gap: 2px; margin-left: 6px; flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  position: relative; display: inline-flex; align-items: center; padding: 0 9px;
  color: var(--muted); font-size: 12.5px; font-weight: 500; white-space: nowrap; transition: color .15s;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); font-weight: 600; }
.nav a.active::after { content: ''; position: absolute; left: 9px; right: 9px; bottom: 0; height: 2px; background: var(--brand); }
.nav-divider { width: 1px; align-self: center; height: 16px; background: var(--line-strong); margin: 0 6px; flex: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.menu-toggle { display: none; }

/* ===== 首页 Hero ===== */
.hero {
  position: relative; overflow: hidden; padding: 84px 0 40px;
  background: radial-gradient(880px 420px at 50% -12%, rgba(var(--brand-rgb), .17), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}
.aero-layer {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  mask-image: radial-gradient(88% 82% at 50% 35%, #000 48%, transparent 100%);
  -webkit-mask-image: radial-gradient(88% 82% at 50% 35%, #000 48%, transparent 100%);
}
.aero-shards-canvas { display: block; width: 100%; height: 100%; }
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 880px; margin: 0 auto; }
.announce {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 5px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(255,255,255,.03);
  font-size: 12px; color: var(--muted);
}
.announce-tag { background: var(--brand); color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .06em; padding: 2px 6px; border-radius: 999px; }
.announce a { color: var(--ink-2); }
.hero h1 {
  margin-top: 24px; font-size: clamp(38px, 5.6vw, 68px); letter-spacing: -.045em; line-height: 1.12; font-weight: 680;
}
.hero-gradient {
  background: linear-gradient(100deg, #8b93eb 0%, #aeb8ff 38%, #ffffff 68%, #8b93eb 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: heroGradientShift 8s ease-in-out infinite;
}
@keyframes heroGradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.hero-sub { margin: 20px auto 0; max-width: 620px; color: var(--muted); font-size: 15.5px; line-height: 1.75; }
.hero-actions { margin-top: 26px; display: flex; justify-content: center; gap: 10px; }

.hero-form {
  margin: 30px auto 0; max-width: 660px; display: flex; gap: 8px; padding: 7px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: 0 12px 40px -20px rgba(var(--brand-rgb), .45);
}
.hero-form textarea {
  flex: 1; min-height: 44px; max-height: 120px; resize: none; border: 0; outline: none;
  padding: 10px 11px; background: transparent; font-size: 13.5px; line-height: 1.55; color: var(--ink);
}
.hero-form textarea::placeholder { color: var(--muted-2); }
.hero-form .btn { align-self: stretch; height: auto; min-height: 42px; }
.hero-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tag-chip {
  font-size: 11.5px; color: var(--muted); background: rgba(255,255,255,.025); border: 1px solid var(--line);
  padding: 3px 9px; border-radius: 999px; cursor: pointer; transition: border-color .15s, color .15s;
}
.tag-chip:hover { border-color: var(--brand); color: var(--ink); }

/* 产品预览：仿编辑器窗口 */
.hero-preview { margin: 54px auto 0; max-width: 980px; text-align: left; }
.preview-frame { border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
.preview-top { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.preview-dots { display: flex; gap: 5px; }
.preview-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); display: block; }
.preview-top .preview-action { margin-left: auto; color: var(--brand-2); }
.preview-body { display: grid; grid-template-columns: 250px 1fr; height: 320px; }
.preview-side { border-right: 1px solid var(--line); padding: 12px; background: var(--surface); }
.preview-side-tab { font-size: 11.5px; color: var(--muted); padding: 6px 8px; border-radius: 5px; }
.preview-side-tab.active { background: var(--brand-soft); color: var(--ink); }
.preview-code { margin-top: 10px; font-family: var(--mono); font-size: 11px; line-height: 1.9; color: var(--muted); white-space: pre; overflow: hidden; }
.preview-code .k { color: var(--brand-2); }
.preview-code .s { color: #c9a26b; }
.preview-canvas { background: #f7f7fa; display: grid; place-items: center; position: relative; }
.preview-canvas svg { width: 82%; max-height: 88%; }
.preview-hint { position: absolute; left: 12px; bottom: 10px; font-size: 10.5px; color: #8b90a0; }
.hero-stats { margin-top: 36px; display: flex; justify-content: center; gap: 46px; flex-wrap: wrap; }
.hero-stats .num { font-size: 21px; font-weight: 650; letter-spacing: -.03em; color: var(--ink); }
.hero-stats .lbl { font-size: 11.5px; color: var(--muted); }

/* ===== 区块 ===== */
.section { padding: 78px 0; }
.section-head { max-width: 640px; margin-bottom: 30px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-2); }
.section-head h2 { margin-top: 10px; font-size: clamp(24px, 3vw, 34px); }
.section-head p { margin: 10px 0 0; color: var(--muted); }
.group-label { display: flex; align-items: center; gap: 10px; margin: 30px 0 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.group-label::after { content: ''; height: 1px; flex: 1; background: var(--line); }

.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, background .15s; color: var(--ink);
}
.tool-card:hover { border-color: rgba(var(--brand-rgb), .55); background: var(--surface-2); color: var(--ink); }
.tool-card .tc-top { display: flex; align-items: center; gap: 10px; }
.tool-icon { width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand-2); }
.tool-icon svg { width: 18px; height: 18px; }
.tool-card h3 { font-size: 14px; }
.tool-card .tc-sub { font-size: 11px; color: var(--muted-2); margin-top: 1px; }
.tool-card p { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.tool-card .tc-go { margin-top: auto; padding-top: 12px; font-size: 12px; font-weight: 600; color: var(--brand-2); display: flex; align-items: center; gap: 5px; }
.tool-card .tc-go svg { width: 14px; height: 14px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.feature { padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.feature .fi { width: 32px; height: 32px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-2); margin-bottom: 12px; }
.feature .fi svg { width: 17px; height: 17px; }
.feature h3 { font-size: 14px; }
.feature p { margin: 7px 0 0; font-size: 12.5px; color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; counter-reset: step; }
.step { position: relative; padding: 20px 18px 18px 52px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before {
  counter-increment: step; content: counter(step); position: absolute; left: 18px; top: 20px;
  width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-2); font-size: 12px; font-weight: 700;
}
.step h3 { font-size: 13.5px; }
.step p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }

.faq-list { display: flex; flex-direction: column; gap: 8px; max-width: 820px; margin: 0 auto; }
.faq { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.faq summary { padding: 14px 16px; font-weight: 600; font-size: 13.5px; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 17px; color: var(--muted-2); font-weight: 400; }
.faq[open] summary::after { content: "−"; }
.faq .faq-body { padding: 0 16px 14px; color: var(--muted); font-size: 13px; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 36px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 26px; }
.footer-grid h4 { font-size: 12.5px; color: var(--ink-2); margin-bottom: 10px; }
.footer-grid a { display: block; font-size: 12.5px; color: var(--muted); padding: 3px 0; }
.footer-grid a:hover { color: var(--ink); }
.footer-bottom { margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted-2); }

/* ===== 编辑器 ===== */
.app-shell { display: flex; flex-direction: column; height: calc(100dvh - 56px); overflow: hidden; }
.editor-bar {
  height: 52px; flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 20;
}
.editor-bar .title-wrap { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.editor-bar .doc-title {
  font-weight: 600; font-size: 13.5px; border: 1px solid transparent; border-radius: 5px;
  padding: 1px 6px; margin-left: -6px; max-width: 340px; background: transparent; outline: none;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden; color: var(--ink);
}
.editor-bar .doc-title:hover { border-color: var(--line); }
.editor-bar .doc-title:focus { border-color: var(--brand); background: var(--input); }
.editor-bar .doc-sub { font-size: 11px; color: var(--muted-2); }
.editor-body { flex: 1; display: flex; min-height: 0; position: relative; }
.side-panel { width: 372px; flex: none; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); min-height: 0; }
.side-panel.collapsed { width: 0; border-right: 0; overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 9px; border: 0; background: transparent; cursor: pointer; flex: none; font-size: 12.5px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }
.panel-scroll { flex: 1; overflow: auto; padding: 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 11px; color: var(--muted-2); margin-top: 5px; line-height: 1.5; }

.code-input {
  width: 100%; min-height: 300px; resize: vertical; padding: 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--input);
  font-family: var(--mono); font-size: 12px; line-height: 1.75; outline: none; tab-size: 2;
}
.code-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.code-input.short { min-height: 74px; }
.code-shell { position: relative; background: var(--input); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.code-shell:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.code-shell .code-hl, .code-shell .code-input { font-family: var(--mono); font-size: 12px; line-height: 1.75; letter-spacing: 0; padding: 12px; tab-size: 2; border: 1px solid transparent; }
.code-hl { position: absolute; inset: 0; margin: 0; z-index: 0; white-space: pre-wrap; word-break: break-word; overflow: auto; pointer-events: none; color: var(--ink-2); background: transparent; }
.code-shell .code-input { position: relative; z-index: 1; color: transparent; caret-color: var(--ink); background: transparent; }
.code-shell .code-input::placeholder { color: var(--muted-2); opacity: 1; }
.code-shell .code-input::selection { background: rgba(var(--brand-rgb), .28); }
.hl-key { color: #a5b4fc; font-weight: 600; }
.hl-type { color: #7dd3c0; }
.hl-str { color: #e6b980; }
.hl-comment { color: #62666e; font-style: italic; }
.hl-num { color: #c4a7f7; }
.hl-arrow { color: #eb8fa5; font-weight: 600; }
.hl-ident { color: #9db4ff; }
.text-input, .select-input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--input); outline: none; font-size: 13px; color: var(--ink);
}
.text-input:focus, .select-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .12); }
.select-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
.panel-actions { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; }
.panel-actions .btn-primary { flex: 1; }

.font-picker { display: flex; flex-direction: column; gap: 5px; }
.font-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--input); cursor: pointer; }
.font-option:hover { border-color: var(--brand); }
.font-option.active { border-color: var(--brand); background: var(--brand-soft); }
.font-option-name { font-size: 12.5px; font-weight: 600; }
.font-option-sample { font-size: 14px; }
.font-preview { margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 7px; background: var(--input); line-height: 1.5; white-space: nowrap; overflow: auto; }
.stepper { display: flex; align-items: center; gap: 7px; }
.stepper button { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); background: var(--input); border-radius: 6px; color: var(--muted); cursor: pointer; }
.stepper button:hover { border-color: var(--brand); color: var(--ink); }
.stepper input { text-align: center; font-variant-numeric: tabular-nums; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; user-select: none; }
.check-line input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.seg { display: flex; padding: 3px; background: var(--input); border-radius: 7px; gap: 2px; }
.seg button { flex: 1; height: 26px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; font-size: 12px; color: var(--muted); }
.seg button.active { background: var(--surface-2); color: var(--ink); }
.examples { display: flex; flex-wrap: wrap; gap: 5px; }
.examples button { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--input); color: var(--muted); cursor: pointer; }
.examples button:hover { border-color: var(--brand); color: var(--ink); }
.sample-list { display: flex; flex-direction: column; gap: 5px; }
.sample-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--input); color: var(--ink-2); font-size: 12.5px; text-align: left; cursor: pointer; }
.sample-item:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.sample-item svg { width: 14px; height: 14px; flex: none; color: var(--muted-2); }
.callout { display: flex; gap: 8px; padding: 10px 11px; border-radius: 7px; background: rgba(var(--brand-rgb), .07); border: 1px solid rgba(var(--brand-rgb), .2); font-size: 12px; color: var(--muted); line-height: 1.65; }
.callout svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--brand-2); }

/* 画布 */
.canvas-area { flex: 1; position: relative; min-width: 0; background: #ffffff; display: flex; flex-direction: column; }
.canvas-toolbar { height: 42px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 10px; background: #ffffff; border-bottom: 1px solid #e4e8f0; }
.canvas-toolbar .divider { width: 1px; height: 18px; background: #e4e8f0; margin: 0 4px; }
.canvas-toolbar .icon-btn { color: #64748b; }
.canvas-toolbar .icon-btn:hover { background: #eef2f7; color: #0f172a; }
.canvas-toolbar .btn-ghost { color: #64748b; }
.canvas-toolbar .btn-ghost:hover { background: #eef2f7; color: #0f172a; }
.zoom-label { font-size: 11.5px; color: #64748b; min-width: 42px; text-align: center; font-variant-numeric: tabular-nums; }
.canvas-toolbar .tiny.muted { color: #64748b; }
.canvas-viewport { flex: 1; overflow: hidden; position: relative; }
.canvas-viewport.grabbing { cursor: grabbing; }
.canvas-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.canvas-stage svg { display: block; background: #fff; border-radius: 3px; overflow: visible; }
.canvas-stage svg .node { cursor: move; }
.canvas-stage svg .node:hover { filter: brightness(.985); }
.canvas-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #94a3b8; font-size: 13px; pointer-events: none; padding: 30px; }
.canvas-hint { position: absolute; left: 12px; bottom: 10px; font-size: 11px; color: #94a3b8; background: rgba(255,255,255,.85); padding: 4px 9px; border-radius: 6px; border: 1px solid #e4e8f0; pointer-events: none; }

/* 下拉菜单 */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 208px; z-index: 80; background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px; padding: 5px; box-shadow: var(--shadow-lg); display: none; }
.dropdown-menu.open { display: block; animation: pop .12s ease; }
.dropdown-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; background: transparent; border-radius: 5px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); text-align: left; }
.dropdown-menu button:hover { background: var(--brand-soft); color: var(--ink); }
.dropdown-menu button svg { width: 14px; height: 14px; color: var(--muted); }
.dropdown-menu .dd-label { font-size: 10.5px; color: var(--muted-2); padding: 6px 9px 4px; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* 图表列表 */
.page { padding: 32px 0 60px; min-height: calc(100dvh - 56px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 20px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.diagram-card { display: flex; flex-direction: column; overflow: hidden; }
.diagram-card:hover { border-color: rgba(var(--brand-rgb), .55); }
.diagram-thumb { height: 150px; background: #f7f7fa; border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.diagram-thumb svg, .diagram-thumb img { max-width: 100%; max-height: 100%; }
.diagram-thumb .empty-thumb { font-size: 12px; color: #8b90a0; }
.diagram-meta { padding: 11px 13px; display: flex; align-items: center; gap: 10px; }
.diagram-meta h3 { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diagram-meta .dm-sub { font-size: 11px; color: var(--muted-2); }
.diagram-actions { margin-left: auto; display: flex; gap: 2px; }
.empty-state { padding: 70px 20px; text-align: center; }
.empty-state .es-icon { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.empty-state .es-icon svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 16px; }
.empty-state p { color: var(--muted); margin: 8px 0 20px; font-size: 13px; }

/* 文档 / 指南 */
.prose { max-width: 800px; }
.prose h2 { font-size: 20px; margin: 32px 0 12px; }
.prose h3 { font-size: 15px; margin: 22px 0 8px; }
.prose p, .prose li { color: var(--ink-2); font-size: 13.5px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose code { font-family: var(--mono); font-size: 12px; background: var(--brand-soft); color: var(--brand-2); padding: 2px 5px; border-radius: 4px; }
.prose pre { background: var(--input); border: 1px solid var(--line); color: var(--ink-2); padding: 14px; border-radius: 8px; overflow: auto; font-size: 12px; line-height: 1.7; }
.prose pre code { background: transparent; color: inherit; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 14px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 11px; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 600; }
.toc { position: sticky; top: 76px; align-self: start; }
.toc a { display: block; font-size: 12.5px; color: var(--muted); padding: 5px 10px; border-left: 2px solid var(--line); }
.toc a:hover, .toc a.active { color: var(--ink); border-left-color: var(--brand); background: var(--brand-soft); }
.doc-layout { display: grid; grid-template-columns: 1fr 210px; gap: 40px; }

/* 弹窗与 Toast */
.modal-mask { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.62); display: grid; place-items: center; padding: 20px; animation: fade .12s ease; }
.modal { width: min(520px, 100%); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 14.5px; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink); font-size: 12.5px; box-shadow: var(--shadow-lg); }
.toast.ok { border-color: rgba(76,183,130,.4); }
.toast.err { border-color: rgba(235,111,111,.4); }
.toast svg { width: 14px; height: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* SQL 表格预览（白色文档表面） */
.sql-table-wrap { padding: 16px; overflow: auto; background: #0b0c0d; flex: 1; }
.sql-sheets { display: flex; flex-direction: column; gap: 20px; align-items: center; }
.sql-sheet { background: #fff; padding: 24px 28px; box-shadow: var(--shadow); border-radius: 4px; min-width: 520px; color: #1e293b; }
.sql-sheet h4 { font-size: 13px; margin-bottom: 10px; }
table.three-line { width: 100%; border-collapse: collapse; font-size: 12px; font-family: var(--font); }
table.three-line th { border-top: 2px solid #1e293b; border-bottom: 1px solid #1e293b; padding: 7px 9px; text-align: left; font-weight: 600; white-space: nowrap; }
table.three-line td { padding: 6px 9px; border: 0; color: #334155; }
table.three-line tr:last-child td { border-bottom: 2px solid #1e293b; }
table.three-line td.nullable { color: #94a3b8; }

.canvas-viewport.grid-on { background-image: radial-gradient(#c3cde0 1.2px, transparent 1.2px); background-size: 20px 20px; }
.shake { animation: shake .3s ease; border-color: var(--danger) !important; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
.diagram-thumb > div { display: grid; place-items: center; }
.diagram-thumb a { display: block; }

/* ===== 标题打字机动画 ===== */
.type-heading { min-height: 2.24em; }
.type-line { display: block; min-height: 1.12em; }
.type-line:not(.hero-gradient) {
  background: linear-gradient(180deg, #ffffff 24%, #c3c9dd 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.type-caret {
  display: inline-block; width: 3px; height: .82em; margin-left: 4px;
  background: var(--brand); vertical-align: -.06em; border-radius: 2px;
  animation: caretBlink .85s steps(1, end) infinite;
}
.type-caret.done { opacity: 0; animation: none; transition: opacity .6s ease; }
@keyframes caretBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .type-caret { display: none; }
  .hero-gradient { animation: none; background-position: 50% 50%; }
}

/* ===== 首页组件动画 ===== */
.anim {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity .55s cubic-bezier(.22, .68, .24, 1),
    transform .55s cubic-bezier(.22, .68, .24, 1),
    filter .55s ease;
  transition-delay: var(--delay, 0ms);
  will-change: opacity, transform;
}
.anim.in { opacity: 1; transform: none; filter: none; }
.is-leaving .anim {
  opacity: 0;
  transform: translateY(-10px) scale(.985);
  filter: blur(2px);
  transition-duration: .24s;
  transition-delay: calc(var(--delay, 0ms) * .25);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .anim, .anim.in, .is-leaving .anim { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ===== 响应式 ===== */
@media (max-width: 1240px) {
  .nav a { padding: 0 7px; font-size: 12px; }
  .nav-divider { margin: 0 4px; }
  .site-header .container { gap: 8px; }
  .header-actions .btn-primary { display: none; }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .doc-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .preview-body { grid-template-columns: 1fr; height: auto; }
  .preview-side { display: none; }
  .preview-canvas { height: 240px; }
  .side-panel { position: absolute; z-index: 30; left: 0; top: 0; bottom: 0; box-shadow: var(--shadow-lg); }
  .side-panel.collapsed { transform: translateX(-100%); width: 372px; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .nav.open { display: flex; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px; gap: 2px; box-shadow: var(--shadow); max-height: calc(100dvh - 56px); overflow-y: auto; }
  .nav.open a { padding: 10px 12px; }
  .nav.open a.active::after { display: none; }
  .nav.open a.active { background: var(--brand-soft); border-radius: 6px; }
  .nav.open .nav-divider { width: auto; height: 1px; margin: 6px 12px; align-self: stretch; }
  .menu-toggle { display: inline-flex; }
  .hero { padding: 56px 0 32px; }
  .hero-actions { flex-direction: column; }
  .hero-form { flex-direction: column; }
  .hero-form .btn { width: 100%; }
  .hero-stats { gap: 24px; }
  .section { padding: 48px 0; }
  .editor-bar .doc-title { max-width: 130px; }
  .sql-sheet { min-width: 0; padding: 18px; }
  .footer-grid { grid-template-columns: 1fr; }
}
