:root {
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-sub: #6b7280;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ===== 顶部标题栏 ===== */
.header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
  color: #fff;
  padding: 40px 24px 32px;
  text-align: center;
}
.header h1 { font-size: 28px; font-weight: 700; letter-spacing: 1px; }
.header p { margin-top: 8px; font-size: 14px; opacity: 0.8; }

/* ===== 顶部导航 ===== */
.header-nav {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.header-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.28);
  transition: all .2s;
}
.header-nav a:hover { background: rgba(255,255,255,0.15); color: #fff; }
.header-nav a.active { background: #fff; color: var(--accent); border-color: #fff; font-weight: 600; }

/* ===== 搜索框 ===== */
.search-wrap {
  max-width: 600px;
  margin: -22px auto 0;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}
.search-box {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  padding: 4px 16px;
  gap: 10px;
}
.search-box svg { flex-shrink: 0; color: #9ca3af; }
.search-box input {
  border: none;
  outline: none;
  font-size: 15px;
  padding: 12px 0;
  width: 100%;
  background: transparent;
  color: var(--text);
}
.search-box input::placeholder { color: #9ca3af; }

/* ===== 分类标签栏 ===== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 28px 16px 8px;
  max-width: 960px;
  margin: 0 auto;
}
.tab {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
  color: var(--text-sub);
  user-select: none;
}
.tab:hover { border-color: var(--accent); color: var(--accent); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== 内容区 ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 16px 60px;
}
.section { margin-bottom: 32px; }
.section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .count {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-sub);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 10px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.card-header { display: flex; align-items: center; gap: 10px; }
.card-favicon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.card-name { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.card-desc { font-size: 12px; color: var(--text-sub); line-height: 1.5; padding-left: 38px; }
.card-url { font-size: 11px; color: #9ca3af; padding-left: 38px; font-family: monospace; }
.card:hover .card-name { color: var(--accent); }

/* ===== 首页入口 ===== */
.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.entry {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 22px 22px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.entry::after {
  content: "→";
  position: absolute;
  right: 20px;
  top: 22px;
  color: #cbd5e1;
  font-size: 18px;
  transition: all .2s;
}
.entry:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  transform: translateY(-3px);
}
.entry:hover::after { color: var(--accent); transform: translateX(3px); }
.entry-icon { font-size: 30px; line-height: 1; }
.entry-title { font-size: 17px; font-weight: 700; }
.entry:hover .entry-title { color: var(--accent); }
.entry-desc { font-size: 12.5px; color: var(--text-sub); line-height: 1.6; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.entry-tags span {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: 8px;
}

/* ===== 空状态 ===== */
.empty { text-align: center; padding: 60px 20px; color: var(--text-sub); font-size: 14px; }

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 32px 16px;
  font-size: 12px;
  color: #9ca3af;
  border-top: 1px solid var(--border);
  margin-top: 20px;
  line-height: 1.9;
}
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .copyright { color: #6b7280; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .grid, .home-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .header h1 { font-size: 22px; }
  .grid, .home-grid { grid-template-columns: 1fr; }
  .tabs { gap: 6px; }
  .tab { padding: 6px 14px; font-size: 12px; }
}
