/* ============================================
   655Z技术栈 · 优质技术网站导航 样式
   www.655z.com
   ============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-deep: #1e40af;
  --accent: #6366f1;
  --dark: #1e293b;
  --text: #475569;
  --text-light: #94a3b8;
  --bg: #f4f6fb;
  --border: #e5e9f2;
  --radius: 14px;
  --shadow: 0 4px 14px rgba(30, 41, 59, .06);
  --shadow-lg: 0 12px 30px rgba(37, 99, 235, .14);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.container { max-width: 1360px; margin: 0 auto; padding: 0 24px; }

a { text-decoration: none; color: inherit; }

/* ---------- 顶部条 ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 64px; position: relative; }
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 10px; margin: 0; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; flex-shrink: 0;
}
.nav-toggle span {
  display: block; height: 2px; width: 100%; border-radius: 2px; background: var(--dark);
  transition: transform .2s, opacity .2s;
}
.topbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.topbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.topbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
  letter-spacing: 0;
}
.brand-logo em { font-style: normal; color: #fbbf24; margin-left: 1px; }
.brand-text b { display: block; font-size: 18px; color: var(--dark); line-height: 1.2; }
.brand-text small { font-size: 11px; color: var(--text-light); letter-spacing: 1px; }
.top-stats { font-size: 13px; color: var(--text-light); }
.top-stats b { color: var(--primary); font-size: 16px; }

/* ---------- 主导航 + 下拉 ---------- */
.top-nav {
  display: flex; align-items: center; gap: 2px; font-size: 15px;
  height: 100%;
}
.top-nav .nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 16px; border-radius: 10px; color: var(--dark);
  font-weight: 700; letter-spacing: .02em; transition: background .15s, color .15s;
}
.top-nav .nav-link:hover { background: var(--bg); color: var(--primary); }
.nav-caret {
  display: inline-block; width: 0; height: 0; margin-left: 2px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; opacity: .5;
}
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.nav-item .mega-panel {
  position: absolute; top: calc(100% - 2px); left: 0;
  width: min(760px, calc(100vw - 24px)); max-width: calc(100vw - 24px);
  padding: 16px 18px 18px;
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  transform: translateY(8px); z-index: 120;
  box-sizing: border-box;
}
/* 默认靠右展开；窄屏由 nav.js 再校正，避免溢出视口 */
.nav-item.has-mega:last-of-type .mega-panel,
.top-nav .nav-item.has-mega:nth-of-type(2) .mega-panel {
  left: auto; right: 0;
}
.nav-item.has-mega:hover .mega-panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0);
}
/* 跳转后鼠标仍停在导航上时，先锁定二级菜单，离开 topbar 后再允许悬停展开 */
html.mega-locked .nav-item.has-mega:hover .mega-panel {
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(8px);
}
.mega-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.mega-hd b { font-size: 13px; color: var(--dark); }
.mega-hd a { font-size: 12px; color: var(--primary); }
.mega-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
}
.mega-grid-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mega-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.mega-item:hover {
  background: #f8fafc; border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .06);
}
.mega-ico {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
}
.mega-ico svg { width: 18px; height: 18px; }
.mega-ico em {
  font-style: normal; font-weight: 800; font-size: 14px; color: var(--primary-deep);
}
.mega-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mega-name { font-size: 13px; font-weight: 700; color: var(--dark); line-height: 1.3; }
.mega-desc {
  font-size: 11px; color: var(--text-light); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- 文章资讯 ---------- */
.article-list { display: flex; flex-direction: column; gap: 14px; }
.article-card {
  display: flex; gap: 16px; align-items: stretch; background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 14px; transition: border-color .15s, box-shadow .15s; text-decoration: none;
}
.article-card:hover { border-color: #c7d2fe; box-shadow: var(--shadow); }
.article-thumb {
  width: 168px; min-height: 96px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: #eef2ff;
}
.article-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 96px; }
.article-body { min-width: 0; flex: 1; display: flex; flex-direction: column; padding: 4px 6px 4px 0; }
.article-card h2, .article-card h3 { font-size: 18px; color: var(--dark); margin: 0 0 8px; line-height: 1.4; }
.article-card h2 a:hover, .article-card h3:hover { color: var(--primary); }
.article-summary { font-size: 14px; color: var(--text); margin: 0; line-height: 1.7; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: auto; padding-top: 12px;
  font-size: 12px; color: var(--text-light);
}
.article-detail {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 32px 36px; box-shadow: var(--shadow);
}
.article-detail-hd {
  margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border);
  text-align: center;
}
.article-detail-hd h1 {
  font-size: clamp(24px, 3vw, 30px); color: var(--dark); line-height: 1.35; margin: 0 0 12px; font-weight: 800;
}
.article-detail .article-meta {
  margin-top: 0; padding-top: 0; justify-content: center;
}
.article-lead {
  font-size: 15px; color: var(--text); background: #f8fafc;
  border-left: 3px solid var(--primary); padding: 12px 14px; margin: 0 0 22px; border-radius: 0 8px 8px 0;
}
.article-cover {
  margin: 0 0 22px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border);
}
.article-cover img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.article-content, .article-content.page-prose {
  line-height: 1.85; color: var(--text); font-size: 15px;
}
.article-content h2, .page-prose h2 {
  font-size: 22px; color: var(--dark); margin: 1.6em 0 .7em; padding-bottom: 8px;
  border-bottom: 1px solid var(--border); font-weight: 800; line-height: 1.35;
}
.article-content h3, .page-prose h3 {
  font-size: 18px; color: var(--dark); margin: 1.4em 0 .55em; font-weight: 700;
}
.article-content h4, .page-prose h4 {
  font-size: 16px; color: var(--dark); margin: 1.2em 0 .5em; font-weight: 700;
}
.article-content p, .page-prose p { margin: 0 0 1em; }
.article-content img, .page-prose img {
  max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 14px auto;
}
.article-content a, .page-prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-content a:hover, .page-prose a:hover { color: var(--primary-deep); }
.article-content ul, .article-content ol, .page-prose ul, .page-prose ol {
  margin: 0 0 1em 1.35em; padding: 0;
}
.article-content li, .page-prose li { margin: 6px 0; }
.article-content blockquote, .page-prose blockquote {
  margin: 16px 0; padding: 12px 16px; border-left: 4px solid var(--primary);
  background: #f8fafc; color: #475569; border-radius: 0 8px 8px 0;
}
.article-content pre, .page-prose pre {
  margin: 14px 0; padding: 14px 16px; overflow-x: auto;
  background: #0f172a; color: #e2e8f0; border-radius: 10px;
  font-size: 13px; line-height: 1.65; font-family: Consolas, "Courier New", monospace;
}
.article-content code, .page-prose code {
  font-family: Consolas, "Courier New", monospace; font-size: .92em;
  background: #f1f5f9; color: #be123c; padding: 1px 6px; border-radius: 4px;
}
.article-content pre code, .page-prose pre code {
  background: transparent; color: inherit; padding: 0; border-radius: 0; font-size: inherit;
}
.article-content table, .page-prose table {
  width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px;
  overflow: hidden; border-radius: 8px; border: 1px solid var(--border);
}
.article-content th, .article-content td, .page-prose th, .page-prose td {
  border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top;
}
.article-content th, .page-prose th {
  background: #f8fafc; color: var(--dark); font-weight: 700;
}
.article-content tr:nth-child(even) td, .page-prose tr:nth-child(even) td { background: #fafbfc; }
.article-content hr, .page-prose hr {
  border: 0; border-top: 1px solid var(--border); margin: 24px 0;
}
.article-list-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.article-list-compact .article-card { flex-direction: column; padding: 14px; }
.article-list-compact .article-thumb { width: 100%; min-height: 120px; }
.article-list-compact .article-card h3 { font-size: 15px; }

@media (max-width: 900px) {
  .mega-grid, .mega-grid-sm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-item .mega-panel {
    width: min(420px, calc(100vw - 24px)); max-width: calc(100vw - 24px);
  }
  .article-card { flex-direction: column; }
  .article-thumb { width: 100%; min-height: 140px; }
  .article-detail { padding: 20px 16px 28px; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #1e40af, #4f46e5 55%, #7c3aed);
  color: #fff; padding: 64px 0 46px; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 15% 30%, rgba(255,255,255,.10), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(251,191,36,.12), transparent 40%);
}
.hero .container { position: relative; }
.hero h1 { font-size: 34px; font-weight: 800; }
.hero p { color: #c7d2fe; margin: 12px 0 26px; font-size: 15px; }

.search {
  max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 50px; padding: 8px 10px 8px 20px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18);
}
.search svg { width: 20px; height: 20px; color: var(--text-light); flex-shrink: 0; }
.search input { flex: 1; border: none; outline: none; font-size: 15px; color: var(--dark); background: transparent; }
.search button {
  border: none; background: var(--bg); color: var(--text-light); width: 34px; height: 34px;
  border-radius: 50%; cursor: pointer; font-size: 14px; display: none; transition: all .2s; flex-shrink: 0;
}
.search button:hover { background: #e2e8f0; color: var(--dark); }

.filters {
  display: flex; flex-wrap: nowrap; justify-content: center; align-items: center;
  gap: 6px; margin-top: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filters a {
  display: inline-block; flex-shrink: 0; padding: 6px 12px; border-radius: 50px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.10); color: #fff; font-size: 12px; text-decoration: none;
  transition: all .2s; white-space: nowrap;
}
.filters a:hover { background: rgba(255,255,255,.22); color: #fff; }
.filters a.on { background: #fff; color: var(--primary-deep); font-weight: 600; box-shadow: 0 8px 20px rgba(0,0,0,.15); }

/* ---------- 分组 ---------- */
main.container { padding: 44px 24px 20px; }

.group { margin-bottom: 40px; }
.group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.g-icon {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .25);
}
.g-icon svg { width: 24px; height: 24px; }
.group-head h2 { font-size: 20px; color: var(--dark); line-height: 1.3; }
.group-head p { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.g-count { margin-left: auto; font-size: 13px; color: var(--text-light); background: #fff; border: 1px solid var(--border); padding: 5px 14px; border-radius: 20px; }

.links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.link-card {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; transition: all .25s; position: relative; overflow: hidden;
}
.link-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0; transition: opacity .25s;
}
.link-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: transparent;
}
.link-card:hover::before { opacity: 1; }

.lc-icon {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  background: var(--bg); color: var(--primary); font-weight: 700; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  transition: all .25s;
}
.link-card:hover .lc-icon { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }

.lc-body { flex: 1; min-width: 0; }
.lc-body b { display: block; font-size: 15px; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-body i { display: block; font-style: normal; font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }

.lc-tag {
  flex-shrink: 0; font-size: 11px; padding: 3px 10px; border-radius: 20px;
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
}
.lc-arrow { flex-shrink: 0; color: var(--text-light); transition: all .25s; }
.lc-arrow svg { width: 16px; height: 16px; display: block; }
.link-card:hover .lc-arrow { color: var(--primary); transform: translate(2px, -2px); }

/* 空状态 */
.empty { text-align: center; padding: 60px 0; color: var(--text-light); }
.empty svg { width: 52px; height: 52px; margin-bottom: 14px; }
.empty p { font-size: 15px; }

/* ---------- 友情链接 ---------- */
.friend-links {
  margin-top: 48px;
  padding: 28px 0 18px;
  border-top: 1px solid var(--border);
  background: #fff;
  text-align: left;
}
.friend-links-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 14px;
}
.friend-links-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 10px 20px;
  margin: 0;
  padding: 0;
}
.friend-links-list li { margin: 0; padding: 0; }
.friend-links-list a {
  font-size: 13px;
  color: var(--text);
  transition: color .2s;
}
.friend-links-list a:hover { color: var(--primary); }
.friend-links-more {
  margin: 14px 0 0;
  font-size: 13px;
}
.friend-links-more a { color: var(--primary); }
.friend-page-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin: 0;
  padding: 0;
}
.friend-page-list a {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: all .2s;
}
.friend-page-list a:hover {
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow);
}

/* ---------- 页脚 ---------- */
.footer {
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  color: #94a3b8;
  padding: 32px 0 28px;
  margin-top: 0;
  font-size: 13px;
  border-top: 1px solid rgba(148,163,184,.12);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 28px;
  border-bottom: 1px solid rgba(148,163,184,.12);
}
.ft-brand { display: flex; align-items: center; gap: 14px; }
.ft-logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-weight: 800; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
  flex-shrink: 0;
}
.ft-logo em { font-style: normal; color: #fbbf24; margin-left: 1px; }
.ft-brand b { display: block; color: #f8fafc; font-size: 16px; line-height: 1.3; }
.ft-brand p { color: #64748b; font-size: 12px; margin-top: 2px; }
.ft-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.ft-nav a { color: #cbd5e1; transition: color .2s; font-size: 14px; }
.ft-nav a:hover { color: #fff; }
.footer-copy { padding: 0; text-align: center; }
.footer-copy p { color: #64748b; line-height: 1.8; margin: 0; }
.footer-copy p + p { margin-top: 2px; font-size: 12px; color: #475569; }

/* ---------- 站点介绍页 ---------- */
.tb-back { color: var(--primary); font-size: 13px; font-weight: 600; }
.tb-back:hover { color: var(--primary-deep); }
.topbar a.brand { text-decoration: none; }

.site-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #eef2ff 100%);
  border-bottom: 1px solid var(--border);
  padding: 28px 0 36px;
}
.crumb {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 13px; color: var(--text-light); margin-bottom: 22px;
}
.crumb a { color: var(--primary); }
.site-hero-row { display: flex; align-items: center; gap: 18px; }
.site-avatar {
  width: 64px; height: 64px; border-radius: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff; font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(37, 99, 235, .28);
}
.site-cat { font-size: 13px; color: var(--primary); font-weight: 600; margin-bottom: 6px; }
.site-hero h1 { font-size: clamp(24px, 3vw, 32px); color: var(--dark); line-height: 1.3; }
.site-host { margin-top: 8px; font-size: 14px; color: var(--text-light); word-break: break-all; }
.cat-nav {
  display: flex; flex-wrap: nowrap; gap: 6px; margin-top: 18px;
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  display: inline-block; flex-shrink: 0; padding: 6px 12px; border-radius: 50px;
  border: 1px solid var(--border); background: #fff; color: var(--text);
  font-size: 12px; text-decoration: none; transition: all .2s; white-space: nowrap;
}
.cat-nav a:hover { border-color: var(--primary); color: var(--primary); }
.cat-nav a.on {
  background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .22);
}

.site-main { padding: 36px 0 20px; }
.site-card {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 28px 30px; box-shadow: var(--shadow);
}
.site-card h2 { font-size: 18px; color: var(--dark); margin-bottom: 14px; }
.site-intro { font-size: 15px; line-height: 1.9; color: var(--text); }
.site-meta {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin: 24px 0 26px;
}
.site-meta div {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.site-meta span { display: block; font-size: 12px; color: var(--text-light); margin-bottom: 4px; }
.site-meta b { font-size: 14px; color: var(--dark); word-break: break-all; }
.site-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-go, .btn-back {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 24px; border-radius: 999px;
  font-size: 15px; font-weight: 700; transition: all .2s;
}
.btn-go {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  color: #fff; box-shadow: 0 10px 24px rgba(37, 99, 235, .28);
}
.btn-go:hover { transform: translateY(-2px); }
.btn-back {
  border: 1px solid var(--border); color: var(--text); background: #fff;
}
.btn-back:hover { border-color: var(--primary); color: var(--primary); }
.site-tip { margin-top: 16px; font-size: 12px; color: var(--text-light); }

.site-related { margin-top: 40px; }
.site-related h2 { font-size: 20px; color: var(--dark); margin-bottom: 18px; }
.site-empty {
  text-align: center; padding: 80px 20px;
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
}
.site-empty h1 { font-size: 24px; color: var(--dark); margin-bottom: 10px; }
.site-empty p { color: var(--text-light); margin-bottom: 22px; }


/* ---------- 404 ---------- */
.page-404 {
  padding: 72px 0 40px;
  min-height: 52vh;
  display: flex;
  align-items: center;
}
.page-404-box {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 48px 36px;
  box-shadow: var(--shadow);
}
.page-404-code {
  font-size: clamp(64px, 12vw, 96px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.page-404-box h1 {
  font-size: 26px;
  color: var(--dark);
  margin-bottom: 12px;
}
.page-404-box > p {
  color: var(--text-light);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 28px;
}
.page-404-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
@media (max-width: 640px) {
  .page-404 { padding: 48px 0 24px; }
  .page-404-box { padding: 36px 20px; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .links { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .hero h1 { font-size: 26px; }
  .links { grid-template-columns: repeat(2, 1fr); }
  .top-stats { display: none; }
  .lc-tag { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; padding: 28px 0 22px; }
  .ft-nav { gap: 10px 16px; }
  .site-meta { grid-template-columns: 1fr; }
  .site-card { padding: 22px 18px; }
  .site-actions .btn-go,
  .site-actions .btn-back { width: 100%; }
  .site-hero-row { align-items: flex-start; }
}


/* --- 导航三五扩展 --- */
.top-stats-inline { text-align:center; color:var(--text-light); font-size:13px; margin:8px 0 20px; }
.top-stats-inline b { color:var(--primary); }
.footer-links {
  display: flex; flex-wrap: wrap; gap: 12px 20px;
  justify-content: center; align-items: center;
  margin: 0 0 16px; padding: 0; font-size: 13px;
}
.footer-links a { color: #94a3b8; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.group-head h2 a:hover { color:var(--primary); }
.page-prose { line-height:1.85; color:var(--text); }
.pager { margin:24px 0; text-align:center; }
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .topbar .container { height: 56px; }
  .brand-logo { width: 36px; height: 36px; border-radius: 10px; font-size: 13px; }
  .brand-text b { font-size: 16px; }
  .brand-text small { display: none; }

  .top-nav {
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    margin: 0; padding: 6px 12px 12px;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    height: auto; max-height: min(78vh, 640px); overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .topbar.nav-open .top-nav { display: flex; }
  .top-nav > .nav-link,
  .top-nav > .nav-item > .nav-link {
    width: 100%; justify-content: space-between; align-items: center;
    min-height: 44px; padding: 10px 12px; margin: 0;
    border-radius: 10px; font-size: 15px; font-weight: 600;
  }
  .top-nav > .nav-link + .nav-link,
  .top-nav > .nav-item + .nav-link,
  .top-nav > .nav-link + .nav-item,
  .top-nav > .nav-item + .nav-item {
    margin-top: 2px;
  }
  .nav-caret {
    margin-left: 8px; opacity: .45;
    transition: transform .18s ease;
  }
  .nav-item { display: block; height: auto; }
  .nav-item .mega-panel,
  .nav-item.has-mega:last-of-type .mega-panel,
  .top-nav .nav-item.has-mega:nth-of-type(2) .mega-panel {
    position: static; left: auto; right: auto; width: 100%; max-width: none;
    margin: 0 0 4px; padding: 6px 4px 8px;
    opacity: 1; visibility: visible; pointer-events: auto;
    transform: none; box-shadow: none;
    border: 0; border-radius: 0; background: transparent;
    display: none;
  }
  /* 特异性需盖过 nth-of-type(2)，否则「文章资讯」二级无法展开 */
  .top-nav .nav-item.has-mega.mega-open .mega-panel { display: block; }
  .mega-hd { display: none; }
  html.mega-locked .nav-item.has-mega:hover .mega-panel {
    opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  }
  .nav-item.mega-open > .nav-link {
    background: #eff6ff; color: var(--primary);
  }
  .nav-item.mega-open .nav-caret { transform: rotate(180deg); opacity: .7; }

  /* 二级：双列横排，更紧凑易扫读 */
  .mega-grid, .mega-grid-sm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .mega-desc { display: none; }
  .mega-item {
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: 8px; padding: 8px 10px; text-align: left;
    border-radius: 10px; background: #f8fafc; border: 0;
    box-shadow: none;
  }
  .mega-item:hover, .mega-item:active {
    background: #eff6ff; border-color: transparent; box-shadow: none;
  }
  .mega-ico {
    width: 28px; height: 28px; border-radius: 8px;
    background: #fff; border: 1px solid #e2e8f0;
  }
  .mega-ico svg { width: 14px; height: 14px; }
  .mega-ico em { font-size: 12px; }
  .mega-txt { min-width: 0; }
  .mega-name {
    font-size: 13px; font-weight: 600; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  .site-hero { padding: 28px 0 20px; }
  .site-hero h1 { font-size: 24px; }
  .hero { padding: 36px 0 28px; }
  .search { max-width: none; }
  .group-head { flex-wrap: wrap; }
  .lc-arrow { display: none; }
}
