:root {
  --bg: #0b1020;
  --bg-2: #0f172a;
  --card: rgba(22, 34, 58, 0.72);
  --card-solid: #16223a;
  --primary: #06b6d4;
  --primary-dark: #0891b2;
  --primary-light: #67e8f9;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(100, 116, 139, 0.35);
  --shadow: 0 8px 32px rgba(2, 8, 23, 0.5);
  --glow: 0 0 18px rgba(6, 182, 212, 0.25);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 22px;
}

/* ---------- 顶部搜索 ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, #070b18 0%, #0f172a 60%, #0b1226 100%);
  color: #fff;
  padding: 76px 0 88px;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
}

/* 科技背景：网格 + 粒子 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 50% 30%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, black 0%, transparent 70%);
  animation: gridMove 24s linear infinite;
  pointer-events: none;
}
@keyframes gridMove {
  0% { transform: perspective(600px) rotateX(20deg) translateY(0); }
  100% { transform: perspective(600px) rotateX(20deg) translateY(40px); }
}

/* 浮动粒子 */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(6,182,212,0.25) 0, transparent 1.5px),
    radial-gradient(circle at 70% 20%, rgba(99,102,241,0.25) 0, transparent 1.5px),
    radial-gradient(circle at 50% 70%, rgba(6,182,212,0.25) 0, transparent 1.5px),
    radial-gradient(circle at 85% 60%, rgba(139,92,246,0.25) 0, transparent 1.5px);
  background-size: 220px 220px, 180px 180px, 260px 260px, 200px 200px;
  animation: particles 18s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}
@keyframes particles {
  0% { background-position: 0 0, 0 0, 0 0, 0 0; }
  100% { background-position: 220px -220px, -180px 180px, -260px 260px, 200px 200px; }
}

.hero .container { position: relative; z-index: 1; }
.hero h1 {
  margin: 0 0 10px;
  font-size: 36px;
  letter-spacing: 1px;
  text-shadow: 0 0 24px rgba(6, 182, 212, 0.35);
}
.hero h1 .logo-img { height: 42px; vertical-align: -6px; margin-right: 10px; border-radius: 10px; }
.hero p { margin: 0 0 32px; opacity: 0.85; font-size: 15px; color: var(--primary-light); }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 999px;
  padding: 8px;
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.15), inset 0 0 20px rgba(6, 182, 212, 0.05);
  backdrop-filter: blur(10px);
}
.search-box select {
  flex: 0 0 auto;
  border: none;
  background: rgba(30, 41, 59, 0.8);
  border-radius: 999px;
  padding: 0 18px;
  height: 48px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  min-width: 120px;
}
.search-box input {
  flex: 1 1 auto;
  min-width: 180px;
  border: none;
  outline: none;
  padding: 0 16px;
  height: 48px;
  font-size: 16px;
  color: var(--text);
  background: transparent;
}
.search-box input::placeholder { color: #64748b; }
.search-box button {
  flex: 0 0 auto;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 0 38px;
  height: 48px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-width: 100px;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.35);
}
.search-box button:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

/* ---------- 分类标签 ---------- */
.tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 26px 0 10px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  padding: 9px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.18s;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}
.tab:hover { color: var(--primary-light); border-color: var(--primary); }
.tab.active {
  background: linear-gradient(135deg, rgba(6,182,212,0.25) 0%, rgba(99,102,241,0.15) 100%);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--glow);
}

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  padding: 24px 0 60px;
}
.cat-group { margin-bottom: 36px; }
.cat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--primary-light);
}
.cat-title .emoji, .cat-title i { font-size: 22px; color: var(--primary); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--shadow);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  backdrop-filter: blur(8px);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow), 0 14px 34px rgba(2, 8, 23, 0.55);
  border-color: rgba(6, 182, 212, 0.55);
}
.card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(6, 182, 212, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--primary-light);
  font-weight: 700;
  border: 1px solid rgba(6, 182, 212, 0.2);
}
.card .icon i { font-size: 20px; }
.card .icon img { width: 100%; height: 100%; object-fit: cover; }
.card .meta { min-width: 0; }
.card .name { font-weight: 600; font-size: 15px; }
.card .desc {
  font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 侧栏文章 ---------- */
.aside {
  align-self: start;
  position: sticky;
  top: 18px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.panel h3 {
  margin: 0 0 16px;
  font-size: 16px;
  display: flex; align-items: center; gap: 8px;
  color: var(--primary-light);
}
.article {
  display: block;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.article:first-of-type { border-top: none; }
.article .t { font-size: 14px; font-weight: 500; transition: color 0.15s; }
.article .t:hover { color: var(--primary-light); }
.article .date { font-size: 12px; color: var(--muted); }

.empty { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }

.more-link { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--primary-light); text-decoration: none; }
.more-link:hover { text-decoration: underline; }
.panel h3 { position: relative; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 26px 0 44px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
}
footer a { color: var(--primary-light); }
footer .icp { display: block; margin-top: 6px; color: #64748b; }

/* ---------- 文章详情弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.7); display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 70; overflow-y: auto; backdrop-filter: blur(4px); }
.modal-mask.show { display: flex; }
.modal {
  background: var(--card-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.45), var(--glow);
  width: 100%; max-width: 480px;
  animation: modalIn 0.18s ease-out;
  color: var(--text);
}
.modal-lg { max-width: 760px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 18px; line-height: 1.4; color: var(--primary-light); }
.modal-close { border: none; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.modal-close:hover { color: var(--text); }

.article-detail-body { padding: 22px; }
.article-detail-date { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.article-detail-content { font-size: 15px; line-height: 1.8; color: var(--text); word-break: break-word; }
.article-detail-content img { max-width: 100%; border-radius: 10px; }
.article-detail-content a { color: var(--primary-light); }
.article-detail-content h2 { font-size: 20px; margin: 18px 0 10px; color: var(--primary-light); }
.article-detail-content h3 { font-size: 17px; margin: 16px 0 8px; color: var(--primary-light); }
.article-detail-content blockquote { margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--primary); background: rgba(6,182,212,0.08); color: var(--muted); border-radius: 0 8px 8px 0; }
.article-detail-content ul, .article-detail-content ol { padding-left: 24px; }
.article-detail-content pre { background: #0b1020; color: #e2e8f0; padding: 14px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--border); }
.article-detail-link { margin-top: 20px; }
.article-detail-link a { color: var(--primary-light); font-weight: 500; }

/* ---------- 全部文章页 ---------- */
.hero-sm { padding: 44px 0 36px; }
.hero-sm h1 { font-size: 26px; margin: 0 0 6px; }
.back-home { color: rgba(255,255,255,0.92); font-size: 14px; text-decoration: none; }
.back-home:hover { text-decoration: underline; color: var(--primary-light); }
.articles-page { padding: 28px 0 50px; display: grid; gap: 18px; }
.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
  backdrop-filter: blur(8px);
}
.article-card:hover { transform: translateY(-4px); box-shadow: var(--glow), 0 14px 34px rgba(2, 8, 23, 0.55); border-color: rgba(6, 182, 212, 0.55); }
.article-card h2 { margin: 0 0 6px; font-size: 19px; color: var(--primary-light); }
.article-card .date { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.article-card p { margin: 0 0 14px; color: var(--text); }
.read-btn { border: none; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding: 8px 18px; border-radius: 999px; font-size: 14px; cursor: pointer; box-shadow: 0 0 12px rgba(6,182,212,0.25); }
.read-btn:hover { box-shadow: 0 0 20px rgba(6,182,212,0.45); transform: translateY(-1px); }

@media (min-width: 700px) {
  .articles-page { grid-template-columns: 1fr 1fr; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; }
  .aside { position: static; }
  .hero { padding: 52px 0 64px; }
  .hero h1 { font-size: 28px; }
  .search-box { gap: 8px; padding: 7px; max-width: 100%; }
  .search-box select { padding: 0 12px; height: 44px; font-size: 14px; min-width: 90px; }
  .search-box input { height: 44px; font-size: 15px; min-width: 0; }
  .search-box button { padding: 0 22px; height: 44px; font-size: 15px; min-width: 80px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
