/* ========== CSS Variables ========== */
:root {
  --primary: #5b4af5;
  --primary-dark: #4338ca;
  --primary-light: #ede9fe;
  --primary-soft: #f5f3ff;
  --accent: #ec4899;
  --text: #1e1e2e;
  --text-secondary: #555;
  --text-muted: #999;
  --bg: #f8f9fb;
  --card-bg: #fff;
  --border: #e8eaee;
  --border-light: #f0f1f3;
  --shadow: 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.08);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --radius-pill: 100px;
  --transition: .2s ease;
  --sidebar-width: 220px;
}

/* ========== Reset ========== */
*, *::before, *::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #f5f6fa;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color:inherit; text-decoration:none; }
button { font:inherit; cursor:pointer; border:none; background:none; }
input { font:inherit; border:none; outline:none; }
img { display:block; max-width:100%; }

/* ========== Sidebar ========== */
.sidebar {
  position: fixed; top: 60px; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--border-light);
  z-index: 100;
  display: flex; flex-direction: column;
  overflow-y: auto;
  transition: transform .3s ease;
}
.sidebar-nav { flex: 1; padding: 12px 0 8px; }
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 20px;
  font-size: 13.5px; color: var(--text-secondary);
  transition: all .15s; width: 100%; text-align: left;
  border-left: 3px solid transparent;
}
.sidebar-link:hover { background: #f9fafb; color: var(--text); }
.sidebar-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
  border-left-color: var(--primary);
}
.sidebar-link .sidebar-badge {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  background: #f3f4f6;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.sidebar-link.active .sidebar-badge {
  background: var(--primary-light);
  color: var(--primary-dark);
}
.sidebar-footer {
  padding: 14px 20px;
  font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border-light);
  text-align: center;
  flex-shrink: 0;
}

/* ========== Main Wrapper ========== */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin .3s ease;
}

/* ========== Header（毛玻璃吸顶） ========== */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 1px 8px rgba(0,0,0,.04);
}
.header-inner {
  padding: 0 28px; height: 60px;
  display: flex; align-items: center; gap: 8px;
  max-width: 1500px; margin: 0 auto;
}
.sidebar-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
  margin-right: 2px;
}
.sidebar-toggle:hover { background: #f3f4f6; color: var(--text); }

/* 顶部 Logo */
.header-logo {
  display: flex; align-items: center; gap: 10px;
  margin-right: 32px; flex-shrink: 0;
  transition: opacity .2s;
}
.header-logo:hover { opacity: .8; }
.header-logo-svg { height: 40px; flex-shrink: 0; }
.header-logo-text {
  font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-logo-domain {
  font-size: 11px; color: var(--text-muted);
  margin-left: -4px; margin-top: 2px;
  align-self: flex-end; padding-bottom: 2px;
}

/* 导航链接 */
.header-nav { display: flex; gap: 2px; flex-wrap: wrap; }
.header-nav a {
  padding: 6px 15px; border-radius: 8px;
  font-size: 13.5px; color: var(--text-secondary);
  transition: all .2s; white-space: nowrap;
}
.header-nav a:hover { background: #f3f4f6; color: var(--text); }
.header-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* 右侧操作区 */
.header-actions {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.header-btn {
  padding: 7px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  transition: all .2s; white-space: nowrap;
}
.header-submit {
  background: var(--primary);
  color: #fff;
}
.header-submit:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(91,74,245,.3);
}

/* ========== Hero ========== */
.hero {
  position: relative;
  min-height: 320px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: linear-gradient(160deg, #0a0e27 0%, #12133d 30%, #1a1040 60%, #0f1a35 100%);
}

/* AI 插画背景层 */
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: 0;
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 420'%3E%3Cg fill='none' stroke='%236366f1' stroke-width='1'%3E%3Ccircle cx='120' cy='80' r='6'/%3E%3Ccircle cx='120' cy='80' r='2' fill='%236366f1'/%3E%3Ccircle cx='280' cy='60' r='6'/%3E%3Ccircle cx='280' cy='60' r='2' fill='%23ec4899'/%3E%3Ccircle cx='460' cy='90' r='6'/%3E%3Ccircle cx='460' cy='90' r='2' fill='%238b5cf6'/%3E%3Ccircle cx='80' cy='200' r='6'/%3E%3Ccircle cx='80' cy='200' r='2' fill='%233b82f6'/%3E%3Ccircle cx='530' cy='180' r='6'/%3E%3Ccircle cx='530' cy='180' r='2' fill='%23f472b6'/%3E%3Ccircle cx='180' cy='310' r='6'/%3E%3Ccircle cx='180' cy='310' r='2' fill='%236366f1'/%3E%3Ccircle cx='420' cy='300' r='6'/%3E%3Ccircle cx='420' cy='300' r='2' fill='%238b5cf6'/%3E%3Ccircle cx='300' cy='380' r='6'/%3E%3Ccircle cx='300' cy='380' r='2' fill='%23ec4899'/%3E%3Cline x1='120' y1='80' x2='280' y2='60'/%3E%3Cline x1='280' y1='60' x2='460' y2='90'/%3E%3Cline x1='120' y1='80' x2='80' y2='200'/%3E%3Cline x1='460' y1='90' x2='530' y2='180'/%3E%3Cline x1='280' y1='60' x2='530' y2='180'/%3E%3Cline x1='80' y1='200' x2='180' y2='310'/%3E%3Cline x1='530' y1='180' x2='420' y2='300'/%3E%3Cline x1='180' y1='310' x2='300' y2='380'/%3E%3Cline x1='420' y1='300' x2='300' y2='380'/%3E%3Crect x='240' y='140' width='120' height='120' rx='16'/%3E%3Crect x='255' y='155' width='90' height='90' rx='8' fill='%236366f1' fill-opacity='.05'/%3E%3Ccircle cx='300' cy='200' r='20'/%3E%3Ccircle cx='300' cy='200' r='6' fill='%236366f1' fill-opacity='.15'/%3E%3Cline x1='200' y1='30' x2='200' y2='110'/%3E%3Cline x1='200' y1='70' x2='150' y2='70'/%3E%3Cline x1='400' y1='30' x2='400' y2='110'/%3E%3Cline x1='400' y1='70' x2='450' y2='70'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 600px 320px;
  background-position: center;
  background-repeat: no-repeat;
}

/* 粒子画布 */
#particleCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

/* 光晕装饰 */
.hero-glow {
  position: absolute; border-radius: 50%;
  filter: blur(100px); z-index: 0; pointer-events: none;
}
.hero-glow-1 {
  width: 500px; height: 500px;
  top: -180px; right: -80px;
  background: rgba(99,102,241,.18);
}
.hero-glow-2 {
  width: 400px; height: 400px;
  bottom: -140px; left: -60px;
  background: rgba(236,72,153,.12);
}

.hero-inner {
  position: relative; z-index: 2;
  text-align: center; max-width: 700px;
  padding: 40px 28px 44px;
}

.hero-title {
  font-size: 42px; font-weight: 800; color: #fff;
  letter-spacing: -1px; line-height: 1.2;
  margin-bottom: 10px;
}
.hero-title-accent {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 40%, #f472b6 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: 15px; color: rgba(255,255,255,.5);
  margin-bottom: 32px;
}

/* 搜索卡片 — 无边框自适应 */
.search-card {
  max-width: 620px; margin: 0 auto;
  padding: 0;
}

/* 搜索引擎切换标签 */
.search-tabs {
  display: flex; justify-content: center; gap: 4px;
  margin-bottom: 14px;
}
.search-tab {
  padding: 6px 18px; border-radius: var(--radius-pill);
  font-size: 12.5px; color: rgba(255,255,255,.5);
  background: transparent; transition: all .2s;
}
.search-tab:hover { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.search-tab.active { background: rgba(99,102,241,.35); color: #fff; font-weight: 600; }

.search-box { position: relative; }
.search-box input {
  width: 100%; height: 52px; padding: 0 54px 0 46px;
  border-radius: 14px; border: 1.5px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.08);
  font-size: 14.5px; color: #fff; transition: all .25s;
}
.search-box input::placeholder { color: rgba(255,255,255,.35); }
.search-box input:focus {
  border-color: rgba(99,102,241,.5);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 4px rgba(99,102,241,.12), 0 0 20px rgba(99,102,241,.1);
}
.search-box-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.35); pointer-events: none;
}
.search-btn {
  position: absolute; right: 5px; top: 5px;
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.search-btn:hover {
  background: linear-gradient(135deg, #818cf8, #a78bfa);
  box-shadow: 0 4px 16px rgba(99,102,241,.3);
  transform: scale(1.05);
}

.hot-tags {
  margin-top: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 7px;
}
.hot-tag {
  padding: 5px 15px; border-radius: var(--radius-pill);
  font-size: 12.5px; font-weight: 500; color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.06);
  transition: all .2s;
}
.hot-tag:hover {
  background: rgba(99,102,241,.25);
  color: #fff;
  border-color: rgba(99,102,241,.4);
  transform: translateY(-1px);
}

/* ========== Main Content ========== */
.main { flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; padding: 28px 28px 48px; }

/* ========== Category Section ========== */
.category-section {
  margin-bottom: 36px;
  padding: 0;
}
.category-section[style*="display:none"] { display: none !important; }

.cat-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}
.cat-icon-box {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.cat-name { font-size: 17px; font-weight: 700; color: var(--text); }
.cat-count {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  margin-left: auto;
}

/* ========== Links Grid ========== */
/* 纯 CSS 三步自适应：
   桌面 5 列(>1000px) / 平板 3 列(640-1000px) / 手机 2 列(≤640px) */
.links-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

/* ========== Link Card ========== */
.link-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 14px;
  background: var(--card-bg);
  border-radius: 10px;
  border: none;
  transition: all .3s cubic-bezier(.25,.8,.25,1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
/* 顶部渐变条——hover时从左滑入 */
.link-card::before {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 100%;
  transform: translateX(-100%);
  transition: transform .45s cubic-bezier(.25,.8,.25,1);
}
.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(91,74,245,.08), 0 2px 4px rgba(0,0,0,.04);
}
.link-card:hover::before { transform: translateX(0); }
/* 卡片点击涟漪 */
.link-card:active { transform: translateY(-1px) scale(.99); }

.link-logo, .link-logo-link {
  flex-shrink: 0; width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 16px; font-weight: 700; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
  transition: transform .3s ease;
}
.link-logo-link {
  cursor: pointer;
  position: relative;
  z-index: 2;
  /* <span> 已经通过父 selector 设为 display:flex，无需额外设置 */
  /* text-decoration 对 span 无效，已移除 */
}
/* 卡片 hover 时 logo 轻微放大 */
.link-card:hover .link-logo,
.link-card:hover .link-logo-link { transform: scale(1.05); }
/* 单独 hover logo 时更明显放大 */
.link-logo-link:hover { transform: scale(1.12) !important; }
.link-logo img, .link-logo-link img { width: 100%; height: 100%; object-fit: contain; padding: 3px; background: #fff; border-radius: 10px; }
.link-logo .logo-text, .link-logo-link .logo-text { line-height: 1; font-size: 15px; }

/* 直达按钮——只有有详情页的工具才有，悬停卡片时出现在右侧 */
.link-goto-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 10px;
  background: #1e1e2e;
  color: #fff;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  transition: opacity .2s ease, max-width .25s ease, padding .2s ease;
  pointer-events: none;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  line-height: 1.2;
  align-self: center;
}
.link-goto-btn svg {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
}
.link-card:hover .link-goto-btn {
  opacity: 1;
  max-width: 80px;
  pointer-events: auto;
}

/* logo 小角标——有详情页时右下角紫色小圆圈 */
.link-logo-arrow {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  z-index: 3;
  box-shadow: 0 1px 3px rgba(91,74,245,.4);
}

/* 有详情页的卡片悬停时给个指示 */
.link-card.has-detail {
  align-items: center;
}
.link-card.has-detail:hover {
  border-color: var(--primary-light);
}

.link-body { flex: 1; min-width: 0; }
.link-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.link-badges { display: flex; flex-wrap: wrap; gap: 4px; }

/* ========== Badge 标签徽章（胶囊样式） ========== */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 600; line-height: 1.6; letter-spacing: .3px;
  border: 1px solid transparent;
  text-transform: uppercase;
}
.badge-hot { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.badge-rec { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }
.badge-cn  { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.badge-en  { background: #fefce8; color: #ca8a04; border-color: #fde68a; }
.badge-new { background: #fdf2f8; color: #db2777; border-color: #fbcfe8; }

/* ========== Search Panel ========== */
.search-panel { margin-bottom: 40px; }
.search-panel-header { padding: 12px 0 16px; font-size: 15px; color: var(--text-secondary); }
.search-panel-header strong { color: var(--primary); }

/* ========== No Result ========== */
.no-result { text-align: center; padding: 80px 24px; color: var(--text-muted); }
.no-result-icon { font-size: 52px; display: block; margin-bottom: 16px; }
.no-result p { font-size: 15px; }

/* ========== Footer ========== */
.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-light);
  padding: 28px;
  margin-top: auto;
}
.footer-inner { max-width: 1300px; margin: 0 auto; text-align: center; font-size: 13px; color: var(--text-muted); }
.footer-inner strong { color: var(--primary); }
.footer-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.footer-links { display: flex; gap: 20px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
.footer-links a { color: var(--text-secondary); font-size: 13px; transition: color .2s; }
.footer-links a:hover { color: var(--primary); }

/* ========== Scroll Top ========== */
.scroll-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 99;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--card-bg); box-shadow: var(--shadow-md);
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  transition: var(--transition); opacity: 0; pointer-events: none;
}
.scroll-top.show { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--primary); }

/* ========== Sidebar Overlay (Mobile) ========== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 190;
}
.sidebar-overlay.show { display: block; }

/* ========== Submit Site Button (Sidebar) ========== */
.submit-site-btn {
  display: block; width: 100%;
  margin-top: 10px; padding: 8px 0;
  background: var(--primary);
  color: #fff; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  transition: var(--transition);
}
.submit-site-btn:hover { background: var(--primary-dark); }

/* ========== Modal ========== */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 520px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 16px 56px rgba(0,0,0,.18);
  position: relative;
  animation: modalFadeIn .25s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.modal-header h3 {
  font-size: 17px; font-weight: 700; color: var(--text);
}
.modal-close {
  width: 28px; height: 28px; border-radius: 6px;
  background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; color: var(--text-muted);
  border: none; transition: var(--transition);
  font-family: inherit; line-height: 1;
}
.modal-close:hover { background: #e5e7eb; color: var(--text); }
.modal .form-group { margin-bottom: 16px; }
.modal .form-group label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: .4px;
}
.modal .form-group label .req { color: #ef4444; margin-left: 2px; }
.modal .form-group input,
.modal .form-group textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 14px;
  outline: none; font-family: inherit;
  transition: border-color .2s; background: #fff;
}
.modal .form-group input:focus,
.modal .form-group textarea:focus,
.modal .form-group select:focus { border-color: var(--primary); }
.modal .form-group textarea { resize: vertical; min-height: 48px; line-height: 1.5; }
.modal .form-group select {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 14px;
  outline: none; font-family: inherit;
  background: #fff; color: var(--text);
  cursor: pointer; appearance: auto;
}

/* 图标输入行 */
.modal .icon-input-row {
  display: flex; gap: 8px; align-items: stretch;
}
.modal .icon-input { flex: 1; }
.modal .icon-preview-box {
  width: 38px; height: 38px; border-radius: 7px;
  border: 1.5px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  overflow: hidden; background: #d1d5db;
}
.modal .icon-preview-box img {
  width: 100%; height: 100%; object-fit: contain;
  padding: 3px; background: #fff;
}
.modal .icon-preview-box.has { border-color: #c4b5fd; }
.modal .icon-hint-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 5px; gap: 8px;
}
.modal .btn-fetch {
  border-color: var(--primary); color: var(--primary); font-size: 12px;
  white-space: nowrap; flex-shrink: 0;
}
.modal .btn-fetch:hover { background: var(--primary); color: #fff; }

/* 抓取进度 */
.modal .fetch-progress {
  display: none; align-items: center; gap: 8px;
  padding: 8px 12px; background: #f0f9ff;
  border-radius: 6px; border: 1px solid #bae6fd;
  margin-top: 8px;
}
.modal .fetch-progress .fetch-spinner {
  width: 14px; height: 14px;
  border: 2px solid #bae6fd; border-top-color: #0ea5e9;
  border-radius: 50%; animation: spin .6s linear infinite;
  flex-shrink: 0;
}
.modal .fetch-progress .fetch-status {
  font-size: 12.5px; color: #0369a1;
}
.modal .hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }
.modal .form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.modal .btn {
  padding: 8px 18px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border);
  background: #fff; color: var(--text);
  transition: var(--transition);
  font-family: inherit;
}
.modal .btn:hover { border-color: var(--primary); color: var(--primary); }
.modal .btn-cancel { background: #f9fafb; }
.modal .btn-submit {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.modal .btn-submit:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.modal .btn:disabled { opacity: .5; pointer-events: none; }
.modal .btn-loading::after {
  content: ''; width: 10px; height: 10px;
  border: 2px solid rgba(255,255,255,.6);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: 6px; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.submit-error {
  display: none; padding: 10px 14px;
  background: #fef2f2; color: #991b1b;
  border-radius: 6px; font-size: 13px;
  margin-bottom: 4px;
}
.submit-success {
  text-align: center; padding: 32px 16px;
}
.submit-success .success-icon {
  font-size: 56px; display: block; margin-bottom: 12px;
}
.submit-success .success-title {
  font-size: 18px; font-weight: 700; color: var(--text);
  margin-bottom: 8px;
}
.submit-success .success-desc {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 20px; line-height: 1.6;
}

/* ========== Responsive ========== */
/* 平板 3 列：viewport ≤1000px */
@media (max-width: 1000px) {
  .links-grid { grid-template-columns: repeat(3, 1fr); }
  .category-section { margin-bottom: 28px; }
  .cat-header { margin-bottom: 12px; }
  .cat-name { font-size: 16px; }
}

@media (max-width: 900px) {
  .sidebar-toggle { display: flex; }
  .sidebar { top: 0; z-index: 300; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-wrapper { margin-left: 0; }
  .hero-inner { padding: 30px 20px; }
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 13px; margin-bottom: 22px; }
  .search-box input { height: 44px; font-size: 13.5px; padding: 0 46px 0 40px; }
  .search-btn { width: 36px; height: 36px; top: 4px; right: 4px; border-radius: 10px; }
  .search-box-icon { left: 12px; width: 16px; height: 16px; }
  .search-tab { padding: 5px 12px; font-size: 12px; }
  .hot-tag { padding: 3px 10px; font-size: 12px; }
  .main { padding: 24px 16px 40px; }
  .header-inner { padding: 0 14px; height: 52px; }
  .header-logo-text { display: inline; font-size: 15px; }
  .header-logo-domain { display: none; }
  .header-logo { margin-right: 6px; }
  .header-nav { display: none; }
  .header-actions { display: none; }
  .header-logo { margin-right: auto; }
  .category-section { margin-bottom: 24px; }
}

/* 手机 2 列：viewport ≤640px → (640-32)/2≈304 */
@media (max-width: 640px) {
  .links-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .link-card { padding: 10px 10px; gap: 8px; border-radius: 10px; }
  .link-logo { width: 36px; height: 36px; border-radius: 8px; }
  .link-logo .logo-text { font-size: 13px; }
  .link-name { font-size: 13px; }
  .link-desc { font-size: 11px; -webkit-line-clamp: 1; }
  .badge { font-size: 9.5px; padding: 1px 6px; }
  .category-section { margin-bottom: 18px; }
  .cat-header { margin-bottom: 10px; padding-bottom: 8px; }
  .cat-icon-box { width: 28px; height: 28px; font-size: 14px; border-radius: 6px; }
  .cat-name { font-size: 14px; }
  .cat-count { font-size: 11px; padding: 2px 8px; }
}

/* 小手机：保持2列但更紧凑 */
@media (max-width: 600px) {
  .hero { min-height: 280px; }
  .hero-inner { padding: 24px 14px; }
  .hero-title { font-size: 24px; }
  .hero-subtitle { font-size: 12px; margin-bottom: 18px; }
  .search-box input { height: 42px; font-size: 13px; padding: 0 42px 0 36px; border-radius: 10px; }
  .search-btn { width: 34px; height: 34px; top: 4px; right: 4px; border-radius: 8px; }
  .search-btn svg { width: 16px; height: 16px; }
  .search-box-icon { left: 10px; width: 14px; height: 14px; }
  .search-tab { padding: 4px 10px; font-size: 11px; }
  .hot-tag { padding: 3px 9px; font-size: 11.5px; }
  .sidebar-link { padding: 8px 14px; font-size: 13px; }
  .header-logo-svg { height: 28px; }
  .footer { padding: 20px 16px; }
  .modal { width: 100%; padding: 20px; }
  .modal .icon-hint-row { flex-direction: column; align-items: flex-start; }
  .header-inner { height: 48px; }
  .category-section { margin-bottom: 14px; }
  .links-grid { gap: 6px; }
  .link-card { padding: 8px 8px; gap: 6px; border-radius: 8px; }
  .link-logo { width: 32px; height: 32px; border-radius: 7px; }
  .link-logo .logo-text { font-size: 12px; }
  .link-name { font-size: 12px; }
  .link-desc { display: none; }
  .badge { font-size: 9px; padding: 1px 5px; }
  .cat-header { margin-bottom: 8px; padding-bottom: 6px; }
  .cat-icon-box { width: 26px; height: 26px; font-size: 13px; border-radius: 6px; }
  .cat-name { font-size: 13px; }
  .cat-count { font-size: 10px; padding: 1px 6px; }
}
