/* ==========================================================================
   site.css — 果仁效能工具库 设计系统（全站单一来源）
   --------------------------------------------------------------------------
   结构：令牌 → 基础 → 外壳（顶栏 / 操作条 / 页脚）→ 公共组件 → 首页 → 响应式
   约束：零外部依赖（无 CDN、无网络字体），沿用系统字体栈
   令牌：可调参数全部收敛在 :root；页面专属样式只允许引用令牌，不再自造色值/字号
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计令牌
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* 色彩 · 中性（占画面 70–90%） */
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-subtle: #FAFAFC;
  --surface-sunken: #F2F2F5;
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;   /* 白 / 近白卡片上的说明文字：白底 5.07:1，页面灰底 4.66:1 */
  --text-on-fill: #66666B;     /* 灰色填充上的文字（徽标、分段控件、输入占位符）：最深灰底 4.80:1 */
  --text-tertiary: #66666B;    /* 存量页面的第三级文字仍引用此名；第二批迁移后并入 --text-on-fill */
  --border: rgba(0, 0, 0, 0.10);
  --border-light: rgba(0, 0, 0, 0.06);
  --ink: #1D1D1F;              /* 品牌深色：标识、选中态 */

  /* 色彩 · 强调（全站唯一强调色；做文字时用 -text 变体保证对比度） */
  --accent: #0071E3;
  --accent-hover: #0077ED;
  --accent-soft: rgba(0, 113, 227, 0.10);
  --accent-text: #0066CC;      /* 白底 5.57:1，灰底 5.11:1 */

  /* 色彩 · 语义 */
  --success: #107C41;
  --success-hover: #0C672F;
  --success-soft: rgba(16, 124, 65, 0.10);
  --success-text: #107C41;
  --warning: #B45309;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --warning-text: #92400E;
  --danger: #D92D20;
  --danger-hover: #B42318;
  --danger-soft: rgba(217, 45, 32, 0.10);
  --danger-text: #B42318;
  --violet: #6D28D9;
  --violet-soft: rgba(109, 40, 217, 0.10);
  --violet-text: #6D28D9;
  --teal: #0E7490;
  --teal-soft: rgba(14, 116, 144, 0.12);
  --teal-text: #0E7490;

  /* 工具类型分类色（只用于类型标识，不与状态色混用） */
  --cat-windows: #0071E3;
  --cat-macro: #107C41;
  --cat-bot: #6D28D9;
  --cat-web: #0E7490;

  /* 兼容别名：存量页面仍在使用的旧令牌名（第二批改造后移除） */
  --blue: var(--accent);
  --blue-hover: var(--accent-hover);
  --blue-soft: var(--accent-soft);
  --green: var(--success);
  --green-soft: var(--success-soft);
  --orange: var(--warning);
  --orange-soft: var(--warning-soft);
  --red: var(--danger);
  --red-soft: var(--danger-soft);
  --purple: var(--violet);
  --purple-soft: var(--violet-soft);
  --card: var(--surface);
  --hairline: var(--border-light);

  /* 字体与字号阶梯（全站 8 级） */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 32px;
  --leading-tight: 1.3;
  --leading-normal: 1.55;
  --leading-relaxed: 1.65;
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* 间距（4 的倍数） */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* 圆角 / 阴影 / 层级 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.18);
  --z-appbar: 100;
  --z-subbar: 90;
  --z-dropdown: 60;
  --z-modal: 500;
  --z-toast: 999;

  /* 版心与外壳尺寸（两档宽度；断点统一为 768 与 1024） */
  --container: 1180px;         /* 列表 / 看板 / 后台 */
  --container-narrow: 1008px;  /* 详情 / 日志 / 个人中心 / 指南（内容宽 960） */
  --appbar-h: 56px;
  --subbar-h: 44px;

  /* 动效：只用于状态切换，命名具体属性，时长 ≤ 200ms */
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. 基础
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; line-height: inherit; }
img, svg { display: block; max-width: 100%; }
code, kbd, pre { font-family: var(--font-mono); }
strong, b { font-weight: var(--weight-semibold); }
h1, h2, h3, h4 { font-weight: var(--weight-semibold); line-height: var(--leading-tight); }
/* 小字号标题折行时需要更松的行距（中文 ≥ 1.5），大标题保持紧凑 */
h3, h4 { line-height: var(--leading-normal); }

/* 键盘焦点：2px 实线 + 2px 偏移，所有可聚焦元素统一 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* 图标：行内 SVG，尺寸由 width/height 控制 */
.icon { display: inline-block; flex-shrink: 0; vertical-align: -0.18em; }

/* 工具类 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.muted { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.skip-link {
  position: fixed; top: 8px; left: 16px; z-index: calc(var(--z-toast) + 1);
  transform: translateY(-200%);
  padding: 8px 14px; border-radius: var(--radius-md);
  background: var(--ink); color: #FFFFFF; font-size: var(--text-sm); font-weight: var(--weight-medium);
}
.skip-link:focus { transform: none; }

/* 版心与页面骨架 */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.container--narrow { max-width: var(--container-narrow); }
.page-main { flex: 1 0 auto; }
.page { display: flex; flex-direction: column; gap: var(--space-5); padding-top: var(--space-6); padding-bottom: var(--space-12); }

/* 页头：标题 + 说明 + 右侧操作 */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3) var(--space-6);
}
.page-title { font-size: var(--text-2xl); letter-spacing: -0.01em; }
.page-desc { margin-top: var(--space-1); font-size: var(--text-base); color: var(--text-secondary); max-width: 65ch; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }

/* --------------------------------------------------------------------------
   3. 外壳 · 顶栏
   -------------------------------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: var(--z-appbar);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
}
.appbar-inner {
  max-width: var(--container); height: var(--appbar-h); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: var(--space-4);
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); letter-spacing: -0.01em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #3A3A3C, var(--ink));
  color: #FFFFFF; display: grid; place-items: center;
}
.brand-name { white-space: nowrap; }

.appnav { display: flex; align-items: center; gap: 2px; }
.appnav-link {
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary);
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.appnav-link:hover { color: var(--text-primary); }
.appnav-link.is-active { color: var(--text-primary); background: rgba(0, 0, 0, 0.07); }

.appbar-end { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* 顶栏搜索：默认紧凑；首页加 .is-primary 成为主搜索框 */
.appbar-search { position: relative; flex: 0 1 260px; min-width: 160px; }
.appbar-search.is-primary { flex: 1 1 360px; max-width: 440px; }
.appbar-search-field {
  display: flex; align-items: center; gap: var(--space-2);
  height: 36px; padding: 0 12px; border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.05); color: var(--text-secondary);
  transition: background-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.appbar-search-field:hover { background: rgba(0, 0, 0, 0.07); }
.appbar-search-field:focus-within { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); }
.appbar-search-input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  font-size: var(--text-sm); color: var(--text-primary);
}
.appbar-search-input::placeholder { color: var(--text-on-fill); opacity: 1; }
.appbar-search-input::-webkit-search-cancel-button { display: none; }
.appbar-search-clear { display: none; width: 24px; height: 24px; border-radius: 50%; color: var(--text-secondary); place-items: center; }
.appbar-search-clear:hover { background: rgba(0, 0, 0, 0.08); color: var(--text-primary); }
.appbar-search-clear.is-visible { display: grid; }

/* 图标按钮（≥ 24×24 触控面积） */
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%; color: var(--text-secondary);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-primary); }
.icon-btn[aria-expanded="true"] { background: rgba(0, 0, 0, 0.08); color: var(--text-primary); }
.menu-btn { display: none; }

/* 用户胶囊与头像 */
.avatar-pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  height: 36px; padding: 0 10px 0 4px; border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.05); font-size: var(--text-sm); font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease);
}
.avatar-pill:hover { background: rgba(0, 0, 0, 0.09); }
.avatar-wrap { display: grid; place-items: center; }
.avatar-dot, .avatar-img { width: 28px; height: 28px; border-radius: 50%; }
.avatar-dot { background: var(--ink); color: #FFFFFF; font-size: var(--text-xs); font-weight: var(--weight-semibold); display: grid; place-items: center; }
.avatar-img { object-fit: cover; background: var(--surface-sunken); }
.user-name { max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
.user-caret { color: var(--text-tertiary); transition: transform var(--dur-fast) var(--ease); }
.avatar-pill[aria-expanded="true"] .user-caret { transform: rotate(180deg); }

/* 下拉面板（用户菜单 / 窄屏导航菜单共用） */
.dropdown-host { position: relative; }
.dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: var(--z-dropdown);
  min-width: 160px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px;
  box-shadow: var(--shadow-md); display: none;
}
.dropdown.is-open { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: var(--space-2); width: 100%;
  height: 38px; padding: 0 10px; border-radius: 9px;
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-primary); text-align: left; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease);
}
.dropdown-item:hover { background: rgba(0, 0, 0, 0.05); }
.dropdown-item.is-active { background: rgba(0, 0, 0, 0.07); }
.dropdown-item--danger { color: var(--danger-text); }
.dropdown-item--danger:hover { background: var(--danger-soft); }

/* --------------------------------------------------------------------------
   4. 外壳 · 页面操作条（详情 / 工单 / 编辑器：返回 + 标题 + 主操作）
   -------------------------------------------------------------------------- */
.subbar {
  position: sticky; top: var(--appbar-h); z-index: var(--z-subbar);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
}
.subbar-inner {
  --subbar-w: var(--container-narrow);
  max-width: var(--subbar-w); height: var(--subbar-h); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: var(--space-3);
}
.subbar--wide .subbar-inner { --subbar-w: var(--container); }
.subbar-back {
  display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 10px 0 6px; margin-left: -6px;
  border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-secondary);
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.subbar-back:hover { background: rgba(0, 0, 0, 0.05); color: var(--text-primary); }
.subbar-title {
  flex: 1; min-width: 0; text-align: center;
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  visibility: hidden; opacity: 0;
  transition: opacity var(--dur-base) var(--ease), visibility var(--dur-base);
}
.subbar-title.is-visible { visibility: visible; opacity: 1; }
.subbar-actions { display: flex; align-items: center; gap: var(--space-2); flex-shrink: 0; }

/* --------------------------------------------------------------------------
   5. 外壳 · 页脚
   -------------------------------------------------------------------------- */
.site-footer { flex-shrink: 0; margin-top: auto; border-top: 1px solid var(--border-light); }
.site-footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--space-2) var(--space-6);
  padding-top: var(--space-5); padding-bottom: var(--space-6);
  font-size: var(--text-xs); color: var(--text-secondary);
}
.site-footer-text strong { font-weight: var(--weight-medium); color: var(--text-primary); }
.site-footer-cta { display: inline-flex; align-items: center; min-height: 24px; }
.site-footer-cta a { margin-left: 4px; color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.site-footer-cta a:hover { text-decoration-color: currentColor; }

/* --------------------------------------------------------------------------
   6. 按钮 / 链接 / 徽标
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: var(--text-base); font-weight: var(--weight-medium); white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.btn .icon { width: 16px; height: 16px; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text-primary); }
.btn-secondary:hover { background: var(--surface-subtle); border-color: rgba(0, 0, 0, 0.16); }
.btn-ghost { background: transparent; color: var(--text-primary); }
.btn-ghost:hover { background: rgba(0, 0, 0, 0.05); }
.btn-danger { background: var(--danger-soft); color: var(--danger-text); }
.btn-danger:hover { background: rgba(217, 45, 32, 0.16); }
.btn-sm { height: 30px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-lg { height: 44px; padding: 0 var(--space-5); font-size: var(--text-md); }
.btn[disabled], .btn.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.link { color: var(--text-primary); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; transition: text-decoration-color var(--dur-fast) var(--ease); }
.link:hover { text-decoration-color: currentColor; }

/* 收藏星标（卡片角落与详情页大按钮共用） */
.fav-btn .icon { fill: none; }
.fav-btn[aria-pressed="true"] { color: var(--warning); }
.fav-btn[aria-pressed="true"] .icon { fill: #D97706; stroke: var(--warning); }
.btn-fav[aria-pressed="true"] { background: rgba(217, 119, 6, 0.10); border-color: rgba(217, 119, 6, 0.36); }

/* 徽标：高度 22，文字一律用 -text 变体保证对比度 */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-medium); white-space: nowrap;
}
.badge-blue { background: var(--accent-soft); color: var(--accent-text); }
.badge-green { background: var(--success-soft); color: var(--success-text); }
.badge-orange { background: var(--warning-soft); color: var(--warning-text); }
.badge-red { background: var(--danger-soft); color: var(--danger-text); }
.badge-purple { background: var(--violet-soft); color: var(--violet-text); }
.badge-teal { background: var(--teal-soft); color: var(--teal-text); }
.badge-gray { background: rgba(0, 0, 0, 0.06); color: var(--text-on-fill); }
.badge-ink { background: var(--ink); color: #FFFFFF; }

/* --------------------------------------------------------------------------
   7. 容器与内容块
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm); padding: var(--space-6);
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.section-title { font-size: var(--text-xl); letter-spacing: -0.01em; }
.section-sub { margin-top: 2px; font-size: var(--text-sm); color: var(--text-secondary); max-width: 65ch; }

/* 工具图标底（渐变来自工具数据；无数据时按类型回退，单色相渐变） */
.app-icon {
  width: 48px; height: 48px; padding: 10px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; color: #FFFFFF;
  background-color: var(--text-secondary);
  background-image: linear-gradient(135deg, var(--cat-from, #8E8E93), var(--cat-to, var(--ink)));
  background-size: cover;
}
.app-icon svg, .app-icon img { width: 100%; height: 100%; object-fit: contain; }
.app-icon span { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1; }
.app-icon.cat-windows { --cat-from: #1A8CFF; --cat-to: #0066CC; }
.app-icon.cat-macro { --cat-from: #22A55B; --cat-to: #0C672F; }
.app-icon.cat-bot { --cat-from: #7E3BD6; --cat-to: #5B1FB3; }
.app-icon.cat-web { --cat-from: #14A3B8; --cat-to: #0B5E73; }
.app-icon--lg { width: 84px; height: 84px; padding: 18px; border-radius: 22px; }

/* --------------------------------------------------------------------------
   8. 表单
   -------------------------------------------------------------------------- */
.form-group { margin-bottom: var(--space-4); }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form-label { display: flex; align-items: baseline; gap: 4px; font-size: var(--text-sm); font-weight: var(--weight-medium); margin-bottom: 6px; }
.form-label .req { color: var(--danger-text); font-weight: var(--weight-normal); }
.form-hint { margin-top: 6px; font-size: var(--text-xs); color: var(--text-secondary); }
.form-control {
  width: 100%; height: 40px; padding: 0 var(--space-3); border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary);
  font-size: var(--text-base); outline: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
textarea.form-control { height: auto; min-height: 120px; padding: 10px var(--space-3); line-height: var(--leading-relaxed); resize: vertical; }
.form-control::placeholder { color: var(--text-on-fill); opacity: 1; }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-control[readonly], .form-control[disabled] { background: var(--surface-sunken); color: var(--text-secondary); }
.form-control[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
select.form-control {
  appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* 分段控件（视图切换 / 筛选）：role=tablist + aria-selected */
.segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, 0.06); }
.segmented-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 14px; border-radius: var(--radius-pill);
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-on-fill); white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.segmented-btn:hover { color: var(--text-primary); }
.segmented-btn.is-active, .segmented-btn[aria-selected="true"] { background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* 筛选胶囊（服务端筛选链接） */
.chip-track { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2); height: 32px; padding: 0 14px;
  border-radius: var(--radius-pill); background: rgba(0, 0, 0, 0.045);
  font-size: var(--text-base); font-weight: var(--weight-medium); color: var(--text-secondary); white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.chip:hover { background: rgba(0, 0, 0, 0.08); color: var(--text-primary); }
.chip.is-active, .chip[aria-current="true"] { background: var(--ink); color: #FFFFFF; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, currentColor); flex-shrink: 0; }
.chip.is-active .chip-dot { background: #FFFFFF; }

/* --------------------------------------------------------------------------
   9. 弹窗 / Toast
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: none; align-items: center; justify-content: center; padding: var(--space-5);
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow: auto;
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  animation: modalIn var(--dur-base) var(--ease);
}
.modal-card--sm { max-width: 400px; }
.modal-card--lg { max-width: 720px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 18px 22px; border-bottom: 1px solid var(--border-light); }
.modal-title { font-size: var(--text-lg); }
.modal-close { width: 30px; height: 30px; border-radius: 50%; background: rgba(0, 0, 0, 0.05); color: var(--text-secondary); display: grid; place-items: center; flex-shrink: 0; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.modal-close:hover { background: rgba(0, 0, 0, 0.1); color: var(--text-primary); }
.modal-body { padding: var(--space-5) 22px; }
.modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); padding: 14px 22px; border-top: 1px solid var(--border-light); background: var(--surface-subtle); }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: var(--z-toast); transform: translateX(-50%);
  display: none; max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.94); color: #FFFFFF;
  font-size: var(--text-sm); font-weight: var(--weight-medium); text-align: center;
  box-shadow: var(--shadow-md);
}
.toast.show { display: block; animation: toastIn var(--dur-base) var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* --------------------------------------------------------------------------
   10. 表格 / 空状态 / 统计卡
   -------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
.data-table th { padding: 10px 12px; text-align: left; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-secondary); white-space: nowrap; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px; vertical-align: middle; border-bottom: 1px solid var(--border-light); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-subtle); }

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: var(--space-10) var(--space-6); }
.empty-icon { width: 48px; height: 48px; border-radius: 50%; background: rgba(0, 0, 0, 0.05); color: var(--text-secondary); display: grid; place-items: center; margin-bottom: var(--space-4); }
.empty-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
.empty-desc { margin-top: var(--space-1); margin-bottom: var(--space-5); font-size: var(--text-sm); color: var(--text-secondary); max-width: 44ch; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.stat-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 18px 20px; min-width: 0; }
.stat-label { font-size: var(--text-sm); color: var(--text-secondary); }
.stat-value { margin: 4px 0; font-size: var(--text-3xl); font-weight: var(--weight-semibold); line-height: 1.15; letter-spacing: -0.02em; }
.stat-sub { font-size: var(--text-xs); color: var(--text-secondary); }

/* --------------------------------------------------------------------------
   11. 手风琴（FAQ）：内容高度由 site.js / detail.js 按实际内容设置
   -------------------------------------------------------------------------- */
.faq-list { display: flex; flex-direction: column; gap: var(--space-2); }
.faq-item { background: var(--surface-subtle); border: 1px solid var(--border-light); border-radius: var(--radius-md); }
.faq-trigger { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); width: 100%; min-height: 48px; padding: 14px 16px; text-align: left; font-size: var(--text-base); font-weight: var(--weight-semibold); color: var(--text-primary); }
.faq-chevron { width: 18px; height: 18px; color: var(--text-secondary); flex-shrink: 0; transition: transform var(--dur-base) var(--ease); }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-content { max-height: 0; overflow: hidden; transition: max-height var(--dur-base) var(--ease); }
.faq-body { padding: 0 16px 16px; font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-relaxed); }

/* --------------------------------------------------------------------------
   12. 首页：筛选条 + 工具卡片
   -------------------------------------------------------------------------- */
.filter-bar { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-5); }
.filter-row + .filter-row { border-top: 1px solid var(--border-light); }
.filter-label { flex-shrink: 0; font-size: var(--text-sm); color: var(--text-secondary); }
.filter-count { margin-left: auto; font-size: var(--text-sm); color: var(--text-secondary); white-space: nowrap; }
.filter-count strong { color: var(--text-primary); font-weight: var(--weight-semibold); }

.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.tool-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.tool-card:hover { border-color: var(--border); box-shadow: var(--shadow-md); }
.tool-card-link { display: flex; flex: 1; padding: var(--space-5) var(--space-5) var(--space-4); border-radius: inherit; }
.tool-card-main { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; flex: 1; }
.tool-card-text { min-width: 0; }
.tool-card-title { display: block; font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: 1.35; }
.tool-card-summary { display: block; margin-top: var(--space-1); font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.6; }
.tool-card-foot { display: flex; align-items: center; gap: var(--space-2); padding: 10px 12px 10px var(--space-5); border-top: 1px solid var(--border-light); }
.tool-card-meta { min-width: 0; font-size: var(--text-xs); color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card .fav-btn { margin-left: auto; width: 32px; height: 32px; }
.home-stats { margin-left: 0; }
.cat-dot-windows { --dot: var(--cat-windows); }
.cat-dot-macro { --dot: var(--cat-macro); }
.cat-dot-bot { --dot: var(--cat-bot); }
.cat-dot-web { --dot: var(--cat-web); }

/* --------------------------------------------------------------------------
   13. 响应式（断点只有 1024 与 768）
   -------------------------------------------------------------------------- */
@media (max-width: 1023.98px) {
  /* 导航收进顶栏下方的面板（同一份链接，不重复渲染），由“菜单”按钮开关 */
  .appnav {
    position: absolute; top: calc(100% + 6px); right: 12px; z-index: var(--z-dropdown);
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    min-width: 176px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px;
    box-shadow: var(--shadow-md);
  }
  .appnav.is-open { display: flex; }
  .appnav-link { height: 40px; padding: 0 12px; border-radius: 9px; font-size: var(--text-md); }
  .menu-btn { display: inline-grid; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .container, .appbar-inner, .subbar-inner { padding-inline: 16px; }
  .appbar-inner { gap: var(--space-2); }
  .brand { gap: var(--space-2); font-size: var(--text-base); }
  .appbar-search { display: none; }
  .appbar-search.is-primary { display: block; flex: 1 0 100%; min-width: 0; max-width: none; order: 5; }
  .appbar-inner.has-primary-search { flex-wrap: wrap; height: auto; min-height: var(--appbar-h); padding-top: var(--space-2); padding-bottom: var(--space-2); row-gap: var(--space-2); }
  .user-name, .user-caret { display: none; }
  .avatar-pill { width: 36px; height: 36px; padding: 0 4px; justify-content: center; }
  .avatar-dot, .avatar-img { width: 28px; height: 28px; }
  .card { padding: var(--space-5); border-radius: var(--radius-lg); }
  .page { padding-top: var(--space-5); gap: var(--space-4); }
  .tool-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .filter-count { margin-left: 0; flex-basis: 100%; }
  .subbar-back span { display: none; }
  .subbar-back { width: 32px; padding: 0; justify-content: center; }
  .subbar-title { text-align: left; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
}

/* --------------------------------------------------------------------------
   14. 动效降级
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
