/* ==========================================================================
   smart-filter-vue 官网统一样式
   纯手写，无外部依赖；深浅配色现代风，中文排版友好
   ========================================================================== */

:root {
  --brand: #4f6ef7;
  --brand-dark: #3b56d4;
  --brand-light: #eef1fe;
  --ink: #1a2233;
  --ink-2: #3d4657;
  --ink-3: #6b7280;
  --line: #e5e8f0;
  --bg: #f7f8fc;
  --card: #ffffff;
  --code-bg: #0f172a;
  --code-ink: #dbe4f5;
  --green: #22a06b;
  --orange: #e8821a;
  --red: #e0504f;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 30px rgba(16, 24, 40, .12);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  height: 60px; display: flex; align-items: center; gap: 28px;
}
.nav-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 17px; color: var(--ink); letter-spacing: .2px;
}
.nav-logo .logo-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #8b5cf6);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}
.nav-links { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav-links a { color: var(--ink-2); font-size: 14.5px; }
.nav-links a:hover, .nav-links a.active { color: var(--brand); }
.nav-gh {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 5px 12px; font-size: 13.5px; color: var(--ink-2) !important;
  background: #fff;
}
.nav-gh:hover { border-color: var(--brand); color: var(--brand) !important; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(139, 92, 246, .35), transparent 60%),
    radial-gradient(700px 380px at 10% 110%, rgba(79, 110, 247, .30), transparent 60%),
    linear-gradient(160deg, #131a2e 0%, #1b2440 55%, #232c52 100%);
  color: #eef2ff;
  padding: 96px 0 88px;
}
.hero-badge {
  display: inline-block; font-size: 13px; letter-spacing: .4px;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px;
  padding: 4px 14px; color: #c7d0f5; margin-bottom: 22px;
  background: rgba(255, 255, 255, .06);
}
.hero h1 {
  font-size: 46px; line-height: 1.25; font-weight: 800; letter-spacing: .5px;
  margin-bottom: 18px;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #93a8ff, #c4b5fd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  font-size: 17.5px; color: #b9c3e4; max-width: 720px; margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 10px; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .18s ease;
}
.btn-primary { background: var(--brand); color: #fff !important; }
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255, 255, 255, .08); color: #e6ebff !important;
  border-color: rgba(255, 255, 255, .22);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }
.btn-light { background: #fff; color: var(--ink) !important; border-color: var(--line); }
.btn-light:hover { border-color: var(--brand); color: var(--brand) !important; }

/* ---------- 区块通用 ---------- */
.section { padding: 72px 0; }
.section-title { text-align: center; margin-bottom: 12px; font-size: 30px; font-weight: 750; }
.section-sub { text-align: center; color: var(--ink-3); margin-bottom: 44px; font-size: 15.5px; }

/* ---------- 特性卡片 ---------- */
.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.feature-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow); transition: all .18s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 42px; height: 42px; border-radius: 10px; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; background: var(--brand-light); color: var(--brand);
}
.feature-card h3 { font-size: 16.5px; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--ink-3); line-height: 1.7; }

/* ---------- 组件展示卡 ---------- */
.comp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.comp-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.comp-card-head { padding: 20px 24px 12px; }
.comp-card-head .comp-name { font-size: 17px; font-weight: 700; }
.comp-card-head .comp-type {
  font-family: "SF Mono", Consolas, monospace; font-size: 12px;
  background: var(--brand-light); color: var(--brand-dark);
  border-radius: 6px; padding: 2px 8px; margin-left: 8px; vertical-align: 2px;
}
.comp-card-head p { font-size: 14px; color: var(--ink-3); margin-top: 6px; }
.comp-mock {
  margin: 6px 24px 14px; background: #f3f5fb; border: 1px solid var(--line);
  border-radius: 10px; padding: 16px; min-height: 96px;
  display: flex; flex-direction: column; gap: 8px; justify-content: center;
}
.comp-card-foot {
  padding: 12px 24px 18px; font-size: 13px; color: var(--ink-3);
  border-top: 1px dashed var(--line);
}
.comp-card-foot b { color: var(--ink-2); font-weight: 600; }

/* ---------- 纯 CSS 示意界面元素 ---------- */
.mock-row { display: flex; align-items: center; gap: 6px; }
.mock-label {
  font-size: 13px; color: var(--ink-2); min-width: 58px; text-align: right;
  flex-shrink: 0;
}
.mock-input {
  flex: 1; background: #fff; border: 1px solid #d6dbe8; border-radius: 7px;
  padding: 6px 10px; font-size: 13px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px; min-height: 32px;
  position: relative;
}
.mock-input .ph { color: #a6adbd; }
.mock-input.focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 110, 247, .12); }
.mock-caret { width: 1px; height: 14px; background: var(--brand); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.mock-icon-btn {
  width: 30px; height: 30px; flex-shrink: 0; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; border: 1px solid transparent;
}
.mock-icon-btn.wand { color: #b0b7c6; }
.mock-icon-btn.wand.on { color: var(--brand); text-shadow: 0 0 8px rgba(79, 110, 247, .55); }
.mock-icon-btn.info { color: #b0b7c6; }
.mock-icon-btn.info.on { color: var(--brand); }
.mock-dropdown {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow-lg); overflow: hidden; font-size: 13px;
  margin-left: 64px;
}
.mock-dropdown .dd-title {
  font-size: 11.5px; color: #9aa1b2; padding: 7px 12px 3px;
}
.mock-option {
  padding: 6px 12px; display: flex; align-items: center; gap: 8px; color: var(--ink-2);
}
.mock-option:hover { background: #f2f5ff; }
.mock-option.grayed { color: #b3b9c8; }
.mock-option .cbx {
  width: 13px; height: 13px; border: 1px solid #c3c9d8; border-radius: 3px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff;
}
.mock-option .cbx.on { background: var(--brand); border-color: var(--brand); }
.mock-option .cfg-tag {
  font-size: 10px; border: 1px solid #d9dde8; border-radius: 4px;
  padding: 0 4px; color: #9aa1b2; margin-left: auto;
}
.mock-match { padding: 6px 12px; color: var(--ink-2); }
.mock-match:hover { background: #f2f5ff; }
.mock-match mark { background: #fff1d6; color: #b26400; padding: 0 1px; border-radius: 2px; }

.mock-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 64px; }
.mock-tag {
  font-size: 12px; border-radius: 6px; padding: 2px 9px;
  display: inline-flex; align-items: center; gap: 5px;
}
.mock-tag.blue { background: #e8efff; color: #2f50d6; border: 1px solid #c8d8fb; }
.mock-tag.orange { background: #fdf0e0; color: #b26400; border: 1px solid #f5d9b0; }
.mock-tag.green { background: #e5f6ee; color: #178755; border: 1px solid #bfe8d3; }
.mock-tag.red { background: #fdeaea; color: #c23b3a; border: 1px solid #f3c4c4; }
.mock-tag .x { opacity: .55; font-size: 11px; }

.mock-switch {
  width: 42px; height: 22px; border-radius: 999px; background: var(--brand);
  position: relative; flex-shrink: 0;
}
.mock-switch::after {
  content: ""; position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
}
.mock-switch.off { background: #c3c9d8; }
.mock-switch.off::after { right: auto; left: 2px; }
.mock-switch-state { font-size: 13px; color: var(--ink-2); }

.mock-panel {
  margin-left: 64px; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 12.5px;
}
.mock-panel .mp-head {
  display: flex; justify-content: space-between; color: var(--ink-2);
  font-weight: 600; margin-bottom: 6px;
}
.mock-panel .mp-head .mp-switch { color: var(--brand); font-weight: 500; }
.mock-panel .mp-body { color: var(--ink-3); line-height: 1.7; }
.mock-panel .mp-desc { color: var(--green); }
.mock-calendar {
  display: flex; align-items: center; gap: 8px; margin-top: 6px;
}
.mock-op {
  font-weight: 700; color: var(--brand); cursor: pointer; user-select: none;
  border: 1px solid #dbe2f5; border-radius: 6px; padding: 2px 8px; background: #f6f8ff;
}
.mock-date {
  flex: 1; border: 1px solid #d6dbe8; border-radius: 6px; background: #fff;
  padding: 4px 9px; color: var(--ink-2); font-size: 12.5px;
}
.mock-select {
  border: 1px solid #d6dbe8; border-radius: 6px; background: #fff;
  padding: 4px 9px; color: var(--ink-2); font-size: 12.5px; flex-shrink: 0;
}

/* ---------- 代码块（手写高亮） ---------- */
pre {
  background: var(--code-bg); color: var(--code-ink);
  border-radius: 10px; padding: 18px 20px; overflow-x: auto;
  font-family: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13px; line-height: 1.72; tab-size: 2;
}
pre .hl-k { color: #8ea6ff; }            /* 关键字 */
pre .hl-s { color: #9ed6a4; }            /* 字符串 */
pre .hl-n { color: #f2b866; }            /* 数字 */
pre .hl-c { color: #667085; font-style: italic; } /* 注释 */
pre .hl-f { color: #7dd3fc; }            /* 函数/属性键 */
pre .hl-b { color: #f0a3c0; }            /* 布尔/null */
.code-wrap { position: relative; }
.code-title {
  display: inline-block; font-size: 12px; color: #94a3c8;
  background: #1b2745; border-radius: 8px 8px 0 0; padding: 4px 14px;
  font-family: "SF Mono", Consolas, monospace;
}
.code-wrap pre { border-radius: 0 10px 10px 10px; margin-top: 0; }

/* ---------- 快速开始 / 文档入口 ---------- */
.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.doc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.doc-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); transition: all .18s ease; display: block;
  color: var(--ink);
}
.doc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #cdd7f8; }
.doc-card h4 { font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.doc-card p { font-size: 13px; color: var(--ink-3); }
.doc-card .go { color: var(--brand); font-size: 13px; margin-top: 8px; display: inline-block; }

/* ---------- 锚点导航（components 页） ---------- */
.layout-with-toc { display: grid; grid-template-columns: 210px 1fr; gap: 36px; align-items: start; }
.toc {
  position: sticky; top: 76px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 10px; box-shadow: var(--shadow);
}
.toc a {
  display: block; padding: 7px 14px; font-size: 13.5px; color: var(--ink-2);
  border-radius: 8px;
}
.toc a:hover { background: var(--brand-light); color: var(--brand-dark); }
.toc a .toc-type { font-family: Consolas, monospace; font-size: 11px; color: #9aa1b2; display: block; }

.detail-section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 30px 32px; margin-bottom: 30px;
}
.detail-section > h2 { font-size: 21px; margin-bottom: 4px; }
.detail-section > h2 .comp-type {
  font-family: Consolas, monospace; font-size: 12.5px; font-weight: 500;
  background: var(--brand-light); color: var(--brand-dark);
  border-radius: 6px; padding: 2px 9px; margin-left: 9px; vertical-align: 3px;
}
.detail-section > .lead { color: var(--ink-3); font-size: 14.5px; margin-bottom: 20px; }
.detail-section h3 {
  font-size: 15.5px; margin: 22px 0 10px; padding-top: 16px; border-top: 1px dashed var(--line);
}
.detail-section h3:first-of-type { border-top: none; padding-top: 0; }
.detail-section p, .detail-section li { font-size: 14px; color: var(--ink-2); }
.detail-section ul { padding-left: 20px; }
.detail-section li { margin-bottom: 4px; }
.detail-section pre { margin: 10px 0; }

/* ---------- 表格 ---------- */
table.tb {
  width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0 14px;
  background: #fff;
}
table.tb th, table.tb td {
  border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top;
}
table.tb th { background: #f3f5fb; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
table.tb td code, p code, li code, .detail-section code {
  font-family: "SF Mono", Consolas, monospace; font-size: 12.5px;
  background: #eef1f8; color: #3b56d4; border-radius: 5px; padding: 1px 6px;
}
table.tb td code { background: #f0f3fb; }

/* ---------- Playground ---------- */
.pg-note {
  background: linear-gradient(120deg, #eef3ff, #f4efff);
  border: 1px solid #d8e0fb; border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 30px; font-size: 14px; color: var(--ink-2);
}
.pg-note b { color: var(--brand-dark); }
.pg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.pg-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 24px;
}
.pg-card h3 { font-size: 16px; margin-bottom: 4px; }
.pg-card h3 .comp-type {
  font-family: Consolas, monospace; font-size: 11.5px; font-weight: 500;
  background: var(--brand-light); color: var(--brand-dark);
  border-radius: 6px; padding: 1px 8px; margin-left: 8px; vertical-align: 2px;
}
.pg-card .pg-desc { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.pg-demo { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pg-row { display: flex; align-items: center; gap: 6px; position: relative; }
.pg-input {
  flex: 1; border: 1px solid #d6dbe8; border-radius: 7px; padding: 7px 11px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); outline: none;
  min-height: 34px; background: #fff;
}
.pg-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 110, 247, .12); }
.pg-select {
  border: 1px solid #d6dbe8; border-radius: 7px; padding: 7px 8px; font-size: 13.5px;
  font-family: inherit; color: var(--ink); background: #fff; outline: none; cursor: pointer;
}
.pg-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 7px;
  width: 34px; height: 34px; cursor: pointer; font-size: 15px; color: #b0b7c6;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pg-btn:hover { color: var(--brand); border-color: var(--brand); }
.pg-btn.loading { color: var(--brand); animation: spin 1s linear infinite; }
.pg-btn.on { color: var(--brand); text-shadow: 0 0 9px rgba(79, 110, 247, .6); }
@keyframes spin { to { transform: rotate(360deg); } }
.pg-dropdown {
  position: absolute; top: calc(100% + 4px); left: 64px; right: 40px; z-index: 20;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow-lg); overflow: hidden; font-size: 13px; max-height: 210px; overflow-y: auto;
}
.pg-dropdown .dd-title { font-size: 11.5px; color: #9aa1b2; padding: 7px 12px 3px; }
.pg-option { padding: 7px 12px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink-2); }
.pg-option:hover { background: #f2f5ff; }
.pg-option .cbx {
  width: 13px; height: 13px; border: 1px solid #c3c9d8; border-radius: 3px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; color: #fff;
}
.pg-option .cbx.on { background: var(--brand); border-color: var(--brand); }
.pg-empty { padding: 10px 12px; color: #9aa1b2; font-size: 12.5px; }
.pg-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 4px; }
.pg-tag {
  font-size: 12px; border-radius: 6px; padding: 2px 9px; cursor: default;
  display: inline-flex; align-items: center; gap: 5px;
}
.pg-tag.blue { background: #e8efff; color: #2f50d6; border: 1px solid #c8d8fb; }
.pg-tag.orange { background: #fdf0e0; color: #b26400; border: 1px solid #f5d9b0; }
.pg-tag.green { background: #e5f6ee; color: #178755; border: 1px solid #bfe8d3; }
.pg-tag.red { background: #fdeaea; color: #c23b3a; border: 1px solid #f3c4c4; }
.pg-tag .x { opacity: .55; cursor: pointer; font-weight: 700; }
.pg-tag .x:hover { opacity: 1; }
.pg-out {
  background: var(--code-bg); color: var(--code-ink); border-radius: 8px;
  font-family: "SF Mono", Consolas, monospace; font-size: 12px; line-height: 1.65;
  padding: 12px 14px; white-space: pre-wrap; word-break: break-all; min-height: 44px;
}
.pg-out .k { color: #8ea6ff; }
.pg-hint { font-size: 12px; color: #9aa1b2; }
.pg-switch {
  width: 46px; height: 24px; border-radius: 999px; background: var(--brand);
  position: relative; cursor: pointer; flex-shrink: 0; border: none; transition: background .18s;
}
.pg-switch::after {
  content: ""; position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: all .18s;
}
.pg-switch.off { background: #c3c9d8; }
.pg-switch.off::after { right: auto; left: 2px; }
.pg-switch-state { font-size: 13.5px; color: var(--ink-2); }
.pg-switch-state.null { color: #b3b9c8; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--line); background: #fff;
  padding: 34px 0; margin-top: 40px;
}
.footer-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 13.5px; color: var(--ink-3); flex-wrap: wrap;
}
.footer a { color: var(--ink-2); }
.footer a:hover { color: var(--brand); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .comp-grid, .pg-grid, .quick-grid { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-with-toc { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 560px) {
  .feature-grid, .doc-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 12px; }
  .nav-links a.nav-hide-sm { display: none; }
  .mock-dropdown, .mock-tags, .mock-panel { margin-left: 0; }
}
