:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #98a2b3;
  --line: #eceff5;
  --line-2: #e2e7f0;
  --brand: #4f46e5;
  --brand-soft: rgba(79, 70, 229, 0.08);
  --brand-2: #7c3aed;
  --brand-3: #0ea5e9;
  --ok: #059669;
  --danger: #dc2626;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 16px -10px rgba(16, 24, 40, 0.14);
  --shadow: 0 2px 6px -2px rgba(16, 24, 40, 0.05), 0 14px 32px -20px rgba(16, 24, 40, 0.18);
  --shadow-lg: 0 28px 64px -32px rgba(16, 24, 40, 0.3);
  --ring: 0 0 0 4px rgba(79, 70, 229, 0.14);
  /* 页面左右留白：手机 16px，随屏宽增大到最多 56px */
  --pad-x: clamp(16px, 4vw, 56px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: #f3f6fc;
  background-image:
    radial-gradient(900px 500px at 8% -8%, rgba(99, 102, 241, 0.08), transparent 60%),
    radial-gradient(800px 420px at 96% 4%, rgba(14, 165, 233, 0.06), transparent 58%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI',
    Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
}

#app {
  width: 100%;
}

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

::selection {
  background: rgba(79, 70, 229, 0.18);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- 首页布局：左侧边栏 + 右侧主内容 ---------- */
.home-layout {
  display: flex;
  min-height: 100vh;
}

.home-sidebar {
  position: sticky;
  top: 0;
  width: 232px;
  height: 100vh;
  flex: none;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #eaedf5;
  padding: 28px 16px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #dde2ee transparent;
  z-index: 10;
}
.home-sidebar::-webkit-scrollbar { width: 5px; }
.home-sidebar::-webkit-scrollbar-thumb {
  background: #dde2ee;
  border-radius: 4px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 24px;
  margin-bottom: 8px;
  border-bottom: 1px solid #f1f3f9;
}

.sidebar-brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 8px 18px -8px rgba(99, 102, 241, 0.45);
  flex: none;
}

.sidebar-brand-mark svg {
  width: 22px;
  height: 22px;
}

.sidebar-brand-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
  position: relative;
}

.sidebar-item:hover {
  background: #f5f7ff;
  color: var(--ink);
}

.sidebar-item.active {
  background: #eef2ff;
  color: var(--brand);
  font-weight: 600;
}

.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brand);
}

.sidebar-icon {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--ink-3);
  background: #f4f6fb;
  transition: background 0.16s, color 0.16s;
}

.sidebar-icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-item:hover .sidebar-icon {
  color: var(--brand);
  background: #e8ecff;
}

.sidebar-item.active .sidebar-icon {
  color: #fff;
  background: var(--brand);
}

.home-main {
  flex: 1;
  min-width: 0;
  padding: 26px 36px 48px;
}

.home-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.home-topbar .search-box {
  flex: 1;
  max-width: 560px;
  margin: 0;
}

.home-topbar .search-input {
  height: 48px;
  border: 1px solid #e2e7f0;
  box-shadow: 0 4px 12px -6px rgba(16, 24, 40, 0.06);
}

.home-topbar .search-input:focus {
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 4px 12px -6px rgba(16, 24, 40, 0.08);
}

.home-content {
  scroll-behavior: smooth;
}

/* 主区域：极淡点阵 + 顶部光晕，营造科技感但不抢内容 */
.home-main {
  background-image: radial-gradient(rgba(16, 24, 40, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
}

.home-layout {
  background-image:
    radial-gradient(760px 420px at 88% -6%, rgba(79, 70, 229, 0.1), transparent 62%),
    radial-gradient(620px 360px at 4% 6%, rgba(14, 165, 233, 0.07), transparent 64%);
}

/* ---------- 首页 Hero：深色科技横幅 ---------- */
.home-hero {
  position: relative;
  overflow: hidden;
  margin: 4px 0 8px;
  padding: 34px 36px 30px;
  border-radius: 22px;
  color: #fff;
  background:
    linear-gradient(135deg, #0b1220 0%, #131c33 52%, #191446 100%);
  box-shadow:
    0 24px 60px -32px rgba(15, 23, 42, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 网格线，向右上角渐隐 */
.home-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(130% 110% at 18% 0%, #000 25%, transparent 78%);
  mask-image: radial-gradient(130% 110% at 18% 0%, #000 25%, transparent 78%);
  pointer-events: none;
}

/* 右上角靛蓝光晕 */
.home-hero::after {
  content: '';
  position: absolute;
  right: -110px;
  top: -190px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.55), transparent 66%);
  filter: blur(6px);
  animation: heroGlow 10s ease-in-out infinite alternate;
  pointer-events: none;
}

/* 左下角青色光晕 */
.hero-decor {
  position: absolute;
  left: -90px;
  bottom: -210px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.4), transparent 68%);
  pointer-events: none;
}

@keyframes heroGlow {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  to { transform: translate3d(-26px, 18px, 0) scale(1.08); opacity: 1; }
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

/* 右侧轨道装饰：同心环 + 两个发光节点，慢慢旋转 */
.hero-orbit {
  position: absolute;
  right: 34px;
  top: 50%;
  width: 280px;
  height: 280px;
  margin-top: -140px;
  pointer-events: none;
  opacity: 0.9;
}

.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(148, 163, 255, 0.22);
  border-radius: 50%;
  animation: orbitSpin 24s linear infinite;
}

.orbit-ring.r2 {
  inset: 46px;
  border-color: rgba(125, 211, 252, 0.2);
  border-style: dashed;
  animation-duration: 40s;
  animation-direction: reverse;
}

.orbit-core {
  position: absolute;
  inset: 108px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(165, 180, 252, 0.85), rgba(79, 70, 229, 0.35) 60%, transparent 72%);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.45);
}

.orbit-node {
  position: absolute;
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: #7dd3fc;
  box-shadow: 0 0 10px rgba(125, 211, 252, 0.95);
}

.orbit-node.n2 {
  top: auto;
  left: auto;
  bottom: 44px;
  right: 40px;
  background: #f0abfc;
  box-shadow: 0 0 10px rgba(240, 171, 252, 0.9);
}

@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 1180px) {
  .hero-orbit {
    right: -40px;
    width: 240px;
    height: 240px;
    margin-top: -120px;
    opacity: 0.6;
  }
  .orbit-core { inset: 92px; }
  .orbit-ring.r2 { inset: 40px; }
  .hero-inner { max-width: 520px; }
}

@media (max-width: 900px) {
  .hero-orbit { display: none; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: rgba(226, 232, 240, 0.92);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.16), 0 0 10px rgba(34, 211, 238, 0.8);
}

.hero-title {
  margin: 16px 0 10px;
  font-size: 31px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -0.6px;
}

.hero-accent {
  background: linear-gradient(100deg, #7dd3fc, #a5b4fc 45%, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  margin: 0;
  max-width: 540px;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(203, 213, 225, 0.88);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-btn {
  height: 40px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}

.hero-btn.primary {
  background: #fff;
  color: #101828;
  box-shadow: 0 10px 24px -14px rgba(255, 255, 255, 0.7);
}

.hero-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -16px rgba(255, 255, 255, 0.85);
}

.hero-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
}

.hero-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.32);
}

.hero-btn:active {
  transform: scale(0.98);
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-stat-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, #fff, #a5b4fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-stat-label {
  font-size: 11.5px;
  color: rgba(148, 163, 184, 0.9);
}

@media (max-width: 900px) {
  .home-hero {
    margin: 0 0 4px;
    padding: 24px 20px 22px;
    border-radius: 18px;
  }
  .hero-title {
    font-size: 24px;
    margin-top: 13px;
  }
  .hero-sub {
    font-size: 12.5px;
  }
  .hero-actions {
    margin-top: 16px;
  }
  .hero-btn {
    height: 38px;
    padding: 0 16px;
  }
  .hero-stats {
    gap: 20px;
    margin-top: 20px;
    padding-top: 14px;
  }
  .hero-stat-num {
    font-size: 19px;
  }
  .home-main {
    background-size: 22px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero::after { animation: none; }
  .orbit-ring { animation: none; }
}


.home-all-anchor {
  height: 0;
  overflow: hidden;
  scroll-margin-top: 16px;
}

/* 移动端分类快捷导航 */
.mobile-cat-nav {
  display: none;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mobile-cat-nav::-webkit-scrollbar { display: none; }

.mobile-cat-chip {
  flex: none;
  padding: 8px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #e2e7f0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.12s;
}

.mobile-cat-chip:hover {
  background: #f5f7ff;
  border-color: #c7c9f7;
  color: var(--brand);
}

.mobile-cat-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.mobile-cat-chip:active {
  transform: scale(0.96);
}

/* ---------- 移动端品牌头（窄屏显示，桌面端隐藏） ---------- */
.mobile-brand {
  display: none;
}

/* ============================================================
   响应式：窄屏（≤900px）移动端商务风布局
   ============================================================ */
@media (max-width: 900px) {
  .home-sidebar { display: none; }
  .home-main { padding: 0 14px 36px; }

  /* ---- 顶部吸顶头部：白底 + 细边线 ---- */
  .home-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 -14px 0;
    padding: 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
  }

  /* 品牌行：标记 + 名称 + 副标题 */
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .mobile-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--brand);
    flex-shrink: 0;
  }
  .mobile-brand-mark svg { width: 18px; height: 18px; display: block; }
  .mobile-brand-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
  }
  .mobile-brand-name {
    font-size: 16.5px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.2px;
  }
  .mobile-brand-sub {
    font-size: 11px;
    color: var(--ink-3);
    margin-top: 2px;
  }

  /* 搜索框：占满整行 */
  .home-topbar .search-box {
    max-width: 100%;
    margin: 0;
  }
  .home-topbar .search-input {
    height: 42px;
    font-size: 14px;
    padding-left: 42px;
    border-radius: 12px;
    box-shadow: none;
  }
  .home-topbar .search-icon { left: 14px; }
  .home-topbar .search-icon svg { width: 16px; height: 16px; }

  /* ---- 分类快捷导航：吸顶在头部下方 ---- */
  .mobile-cat-nav {
    display: flex;
    position: sticky;
    top: 92px;
    z-index: 25;
    margin: 0 -14px 18px;
    padding: 10px 14px;
    background: rgba(246, 247, 251, 0.92);
    backdrop-filter: saturate(180%) blur(10px);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-cat-chip {
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 999px;
  }

  /* ---- 区块 ---- */
  .section {
    margin-top: 24px;
    scroll-margin-top: 140px;
  }
  .section-head { margin-bottom: 12px; }
  .section-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .section-mark svg { width: 16px; height: 16px; }
  .section-title { font-size: 16px; }
  .section-sub { font-size: 11.5px; }
  .section-count { padding: 3px 10px; font-size: 11px; }

  /* 横向模块面板：窄屏收窄内边距 */
  .section-newest,
  .section-hot {
    padding: 14px 12px 2px;
    border-radius: 18px;
  }

  /* ---- 工具卡片：单列列表（更人性化、商务） ---- */
  .home-content .card-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .card {
    padding: 13px 14px;
    gap: 12px;
    border-radius: 12px;
    box-shadow: none;
  }
  .card::after {
    content: '';
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    border-top: 1.5px solid var(--ink-3);
    border-right: 1.5px solid var(--ink-3);
    transform: rotate(45deg);
    margin-left: auto;
    opacity: 0.6;
  }
  .card-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }
  .card-badge .card-icon { width: 20px; height: 20px; }
  .card-letter { font-size: 16px; }
  .card-name { font-size: 14.5px; }
  .card-desc { font-size: 12px; }

  /* ---- 横向滚动卡片：紧凑 ---- */
  .card-scroll {
    gap: 10px;
    padding: 2px 2px 14px;
    margin: 0 -2px;
  }
  .card-scroll .card {
    width: 130px;
    padding: 14px 12px;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
  }
  .card-scroll .card::after { display: none; }
  .card-scroll .card-badge {
    width: 40px;
    height: 40px;
    margin-bottom: 4px;
  }
  .card-scroll .card-body { width: 100%; }
  .card-scroll .card-name {
    font-size: 13.5px;
    white-space: normal;
    line-height: 1.3;
  }
  .card-scroll .card-desc {
    font-size: 11px;
    margin-top: 3px;
    white-space: normal;
    line-height: 1.35;
  }

  /* 最近使用 chips */
  .chip-row { gap: 6px; }
  .chip { padding: 7px 12px; font-size: 12.5px; border-radius: 10px; }

  /* 页脚 */
  .home-foot { margin-top: 36px; padding-top: 22px; }
  .foot-stats { gap: 18px; }
}

/* 超窄屏微调 */
@media (max-width: 380px) {
  .card-scroll .card { width: 72vw; max-width: 150px; }
  .mobile-brand-sub { display: none; }
}

.search-box {
  position: relative;
  margin-top: 0;
  max-width: 580px;
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #98a2b3;
  display: flex;
  pointer-events: none;
  transition: color 0.15s;
}

.search-box:focus-within .search-icon {
  color: var(--brand);
}

.search-input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  border-radius: 16px;
  border: 1px solid #e2e7f0;
  background: #fff;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  box-shadow: 0 4px 12px -6px rgba(16, 24, 40, 0.06);
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.search-input::placeholder {
  color: #b3bac7;
}

.search-input:focus {
  border-color: #c7c9f7;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1), 0 4px 12px -6px rgba(16, 24, 40, 0.08);
}

/* ---------- 首页主体 ---------- */

.section {
  margin-top: 40px;
  scroll-margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 16px;
}

.section-mark {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--brand);
  background: linear-gradient(150deg, #eef2ff, #e0e7ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 20px -14px color-mix(in srgb, var(--cat, #4f46e5) 65%, transparent);
}
.section-mark svg { display: block; }
.hot-mark {
  background: linear-gradient(150deg, #fff7ed, #fed7aa) !important;
  color: #ea580c !important;
  --cat: #ea580c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 20px -14px rgba(234, 88, 12, 0.55) !important;
}

.section-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.section-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.section-count {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 4px 11px;
  border-radius: 20px;
  color: color-mix(in srgb, var(--cat, #4f46e5) 72%, #334155);
  background: color-mix(in srgb, var(--cat, #4f46e5) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--cat, #4f46e5) 18%, transparent);
}

/* 最新 / 最热：把横向卡片区做成一个模块面板 */
.section-newest,
.section-hot {
  padding: 18px 18px 4px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background-color: #fff;
  background-image: radial-gradient(520px 200px at 100% 0%, rgba(14, 165, 233, 0.07), transparent 72%);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

.section-hot {
  background-image: radial-gradient(520px 200px at 100% 0%, rgba(234, 88, 12, 0.07), transparent 72%);
}

.search-result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 620px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* 全屏布局：宽屏下自动增加列数，避免卡片被拉成超宽条 */
@media (min-width: 1000px) {
  .card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}
@media (min-width: 1400px) {
  .card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (min-width: 1800px) {
  .card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.04),
    0 10px 24px -22px rgba(16, 24, 40, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}

.card:active {
  transform: scale(0.985);
}

/* 悬停时左侧亮起分类色竖条 */
.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--cat, #4f46e5);
  opacity: 0;
  transform: scaleY(0.55);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--cat, #4f46e5) 30%, var(--line));
    box-shadow:
      0 12px 30px -16px color-mix(in srgb, var(--cat, #4f46e5) 45%, transparent),
      0 2px 6px rgba(16, 24, 40, 0.04);
  }

  .card:hover::before {
    opacity: 0.85;
    transform: scaleY(1);
  }
}

.card-badge {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--cat, #4f46e5);
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--cat, #4f46e5) 15%, #fff),
    color-mix(in srgb, var(--cat, #4f46e5) 5%, #fff));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--cat, #4f46e5) 12%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  transition: transform 0.18s ease, border-radius 0.18s ease, box-shadow 0.18s ease;
}

@media (hover: hover) {
  .card:hover .card-badge {
    transform: scale(1.06);
    border-radius: 16px;
  }
}

.card-letter {
  font-size: 17px;
  font-weight: 700;
}

.card-badge .card-icon {
  width: 22px;
  height: 22px;
  color: inherit;
  flex: none;
}

.card-badge .card-icon path {
  vector-effect: non-scaling-stroke;
}

.card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.card-name {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  letter-spacing: -0.1px;
  transition: color 0.16s;
}

.card-desc {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 3px;
}

/* 横向滚动卡片区（最新工具 / 最热工具） */
.card-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #dde2ee transparent;
}
.card-scroll::-webkit-scrollbar { height: 5px; }
.card-scroll::-webkit-scrollbar-thumb {
  background: #dde2ee;
  border-radius: 4px;
}

.card-scroll .card {
  flex: none;
  width: 272px;
  scroll-snap-align: start;
  padding: 18px;
  gap: 16px;
}

.card-scroll .card-badge {
  width: 58px;
  height: 58px;
  border-radius: 50%;
}

.card-scroll .card-icon {
  width: 26px;
  height: 26px;
}

.card-scroll .card-name {
  font-size: 16px;
}

.card-scroll .card-desc {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 5px;
  line-height: 1.5;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s, color 0.16s, transform 0.16s, box-shadow 0.16s;
}
.chip:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.empty,
.notfound {
  color: var(--ink-3);
  text-align: center;
  padding: 56px 0;
  font-size: 14px;
}
.notfound h1 {
  margin: 0 0 18px;
  font-size: 22px;
  color: var(--ink);
}

/* ---------- 页脚 ---------- */
.home-foot {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line-2);
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
}

.foot-stats {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  gap: 0;
  max-width: 620px;
  margin: 0 auto 24px;
  padding: 22px 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  background: linear-gradient(135deg, #0f172a 0%, #181a38 55%, #1b1442 100%);
  box-shadow:
    0 26px 54px -32px rgba(15, 23, 42, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* 深色面板上的极淡网格，呼应 Hero */
.foot-stats::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 120% at 50% 0%, #000 20%, transparent 82%);
  mask-image: radial-gradient(120% 120% at 50% 0%, #000 20%, transparent 82%);
  pointer-events: none;
}

.stat {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.stat + .stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: rgba(255, 255, 255, 0.12);
}
.stat-num {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff, #a5b4fc 55%, #7dd3fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11.5px;
  color: rgba(148, 163, 184, 0.92);
  margin-top: 3px;
}
.foot-note {
  margin: 0 auto 8px;
  max-width: 820px;
  color: var(--ink-2);
  font-size: 12.5px;
}

/* ---------- 工具页 ---------- */
.tool-page {
  padding-top: 18px;
  /* 工具页表单/结果限宽居中，全屏下也不至于拉到两千多像素 */
  max-width: 1040px;
  margin: 0 auto;
}

.tool-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0 18px;
}

.icon-btn {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.12s;
}

.icon-btn:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  color: var(--brand);
  background: #f8f8ff;
}

.icon-btn:active {
  transform: scale(0.94);
}

.tool-head-text {
  padding-top: 1px;
}

.tool-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.tool-crumbs a {
  color: var(--brand);
  text-decoration: none;
}

.tool-crumbs a:hover {
  text-decoration: underline;
}

.tool-head-text h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.3px;
  font-weight: 700;
}

.tool-head-text p {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-3);
}

.tool-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.panel-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.1px;
}

.dropzone {
  border: 1.5px dashed #d5dbe7;
  border-radius: 14px;
  padding: 34px 16px;
  text-align: center;
  color: var(--ink-2);
  background: linear-gradient(180deg, #fbfcff, #f7f9fe);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.dropzone:hover,
.dropzone.over {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f5f6ff, #eff2ff);
}

.dropzone.over {
  transform: scale(1.005);
}

.dropzone-icon {
  color: var(--brand);
  margin-bottom: 10px;
  line-height: 0;
}

.dropzone-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.dropzone-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-3);
}

.thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 11px;
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--line);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.thumb-size {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  font-size: 10px;
  text-align: center;
  color: #fff;
  background: rgba(15, 23, 42, 0.5);
  padding: 1px 0;
}

.row-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ghost-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 12px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s, color 0.16s, background 0.16s, transform 0.12s;
}

.ghost-btn:hover {
  border-color: color-mix(in srgb, var(--brand) 36%, var(--line));
  color: var(--brand);
}

.ghost-btn:active {
  transform: scale(0.97);
}

.primary-btn {
  border: none;
  border-radius: 13px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 55%, #9333ea);
  box-shadow: 0 12px 24px -14px rgba(79, 70, 229, 0.85);
  cursor: pointer;
  transition: transform 0.14s, box-shadow 0.16s, filter 0.16s;
}

.primary-btn:hover {
  filter: brightness(1.05);
  box-shadow: 0 16px 30px -14px rgba(79, 70, 229, 0.9);
}

.primary-btn:active {
  transform: scale(0.985);
}

.primary-btn:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
  filter: none;
}

.primary-btn.small,
.ghost-btn.small {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.input-area {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  font-size: 14.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  color: var(--ink);
  background: #fbfcff;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.input-area:focus {
  border-color: #c7c9f7;
  background: #fff;
  box-shadow: var(--ring);
}

/* 参数 */
.param {
  margin-bottom: 14px;
}

.param:last-child {
  margin-bottom: 0;
}

.param-label {
  display: block;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 7px;
  font-weight: 500;
}

.param-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.param-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0 13px;
  font-size: 14.5px;
  color: var(--ink);
  background: #fbfcff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.param-input:focus {
  border-color: #c7c9f7;
  background: #fff;
  box-shadow: var(--ring);
}

textarea.param-input {
  height: auto;
  padding: 11px 13px;
  line-height: 1.65;
  resize: vertical;
}

select.param-input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}

.param-range {
  flex: 1;
  accent-color: var(--brand);
}

.param-color {
  width: 44px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.param-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
}

.param-check {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.param-tip {
  font-size: 12.5px;
  color: var(--ink-3);
  background: #f8fafc;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-chip {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--line);
  display: inline-block;
}

.range-val {
  font-size: 12.5px;
  color: var(--ink-2);
  min-width: 46px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.unit {
  font-size: 12.5px;
  color: var(--ink-3);
}

/* 图片舞台 / 裁剪框 */
.stage-wrap {
  margin-top: 14px;
}

.stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
}

.stage-img {
  max-width: 100%;
  max-height: 360px;
  display: block;
  user-select: none;
}

.stage-overlay {
  position: absolute;
  inset: 0;
}

.crop-box {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.45);
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  cursor: nwse-resize;
}

/* 结果 */
.status {
  font-size: 12.5px;
  color: var(--ink-3);
}

.result {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.result-meta {
  font-size: 12px;
  color: var(--ok);
}

.output-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.output-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.7;
  max-height: 420px;
  overflow: auto;
  color: var(--ink);
}

.output-html {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.16s, box-shadow 0.16s;
}

@media (hover: hover) {
  .result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
}

.result-img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  background: #f8fafc;
  display: block;
}

.result-file {
  height: 130px;
  display: grid;
  place-items: center;
  background: #f8fafc;
}

.result-info {
  padding: 8px 12px 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.result-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink-2);
}

.result-size {
  color: var(--ink-3);
  flex: none;
}

.result-actions {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
}

.result-actions > * {
  flex: 1;
  text-align: center;
  white-space: nowrap;
  font-size: 12.5px;
}

.hint {
  font-size: 12px;
  color: var(--ink-3);
  margin: 0;
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 12px;
  padding: 14px;
  font-size: 13.5px;
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translate(-50%, 12px);
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 22px;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 99;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}


/* 首页特色三栏 */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 44px 0 6px;
}
.feature {
  --fc: #4f46e5;
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 13px;
  padding: 20px;
  background: linear-gradient(180deg, #fff, #fafbff);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 12px 28px -26px rgba(16, 24, 40, 0.3);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}

/* 顶部一道该卡片主题色的微光 */
.feature::before {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  top: 0;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--fc), transparent);
  opacity: 0.5;
}

.feature:nth-child(2) { --fc: #059669; }
.feature:nth-child(3) { --fc: #ea580c; }

@media (hover: hover) {
  .feature:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--fc) 22%, var(--line));
    box-shadow: 0 20px 36px -26px color-mix(in srgb, var(--fc) 50%, transparent);
  }
}

.feature-icon {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
  color: var(--fc);
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--fc) 12%, #fff),
    color-mix(in srgb, var(--fc) 4%, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc) 12%, transparent);
}

.feature-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.feature-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-3);
}
@media (max-width: 720px) {
  .features {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 36px;
  }
}

/* ---------- 广告位（Banner） ---------- */
/* 外层只负责间距；有真实内容时不描边，只有「仅 ID」占位态才显示虚线框。
 * 右上角始终保留「广告」标记，符合广告标识规范。 */
.ad-slot {
  position: relative;
  margin: 16px 0 4px;
  border-radius: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
  overflow: hidden;
}
.ad-slot-label {
  position: absolute;
  top: 2px;
  right: 8px;
  font-size: 10px;
  color: #cbd5e1;
  letter-spacing: 1px;
  z-index: 1;
}
.ad-slot-body {
  display: grid;
  place-items: center;
}
.ad-slot-placeholder {
  width: 100%;
  min-height: 70px;
  display: grid;
  place-items: center;
  padding: 14px 12px;
  background: #fbfcfe;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  font-style: italic;
  color: var(--ink-3);
}
.ad-slot-image-link {
  display: block;
  max-width: 100%;
}
.ad-slot-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
}
.ad-slot-js {
  width: 100%;
  display: grid;
  place-items: center;
}

/* 插屏浮层：JS / 图片广告在工具处理完成后弹出 */
.ad-interstitial-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}
.ad-interstitial-mask .ad-slot {
  width: min(560px, 100%);
  margin: 0;
  background: #fff;
  padding: 16px;
  border-radius: 16px;
}
.ad-interstitial-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

/* 固定底部 Banner（所有页面可见，侵入性强，慎用） */
.ad-fixed-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: #fff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px -8px rgba(15, 23, 42, 0.15);
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
}
.ad-fixed-bottom .ad-slot {
  border: none;
  background: transparent;
  margin: 0;
  padding: 0;
}
.ad-fixed-bottom .ad-slot-image {
  max-height: 64px;
  width: auto;
}
/* fixed banner 启用时给 <body> 底部留白，不然内容被遮住 */
body.has-fixed-ad {
  padding-bottom: 80px;
}
@media (max-width: 480px) {
  .ad-fixed-bottom .ad-slot-body { min-height: 50px; }
}

/* ---------- 正则测试高亮 ---------- */
.regex-result {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--ink);
}
.regex-result mark {
  background: #fde68a;
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
}

/* ---------- 番茄钟 ---------- */
.pomo-panel {
  padding: 32px 20px;
}

.pomo-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.pomo-dial {
  position: relative;
  width: 240px;
  height: 240px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #f7f8ff 0%, #f1f3fb 62%, #e9ecf8 100%);
  box-shadow: inset 0 1px 0 #fff, 0 18px 34px -22px rgba(49, 46, 129, 0.4);
}

.pomo-dial-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.pomo-ring {
  transform: rotate(-90deg);
}
.pomo-ring .pomo-track {
  stroke: #e6eaf6;
}
.pomo-ring .pomo-progress {
  stroke: var(--brand);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear;
}
.pomo-dial.break .pomo-progress {
  stroke: #059669;
}

.pomo-time {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.pomo-mode {
  font-size: 13px;
  letter-spacing: 0.4px;
  color: var(--brand);
  font-weight: 600;
}
.pomo-mode.break {
  color: #059669;
}

.pomo-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.pomo-controls button {
  min-width: 96px;
}

/* ---------- 通用结果表格 ---------- */
.jwt-meta,
.url-meta,
.pw-meta,
.cron-runs {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 14px;
}
.jwt-meta td,
.url-meta td,
.pw-meta td,
.cron-runs td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.jwt-meta .k,
.url-meta .k,
.pw-meta .k {
  color: var(--ink-3);
  width: 42%;
  font-weight: 500;
}
.jwt-meta .v,
.url-meta .v,
.pw-meta .v {
  color: var(--ink);
  word-break: break-all;
}
.jwt-meta .v.bad { color: #dc2626; }
.jwt-meta .v.ok { color: #16a34a; }
.jwt-meta .note {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ---------- JWT ---------- */
.jwt-block {
  margin-bottom: 12px;
}
.jwt-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: 6px;
}
.jwt-label code {
  font-weight: 400;
  color: var(--ink-3);
  font-size: 11.5px;
}
.jwt-block pre {
  margin: 0;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--ink);
}

/* ---------- URL 参数 ---------- */
.url-param-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  margin: 4px 0 8px;
}
.url-params {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.url-params td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  word-break: break-all;
}
.url-params .k {
  color: var(--brand);
  font-weight: 500;
  width: 38%;
}
.url-params .v { color: var(--ink); }
.url-params .empty { color: var(--ink-3); font-style: italic; }

/* ---------- 密码强度 ---------- */
.pw-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.pw-label {
  font-size: 20px;
  font-weight: 700;
}
.pw-entropy {
  font-size: 12px;
  color: var(--ink-3);
}
.pw-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
}
.pw-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  transition: background 0.2s;
}
.pw-issues {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 12px 14px;
}
.pw-issues-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #b45309;
  margin-bottom: 6px;
}
.pw-issues ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.7;
}
.pw-ok {
  font-size: 13px;
  color: #16a34a;
  margin: 0;
}

/* ---------- Cron ---------- */
.cron-expr {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
  background: #eef2ff;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  word-break: break-all;
}
.cron-desc {
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.6;
}
.cron-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.cron-runs .idx {
  width: 40px;
  color: var(--ink-3);
}

/* ---------- HTTP 状态码 ---------- */
.status-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.status-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.status-code {
  flex: none;
  width: 44px;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.status-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.status-en {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: 4px;
}
.status-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.6;
}
.status-item.g2 .status-code { color: #16a34a; }
.status-item.g3 .status-code { color: #d97706; }
.status-item.g4 .status-code { color: #dc2626; }
.status-item.g5 .status-code { color: #9333ea; }

/* ---------- 身份证 ---------- */
.idcard-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.idcard-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
}
.idcard-item.bad {
  border-color: #fecaca;
  background: #fef2f2;
}
.idcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.idcard-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13.5px;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.idcard-badge {
  flex: none;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #f1f5f9;
  color: var(--ink-3);
}
.idcard-badge.ok { background: #dcfce7; color: #15803d; }
.idcard-badge.bad { background: #fee2e2; color: #b91c1c; }
.idcard-badge.warn { background: #fef3c7; color: #b45309; }
.idcard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
}
.idcard-grid > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.idcard-grid .k {
  font-size: 11.5px;
  color: var(--ink-3);
}
.idcard-grid .v {
  font-size: 13.5px;
  color: var(--ink);
  font-weight: 500;
}
.idcard-err {
  font-size: 12.5px;
  color: #b91c1c;
}
@media (max-width: 480px) {
  .idcard-grid { grid-template-columns: 1fr; }
}

/* ---------- 管理后台 ---------- */
.admin-login {
  min-height: calc(100vh - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(700px 420px at 15% 0%, rgba(79, 70, 229, 0.14), transparent 62%),
    radial-gradient(600px 400px at 88% 100%, rgba(14, 165, 233, 0.12), transparent 62%),
    #f6f7fb;
}
.admin-login-card {
  width: 100%;
  max-width: 384px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 32px 70px -34px rgba(49, 46, 129, 0.5);
  padding: 38px 30px;
}
.admin-login-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.admin-login-head p {
  margin: 7px 0 26px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}
.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-login-input {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  background: #fbfcff;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.admin-login-input:focus {
  border-color: #c7c9f7;
  background: #fff;
  box-shadow: var(--ring);
}
.admin-login-btn {
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #9333ea);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 26px -14px rgba(79, 70, 229, 0.85);
  transition: opacity 0.15s, transform 0.1s;
}
.admin-login-btn:hover { opacity: 0.94; }
.admin-login-btn:active { transform: scale(0.985); }
.admin-login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.admin-login-err {
  margin: 0;
  min-height: 18px;
  font-size: 13px;
  color: #dc2626;
  text-align: center;
}

/* ---------- 管理后台通用导航 ---------- */
.admin-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 18px;
  background: #edeff6;
  border-radius: 12px;
}
.admin-tab {
  padding: 8px 17px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ---------- 广告位配置页 ---------- */
.ads-sec { margin-bottom: 26px; }
.ads-sec-title {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.ads-sec-sub {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--ink-3);
}
.ads-slot {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  margin-bottom: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.ads-slot.on {
  border-color: #86efac;
  background: #f0fdf4;
}
.ads-slot-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.ads-slot-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.ads-slot-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.ads-slot-where {
  font-size: 12px;
  color: var(--ink-3);
}
.ads-switch {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #f8fafc;
  cursor: pointer;
}
.ads-switch input {
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.ads-slot.on .ads-switch {
  border-color: #86efac;
  background: #dcfce7;
  color: #15803d;
  font-weight: 600;
}
.ads-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ads-pane {
  margin-top: 10px;
}
.ads-js {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.ads-note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.55;
}
@media (max-width: 640px) {
  .ads-grid { grid-template-columns: 1fr; }
  .ads-slot { padding: 12px; }
}

/* ---------- SEO 管理页 ---------- */
.seo-admin {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 100px;
}
.seo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.seo-topbar h1 {
  margin: 0;
  font-size: 22px;
  color: var(--ink);
}
.seo-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.seo-search {
  flex: 1;
  min-width: 240px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
}
.seo-search:focus { border-color: var(--brand); }
.seo-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
}
.seo-tip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.seo-tip p {
  margin: 0;
  font-size: 12.5px;
  color: #1e40af;
  line-height: 1.6;
}
.seo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.seo-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  transition: border-color 0.15s;
}
.seo-row.configured {
  border-color: #86efac;
  background: #f0fdf4;
}
.seo-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.seo-cat {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 500;
}
.seo-name {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}
.seo-key {
  font-size: 12px;
  color: var(--ink-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.seo-desc {
  font-size: 12px;
  color: var(--ink-3);
  margin-left: auto;
}
.seo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.seo-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.seo-field.full { grid-column: 1 / -1; }

/* 站点设置：图标预览 / 行内按钮 / 提示文字 */
.site-icon-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-icon-preview {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #fff;
}

.seo-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.seo-hint {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

.seo-link {
  font-size: 12px;
  color: var(--brand);
  text-decoration: none;
}

.seo-link:hover {
  text-decoration: underline;
}

/* 工具页：同类工具推荐 */
.related {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  padding: 14px 16px;
}

.related-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.related-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, background 0.15s;
}

.related-item:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.related-name {
  font-size: 13px;
  font-weight: 600;
}

.related-desc {
  font-size: 11.5px;
  color: var(--ink-3);
}
.seo-label {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 500;
}
.seo-input, .seo-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  box-sizing: border-box;
}
.seo-input:focus, .seo-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.seo-empty {
  text-align: center;
  color: var(--ink-3);
  padding: 40px;
}
.seo-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  box-shadow: 0 -4px 20px -8px rgba(15, 23, 42, 0.12);
}
.seo-status {
  font-size: 12px;
  color: var(--ink-3);
}
.seo-btn {
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.seo-btn:active { transform: scale(0.97); }
.seo-btn.primary {
  background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #9333ea);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(79, 70, 229, 0.85);
}
.seo-btn.ghost {
  background: #f1f5f9;
  color: var(--ink);
}
.seo-btn:disabled { opacity: 0.6; cursor: not-allowed; }
@media (max-width: 640px) {
  .seo-grid { grid-template-columns: 1fr; }
  .seo-desc { margin-left: 0; width: 100%; }
}

/* ---------- 网站测速 ---------- */
.ms-form {
  padding: 16px 18px;
}
.ms-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.ms-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.ms-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--ink-3);
  pointer-events: none;
}
.ms-url {
  padding-left: 38px;
  width: 100%;
}
.ms-start {
  flex: none;
  min-width: 104px;
  padding: 0 18px;
}

.ms-result {
  margin-top: 14px;
  padding: 18px;
}
.ms-result[hidden] {
  display: none !important;
}

.ms-summary-top {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.ms-summary-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
  background: linear-gradient(135deg, #f8f9fd, #ffffff);
  border: 1px solid #eef0f8;
  border-radius: 14px;
  text-align: center;
}
.ms-summary-label {
  font-size: 12px;
  color: var(--ink-3);
}
.ms-summary-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.ms-url-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding: 10px 12px;
  background: #f8f9fd;
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
  overflow: hidden;
}
.ms-url-row a {
  color: var(--brand);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ms-url-row a:hover {
  text-decoration: underline;
}

.ms-bars {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ms-bar-row {
  display: grid;
  grid-template-columns: 90px 1fr 80px;
  align-items: center;
  gap: 12px;
}
.ms-bar-label {
  font-size: 12.5px;
  color: var(--ink-2);
}
.ms-bar-track {
  height: 10px;
  background: #eef1f8;
  border-radius: 999px;
  overflow: hidden;
}
.ms-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width 0.45s ease;
}
.ms-bar-value {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ms-cached {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--ink-3);
}
.ms-empty {
  margin: 0;
  padding: 16px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}
.ms-error {
  margin: 0;
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: var(--danger);
}

@media (max-width: 640px) {
  .ms-row {
    flex-direction: column;
  }
  .ms-start {
    padding: 12px 18px;
  }
  .ms-summary-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ms-bar-row {
    grid-template-columns: 80px 1fr 70px;
    gap: 8px;
  }
}

/* ============================================================
   首页 2026 版式：顶部品牌栏 + 分类标签 + 单列内容流
   覆盖旧版「左侧栏 + 右侧主内容」的布局
   ============================================================ */
.home-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- 顶部粘性头部 ---------- */
.home-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(249, 250, 253, 0.86);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 32px 10px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: none;
}

.site-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow:
    0 10px 22px -12px rgba(99, 102, 241, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.site-brand-mark svg {
  width: 22px;
  height: 22px;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.site-brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--ink);
}

.site-brand-sub {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

.header-inner .search-box {
  flex: 1;
  max-width: 520px;
  margin: 0;
}

.header-inner .search-input {
  height: 44px;
  border: 1px solid #e3e8f1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px -4px rgba(16, 24, 40, 0.08);
}

.header-inner .search-input:focus {
  box-shadow:
    0 0 0 4px rgba(99, 102, 241, 0.1),
    0 2px 6px -4px rgba(16, 24, 40, 0.08);
}

.header-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
  animation: livePulse 2.4s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ---------- 分类标签 ---------- */
.cat-tabs {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 2px 32px 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.cat-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cat, #4f46e5);
  opacity: 0.7;
}

.cat-tab:hover {
  background: #f0f3fa;
  color: var(--ink);
}

.cat-tab.active {
  color: color-mix(in srgb, var(--cat, #4f46e5) 78%, #1e293b);
  background: color-mix(in srgb, var(--cat, #4f46e5) 9%, #fff);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat, #4f46e5) 20%, transparent);
  font-weight: 600;
}

/* ---------- 主内容容器 ---------- */
.home-main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 32px 64px;
  background-image: none;
}

/* ---------- Hero：左文案 + 右快捷面板 ---------- */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 334px;
  gap: 36px;
  align-items: center;
  padding: 42px 42px 34px;
  min-height: 340px;
  margin-bottom: 6px;
  border-radius: 26px;
}

.hero-title {
  margin: 18px 0 12px;
  font-size: 42px;
  line-height: 1.2;
  letter-spacing: -1.2px;
}

.hero-inner {
  max-width: 720px;
}

.hero-sub {
  max-width: 560px;
  font-size: 13.5px;
}

.hero-stats {
  gap: 34px;
  margin-top: 24px;
}

.hero-panel {
  position: relative;
  z-index: 1;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 26px 50px -32px rgba(0, 0, 0, 0.85);
}

.hero-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 8px 10px;
}

.hero-panel-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.04em;
}

.hero-panel-en {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(148, 163, 184, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hero-quick {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border-radius: 11px;
  border: 1px solid transparent;
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
}

.hero-quick:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.hero-quick-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--cat, #a5b4fc);
  background: color-mix(in srgb, var(--cat, #6366f1) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat, #6366f1) 30%, transparent);
}
.hero-quick-icon svg {
  width: 18px;
  height: 18px;
}

.hero-quick-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.25;
}

.hero-quick-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(241, 245, 249, 0.96);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-quick-desc {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.hero-quick-arrow {
  flex: none;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.35);
  transition: color 0.16s, transform 0.16s;
}
.hero-quick:hover .hero-quick-arrow {
  color: #fff;
  transform: translateX(2px);
}

.hero-panel-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 11px 8px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  color: rgba(148, 163, 184, 0.86);
}

/* ---------- 最新上线：紧凑横条 ---------- */
.latest-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.latest-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}

.latest-item:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--cat, #4f46e5) 30%, var(--line));
  box-shadow: 0 12px 22px -18px color-mix(in srgb, var(--cat, #4f46e5) 55%, transparent);
}

.latest-icon {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--cat, #4f46e5);
  background: color-mix(in srgb, var(--cat, #4f46e5) 10%, #fff);
}
.latest-icon svg {
  width: 16px;
  height: 16px;
}

.latest-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 最热工具：Bento 网格 ---------- */
.section-hot {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 104px;
  gap: 12px;
}

.bento > .card {
  padding: 12px 14px;
}

.bento .card-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.bento .card-badge .card-icon {
  width: 20px;
  height: 20px;
}
.bento .card-name { font-size: 13.5px; }
.bento .card-desc { font-size: 11.5px; margin-top: 2px; }

.bento-lead {
  position: relative;
  overflow: hidden;
  grid-column: span 2;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #171539 0%, #2a2670 55%, #4338ca 100%);
  box-shadow: 0 24px 44px -30px rgba(49, 46, 129, 0.8);
  transition: transform 0.2s, box-shadow 0.2s;
}

.bento-lead::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(120% 110% at 85% 0%, #000 20%, transparent 75%);
  mask-image: radial-gradient(120% 110% at 85% 0%, #000 20%, transparent 75%);
  pointer-events: none;
}

.bento-lead::after {
  content: '';
  position: absolute;
  right: -70px;
  top: -90px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--cat, #6366f1) 55%, transparent), transparent 68%);
  opacity: 0.55;
  pointer-events: none;
}

@media (hover: hover) {
  .bento-lead:hover {
    transform: translateY(-3px);
    box-shadow: 0 30px 54px -32px rgba(49, 46, 129, 0.9);
  }
}

.bento-lead > * {
  position: relative;
  z-index: 1;
}

.bento-lead-tag {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(224, 231, 255, 0.9);
}

.bento-lead-icon {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  margin-bottom: 4px;
}
.bento-lead-icon svg {
  width: 28px;
  height: 28px;
  color: #e0e7ff;
}

.bento-lead-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.bento-lead-desc {
  margin: 0;
  max-width: 330px;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(199, 210, 254, 0.86);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bento-lead-go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: #c7d2fe;
}

/* ---------- 特色说明：一条横带，三栏分隔 ---------- */
.features {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 46px 0 0;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 20px 44px -42px rgba(16, 24, 40, 0.5);
  overflow: hidden;
}

.feature {
  padding: 22px 26px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.feature::before {
  display: none;
}

.feature + .feature::after {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--line-2), transparent);
}

@media (hover: hover) {
  .feature:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
    background: #fafbff;
  }
}

/* ---------- 页脚留白 ---------- */
.home-foot {
  margin-top: 52px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    padding: 34px 32px 28px;
    gap: 26px;
  }
  .hero-title { font-size: 36px; }
  .bento { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding: 30px 26px 26px;
  }
  .hero-panel { display: none; }
  .hero-inner { max-width: none; }
  .header-badge { display: none; }
  .header-inner .search-box { max-width: none; }
}

@media (max-width: 900px) {
  .home-header {
    position: sticky;
    top: 0;
    background: rgba(249, 250, 253, 0.9);
    border-bottom: 1px solid var(--line);
  }

  .header-inner {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px 16px 8px;
  }

  .site-brand { gap: 8px; }

  .site-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }
  .site-brand-mark svg { width: 18px; height: 18px; }
  .site-brand-name { font-size: 16px; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-brand-sub { display: none; }

  .header-inner .search-box {
    flex: 1;
    min-width: 0;
    max-width: none;
  }
  .header-inner .search-input {
    height: 40px;
    font-size: 13.5px;
  }

  .cat-tabs {
    position: static;
    margin: 0;
    padding: 0 16px 10px;
    background: transparent;
    border-bottom: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .cat-tab { padding: 6px 13px; font-size: 12.5px; }

  .home-main {
    padding: 0 16px 40px;
  }

  .home-hero {
    margin: 18px 0 0;
    padding: 24px 20px 22px;
    border-radius: 18px;
    min-height: 0;
  }
  .hero-title {
    margin-top: 14px;
    font-size: 27px;
    letter-spacing: -0.6px;
  }
  .hero-stats {
    gap: 24px;
    margin-top: 18px;
    padding-top: 14px;
  }

  .latest-row {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .latest-row::-webkit-scrollbar { display: none; }
  .latest-item {
    flex: none;
    width: 148px;
  }

  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 8px;
  }
  .bento-lead {
    grid-column: span 2;
    grid-row: auto;
    min-height: 186px;
    padding: 18px;
  }
  .bento > .card { padding: 11px 12px; }
  .bento .card-desc { display: none; }

  .features {
    grid-template-columns: 1fr;
    margin-top: 34px;
    padding: 2px 0;
    border-radius: 18px;
  }
  .feature {
    padding: 18px 20px;
  }
  .feature + .feature::after {
    left: 20px;
    right: 20px;
    top: 0;
    bottom: auto;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-2), transparent);
  }

  .home-foot { margin-top: 38px; }
}

/* ============================================================
   分类合集页 + 工具页 FAQ
   ============================================================ */
.section-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.16s, gap 0.16s;
}
.section-more:hover {
  color: var(--brand);
  gap: 7px;
}

.cat-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.cat-crumbs a:hover {
  color: var(--brand);
}

.cat-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 28px 30px;
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.03),
    0 20px 44px -42px rgba(16, 24, 40, 0.5);
}

.cat-hero::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -130px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--cat, #4f46e5) 15%, transparent), transparent 68%);
  pointer-events: none;
}

.cat-hero-mark {
  position: relative;
  z-index: 1;
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--cat, #4f46e5);
  background: linear-gradient(150deg,
    color-mix(in srgb, var(--cat, #4f46e5) 14%, #fff),
    color-mix(in srgb, var(--cat, #4f46e5) 5%, #fff));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cat, #4f46e5) 14%, transparent);
}

.cat-hero-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.cat-hero-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: color-mix(in srgb, var(--cat, #4f46e5) 65%, #64748b);
}

.cat-hero-title {
  margin: 4px 0;
  font-size: 26px;
  letter-spacing: -0.5px;
  color: var(--ink);
}

.cat-hero-desc {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

.cat-hero-count {
  position: relative;
  z-index: 1;
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: color-mix(in srgb, var(--cat, #4f46e5) 72%, #334155);
  background: color-mix(in srgb, var(--cat, #4f46e5) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--cat, #4f46e5) 18%, transparent);
}

.cat-empty {
  grid-column: 1 / -1;
  padding: 40px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-3);
}

.other-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 34px;
}

.other-cats-label {
  font-size: 12px;
  color: var(--ink-3);
  margin-right: 2px;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}
.cat-chip:hover {
  border-color: color-mix(in srgb, var(--cat, #4f46e5) 35%, var(--line));
  background: color-mix(in srgb, var(--cat, #4f46e5) 5%, #fff);
  color: color-mix(in srgb, var(--cat, #4f46e5) 72%, #1e293b);
}

/* ---------- 工具页 FAQ ---------- */
.related-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color 0.16s;
}
.related-more:hover {
  color: var(--brand);
}

.tool-faq {
  margin-top: 26px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.faq-item {
  padding: 14px 0;
  border-top: 1px solid var(--line-2);
}
.faq-item:first-of-type {
  border-top: 0;
  padding-top: 6px;
}
.faq-item:last-child {
  padding-bottom: 2px;
}

.faq-q {
  margin: 0 0 5px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.faq-a {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
}

@media (max-width: 720px) {
  .cat-hero {
    flex-wrap: wrap;
    padding: 20px;
    gap: 14px;
  }
  .cat-hero-title { font-size: 22px; }
  .cat-hero-count {
    margin-left: 70px;
  }
  .other-cats { margin-top: 26px; }
  .tool-faq { padding: 16px 18px; }
  .section-more { font-size: 12px; }
  .cat-crumbs { margin-top: 16px; }
}

@media (max-width: 420px) {
  .section-more { display: none; }
  .cat-hero-count { margin-left: 0; }
}

/* ===== 体验优化：收藏 / 长任务进度 / 工具错误兜底 / 无障碍 ===== */

/* 工具页收藏按钮（右上角） */
.fav-btn {
  flex: none;
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: color 0.16s, border-color 0.16s, background 0.16s, transform 0.12s;
}

.fav-btn:hover {
  color: #d97706;
  border-color: #fcd34d;
  background: #fffbeb;
}

.fav-btn:active {
  transform: scale(0.94);
}

.fav-btn.on {
  color: #d97706;
  border-color: #fcd34d;
  background: #fffbeb;
}

.fav-btn.on svg path {
  fill: currentColor;
}

/* 首页收藏 chip 的小星标 */
.chip-fav::before {
  content: '★';
  font-size: 11px;
  margin-right: 5px;
  color: #d97706;
}

/* 长任务进度条 + 取消 */
.run-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.run-progress-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #7c8cf8);
  transition: width 0.18s ease;
}

.run-progress-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cancel-btn {
  flex: none;
  padding: 5px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
}

.cancel-btn:hover:not(:disabled) {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fef2f2;
}

.cancel-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* 工具初始化失败兜底页 */
.tool-error {
  max-width: 620px;
  margin: 48px auto;
  padding: 0 20px;
  text-align: center;
}

.tool-error-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #b45309;
  background: #fef3c7;
}

.tool-error h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.tool-error-desc {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-3);
}

.tool-error-detail {
  display: block;
  margin: 0 0 18px;
  padding: 10px 12px;
  max-height: 180px;
  overflow: auto;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  color: #9a3412;
  font-size: 12px;
}

.tool-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* 无障碍：屏幕阅读器专用文本 / 跳过导航 */
.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;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 12px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

[tabindex='-1']:focus {
  outline: none;
}

@media (max-width: 720px) {
  .tool-error { margin: 28px auto; }
}

/* ===== 工具页视觉重做（110 个工具共用的外壳） ===== */

/* 顶部身份卡：分类色光晕 + 渐变图标块 + 分类徽标 */
.tool-page .tool-head {
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(130% 160% at 0% 0%, color-mix(in srgb, var(--cat, #4f46e5) 10%, transparent), transparent 62%),
    linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--shadow-sm);
}

.tool-page .tool-head-text {
  flex: 1;
  min-width: 0;
  padding-top: 0;
}

.tool-badge {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, color-mix(in srgb, var(--cat, #4f46e5) 82%, #fff), var(--cat, #4f46e5));
  box-shadow:
    0 10px 22px -12px color-mix(in srgb, var(--cat, #4f46e5) 75%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tool-badge svg { display: block; }

.tool-badge-letter {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.tool-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tool-cat-tag {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--cat, #4f46e5);
  background: color-mix(in srgb, var(--cat, #4f46e5) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--cat, #4f46e5) 24%, transparent);
}

/* 拖拽区：渐变虚线 + 图标微浮动 */
.tool-page .dropzone {
  border: 1.5px dashed color-mix(in srgb, var(--brand) 30%, var(--line-2));
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 62%),
    #fcfcff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.tool-page .dropzone:hover,
.tool-page .dropzone.over {
  border-color: color-mix(in srgb, var(--brand) 68%, #fff);
  box-shadow: 0 14px 30px -24px color-mix(in srgb, var(--brand) 65%, transparent);
  transform: translateY(-1px);
}

.tool-page .dropzone-icon {
  color: color-mix(in srgb, var(--brand) 72%, #fff);
  animation: tool-float 3.8s ease-in-out infinite;
}

@keyframes tool-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* 分段控件：替代选项较少的下拉框 */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: #f2f4f9;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.seg-btn {
  border: 0;
  background: transparent;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.seg-btn:hover { color: var(--ink); }

.seg-btn.on {
  background: #fff;
  color: var(--brand);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-xs);
}

/* 主操作按钮：渐变 + 光晕 */
.tool-page .primary-btn {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 90%, #fff), var(--brand-2));
  box-shadow: 0 12px 26px -14px color-mix(in srgb, var(--brand) 75%, transparent);
  transition: transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.tool-page .primary-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow: 0 16px 32px -14px color-mix(in srgb, var(--brand) 80%, transparent);
}

/* 结果区：完成徽标 + 逐块入场 */
.result-done {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ok);
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.result > * {
  animation: tool-rise 0.36s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.result > :nth-child(2) { animation-delay: 0.05s; }
.result > :nth-child(3) { animation-delay: 0.1s; }
.result > :nth-child(n + 4) { animation-delay: 0.14s; }

@keyframes tool-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .tool-page .tool-head { gap: 10px; padding: 12px; }
  .tool-badge { width: 40px; height: 40px; border-radius: 12px; }
  /* 滚动查看结果时，主按钮粘在底部，方便再次处理 */
  .tool-page .tool-body > .primary-btn {
    position: sticky;
    bottom: 10px;
    z-index: 6;
    box-shadow: 0 14px 30px -16px rgba(79, 70, 229, 0.6);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-page .dropzone-icon { animation: none; }
  .result > * { animation: none; }
  .tool-page .dropzone:hover,
  .tool-page .dropzone.over { transform: none; }
}

