/* ============ 基础 ============ */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #a855f7;
  --grad: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  --bg: #f5f6fa;
  --bg-soft: #f9fafb;
  --card: #ffffff;
  --text: #1e293b;
  --text-2: #64748b;
  --text-3: #94a3b8;
  --border: #e8eaf1;
  --border-2: #eef0f6;
  --shadow: 0 2px 8px rgba(30, 41, 59, .06);
  --shadow-md: 0 4px 14px rgba(30, 41, 59, .08);
  --shadow-lg: 0 12px 28px rgba(99, 102, 241, .16);
  --radius: 10px;
  --radius-lg: 14px;
  --container: 1600px;
  --red: #ef4444;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

/* ============ 顶部导航 ============ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 28px;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  width: 42px; height: 42px; border-radius: 11px;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 800; letter-spacing: -0.5px;
  box-shadow: 0 6px 14px rgba(99,102,241,.35);
  position: relative;
}
.logo-mark::after {
  content: ''; position: absolute; inset: -3px;
  border-radius: 14px;
  background: var(--grad);
  opacity: .18;
  z-index: -1;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-cn { font-size: 20px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -.5px; }
.logo-en { font-size: 10px; color: var(--text-3); letter-spacing: 1px; font-weight: 600; margin-top: 2px; }

.nav-menu {
  display: flex; align-items: center; gap: 4px;
  list-style: none;
  flex: 1;
}
.nav-menu a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: all .18s;
}
.nav-menu a:hover { color: var(--primary); background: rgba(99,102,241,.08); }
.nav-menu a.active { color: var(--primary); background: rgba(99,102,241,.08); font-weight: 600; }
.nav-menu .nav-icon { font-size: 15px; opacity: .8; }

.nav-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nav-tool-link {
  background: var(--grad); color: #fff;
  padding: 9px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
  transition: all .2s;
}
.nav-tool-link:hover { opacity: .92; transform: translateY(-1px); }

/* ============ Hero ============ */
.hero {
  background: linear-gradient(180deg, #f9fafb 0%, #f5f6fa 100%);
  padding: 38px 0 32px;
  border-bottom: 1px solid var(--border-2);
}
.hero-inner { display: flex; flex-direction: column; align-items: center; }

/* 搜索源 Tab */
.search-tabs {
  display: flex; gap: 26px;
  margin-bottom: 16px;
}
.stab {
  font-size: 16px; font-weight: 500;
  color: var(--text-2);
  padding: 6px 4px;
  position: relative;
  transition: color .18s;
}
.stab:hover { color: var(--text); }
.stab.active { color: var(--text); font-weight: 600; }
.stab.active::after {
  content: ''; position: absolute;
  left: 50%; transform: translateX(-50%);
  bottom: -2px; width: 24px; height: 3px;
  background: var(--grad); border-radius: 2px;
}

/* 搜索行 */
.search-row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: 880px;
}
.search-box {
  flex: 1;
  position: relative;
  display: flex; align-items: center;
  height: 52px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 26px;
  padding: 0 8px 0 20px;
  box-shadow: var(--shadow);
  transition: all .2s;
}
.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.10), var(--shadow);
}
.search-box .sb-icon {
  font-size: 18px; color: var(--text-3); margin-right: 10px;
}
.search-box input {
  flex: 1; height: 100%;
  border: none; outline: none;
  background: transparent;
  font-size: 15px; color: var(--text);
}
.search-box input::placeholder { color: var(--text-3); }
.sb-btn {
  height: 40px; width: 60px;
  background: var(--red); color: #fff;
  border-radius: 22px;
  font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.sb-btn:hover { background: #dc2626; transform: translateY(-1px); }

/* 右侧统计卡 */
.hero-stat-card {
  display: inline-flex; align-items: center; gap: 8px;
  height: 52px;
  padding: 0 22px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 26px;
  font-size: 14px; color: var(--text-2);
  box-shadow: var(--shadow);
  white-space: nowrap;
}
.hsc-icon { color: var(--primary); font-size: 16px; }
.hsc-text b {
  color: var(--red); font-size: 18px; font-weight: 800; margin: 0 2px;
}

.hero-tip {
  margin-top: 12px;
  font-size: 13px; color: var(--text-3);
}

/* ============ 内容区分组 ============ */
.main-area { padding: 28px 0 40px; }

.group { margin-bottom: 36px; }
.group-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.group-title {
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
}
.group-title .gi { font-size: 20px; }
.group-more {
  font-size: 13px; color: var(--text-3);
  cursor: pointer; transition: color .15s;
}
.group-more:hover { color: var(--primary); }

/* ============ 卡片网格 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
@media (max-width: 1300px) { .grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 760px)  { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px)  { .grid { grid-template-columns: repeat(2, 1fr); } }

/* 站点卡片 */
.site-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 14px 14px;
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  transition: all .22s ease;
  cursor: pointer;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.site-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(99,102,241,.35);
}
.site-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.site-logo {
  width: 40px; height: 40px; border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 800;
  letter-spacing: -0.5px;
}
.site-logo-img {
  width: 40px; height: 40px; border-radius: 10px;
  flex-shrink: 0; object-fit: cover; background: #f1f3f9;
}
.logo-preview {
  margin-top: 8px; display: none;
}
.logo-preview.show { display: flex; align-items: center; gap: 10px; }
.logo-preview img {
  width: 48px; height: 48px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border);
}
.logo-preview .lp-clear {
  font-size: 12px; color: var(--primary); cursor: pointer;
}
.site-info { min-width: 0; flex: 1; }
.site-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 4px;
}
.site-host {
  font-size: 11px; color: var(--text-3); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site-desc {
  font-size: 12px; color: var(--text-2);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.site-tags {
  display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap;
  min-height: 16px;
}
.site-tags span {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}
.site-tags span.more-tag { color: var(--text-3); background: transparent; border-color: transparent; }

/* 徽标 */
.badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  line-height: 1.4;
}
.badge.hot { background: rgba(239,68,68,.10); color: var(--red); }
.badge.new { background: rgba(249,115,22,.10); color: #f97316; }
.badge.week { background: rgba(99,102,241,.10); color: var(--primary); }

.empty { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--text-3); }
.empty .icon { font-size: 36px; margin-bottom: 10px; }

/* ============ 全部分类页 ============ */
.full-cat { margin-bottom: 36px; }

/* ============ 页脚 ============ */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 30px; padding: 26px 0;
  background: #fff;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer p { font-size: 13px; color: var(--text-3); }
.footer a { color: var(--primary); font-size: 13px; }
.footer a:hover { text-decoration: underline; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .nav-menu { display: none; }
  .nav-inner { gap: 12px; }
  .container { padding: 0 16px; }
}
@media (max-width: 768px) {
  .hero { padding: 24px 0 22px; }
  .search-tabs { gap: 18px; }
  .stab { font-size: 14px; }
  .search-box { height: 46px; }
  .search-box .sb-icon { display: none; }
  .hero-stat-card { display: none; }
  .group-title { font-size: 17px; }
}

/* ============ 通用按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px; padding: 10px 22px; font-size: 14px; font-weight: 600;
  transition: all .2s;
}
.btn-grad { background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.btn-grad:hover { opacity: .92; transform: translateY(-1px); }
.btn-ghost { background: #fff; border: 1px solid var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }

/* ============ 表单（提交页 / 后台共用） ============ */
.form-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  border: 1px solid var(--border); padding: 32px;
}
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-label .req { color: var(--red); margin-left: 2px; }
.form-input, .form-select, .form-textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 11px 14px; font-size: 14px; outline: none; background: #fff;
  transition: all .2s; color: var(--text);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.form-error { font-size: 13px; color: var(--red); margin-top: 6px; display: none; }

/* ============ Toast ============ */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: #1e293b; color: #fff; padding: 12px 24px; border-radius: 10px;
  font-size: 14px; z-index: 1000; opacity: 0; transition: all .3s; pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: linear-gradient(135deg, #059669, #10b981); }
.toast.error { background: linear-gradient(135deg, #dc2626, #ef4444); }
