/* =========================================================
   ZFCHAT · 智能 AI 工具导航 —— 设计系统 v2
   风格方向：Soft UI Evolution（柔和阴影 / 高对比 / 现代留白）
   合规基线：WCAG AA（正文对比度 ≥ 4.5:1）、可见焦点、尊重 reduced-motion
   断点：375 / 768 / 1024 / 1440
   ========================================================= */

/* ---------------- 设计令牌 ---------------- */
:root {
  /* 品牌与语义色 */
  --brand: #5b5bd6;          /* 主色：紫蓝，白字对比 5.4:1 */
  --brand-strong: #4f46e5;
  --brand-2: #8b5cf6;
  --brand-soft: #eef0ff;
  --brand-ring: rgba(91, 91, 214, .28);
  --accent: #06b6d4;
  --cta: #f97316;            /* 强调色，仅用于非文字装饰与 hover */
  --hot: #dc2626;            /* HOT 徽标：白字 4.8:1 */
  --new: #047857;            /* NEW 徽标：白字 4.9:1 */
  --ok: #047857;
  --warn: #b45309;
  --danger: #dc2626;

  /* 中性色（Slate 系，对比度达标） */
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --card: #ffffff;
  --text: #1e293b;           /* 主文字 */
  --text-2: #475569;         /* 次要文字 7.0:1 */
  --text-3: #64748b;         /* 辅助文字 4.7:1 */
  --line: #e2e8f0;
  --line-soft: #eef2f7;

  /* 间距刻度（4px 基准） */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* 圆角与阴影 */
  --r-sm: 8px; --r: 12px; --r-md: 14px; --r-lg: 18px; --r-full: 999px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-2: 0 2px 4px rgba(15, 23, 42, .04), 0 8px 20px rgba(15, 23, 42, .06);
  --shadow-3: 0 4px 8px rgba(15, 23, 42, .05), 0 16px 36px rgba(91, 91, 214, .16);

  /* 动效 */
  --t-fast: 150ms; --t: 200ms; --t-slow: 300ms;
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* 字号刻度 */
  --fs-xs: 11.5px; --fs-sm: 13px; --fs-base: 14px;
  --fs-md: 15px; --fs-lg: 17px; --fs-xl: 21px; --fs-2xl: 30px; --fs-3xl: 40px;

  --maxw: 1320px;
  --nav-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 24px); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }

/* 图标默认与文字基线对齐 */
.zi { display: inline-block; vertical-align: -.15em; flex-shrink: 0; }
i[data-icon] { display: inline-flex; align-items: center; justify-content: center; }

/* ---------------- 可见焦点（键盘导航） ---------------- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible, label:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
/* 鼠标点击不显示焦点环，但保留键盘焦点 */
:focus:not(:focus-visible) { outline: none; }

/* ---------------- 布局 ---------------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-6); }

/* ---------------- 顶部导航 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 var(--s-6);
  min-height: var(--nav-h); display: flex; align-items: center; gap: var(--s-5);
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.4px; flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; display: grid; place-items: center; font-size: 15px; font-weight: 900;
  box-shadow: 0 4px 14px rgba(91, 91, 214, .3);
}
.logo-sub { font-size: 12px; font-weight: 500; color: var(--text-3); letter-spacing: 0; }

.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border-radius: var(--r-sm); font-size: var(--fs-base); font-weight: 500;
  color: var(--text-2); white-space: nowrap; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-link:hover { background: var(--bg-soft); color: var(--text); }
.nav-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 var(--s-4); border-radius: var(--r); cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: var(--fs-base); font-weight: 600; font-family: var(--font);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { border-color: #cbd5e1; box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-1); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: none;
  box-shadow: 0 4px 14px rgba(91, 91, 214, .28);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(91, 91, 214, .38); }
.btn-danger { color: var(--danger); border-color: #f3d2d2; background: #fff; }
.btn-danger:hover { background: #fef2f2; border-color: #eebfbf; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------------- Hero ---------------- */
.hero { padding: var(--s-16) 0 var(--s-8); text-align: center; position: relative; }
.hero::before {
  content: ''; position: absolute; inset: -50% 0 auto; height: 520px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(139, 92, 246, .16), transparent 70%),
              radial-gradient(closest-side at 32%, rgba(91, 91, 214, .14), transparent 70%);
}
.hero h1 { margin: 0 0 var(--s-3); font-size: var(--fs-3xl); line-height: 1.18; letter-spacing: -1.2px; font-weight: 800; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 58%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0 auto var(--s-6); max-width: 660px; color: var(--text-2); font-size: 16px; }

.search-wrap { max-width: 640px; margin: 0 auto; position: relative; }
.search {
  width: 100%; height: 54px; padding: 0 50px 0 50px; font-size: var(--fs-md); font-family: var(--font);
  border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; color: var(--text);
  box-shadow: var(--shadow-2); outline: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.search::placeholder { color: #94a3b8; }
.search:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.search-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--text-3); display: flex; }
.search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--bg-soft); color: var(--text-2); cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%; display: none; place-items: center;
  transition: background var(--t-fast) var(--ease);
}
.search-clear:hover { background: #e2e8f0; }
.search-clear.show { display: grid; }

/* 热门搜索建议 */
.chips { display: flex; justify-content: center; gap: var(--s-2); margin: var(--s-4) auto 0; flex-wrap: wrap; max-width: 640px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px;
  border: 1px solid var(--line); background: #fff; border-radius: var(--r-full);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); cursor: pointer;
  font-family: var(--font); transition: all var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.chip:active { transform: translateY(0); }
.chips-label { display: inline-flex; align-items: center; height: 32px; font-size: var(--fs-sm); color: var(--text-3); }

.hero-stats { display: flex; justify-content: center; gap: var(--s-10); margin-top: var(--s-8); flex-wrap: wrap; }
.stat b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.stat span { font-size: var(--fs-sm); color: var(--text-3); }

/* ---------------- 分类区块 ---------------- */
.main { padding-bottom: var(--s-16); }

/* 首页布局：左侧分类栏 + 右侧内容 */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--s-6); align-items: start; }

.cat-side {
  position: sticky; top: calc(var(--nav-h) + 16px);
  align-self: start;
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: var(--s-2);
}
.cat-side-inner { display: flex; flex-direction: column; gap: 2px; }
.cat-side-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border: none; background: none; border-radius: var(--r);
  font-size: var(--fs-base); font-weight: 600; color: var(--text-2);
  cursor: pointer; text-align: left; font-family: var(--font);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.cat-side-item .ico {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand);
}
.cat-side-item .cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-side-item .cnt { margin-left: auto; font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); flex-shrink: 0; }
.cat-side-item:hover { background: var(--bg-soft); }
.cat-side-item.active { background: var(--brand-soft); color: var(--brand); }
.cat-side-item.active .cnt { color: var(--brand); }
.section { margin-top: var(--s-12); scroll-margin-top: calc(var(--nav-h) + 20px); }
.section-head { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-4); flex-wrap: wrap; }
.section-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.4px; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-title .ico {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.section-en { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: .8px; text-transform: uppercase; }
.section-desc { font-size: var(--fs-sm); color: var(--text-3); flex: 1 1 100%; margin-top: -2px; }
.section-count { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); }

/* ---------------- 卡片网格 ---------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: var(--s-4); }

.card {
  position: relative; display: flex; gap: var(--s-3); padding: var(--s-4);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); cursor: pointer;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), border-color var(--t) var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-3); border-color: #d8dcf3; }
.card:active { transform: translateY(-1px); }

.fav {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0; overflow: hidden;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #eef0ff, #f5f0ff); font-weight: 800; font-size: 17px; color: var(--brand);
}
.fav img { width: 24px; height: 24px; object-fit: contain; border-radius: 5px; }

.card-body { min-width: 0; flex: 1; }
.card-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--fs-md); }
.card-title .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-desc {
  margin-top: 5px; font-size: var(--fs-sm); color: var(--text-3); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px;
}
.card-host { margin-top: 7px; font-size: var(--fs-xs); color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 5px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .2px; flex-shrink: 0; color: #fff;
}
.badge-hot { background: var(--hot); }
.badge-new { background: var(--new); }
.badge-pending { background: #fef3c7; color: var(--warn); border: 1px solid #fcd34d; }

.card-tags { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.tag { font-size: var(--fs-xs); color: var(--text-3); background: var(--bg-soft); padding: 1px 7px; border-radius: 5px; }

/* 卡片外链指示：hover / focus 时淡入 */
.card-ext {
  position: absolute; top: 12px; right: 12px; color: #cbd5e1;
  opacity: 0; transform: translate(-2px, 2px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease), color var(--t) var(--ease);
}
.card:hover .card-ext, .card:focus-visible .card-ext { opacity: 1; transform: translate(0, 0); color: var(--brand); }

/* ---------------- 状态：加载 / 空 / 错误 ---------------- */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: var(--s-4); }
.sk { height: 112px; border-radius: var(--r-md); background: linear-gradient(100deg, #f1f5f9 30%, #e6ebf2 50%, #f1f5f9 70%); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }

.empty { padding: var(--s-12) var(--s-5); text-align: center; color: var(--text-3); font-size: var(--fs-base); }
.empty .e-ico { color: #cbd5e1; margin-bottom: var(--s-3); }
.empty .e-title { font-weight: 600; color: var(--text-2); margin-bottom: 6px; font-size: var(--fs-md); }
.empty .e-actions { margin-top: var(--s-4); display: flex; gap: var(--s-2); justify-content: center; flex-wrap: wrap; }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: #1e293b; color: #fff; padding: 11px 20px; border-radius: var(--r);
  font-size: var(--fs-base); opacity: 0; pointer-events: none; z-index: 200;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .22);
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #b42318; }
.toast.ok { background: #047857; }

/* ---------------- 页脚 ---------------- */
.footer { border-top: 1px solid var(--line); background: #fff; padding: var(--s-8) 0; }
.footer-inner { display: flex; justify-content: space-between; gap: var(--s-5); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--text-3); }
.footer-links { display: flex; gap: var(--s-4); flex-wrap: wrap; align-items: center; }
.footer a { transition: color var(--t-fast) var(--ease); }
.footer a:hover { color: var(--brand); }
.footer .copyright { font-weight: 600; color: var(--text-2); }
.footer .f-note { margin-top: 6px; }

/* ---------------- 内页（提交 / 后台） ---------------- */
.page { padding: var(--s-10) 0 var(--s-16); }
.page-head { margin-bottom: var(--s-6); }
.page-head h1 { margin: 0 0 var(--s-2); font-size: var(--fs-2xl); letter-spacing: -.8px; }
.page-head p { margin: 0; color: var(--text-3); font-size: var(--fs-base); max-width: 720px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--s-6); }
.panel + .panel { margin-top: var(--s-4); }
.panel-title { font-size: var(--fs-lg); font-weight: 700; margin: 0 0 6px; display: flex; align-items: center; gap: var(--s-2); }
.panel-desc { font-size: var(--fs-sm); color: var(--text-3); margin: 0 0 var(--s-5); }

.field { margin-bottom: var(--s-4); }
.field > label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: var(--fs-xs); color: var(--text-3); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: 0 var(--s-3); font-size: var(--fs-base); font-family: var(--font);
  border: 1px solid var(--line); border-radius: var(--r); background: #fff; color: var(--text); outline: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.textarea { min-height: 88px; padding: 11px var(--s-3); resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--s-4); }

.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--line); margin-bottom: var(--s-6); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 11px var(--s-4);
  font-size: var(--fs-base); font-weight: 600; color: var(--text-3); background: none;
  border: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; font-family: var(--font);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------------- 上传 / 导入 ---------------- */
.drop {
  border: 2px dashed #d5dbe6; border-radius: var(--r-lg); padding: var(--s-8) var(--s-5);
  text-align: center; background: #fbfcfe; cursor: pointer;
  transition: border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .big { color: var(--brand); margin-bottom: var(--s-2); }
.drop .t { font-weight: 600; }
.drop .s { font-size: var(--fs-sm); color: var(--text-3); margin-top: 6px; }
.steps { display: flex; gap: var(--s-2); flex-wrap: wrap; margin: var(--s-4) 0 0; padding: 0; list-style: none; }
.steps li { font-size: var(--fs-xs); color: var(--text-2); background: var(--bg-soft); padding: 5px 11px; border-radius: var(--r-full); }

.import-bar {
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin: var(--s-4) 0 var(--s-3);
  padding: var(--s-3) var(--s-4); background: var(--bg-soft); border-radius: var(--r); font-size: var(--fs-sm);
}
.import-bar select, .import-bar input {
  height: 34px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: #fff; font-family: var(--font); font-size: var(--fs-sm);
}
.import-bar .spacer { flex: 1; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 720px; }
th, td { padding: 11px var(--s-3); text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { background: #f8fafc; font-size: var(--fs-xs); font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .4px; position: sticky; top: 0; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbff; }
td .cell-name { font-weight: 600; }
td .cell-url { color: var(--text-3); font-size: var(--fs-xs); word-break: break-all; }
.td-actions { white-space: nowrap; text-align: right; }
.check { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.table-scroll { max-height: 460px; overflow: auto; }
.table-scroll table { min-width: 640px; }
.table-scroll td select, .table-scroll td input {
  height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: var(--fs-xs); font-family: var(--font); width: 100%;
}

.result-box { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r); font-size: var(--fs-sm); display: none; }
.result-box.show { display: block; }
.result-box.ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.result-box.err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.result-box.info { background: var(--brand-soft); color: #3730a3; border: 1px solid #c7d2fe; }

/* ---------------- 返回顶部 ---------------- */
.to-top {
  position: fixed; right: 24px; bottom: 30px; width: 44px; height: 44px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-2); cursor: pointer;
  display: none; place-items: center; color: var(--text-2); z-index: 60;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.to-top.show { display: grid; }
.to-top:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-2px); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); }
  .hero h1 { font-size: 34px; }
}
@media (max-width: 900px) {
  .nav-inner { flex-wrap: wrap; min-height: 0; padding-top: 10px; padding-bottom: 8px; gap: var(--s-3); }
  .logo-sub { display: none; }
  .nav-links { order: 3; flex-basis: 100%; }
  .nav-actions { margin-left: auto; }
  .hero { padding: var(--s-10) 0 var(--s-6); }
  .hero-stats { gap: var(--s-6); }
  .row, .row-3 { grid-template-columns: 1fr; }
  .container { padding: 0 var(--s-4); }
  .layout { grid-template-columns: 1fr; gap: var(--s-4); }
  .cat-side {
    position: static; max-height: none; overflow: visible;
    padding: var(--s-1);
  }
  .cat-side-inner { flex-direction: row; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px; }
  .cat-side-inner::-webkit-scrollbar { display: none; }
  .cat-side-item { width: auto; flex-shrink: 0; white-space: nowrap; }
  .cat-side-item .cnt { margin-left: 6px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: var(--fs-base); }
  .search { height: 48px; font-size: var(--fs-base); }
  .stat b { font-size: 22px; }
  .hero-stats { gap: var(--s-5); }
  /* 移动端保证触控目标 ≥ 44px */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .nav-link { padding: 9px 12px; }
  .panel { padding: var(--s-4); border-radius: var(--r-md); }
  .chip, .chips-label { height: 40px; padding: 0 15px; }
  .to-top { right: 16px; bottom: 20px; }
}

/* ---------------- 尊重系统动效偏好 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover { transform: none; }
  .btn:hover { transform: none; }
}
