/* ========== tp004 - 安全百科 · 红色Red ========== */
:root {
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-400: #f87171;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;
  --red-800: #991b1b;
  --red-900: #7f1d1d;
  --white: #ffffff;
  --warm-bg: #fefefe;
  --cream: #fff8f6;
  --sand: #faf5f0;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 16px rgba(0,0,0,.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Serif SC", "Noto Sans SC", serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.8;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
svg { flex-shrink: 0; }

/* ===== 顶栏（百科风格·图书馆式） ===== */
.wiki-bar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--red-100);
  padding: 0 28px;
}
.wiki-bar-inner {
  max-width: 1300px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.wiki-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; color: var(--red-700);
  font-family: "Noto Serif SC", serif;
}
.wiki-logo img { width: 34px; height: 34px; border-radius: 6px; }
.wiki-nav { display: flex; gap: 4px; align-items: center; }
.wiki-nav a {
  padding: 8px 18px; border-radius: 8px;
  font-size: .9rem; font-weight: 500; color: var(--gray-600);
  transition: all .2s;
}
.wiki-nav a:hover { background: var(--red-50); color: var(--red-600); }
.wiki-nav a.active { background: var(--red-500); color: #fff; font-weight: 600; }
.wiki-nav .wiki-dl {
  background: var(--red-600); color: #fff; border-radius: 50px;
  padding: 10px 22px; font-weight: 600; font-size: .875rem;
  margin-left: 8px; display: flex; align-items: center; gap: 6px;
  transition: background .2s;
}
.wiki-nav .wiki-dl:hover { background: var(--red-700); color: #fff; }

/* ===== 百科主体布局（侧栏 + 主内容） ===== */
.wiki-shell { display: flex; max-width: 1300px; margin: 0 auto; padding: 32px 28px 60px; gap: 36px; min-height: 70vh; }
.wiki-side { width: 240px; flex-shrink: 0; position: sticky; top: 96px; align-self: flex-start; }
.wiki-side h5 {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--red-500); margin-bottom: 10px; font-weight: 700;
}
.wiki-side a {
  display: block; padding: 8px 14px; border-radius: 6px;
  font-size: .9rem; color: var(--gray-600); transition: all .15s; margin-bottom: 2px;
  border-left: 3px solid transparent;
}
.wiki-side a:hover, .wiki-side a.active { background: var(--red-50); color: var(--red-600); border-left-color: var(--red-400); }
.wiki-main { flex: 1; min-width: 0; }
.wiki-main h1 {
  font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em;
  margin-bottom: 6px; color: var(--gray-900);
}
.wiki-main .wm-subtitle { color: var(--gray-500); font-size: 1.05rem; margin-bottom: 32px; }

/* ===== 定义卡片 ===== */
.def-box {
  background: var(--cream); border-radius: var(--radius);
  border: 1px solid var(--gray-200); padding: 28px 32px; margin-bottom: 24px;
}
.def-box h3 { font-size: 1.2rem; font-weight: 700; color: var(--red-700); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.def-box h3 .df-icon { font-size: 1.4rem; }
.def-box p { color: var(--gray-600); font-size: .95rem; }
.def-box ul { list-style: none; margin-top: 10px; }
.def-box ul li { padding: 4px 0 4px 20px; position: relative; font-size: .9rem; color: var(--gray-600); }
.def-box ul li::before { content: '·'; position: absolute; left: 6px; color: var(--red-400); font-weight: 700; font-size: 1.2rem; line-height: 1; }

/* ===== 警示框 ===== */
.alert-note {
  border-radius: var(--radius-sm); padding: 18px 22px; margin: 20px 0; font-size: .92rem;
  display: flex; gap: 12px; align-items: flex-start; line-height: 1.6;
}
.alert-note .an-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-good { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ===== 步骤清单 ===== */
.step-list { counter-reset: step; list-style: none; }
.step-list li {
  counter-increment: step; padding: 18px 22px 18px 60px;
  position: relative; background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); margin-bottom: 12px;
}
.step-list li::before {
  content: counter(step);
  position: absolute; left: 16px; top: 18px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--red-500); color: #fff; font-weight: 800; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.step-list li h4 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.step-list li p { font-size: .9rem; color: var(--gray-600); }

/* ===== 对比矩阵表格 ===== */
.matrix-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 24px 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.matrix-table th {
  background: var(--red-500); color: #fff; padding: 14px 18px; text-align: center;
  font-weight: 600; font-size: .9rem;
}
.matrix-table th:first-child { text-align: left; background: var(--gray-200); color: var(--gray-800); font-weight: 700; }
.matrix-table td {
  padding: 14px 18px; text-align: center; font-size: .9rem; border-bottom: 1px solid var(--gray-100);
  background: var(--white);
}
.matrix-table td:first-child {
  text-align: left; font-weight: 600; background: var(--gray-50); color: var(--gray-700);
}
.matrix-table tr:last-child td { border-bottom: none; }
.matrix-table .best { color: var(--red-600); font-weight: 700; }
.matrix-table .ok { color: var(--gray-500); }
.matrix-table .warn { color: #d97706; font-weight: 500; }

/* ===== 百科页面无侧栏模式 ===== */
.wiki-no-side .wiki-shell { display: block; }
.wiki-no-side .wiki-main { max-width: 820px; margin: 0 auto; }

/* ===== 特性卡片 ===== */
.feat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; margin: 28px 0;
}
.feat-tile {
  background: var(--white); border: 1px solid var(--gray-200);
  border-radius: var(--radius); padding: 24px; transition: box-shadow .2s;
}
.feat-tile:hover { box-shadow: var(--shadow-md); }
.feat-tile .ft-icon { font-size: 1.8rem; margin-bottom: 12px; }
.feat-tile h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; color: var(--red-700); }
.feat-tile p { font-size: .9rem; color: var(--gray-600); }

/* ===== 参考资料表格 ===== */
.ref-list { list-style: none; }
.ref-list li {
  padding: 14px 20px; border-left: 3px solid var(--red-200);
  margin-bottom: 10px; background: var(--cream); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .92rem; color: var(--gray-700);
}
.ref-list li strong { color: var(--red-600); }

/* ===== 页脚 ===== */
.wiki-foot {
  background: var(--gray-900); color: #fff; padding: 44px 28px 28px;
  border-top: 4px solid var(--red-500);
}
.wiki-foot .wf-inner { max-width: 1300px; margin: 0 auto; }
.wf-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.wf-grid h5 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.wf-grid a { display: block; font-size: .875rem; color: var(--gray-400); padding: 4px 0; transition: color .2s; }
.wf-grid a:hover { color: var(--red-400); }
.wf-grid p { color: var(--gray-400); font-size: .875rem; line-height: 1.7; }
.wf-copy { margin-top: 32px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); text-align: center; font-size: .8rem; color: var(--gray-400); }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .wiki-shell { flex-direction: column; }
  .wiki-side { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; }
  .wiki-side h5 { width: 100%; }
  .wiki-side a { border-left: none; border-bottom: 2px solid transparent; }
  .wiki-side a:hover, .wiki-side a.active { border-bottom-color: var(--red-400); }
  .wiki-nav { flex-wrap: wrap; gap: 4px; }
  .wiki-main h1 { font-size: 1.7rem; }
  .wf-grid { grid-template-columns: 1fr; gap: 24px; }
  .matrix-table { font-size: .8rem; }
  .matrix-table th, .matrix-table td { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .wiki-bar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .def-box { padding: 18px; }
  .feat-row { grid-template-columns: 1fr; }
}