/* ==========================================================================
   渔网网址导航 — 设计系统
   1. Token（颜色 / 圆角 / 阴影 / 字体）
   2. 基础重置
   3. Hero（时间与搜索）
   4. 常用快捷方式
   5. 精选网址目录
   6. 页脚与弹窗
   7. 响应式
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* --- 字体 --- */
  --font-sans: "Manrope", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "SF Mono", "Cascadia Mono",
    "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

  /* --- 中性色阶 --- */
  --ink-900: #16212e;
  --ink-800: #1e2a38;
  --ink-700: #2a3a4d;
  --ink-600: #44576b;
  --ink-500: #5f6b7a;
  --ink-400: #7d8896;
  --ink-300: #9aa4b0;

  --line: #e5e9ee;
  --line-soft: #edf0f3;

  /* --- 表面（RGB 分量，便于叠加透明度） --- */
  --page-rgb: 244 246 248;
  --surface-rgb: 255 255 255;
  --surface-2-rgb: 249 251 252;
  --line-rgb: 229 233 238;
  --glow-rgb: 218 229 238;
  --shadow-rgb: 30 45 62;

  /* --- 品牌与语义色 --- */
  --brand: #2a63a6;
  --brand-strong: #1f4f88;
  --brand-soft: #eef4fc;
  --brand-tint-rgb: 42 99 166;
  --danger: #b14545;
  --danger-soft-rgb: 255 241 241;

  /* --- Hero 前景（叠在插图上） --- */
  --hero-base: #9eb2c9;
  --hero-mark: #2b5d82;
  --hero-ink-strong: #1d2b3b;
  --hero-ink: rgb(34 53 72 / 0.82);
  --hero-ink-soft: rgb(47 70 95 / 0.72);
  --hero-ink-faint: rgb(36 59 82 / 0.6);
  --hero-line: rgb(42 63 84 / 0.25);
  --hero-art-filter: none;
  --hero-veil-top: rgb(219 230 239 / 0.1);
  --hero-veil-mid: rgb(224 233 240 / 0.03);
  --hero-veil-bottom: rgb(219 230 238 / 0.28);
  --hero-veil-side: rgb(222 230 239 / 0.13);

  /* --- 圆角 --- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* --- 阴影 --- */
  --shadow-xs: 0 1px 3px rgb(var(--shadow-rgb) / 0.06);
  --shadow-sm: 0 4px 14px rgb(var(--shadow-rgb) / 0.07);
  --shadow-md: 0 10px 28px rgb(var(--shadow-rgb) / 0.1);
  --shadow-lg: 0 18px 48px rgb(var(--shadow-rgb) / 0.15);
  --shadow-pop: 0 24px 80px rgb(var(--shadow-rgb) / 0.22);

  /* --- 动效 --- */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  font-family: var(--font-sans);
  color: var(--ink-800);
  background: rgb(var(--page-rgb));
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink-900: #eef2f7;
    --ink-800: #dfe6ee;
    --ink-700: #c8d3e0;
    --ink-600: #aebbca;
    --ink-500: #96a3b2;
    --ink-400: #7f8c9b;
    --ink-300: #6b7784;

    --line: #2b3542;
    --line-soft: #242d38;

    --page-rgb: 15 20 26;
    --surface-rgb: 26 32 41;
    --surface-2-rgb: 21 26 34;
    --line-rgb: 43 53 66;
    --glow-rgb: 60 86 120;
    --shadow-rgb: 0 0 0;

    --brand: #77a9de;
    --brand-strong: #9cc2ea;
    --brand-soft: #1c2737;
    --brand-tint-rgb: 119 169 222;
    --danger: #e08a8a;
    --danger-soft-rgb: 58 34 34;

    --hero-base: #16202b;
    --hero-mark: #9fc4e2;
    --hero-ink-strong: #f0f5fa;
    --hero-ink: rgb(232 240 248 / 0.88);
    --hero-ink-soft: rgb(224 234 244 / 0.74);
    --hero-ink-faint: rgb(214 226 238 / 0.62);
    --hero-line: rgb(214 226 238 / 0.3);
    --hero-art-filter: brightness(0.5) saturate(0.65) hue-rotate(-14deg);
    --hero-veil-top: rgb(10 15 21 / 0.45);
    --hero-veil-mid: rgb(10 15 21 / 0.5);
    --hero-veil-bottom: rgb(10 15 21 / 0.72);
    --hero-veil-side: rgb(10 15 21 / 0.35);
  }

  .search-bar input::-webkit-search-cancel-button {
    filter: invert(1) brightness(1.6);
  }
}

/* ==========================================================================
   2. 基础重置
   ========================================================================== */

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  padding: 20px 24px 0;
  background:
    radial-gradient(ellipse at 50% 22%, rgb(var(--glow-rgb) / 0.32), transparent 42%),
    rgb(var(--page-rgb));
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgb(var(--brand-tint-rgb) / 0.18);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid rgb(var(--brand-tint-rgb) / 0.85);
  outline-offset: 2px;
}

.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
}

/* 拖拽：让整张卡片成为唯一拖拽源，禁止链接/图片/文字抢走拖拽手势 */
.favorite-card,
.site-card {
  -webkit-user-select: none;
  user-select: none;
}

.favorite-card .favorite-link,
.category-links .directory-link,
.favorite-icon,
.site-icon,
.site-logo,
.icon-symbol {
  -webkit-user-drag: none;
  user-drag: none;
}

/* ==========================================================================
   3. Hero
   ========================================================================== */

.hero {
  position: relative;
  min-height: 326px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgb(var(--surface-rgb) / 0.62);
  border-radius: var(--radius-lg);
  background: var(--hero-base);
  box-shadow: var(--shadow-md);
}

.hero-art {
  position: absolute;
  z-index: -2;
  inset: 0;
  background: url("hero-background.svg") center 49% / cover no-repeat;
  filter: var(--hero-art-filter);
  transform: scale(1.015);
}

.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, var(--hero-veil-top) 0%, var(--hero-veil-mid) 38%, var(--hero-veil-bottom) 100%),
    linear-gradient(90deg, var(--hero-veil-side), transparent 70%);
}

.brand {
  position: absolute;
  top: 25px;
  left: 32px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--hero-ink-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  overflow: visible;
  stroke: var(--hero-mark);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-mark .brand-net {
  stroke: var(--brand);
  stroke-width: 1.2;
}

.brand-dot {
  color: var(--brand);
}

.hero-content {
  display: flex;
  min-height: 326px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 46px 20px 26px;
  text-align: center;
  transform: translateY(1px);
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--hero-ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.clock {
  margin-top: 2px;
  color: var(--hero-ink-strong);
  font-family: var(--font-mono);
  font-size: clamp(54px, 7vw, 76px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 20px rgb(var(--surface-rgb) / 0.28);
}

.date-line {
  display: flex;
  min-height: 22px;
  gap: 12px;
  align-items: center;
  color: var(--hero-ink);
  font-size: 13px;
  font-weight: 600;
}

.date-separator {
  width: 1px;
  height: 12px;
  background: var(--hero-line);
}

.location {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.location svg {
  width: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
}

.search-bar {
  display: flex;
  width: min(700px, 100%);
  height: 54px;
  align-items: center;
  margin-top: 31px;
  padding: 0 11px 0 19px;
  border: 1px solid rgb(var(--line-rgb) / 0.95);
  border-radius: var(--radius-pill);
  background: rgb(var(--surface-rgb) / 0.97);
  box-shadow: 0 12px 38px rgb(var(--shadow-rgb) / 0.17), 0 2px 5px rgb(var(--shadow-rgb) / 0.08);
  transition: box-shadow 180ms ease, transform 180ms ease;
}

.search-bar:focus-within {
  box-shadow: 0 14px 42px rgb(var(--shadow-rgb) / 0.2), 0 0 0 3px rgb(var(--brand-tint-rgb) / 0.18);
  transform: translateY(-1px);
}

.engine-control {
  position: relative;
  flex: 0 0 auto;
  color: var(--ink-700);
}

.engine-trigger {
  display: flex;
  min-width: 113px;
  height: 36px;
  gap: 9px;
  align-items: center;
  padding: 0 5px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background 150ms ease;
}

.engine-trigger:hover,
.engine-trigger[aria-expanded="true"] {
  background: rgb(var(--brand-tint-rgb) / 0.1);
}

.engine-symbol {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
}

.engine-symbol-baidu {
  color: #293cce;
}

.engine-symbol svg {
  display: block;
  width: 24px;
  height: 24px;
}

.engine-symbol-google {
  background: conic-gradient(
    from -45deg,
    #4285f4 0deg 112deg,
    #34a853 112deg 190deg,
    #fbbc05 190deg 250deg,
    #ea4335 250deg 302deg,
    #4285f4 302deg
  );
  background-clip: text;
  color: transparent;
  font-family: Arial, sans-serif;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  -webkit-background-clip: text;
}

.engine-current {
  white-space: nowrap;
}

.engine-trigger .chevron {
  width: 13px;
  margin-left: auto;
  transition: transform 150ms ease;
}

.engine-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.engine-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 18px);
  left: -7px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(520px, calc(100vw - 24px));
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgb(var(--surface-rgb) / 0.98);
  box-shadow: var(--shadow-lg);
}

.engine-options[hidden] {
  display: none;
}

.engine-option {
  display: flex;
  min-width: 0;
  min-height: 72px;
  gap: 12px;
  align-items: center;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--ink-700);
  cursor: pointer;
  font-size: 17px;
  text-align: left;
}

.engine-option .engine-symbol {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  background: rgb(var(--surface-rgb) / 0.9);
}

.engine-option .engine-symbol svg {
  width: 30px;
  height: 30px;
}

.engine-option .engine-symbol-google {
  background-color: transparent;
  background-image: conic-gradient(
    from -45deg,
    #4285f4 0deg 112deg,
    #34a853 112deg 190deg,
    #fbbc05 190deg 250deg,
    #ea4335 250deg 302deg,
    #4285f4 302deg
  );
  background-clip: text;
  color: transparent;
  font-size: 35px;
  -webkit-background-clip: text;
}

.engine-option[aria-selected="true"] {
  background: var(--brand-soft);
  color: var(--brand);
}

.engine-option:hover:not([aria-selected="true"]) {
  background: rgb(var(--surface-2-rgb));
}

.chevron {
  width: 13px;
  stroke: var(--ink-400);
  stroke-width: 1.6;
}

.search-divider {
  width: 1px;
  height: 26px;
  margin: 0 17px 0 9px;
  background: var(--line);
}

.search-bar input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-800);
  font-size: 14px;
}

.search-bar input::placeholder {
  color: var(--ink-500);
  opacity: 1;
}

.search-bar input::-webkit-search-cancel-button {
  cursor: pointer;
}

.search-submit {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-700);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.search-submit:hover {
  background: var(--brand);
  color: rgb(var(--surface-rgb));
}

.search-submit svg {
  width: 22px;
  stroke: currentColor;
  stroke-width: 1.9;
}

.hero-caption {
  position: absolute;
  right: 24px;
  bottom: 18px;
  color: var(--hero-ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

/* ==========================================================================
   4. 常用快捷方式
   ========================================================================== */

.favorites-section {
  margin-top: 30px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.section-kicker {
  color: var(--ink-400);
}

.section-heading h1 {
  margin: 5px 0 0;
  color: var(--ink-800);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.section-note {
  display: flex;
  gap: 7px;
  align-items: center;
  margin: 0 2px 4px 0;
  color: var(--ink-500);
  font-size: 11px;
}

.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgb(var(--brand-tint-rgb) / 0.14);
}

.favorites-rail {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  padding: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgb(var(--surface-rgb) / 0.7);
  border-radius: var(--radius-lg);
  background: rgb(var(--surface-rgb) / 0.66);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(var(--surface-rgb) / 0.9);
  scrollbar-width: thin;
  -webkit-backdrop-filter: blur(18px) saturate(135%);
  backdrop-filter: blur(18px) saturate(135%);
}

.favorites-empty {
  flex: 1 1 auto;
  align-self: center;
  margin: 0;
  padding: 0 14px;
  color: var(--ink-500);
  font-size: 12px;
  text-align: center;
}

.favorite-card {
  position: relative;
  flex: 1 1 96px;
  min-width: 84px;
  max-width: 148px;
  min-height: 92px;
  overflow: visible;
  border-radius: var(--radius-sm);
  transition:
    background 170ms ease,
    opacity 170ms ease,
    transform 180ms var(--ease);
}

.favorite-card:hover,
.favorite-card:focus-within {
  z-index: 2;
  background: rgb(var(--brand-tint-rgb) / 0.13);
}

/* 拖拽中的原卡片退化为“空槽位”，指示落点，避免与其他卡片重叠 */
.favorite-card.is-dragging {
  z-index: 0;
  opacity: 1;
  background: rgb(var(--brand-tint-rgb) / 0.07);
  outline: 1px dashed rgb(var(--brand-tint-rgb) / 0.55);
  outline-offset: -1px;
}

.favorite-card.is-dragging .favorite-link,
.favorite-card.is-dragging .favorite-menu-wrap {
  opacity: 0;
}

/* 拖拽期间禁用悬停抬升，避免滑动中的卡片互相压盖 */
.favorites-rail.is-dragging .favorite-card:not(.is-dragging):hover,
.favorites-rail.is-dragging .favorite-card:not(.is-dragging):focus-within {
  z-index: auto;
  background: transparent;
}

.favorite-drag-image {
  position: fixed;
  z-index: 1000;
  top: -1000px;
  left: -1000px;
  width: 150px;
  min-height: 110px;
  border-radius: var(--radius-md);
  opacity: 1;
  transform: scale(1.04);
  background: var(--brand-strong);
  box-shadow: 0 14px 36px rgb(var(--shadow-rgb) / 0.3);
  pointer-events: none;
}

.favorite-link {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 92px;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 9px 4px;
  color: var(--ink-600);
  text-decoration: none;
  transition: background 170ms ease, transform 170ms ease;
}

.favorite-link:active {
  cursor: grabbing;
}

.favorite-icon {
  position: relative;
  display: grid;
  width: clamp(38px, 5vw, 54px);
  height: clamp(38px, 5vw, 54px);
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(var(--surface-rgb) / 0.9);
  border-radius: 50%;
  background: rgb(var(--surface-rgb) / 0.85);
  box-shadow: var(--shadow-xs);
  color: var(--accent, var(--brand));
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  transition: background 170ms ease, box-shadow 170ms ease;
}

.favorite-link:hover .favorite-icon {
  background: rgb(var(--surface-rgb));
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent) 25%, transparent);
}

.favorite-link .icon-symbol {
  max-width: 42px;
  font-size: 25px;
}

.favorite-name {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-size: clamp(10px, 1.1vw, 13px);
  font-weight: 500;
  line-height: 1.25;
  text-overflow: ellipsis;
  text-align: center;
  white-space: nowrap;
}

.favorite-add-card {
  display: flex;
  min-width: 84px;
  max-width: 148px;
  flex: 0 0 96px;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgb(var(--brand-tint-rgb) / 0.32);
  border-radius: var(--radius-sm);
  background: rgb(var(--surface-rgb) / 0.35);
  color: var(--ink-500);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.favorite-add-card:hover {
  border-color: rgb(var(--brand-tint-rgb) / 0.6);
  background: rgb(var(--surface-rgb) / 0.8);
  color: var(--brand);
}

.favorite-add-card > span:first-child {
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
}

.favorite-menu-wrap {
  position: absolute;
  z-index: 4;
  top: 6px;
  right: 6px;
}

.favorite-menu-trigger {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgb(var(--surface-rgb) / 0.92);
  color: var(--ink-500);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}

.favorite-card:hover .favorite-menu-trigger,
.favorite-card:focus-within .favorite-menu-trigger,
.favorite-menu-trigger[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
}

.favorite-menu-trigger:hover,
.favorite-menu-trigger[aria-expanded="true"] {
  background: rgb(var(--surface-rgb));
  color: var(--brand);
}

.favorite-menu {
  position: absolute;
  top: 46px;
  right: 0;
  display: flex;
  width: 178px;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(var(--surface-rgb));
  box-shadow: var(--shadow-lg);
}

.favorite-menu[hidden] {
  display: none;
}

.favorite-menu button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.favorite-menu button:hover {
  background: rgb(var(--brand-tint-rgb) / 0.1);
  color: var(--brand);
}

.favorite-menu button[data-action="remove"] {
  color: var(--danger);
}

.favorite-menu button[data-action="remove"]:hover {
  background: rgb(var(--danger-soft-rgb));
  color: var(--danger);
}

/* ==========================================================================
   5. 精选网址目录
   ========================================================================== */

.directory {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgb(var(--surface-rgb) / 0.72);
  box-shadow: var(--shadow-sm);
}

.directory-toolbar {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 19px;
  border-bottom: 1px solid var(--line-soft);
}

.directory-actions {
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 14px;
  border-top: 1px solid var(--line-soft);
  background: rgb(var(--surface-2-rgb) / 0.9);
}

.directory-toolbar p {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 0;
  color: var(--ink-500);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.directory-toolbar p > span:last-child {
  color: var(--ink-400);
  font-family: var(--font-mono);
  font-size: 11px;
}

.add-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-500);
  cursor: pointer;
  font-size: 12px;
  transition: background 150ms ease, color 150ms ease;
}

.add-link:hover {
  background: rgb(var(--brand-tint-rgb) / 0.1);
  color: var(--brand);
}

.add-link span {
  color: var(--brand);
  font-size: 16px;
  line-height: 1;
}

.add-link-primary {
  padding: 7px 14px;
  background: var(--brand);
  color: rgb(var(--surface-rgb));
  font-weight: 600;
}

.add-link-primary:hover {
  background: var(--brand-strong);
  color: rgb(var(--surface-rgb));
}

.add-link-primary span {
  color: rgb(var(--surface-rgb));
}

.category-row {
  display: grid;
  min-height: 79px;
  grid-template-columns: minmax(88px, 120px) minmax(0, 1fr);
}

.category-row + .category-row {
  border-top: 1px solid var(--line-soft);
}

.category-label {
  display: flex;
  align-items: center;
  padding: 8px 12px 8px 22px;
  border-right: 1px solid var(--line-soft);
  border-left: 3px solid var(--brand);
  overflow-wrap: anywhere;
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.category-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  padding: 7px 8px;
}

.category-empty {
  grid-column: 1 / -1;
  margin: 0;
  align-self: center;
  padding: 14px 12px;
  color: var(--ink-400);
  font-size: 12px;
}

.site-card {
  position: relative;
  min-width: 0;
  border-radius: var(--radius-sm);
  transition:
    background 150ms ease,
    opacity 150ms ease,
    transform 260ms var(--ease);
}

.site-card:hover,
.site-card:focus-within {
  z-index: 2;
  background: rgb(var(--brand-tint-rgb) / 0.09);
}

.site-card.is-dragging {
  opacity: 0.28;
  transform: scale(0.92);
}

.site-drag-image {
  position: fixed;
  z-index: 1000;
  top: -1000px;
  left: -1000px;
  width: 190px;
  min-height: 56px;
  border-radius: var(--radius-sm);
  background: rgb(var(--surface-2-rgb));
  box-shadow: 0 12px 30px rgb(var(--shadow-rgb) / 0.2);
  opacity: 1;
  pointer-events: none;
}

.directory-link {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none;
  transition: transform 150ms ease;
}

.directory-link:hover {
  transform: translateY(-1px);
}

.site-icon {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: rgb(var(--surface-rgb));
  box-shadow: var(--shadow-xs);
  color: var(--accent, var(--brand));
  font-size: 13px;
  font-weight: 800;
}

.site-icon .icon-symbol {
  font-size: 14px;
}

.site-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.site-icon.has-logo .icon-symbol,
.favorite-icon.has-logo .icon-symbol {
  display: none;
}

.site-menu-wrap {
  position: absolute;
  z-index: 3;
  top: 4px;
  right: 4px;
}

.site-menu-trigger {
  display: grid;
  width: 32px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: rgb(var(--surface-rgb) / 0.96);
  color: var(--ink-500);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  line-height: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, background 140ms ease, color 140ms ease;
}

.site-card:hover .site-menu-trigger,
.site-card:focus-within .site-menu-trigger,
.site-menu-trigger[aria-expanded="true"] {
  opacity: 1;
  pointer-events: auto;
}

.site-menu-trigger:hover,
.site-menu-trigger[aria-expanded="true"] {
  background: rgb(var(--brand-tint-rgb) / 0.1);
  color: var(--brand);
}

.site-menu {
  position: absolute;
  top: 36px;
  right: 0;
  display: flex;
  width: 132px;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgb(var(--surface-rgb));
  box-shadow: var(--shadow-lg);
}

.site-menu[hidden] {
  display: none;
}

.site-menu button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-600);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.site-menu button:hover {
  background: rgb(var(--brand-tint-rgb) / 0.1);
  color: var(--brand);
}

.site-menu .site-menu-delete {
  color: var(--danger);
}

.site-menu .site-menu-delete:hover {
  background: rgb(var(--danger-soft-rgb));
  color: var(--danger);
}

.site-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.site-name,
.site-description {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-name {
  color: var(--ink-700);
  font-size: 12.5px;
  font-weight: 600;
}

.site-description {
  color: var(--ink-500);
  font-size: 11px;
}

/* ==========================================================================
   6. 页脚与弹窗
   ========================================================================== */

.footer {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-500);
  font-size: 11px;
}

.footer-brand {
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.footer a {
  color: var(--ink-500);
  text-decoration: none;
  transition: color 140ms ease;
}

.footer a:hover {
  color: var(--brand);
}

.add-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgb(var(--surface-rgb));
  box-shadow: var(--shadow-pop);
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition:
    opacity 180ms ease,
    transform 260ms var(--ease),
    overlay 260ms ease allow-discrete,
    display 260ms ease allow-discrete;
}

.add-dialog[open] {
  opacity: 1;
  transform: none;
}

@starting-style {
  .add-dialog[open] {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

.add-dialog::backdrop {
  background: rgb(12 18 26 / 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition:
    background 260ms ease,
    backdrop-filter 260ms ease,
    overlay 260ms ease allow-discrete,
    display 260ms ease allow-discrete;
}

.add-dialog[open]::backdrop {
  background: rgb(12 18 26 / 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

@starting-style {
  .add-dialog[open]::backdrop {
    background: rgb(12 18 26 / 0);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
  }
}

.add-dialog form {
  padding: 26px;
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 23px;
}

.dialog-heading .section-kicker {
  color: var(--ink-400);
}

.dialog-heading h2 {
  margin: 6px 0 0;
  color: var(--ink-800);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.dialog-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgb(var(--surface-2-rgb));
  color: var(--ink-500);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 140ms ease, color 140ms ease;
}

.dialog-close:hover {
  background: rgb(var(--brand-tint-rgb) / 0.12);
  color: var(--brand);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 15px;
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 600;
}

.form-field input,
.form-field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(var(--surface-rgb));
  color: var(--ink-800);
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field input:focus,
.form-field select:focus {
  border-color: rgb(var(--brand-tint-rgb) / 0.6);
  box-shadow: 0 0 0 3px rgb(var(--brand-tint-rgb) / 0.15);
  outline: none;
}

.form-field input::placeholder {
  color: var(--ink-400);
}

.form-error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 12px;
}

.submit-link {
  display: flex;
  width: 100%;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 23px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: rgb(var(--surface-rgb));
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 150ms ease;
}

.submit-link:hover {
  background: var(--brand-strong);
}

/* ==========================================================================
   7. 响应式
   ========================================================================== */

@media (min-width: 1500px) {
  body {
    padding-top: 26px;
  }

  .hero,
  .hero-content {
    min-height: 360px;
  }
}

@media (max-width: 1000px) {
  .category-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .favorite-card,
  .favorite-add-card {
    flex: 1 1 88px;
  }

  .favorite-icon {
    width: 44px;
    height: 44px;
  }

  .favorite-link .icon-symbol {
    font-size: 21px;
  }

  .favorite-name {
    font-size: 11px;
  }
}

@media (max-width: 860px) {
  .favorites-rail {
    gap: 7px;
    padding: 8px;
  }

  .favorite-card,
  .favorite-add-card {
    flex: 1 1 84px;
    min-width: 76px;
  }

  .favorite-menu-trigger {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 620px) {
  body {
    padding: 12px 12px 0;
  }

  .hero {
    min-height: 316px;
  }

  .hero-art {
    background-position: center 44%;
    transform: none;
  }

  .hero-content {
    min-height: 316px;
    padding: 47px 17px 18px;
  }

  .brand {
    top: 19px;
    left: 18px;
  }

  .eyebrow {
    font-size: 9px;
  }

  .clock {
    margin-top: 6px;
    font-size: clamp(50px, 15vw, 64px);
  }

  .date-line {
    gap: 8px;
    font-size: 12px;
  }

  .search-bar {
    height: 50px;
    margin-top: 26px;
    padding-left: 12px;
  }

  .engine-control {
    min-width: 0;
  }

  .engine-trigger {
    min-width: 96px;
    gap: 5px;
    padding: 0 2px;
    font-size: 12px;
  }

  .engine-symbol {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
  }

  .engine-symbol svg {
    width: 20px;
    height: 20px;
  }

  .engine-symbol-google {
    font-size: 22px;
  }

  .engine-options {
    width: min(520px, calc(100vw - 24px));
    gap: 5px;
    padding: 8px;
    border-radius: var(--radius-md);
  }

  .engine-option {
    min-height: 60px;
    gap: 6px;
    padding: 0 7px;
    border-radius: var(--radius-sm);
    font-size: 14px;
  }

  .engine-option .engine-symbol {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .engine-option .engine-symbol svg {
    width: 24px;
    height: 24px;
  }

  .engine-option .engine-symbol-google {
    font-size: 28px;
  }

  .search-divider {
    margin-right: 10px;
    margin-left: 5px;
  }

  .search-bar input {
    font-size: 12px;
  }

  .search-bar input::placeholder {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .search-submit {
    width: 32px;
  }

  .search-submit svg {
    width: 20px;
  }

  .hero-caption {
    display: none;
  }

  .section-heading {
    align-items: start;
  }

  .section-note {
    display: none;
  }

  .section-heading h1 {
    font-size: 21px;
  }

  .favorites-section {
    margin-top: 24px;
  }

  .favorites-rail {
    margin-top: 12px;
  }

  .favorite-link {
    min-height: 76px;
    gap: 6px;
    padding: 6px 3px;
  }

  .favorite-card {
    min-height: 76px;
  }

  .favorite-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .favorite-name {
    font-size: 10px;
  }

  .favorite-add-card > span:first-child {
    font-size: 27px;
  }

  .favorite-menu-trigger {
    width: 40px;
    height: 40px;
    opacity: 1;
    pointer-events: auto;
  }

  .favorite-menu {
    width: min(178px, calc(100vw - 46px));
  }

  .favorite-menu button {
    min-height: 44px;
    font-size: 14px;
  }

  .directory {
    margin-top: 20px;
  }

  .category-row {
    grid-template-columns: minmax(64px, 92px) minmax(0, 1fr);
  }

  .category-label {
    padding: 8px 8px 8px 13px;
    font-size: 12px;
  }

  .category-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
  }

  .directory-link {
    gap: 7px;
    padding: 7px 5px;
  }

  .site-menu-trigger {
    width: 36px;
    height: 34px;
    opacity: 1;
    pointer-events: auto;
  }

  .site-menu {
    width: min(132px, calc(100vw - 46px));
  }

  .site-menu button {
    min-height: 42px;
    font-size: 14px;
  }

  .site-logo {
    width: 19px;
    height: 19px;
  }

  .site-icon {
    width: 31px;
    height: 31px;
  }

  .site-name {
    font-size: 12px;
  }

  .site-description {
    font-size: 10px;
  }

  .directory-actions {
    min-height: 58px;
  }

  .footer {
    min-height: 64px;
  }
}

@media (hover: none), (pointer: coarse) {
  .site-menu-trigger,
  .favorite-menu-trigger {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
