/*
Theme Name: CS2 电脑知识库与工具站
Theme URI: http://82.157.180.81:8888/
Author: ayfans
Author URI: http://82.157.180.81:8888/
Description: 面向 CS2 玩家的高性能电脑知识、操作教程与实用工具下载中心。纯净轻量，零外部依赖，极速响应。
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: cs2-kb
*/

/* 本地独立样式，无字体、脚本或外部 CDN 依赖 */
:root {
  --background: #f8fafc;
  --card: #ffffff;
  --foreground: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-hover: #93c5fd;
  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;
  --green: #059669;
  --green-hover: #047857;
  --green-soft: #ecfdf5;
  --green-border: #a7f3d0;
  --purple: #7c3aed;
  --purple-soft: #f5f3ff;
  --purple-border: #ddd6fe;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 10px 25px -4px rgba(37, 99, 235, 0.08), 0 6px 12px -4px rgba(15, 23, 42, 0.03);
  --shadow-input: 0 4px 16px -2px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #dbeafe; color: #1e40af; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
input, input:focus, input:focus-visible { outline: none !important; box-shadow: none !important; }
button:disabled { cursor: not-allowed; opacity: 0.6; }

h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 3.2vw, 34px); line-height: 1.35; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: 20px; line-height: 1.45; font-weight: 750; }
h3 { font-size: 17px; font-weight: 700; }
small, .small { font-size: 13px; }

.page-shell { width: min(1080px, calc(100% - 40px)); margin: auto; }

/* 网站单一主 Header (提升视觉重心与尺寸) */
.site-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 28px;
  margin: 22px 0 36px;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.02);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 850; letter-spacing: -0.01em; white-space: nowrap; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.28);
}
.prototype-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}
.badge, .tag {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 3px 9px;
  background: var(--blue-soft);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--blue-border);
}
.site-nav { display: flex; flex-wrap: wrap; gap: 26px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.site-nav a { padding: 4px 2px; transition: color 0.15s ease; }
.site-nav a:hover, .footer-links button:hover, .text-link:hover { color: var(--blue); }
.site-nav a[aria-current="page"] { color: var(--blue); font-weight: 750; }

/* 头部搜索框 (放大尺寸，平滑聚焦) */
.header-search {
  display: flex;
  align-items: center;
  margin-left: auto;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 4px 5px;
  width: 255px;
  background: var(--background);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.header-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  background: #ffffff;
}
.header-search input {
  width: 100%;
  min-width: 0;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  color: var(--foreground);
  outline: none !important;
}
.header-search input:focus, .header-search input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
.header-search button {
  flex-shrink: 0;
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 650;
  padding: 5px 12px;
  border: 0;
  transition: background 0.15s, color 0.15s;
}
.header-search button:hover {
  background: var(--blue);
  color: #fff;
}

[hidden] { display: none !important; }
main {
  min-height: 55vh;
  outline: none !important;
}
main:focus, main:focus-visible {
  outline: none !important;
}

/* 首页 Hero 区域 */
.hero {
  text-align: center;
  padding: 24px 12px 36px;
  background: radial-gradient(ellipse 70% 60% at 50% -10%, rgba(219, 234, 254, 0.65) 0%, rgba(248, 250, 252, 0) 100%);
  border-radius: var(--radius-lg);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 16px;
  border-radius: 9999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.05);
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}
.hero p { color: var(--muted); margin: 10px auto 24px; font-size: 15px; max-width: 520px; }

/* 居中大搜索框 */
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 16px;
  background: var(--card);
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  max-width: 620px;
  margin: auto;
  box-shadow: var(--shadow-input);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-form:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}
.search-icon { font-size: 15px; opacity: 0.6; flex-shrink: 0; }
.search-form input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 7px 4px;
  background: transparent;
  color: var(--foreground);
  font-size: 14.5px;
}
.search-form input:focus { outline: none; }
.quick-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}
.quick-links a {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 6px;
  color: #475569;
  text-decoration: none;
  transition: all 0.15s;
}
.quick-links a:hover {
  border-color: var(--blue-border);
  color: var(--blue);
  background: var(--blue-soft);
}

/* 核心分类卡片网格 */
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}
.eyebrow {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-right: 8px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

/* 卡片基础样式 */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
a.card {
  display: block;
  transition: border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
a.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
}
a.card:hover h3 { color: var(--blue); }
.card p { color: var(--muted); margin-top: 8px; font-size: 14px; line-height: 1.6; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }

/* 分类图标容器 */
.icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}
.icon svg { display: block; width: 22px; height: 22px; }
.icon.green { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }
.icon.purple { background: var(--purple-soft); color: var(--purple); border-color: var(--purple-border); }
.icon.amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }

.category-action {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
a.card:hover .category-action { color: var(--blue); }
.arrow { display: inline-block; transition: transform 0.15s ease; }
a.card:hover .arrow { transform: translateX(3px); }

.card-footer {
  border-top: 1px solid #f1f5f9;
  margin-top: 14px;
  padding-top: 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.card-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.card-tags .tag {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 500;
  font-size: 12px;
  border-radius: 6px;
  padding: 2.5px 8.5px;
  line-height: 1.4;
  transition: border-color 0.15s;
}
a.card:hover .card-tags .tag { border-color: #cbd5e1; }
.card-action {
  color: var(--blue);
  font-weight: 600;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  margin-left: auto;
  transition: transform 0.15s ease, color 0.15s ease;
}
a.card:hover .card-action {
  transform: translateX(3px);
  color: var(--blue-hover);
}
.card.tutorial-card {
  padding: 18px 22px;
}
.card.tutorial-card h3 {
  font-size: 17px;
  font-weight: 750;
  line-height: 1.4;
  margin: 0;
}
.card.tutorial-card p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
  margin-bottom: 0;
}
.tag {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 500;
  font-size: 12px;
  border-radius: 6px;
  padding: 3px 9px;
  transition: border-color 0.15s;
}
a.card:hover .tag { border-color: #cbd5e1; }
.tag.green { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }

/* 教程目录结构 */
.catalog-section {
  margin-bottom: 32px;
}
.catalog-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e2e8f0;
}
.catalog-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.catalog-section-title .icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}
.catalog-section-title h2 {
  font-size: 18px;
  font-weight: 750;
  color: var(--foreground);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.catalog-count-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}
.catalog-section-title p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  margin-bottom: 0;
}
.catalog-section-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-bottom: 2px;
}
.catalog-section-link:hover {
  color: var(--blue-hover);
}
.catalog-empty-notice {
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.catalog-empty-notice .badge-pending {
  font-size: 11px;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 底部常用工具直通条 */
.shortcut-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 26px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-left: 4px solid var(--blue);
}
.shortcut-lead { display: flex; align-items: center; gap: 14px; }
.shortcut-badge {
  background: var(--blue-soft);
  color: #1d4ed8;
  border: 1px solid var(--blue-border);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.shortcut-text strong { display: block; font-size: 14.5px; color: var(--foreground); }
.shortcut-text .muted { font-size: 12px; }

/* 按钮与操作区域 */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  background: var(--card);
  color: var(--foreground);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.button:hover { border-color: var(--blue); color: var(--blue); }
.button.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}
.button.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }
.button.primary.green {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}
.button.primary.green:hover { background: var(--green-hover); border-color: var(--green-hover); color: #fff; }
.text-link { color: var(--blue); font-weight: 500; }
.muted { color: var(--muted); }

/* 面包屑与页头 */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.breadcrumb a { color: var(--blue); }
.page-heading { margin-bottom: 24px; }
.page-heading p { color: var(--muted); margin-top: 8px; }
.stack { display: grid; gap: 16px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.filter-bar a {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: all 0.15s ease;
}
.filter-bar a:hover { border-color: var(--border-hover); color: var(--blue); }
.filter-bar a[aria-current="true"] {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: var(--blue-border);
  font-weight: 650;
}

/* 教程详情页布局 */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; align-items: start; }
.article { padding: 32px; }
.article > * + * { margin-top: 24px; }
.article h1 { font-size: clamp(24px, 3vw, 30px); }
.article p, .article li, .article-content p, .article-content li { 
  font-size: 15.5px; 
  line-height: 1.85; 
  color: var(--foreground); 
}
.article p.muted { color: var(--muted); }
.article h2 { margin-bottom: 10px; color: var(--foreground); }
.article ol { padding-left: 23px; }
.article li + li { margin-top: 8px; }
.article code { background: #f1f5f9; border: 1px solid var(--border); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; font-size: 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.article-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }

/* 教程步骤序号徽章 */
.step-num {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: middle;
}

/* 教程所需工具提示卡 */
.prerequisites-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid var(--green);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 20px 0;
}
.prerequisites-box h2 { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }

/* 提示与警示块 */
.notice {
  padding: 16px 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  color: #92400e;
  font-size: 13.5px;
  line-height: 1.7;
}
.notice strong { color: #78350f; }
.notice p { font-size: 13.5px; margin-top: 4px; }

/* 适用环境轻量化紧凑条（去噪微缩设计，不喧宾夺主） */
.environment {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  margin: 12px 0 16px;
  width: 100%;
}
.env-badge-title {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid var(--blue-border);
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.env-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
  padding: 0;
}
.env-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
  line-height: 1.5;
}
.env-tag dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}
.env-tag dt::after {
  content: ":";
  margin-left: 1px;
}
.env-tag dd {
  color: var(--foreground);
  font-weight: 550;
  margin: 0;
}
.env-tag + .env-tag {
  position: relative;
  padding-left: 14px;
}
.env-tag + .env-tag::before {
  content: "·";
  position: absolute;
  left: 3px;
  color: #94a3b8;
  font-weight: 700;
}
.env-tag-risk dd {
  color: #b45309;
}

/* 文章目录 TOC (上下级知识库大纲) */
.toc { position: sticky; top: 24px; padding: 20px; border-radius: var(--radius-md); }
.toc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.toc-header h2 { font-size: 13.5px; font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em; color: var(--foreground); margin: 0; }
.toc-badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--blue-soft); color: var(--blue); border: 1px solid var(--blue-border); font-weight: 600; }
.toc-tree { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.toc-node { position: relative; }
.toc-h2 { display: block; padding: 5px 8px; color: var(--foreground); font-size: 13px; font-weight: 700; border-radius: 6px; transition: all 0.15s; }
.toc-h2:hover { color: var(--blue); background: var(--blue-soft); }
.toc-branch {
  margin-left: 14px;
  padding-left: 10px;
  border-left: 1.5px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 3px;
}
.toc-h3 { display: block; padding: 3px 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; border-radius: 5px; transition: all 0.15s; }
.toc-h3:hover { color: var(--blue); background: var(--blue-soft); transform: translateX(2px); }

/* 教程子步骤正文排版 */
.sub-step {
  margin: 14px 0 14px 12px;
  padding-left: 14px;
  border-left: 2.5px solid #e2e8f0;
}
.sub-step h3 { font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 2px; }

/* 工具库卡片 */
.tool-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.tool-name { display: flex; align-items: center; gap: 14px; }
.tool-name p { margin: 3px 0 0; }
.table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; min-width: 610px; border-collapse: collapse; font-size: 13.5px; text-align: left; }
th { background: #f8fafc; color: var(--muted); font-weight: 600; font-size: 12.5px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }

/* 搜索结果 */
.result-label { display: inline-flex; align-items: center; margin-bottom: 8px; color: var(--blue); background: var(--blue-soft); border: 1px solid var(--blue-border); border-radius: 4px; padding: 2px 7px; font-size: 11.5px; font-weight: 650; }
.result-label.green { color: var(--green); background: var(--green-soft); border-color: var(--green-border); }

/* 空状态 */
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state h2 { font-size: 19px; }
.empty-state p { margin: 8px 0 22px; color: var(--muted); }

/* 页脚 */
.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding: 24px 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-links { display: flex; gap: 20px; }
.footer-links button { background: transparent; color: var(--muted); padding: 8px 0; font-size: 12.5px; }

/* 对话框 */
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(440px, calc(100% - 32px));
  padding: 0;
  color: var(--foreground);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
dialog::backdrop { background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(2px); }
.dialog-content { padding: 26px; }
.dialog-content p { margin: 14px 0 22px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; line-height: 1.6; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -80px; left: 16px; background: var(--card); padding: 12px; z-index: 10; border-radius: 6px; box-shadow: var(--shadow-card); }
.skip-link:focus { top: 8px; }
.noscript-message { margin: 24px; padding: 20px; background: #fffbeb; border-radius: 8px; }

/* 响应式断点 */
@media (max-width: 900px) {
  .header-search { width: 100%; margin-left: 0; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; grid-row: 1; }
  .toc-tree { flex-direction: row; flex-wrap: wrap; gap: 8px 16px; }
  .toc-branch { flex-direction: row; flex-wrap: wrap; gap: 6px; margin-left: 0; padding-left: 0; border-left: 0; }
}
@media (max-width: 600px) {
  .page-shell { width: calc(100% - 28px); }
  .site-header { gap: 14px; margin: 16px 0 24px; padding: 14px 16px; }
  .site-nav { width: 100%; gap: 12px 16px; }
  .category-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .hero { padding: 12px 8px 28px; }
  .hero p { font-size: 14px; }
  .search-form input { font-size: 15px; padding: 5px; }
  .search-form .button { padding: 8px 14px; flex-shrink: 0; }
  .article { padding: 22px; }
  .site-footer { align-items: flex-start; flex-direction: column; margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.card { transition: none; }
  a.card:hover { transform: none; }
  .arrow { transition: none; }
  a.card:hover .arrow { transform: none; }
}

/* 连续知识长页与工具专题：独立样式，不套用教程步骤计数器。 */
.reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) 246px; gap: 24px; align-items: start; }
.reading-article { padding: 32px; min-width: 0; }
.reading-header { margin-bottom: 28px; }
.reading-header h1 { margin: 14px 0 10px; font-size: clamp(26px, 3vw, 34px); }
.reading-intro { color: var(--muted); font-size: 16px; }
.reading-content { font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.reading-content > * + * { margin-top: 16px; }
.reading-content h2 { margin: 44px 0 14px; padding-top: 26px; border-top: 1px solid var(--border); font-size: 23px; scroll-margin-top: 28px; }
.reading-content h3 { margin: 28px 0 10px; padding-left: 13px; border-left: 4px solid var(--blue); font-size: 18px; scroll-margin-top: 28px; }
.reading-content h2:focus, .reading-content h3:focus { outline: none; }
.reading-content h2:focus-visible, .reading-content h3:focus-visible { outline: 2px solid var(--blue); outline-offset: 5px; }
.chapter-number { color: var(--blue); margin-right: 8px; font-variant-numeric: tabular-nums; }
.reading-content a:not(.button) { color: var(--blue); text-underline-offset: 3px; }
.reading-content a:hover { text-decoration: underline; }
.reading-content ul, .reading-content ol { padding-left: 24px; }
.reading-content li + li { margin-top: 8px; }
.reading-content code { background: var(--background); border: 1px solid var(--border); border-radius: 5px; padding: 2px 5px; font-size: .9em; }
.reading-content .reading-muted { color: var(--muted); font-size: 13px; }
.chapter-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chapter-links a { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-weight: 600; font-size: 14px; }
.chapter-links span { margin-right: 6px; }
.chapter-links a:hover { background: var(--blue-soft); border-color: var(--blue-border); }
.network-flow { display: flex; align-items: center; gap: 8px; background: var(--blue-soft); padding: 24px 12px; border-radius: 12px; }
.network-flow div { flex: 1; text-align: center; min-width: 0; }
.network-flow span { display: block; color: var(--blue); font-size: 32px; line-height: 1.2; margin-bottom: 10px; }
.network-flow strong { display: block; font-size: 13px; }
.network-flow small { display: block; color: var(--muted); font-size: 11px; }
.network-flow b { color: var(--blue); }
.reading-note { background: var(--blue-soft); border-left: 3px solid var(--blue); border-radius: 0 10px 10px 0; padding: 14px 16px; font-size: 14px; }
.definition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.definition-grid > div { background: var(--blue-soft); padding: 16px; border-radius: 12px; }
.definition-grid > div:nth-child(2) { background: var(--purple-soft); }
.definition-grid p { margin-top: 6px; font-size: 14px; }
.unit-example { display: flex; flex-direction: column; gap: 4px; background: var(--blue-soft); padding: 18px; border-radius: 12px; }
.unit-example strong { font-size: 20px; color: var(--blue); }
.unit-example span { color: var(--muted); font-size: 13px; }
.reading-table { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.reading-table table { border-collapse: collapse; width: 100%; font-size: 14px; }
.reading-table th, .reading-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.reading-table thead { background: var(--background); }
.reading-table th:first-child { min-width: 130px; }
.reading-table tr:last-child > * { border-bottom: 0; }
.reading-table thead th { border-bottom: 1px solid var(--border) !important; }
.frame-demo { border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.frame-demo > div { display: flex; align-items: center; gap: 16px; }
.frame-demo > div + div { margin-top: 14px; }
.frame-demo span { font-size: 13px; flex-shrink: 0; }
.frame-line { flex: 1; height: 18px; border-bottom: 1px solid var(--muted); }
.frame-line.stable { background: repeating-linear-gradient(90deg, transparent 0 30px, var(--blue) 30px 32px, transparent 32px 60px); }
.frame-line.uneven { background: linear-gradient(90deg, transparent 8%, var(--blue) 8% 9%, transparent 9% 20%, var(--blue) 20% 21%, transparent 21% 49%, var(--blue) 49% 50%, transparent 50% 57%, var(--blue) 57% 58%, transparent 58% 90%, var(--blue) 90% 91%, transparent 91%); }
.reading-sources { border-top: 1px solid var(--border); margin-top: 36px; padding-top: 16px; font-size: 13px; color: var(--muted); }
.reading-sources summary { cursor: pointer; }
.recommendation { padding: 22px; border: 1px solid var(--border); border-radius: 14px; }
.recommendation > * + * { margin-top: 14px; }
.recommendation-heading { display: flex; align-items: center; gap: 14px; }
.recommendation-heading h3 { margin: 0 0 6px; padding: 0; border: 0; font-size: 23px; }
.recommendation-icon { display: grid; place-items: center; width: 54px; height: 54px; flex-shrink: 0; background: var(--blue-soft); color: var(--blue); font-size: 30px; border-radius: 12px; }
.recommendation-icon.purple { background: var(--purple-soft); color: var(--purple); }
.recommendation-icon.green { background: var(--green-soft); color: var(--green); }
.reading-toc { position: sticky; top: 24px; padding: 18px; }
.reading-toc-panel > summary { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 750; cursor: pointer; list-style: none; }
.reading-toc-panel > summary::-webkit-details-marker { display: none; }
.reading-toc-panel[open] > summary > span { transform: rotate(180deg); }
#reading-toc { max-height: calc(100dvh - 135px); overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; margin-top: 16px; }
.reading-toc-group { border-left: 1px solid var(--border); padding: 0 0 12px 12px; margin-left: 4px; }
.reading-toc-group summary { font-size: 13px; font-weight: 700; cursor: pointer; padding: 7px 2px; }
.reading-toc-group a { display: block; font-size: 12px; padding: 6px 9px; color: var(--muted); border-radius: 6px; margin-top: 2px; }
.reading-toc-group a:hover, .reading-toc-group a[aria-current] { background: var(--blue-soft); color: var(--blue); }
.reading-toc-group a[aria-current] { font-weight: 700; }
.reading-toc-start { font-size: 11px !important; }
.topic-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.topic-entry p { margin-top: 4px; color: var(--muted); }
.basics-entry { margin-top: 24px; }
@media (min-width: 901px) {
  .site-header:has(.header-search:not([hidden])) { gap: 18px; padding: 18px 22px; }
  .site-header:has(.header-search:not([hidden])) .site-nav { gap: 16px; }
  .site-header:has(.header-search:not([hidden])) .header-search { width: 200px; flex: 1; min-width: 140px; }
}
@media (max-width: 900px) {
  .reading-layout { grid-template-columns: minmax(0, 1fr); }
  .reading-toc { position: static; grid-row: 1; padding: 16px 20px; }
  #reading-toc { max-height: 50dvh; }
  .reading-toc-group { padding-bottom: 8px; }
}
@media (max-width: 600px) {
  .reading-article { padding: 22px 18px; }
  .reading-content h2 { font-size: 21px; }
  .reading-content h3 { font-size: 17px; }
  .network-flow { flex-direction: column; gap: 10px; }
  .network-flow div { width: 100%; }
  .network-flow b { transform: rotate(90deg); }
  .network-flow span { font-size: 25px; margin-bottom: 2px; }
  .definition-grid { grid-template-columns: 1fr; }
  .recommendation { padding: 18px 14px; }
  .topic-entry { align-items: flex-start; flex-direction: column; }
  .chapter-links a { font-size: 12px; padding: 10px; }
}
.network-flow .network-icon { display: block; width: 46px; height: 36px; margin: 0 auto 10px; background-position: center; background-repeat: no-repeat; background-size: contain; }
.network-icon.fiber { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 36' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M14 34V23L6 11m18 23V7m10 27V23l8-12'/%3E%3Ccircle cx='6' cy='8' r='3'/%3E%3Ccircle cx='24' cy='4' r='3'/%3E%3Ccircle cx='42' cy='8' r='3'/%3E%3C/svg%3E"); }
.network-icon.ont { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 36' fill='none' stroke='%232563eb' stroke-width='2'%3E%3Crect x='3' y='12' width='42' height='20' rx='5'/%3E%3Cpath d='M10 22h10m8 0h2m5 0h2'/%3E%3C/svg%3E"); }
.network-icon.router { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 36' fill='none' stroke='%232563eb' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='18' width='42' height='14' rx='4'/%3E%3Cpath d='M9 18V3m30 15V3m-26 22h8m7 0h1m5 0h1M19 8q5-5 10 0m-7 4q2-2 4 0'/%3E%3C/svg%3E"); }
.network-icon.computer { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 36' fill='none' stroke='%232563eb' stroke-width='2' stroke-linejoin='round'%3E%3Crect x='8' y='3' width='32' height='23' rx='2'/%3E%3Cpath d='M8 26L2 32h44l-6-6M19 29h10'/%3E%3C/svg%3E"); }
.reading-toc-group:has(a[aria-current]) > summary { color: var(--blue); }
@media (min-width: 1100px) { .chapter-links { grid-template-columns: repeat(4, minmax(0, 1fr)); } .chapter-links a { font-size: 12px; padding: 10px 8px; } }
.recommendation .recommendation-category { margin: 0 0 14px; padding: 0; border: 0; font-size: 12px; font-weight: 650; color: var(--blue); }
.tool-instructions summary { color: var(--blue); cursor: pointer; font-size: 13px; }
.tool-instructions ol, .tool-instructions ul, .tool-instructions p { font-size: 14px; margin-top: 12px; }
.recommendation + .recommendation { margin-top: 20px; }
/* 正文覆盖通用卡片摘要样式，保持与教程一致的深色、可读字号。 */
.reading-content p { color: var(--foreground); font-size: 15px; line-height: 1.85; margin-top: 14px; }
.reading-header .reading-intro { font-size: 16px; line-height: 1.7; }
.reading-content .reading-muted { color: var(--muted); font-size: 13px; }
/* 使用块级箭头，兼容 WordPress 自动段落过滤。 */
.network-flow .flow-arrow { flex: 0 0 auto; width: auto; color: var(--blue); }
@media (max-width: 600px) { .network-flow .flow-arrow { transform: rotate(90deg); } }

/* NVIDIA 历史版本官方直链。 */
.driver-history { padding-top: 4px; }
.driver-history ol { padding-left: 22px; line-height: 1.9; margin: 14px 0 20px; }
.driver-link-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0; }
.driver-link-form label, .driver-link-heading label { font-weight: 650; }
.driver-link-form select, .driver-link-form input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; width: 150px; min-width: 0; color: var(--foreground); background: var(--card); }
.driver-link-form input:focus-visible { border-color: var(--blue); outline: 2px solid var(--blue) !important; outline-offset: 2px; }
.driver-link-row { margin-top: 16px; }
.driver-link-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.driver-link-heading .button { padding: 6px 12px; font-size: 13px; }
.driver-link-row textarea { display: block; width: 100%; min-width: 0; resize: vertical; height: 48px; min-height: 48px; white-space: pre; overflow-x: auto; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--background); color: var(--foreground); font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.driver-link-row textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.card p.driver-link-status { color: var(--blue); font-size: 13px; }
.driver-link-status:empty { display: none; }
.driver-link-heading a[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.driver-link-format { margin-top: 12px; }
.driver-link-format summary { cursor: pointer; font-size: 14px; color: var(--blue); }
.driver-link-format p { margin-top: 12px; }
.driver-link-format .driver-format-url { display: block; overflow-wrap: anywhere; font-size: 12px; padding: 10px; background: var(--background); border-radius: 8px; }
@media (max-width: 600px) { .driver-link-form label { width: 100%; } .driver-link-form input { flex: 1; } }

.brand-mark { overflow: hidden; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.driver-link-form select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
