:root {
  --primary: #667eea;
  --primary-dark: #5a67d8;
  --accent: #764ba2;
  --danger: #e53e3e;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #2d3748;
  --muted: #718096;
  --border: #e2e8f0;
  --shadow: 0 4px 18px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
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;
  /* 让页脚在内容不足时也贴到页面底部 */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* 顶部 */
.top-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,.03);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.logo-icon { width: 34px; height: 34px; }
.logo-text { background: linear-gradient(135deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.header-tools { display: flex; gap: 10px; }
.icon-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 50%;
  background: #fff; cursor: pointer; font-size: 16px; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .2s, color .2s, transform .1s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.main-wrap { padding-top: 28px; padding-bottom: 50px; flex: 1 0 auto; width: 100%; }

/* 搜索区（居中、轻量） */
.search-card {
  background: transparent; box-shadow: none;
  padding: 10px 0 30px; margin-bottom: 0;
  text-align: center;
}
.search-form { max-width: 560px; margin: 0 auto; }
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 6px 4px 12px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(60, 70, 120, .05);
  transition: border-color .2s, box-shadow .2s;
}
.search-input-wrap:focus-within {
  border-color: rgba(102, 126, 234, .55);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, .1);
}
.search-icon { flex: none; width: 26px; height: 26px; display: inline-flex; }
.search-input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; font-size: 15px;
  color: var(--text); height: 40px; padding: 0 4px; background: transparent;
}
.search-input::placeholder { color: #a0aec0; }
.search-btn {
  flex: none; border: 0; border-radius: 6px; background: transparent; color: #a0aec0;
  width: 40px; height: 40px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s;
}
.search-btn:hover { color: var(--primary); background: #f4f6fb; }

.search-tab { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.tab {
  font-size: 13px; padding: 4px 14px; border-radius: 20px;
  background: #eef0f7; color: var(--muted); cursor: pointer; transition: .2s;
}
.tab:hover { color: var(--primary); }
.tab.active { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; }

/* 分组导航：3 列分组，每组 3 列文字链接（仿参考站样式） */
.nav-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 30px;
}
@media (max-width: 900px) { .nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 22px; } }
@media (max-width: 560px) { .nav-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; } }

.nav-group { min-width: 0; }
.group-title {
  display: flex; align-items: baseline; gap: 0;
  margin: 0 0 5px; font-size: 12px; min-width: 0;
}
.group-title .gt-main { color: #b7b7b7; font-weight: 400; }
.group-title .gt-main::after { content: '·'; margin: 0 5px; color: #d0d0d0; }
.group-title .gt-sub { color: #b7b7b7; }
.group-title .gt-more { margin-left: auto; font-size: 12px; color: #b7b7b7; }
.group-title .gt-more:hover { color: var(--primary); }

/* 站点链接：默认白色背景块，悬浮变深灰底白字（对齐参考站 .link-list-a 样式） */
.group-links {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.group-links li { min-width: 0; padding: 0 3px; }
.group-links a {
  display: block;
  background: #fff;
  margin-bottom: 10px;
  padding: 0 8px;
  line-height: 44px;
  border-radius: 2px;
  font-size: 14px;
  color: #6b7184;
  text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: all .3s ease;
}
.group-links a:hover {
  background: #6b7184;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

/* 页脚 */
.footer {
  border-top: 1px solid var(--border); background: #fff; padding: 22px 0;
  margin-top: auto; width: 100%;
}
.footer-inner { text-align: center; color: var(--muted); font-size: 13px; }
.footer-inner p { margin: 4px 0; }

/* 文章列表页 */
.articles-page { padding-top: 24px; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; }
.articles-wrap {
  display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start;
}
@media (max-width: 760px) { .articles-wrap { grid-template-columns: 1fr; } }

.article-nav {
  background: var(--card); border-radius: 14px; padding: 16px;
  box-shadow: var(--shadow); position: sticky; top: 20px;
}
.article-nav h3 { font-size: 15px; margin: 0 0 12px; }
.article-nav-list { list-style: none; margin: 0; padding: 0; }
.article-nav-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.article-nav-list li:last-child { border-bottom: none; }
.article-nav-list a { color: var(--text); display: block; }
.article-nav-list a:hover { color: var(--primary); }

.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-card {
  background: var(--card); border-radius: 12px; padding: 18px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.article-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(60,70,120,.12); }
.article-card h3 { font-size: 17px; margin: 0 0 8px; }
.article-card p { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.article-meta { font-size: 12px; color: var(--muted); }

/* 文章详情页 */
.article-detail {
  background: var(--card); border-radius: 12px; padding: 26px 28px;
  box-shadow: var(--shadow); min-width: 0; word-break: break-word;
}

.article-head { padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.article-head h1 { font-size: 24px; line-height: 1.45; font-weight: 700; margin: 0 0 12px; }
.article-detail .article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  font-size: 13px; color: var(--muted);
}
.article-detail .article-meta .meta-cat {
  background: #f3f0ff; color: var(--accent);
  border-radius: 4px; padding: 2px 9px; font-size: 12px;
}
.article-detail .article-meta time { color: var(--muted); }

.article-summary {
  background: #f7f8fc; border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0; padding: 12px 16px; margin: 0 0 20px;
  font-size: 14px; line-height: 1.8; color: #5a6474;
}

/* 正文富文本：与后台编辑器产出（h2/h3/ul/ol/blockquote/a/img/table/code）保持一致 */
.article-content { font-size: 15px; line-height: 1.9; color: #33383f; word-break: break-word; }
.article-content > *:first-child { margin-top: 0; }
.article-content > *:last-child { margin-bottom: 0; }

.article-content p { margin: 0 0 14px; }

.article-content h1,
.article-content h2 { font-size: 19px; font-weight: 600; line-height: 1.5; margin: 26px 0 12px; }
.article-content h1,
.article-content h2 { padding-left: 11px; border-left: 4px solid var(--primary); }
.article-content h3 { font-size: 17px; font-weight: 600; line-height: 1.5; margin: 22px 0 10px; }
.article-content h4 { font-size: 15px; font-weight: 600; line-height: 1.5; margin: 18px 0 8px; }

.article-content ul,
.article-content ol { margin: 0 0 14px; padding-left: 24px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 6px; }
.article-content li > ul,
.article-content li > ol { margin: 6px 0 0; }

.article-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-content a:hover { color: var(--primary-dark); }
.article-content strong,
.article-content b { font-weight: 700; color: #1a202c; }

.article-content blockquote {
  margin: 0 0 14px; padding: 10px 16px;
  background: #f7f8fc; border-left: 3px solid var(--border);
  border-radius: 0 6px 6px 0; color: #5a6474;
}
.article-content blockquote p:last-child { margin-bottom: 0; }

.article-content img { max-width: 100%; height: auto; border-radius: 8px; display: block; margin: 6px auto; }
.article-content iframe,
.article-content video { max-width: 100%; border-radius: 8px; }
.article-content hr { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }

.article-content code {
  background: #f4f6fa; border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; font-family: Consolas, Menlo, monospace; font-size: .92em; color: #d53f8c;
}
.article-content pre {
  background: #2d3748; color: #e2e8f0; border-radius: 8px; padding: 14px 16px;
  margin: 0 0 14px; font-size: 13px; line-height: 1.7; overflow-x: auto;
}
.article-content pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }

.article-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 14px; font-size: 14px; }
.article-content th,
.article-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-content th { background: #f7f8fc; font-weight: 600; }

.article-tags { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; }
.article-tags .tags-label { color: var(--muted); margin-right: 6px; }
.article-tag {
  display: inline-block; background: #f7f8fc; border: 1px solid var(--border);
  color: var(--muted); border-radius: 14px; padding: 2px 12px;
  font-size: 12px; margin: 0 8px 8px 0;
}

.article-foot { margin-top: 20px; }
.back-link { display: inline-block; color: var(--primary); font-size: 14px; }
.back-link:hover { text-decoration: underline; }

.empty-tip { text-align: center; padding: 60px 20px; color: var(--muted); }

@media (max-width: 760px) {
  .article-detail { padding: 18px 16px; }
  .article-head h1 { font-size: 20px; }
  .article-content { font-size: 14px; line-height: 1.85; }
  .article-content h1,
  .article-content h2 { font-size: 17px; }
  .article-content h3 { font-size: 16px; }
}
