/* fcc- 蓝图工程风样式 —— code.fakra.中国 颜色编码与防误插平台
   深蓝黑底 + 信号紫主色 + 校验琥珀强调 */

:root {
  --ink: #0F1520;
  --surface: #17202E;
  --surface-2: #1D2836;
  --grid: #1B2733;
  --line: #2A3646;
  --text: #F2F6FA;
  --muted: #A9B7C6;
  --signal: #8B6CF0;   /* 信号紫 主色 */
  --signal-soft: #B7A6F7;
  --amber: #F5A623;    /* 校验琥珀 强调/防误插 */
  --teal: #2BD4C4;     /* 辅助信号青 */
  --radius: 10px;
  --maxw: 1200px;
  --nav-h: 64px;
  /* 面包屑与正文 H2 左缘对齐 */
  --h2-inset: 16px;
  --page-inset: 0;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background-color: var(--ink);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}

a { color: var(--signal-soft); text-decoration: none; }
a:hover { color: var(--signal); text-decoration: underline; }

img { max-width: 100%; height: auto; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 24px) 20px 0;
}

/* ===== 顶部固定导航 ===== */
.fcc-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
  z-index: 1000;
}
.fcc-nav .container {
  height: 100%;
  padding: 0 20px;   /* 覆盖全局 .container 的 padding-top，导航内容保持在栏内 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.fcc-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.fcc-brand .dot {
  width: 12px; height: 12px; border-radius: 3px;
  background: var(--signal);
  box-shadow: 0 0 10px var(--signal);
}
.fcc-nav ul {
  list-style: none; display: flex; gap: 18px; margin: 0; padding: 0;
  align-items: center;
}
.fcc-nav li { position: relative; }
.fcc-nav a { color: #C6D2DF; font-size: 15px; padding: 6px 2px; }
.fcc-nav a:hover, .fcc-nav a.active { color: #FFFFFF; }
.fcc-nav .has-menu > a::after {
  content: "▾"; font-size: 11px; margin-left: 4px; color: var(--muted);
}
.fcc-nav .submenu {
  position: absolute; top: 100%; left: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 160px;
  display: none;
  flex-direction: column;
  gap: 2px;
}
.fcc-nav .has-menu:hover .submenu { display: flex; }
.fcc-nav .submenu a { display: block; padding: 6px 10px; border-radius: 6px; }
.fcc-nav .submenu a:hover { background: var(--surface-2); text-decoration: none; }

.fcc-burger { display: none; background: none; border: 1px solid var(--line);
  color: var(--text); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 18px; }

/* ===== 首屏 hero ===== */
.fcc-hero {
  padding: calc(var(--nav-h) + 60px) 0 50px;
  border-bottom: 1px solid var(--line);
}
.fcc-hero h1 {
  font-size: 42px; line-height: 1.2; margin: 0 0 16px;
  letter-spacing: 0.5px;
}
.fcc-hero .lead { color: var(--muted); font-size: 18px; max-width: 760px; }
.fcc-hero .accent { color: var(--signal); }
.fcc-hero .amber { color: var(--amber); }

/* ===== 区块标题 ===== */
.fcc-section { padding: 48px 0; }
.fcc-section h2.fcc-h2 {
  font-size: 26px; margin: 0 0 24px;
  padding-left: 14px; border-left: 4px solid var(--signal);
}
.fcc-grid-cards {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.fcc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .2s, transform .2s;
}
.fcc-card:hover { border-color: var(--signal); transform: translateY(-3px); }
.fcc-card h3 { margin: 0 0 8px; font-size: 18px; }
.fcc-card p { margin: 0; color: var(--muted); font-size: 14px; }
.fcc-card .tag { display:inline-block; font-size:12px; color: var(--teal);
  border:1px solid var(--line); border-radius:20px; padding:2px 10px; margin-bottom:10px; }

/* 首页关键词/应用场景 pill */
.fcc-pills { display:flex; flex-wrap:wrap; gap:10px; }
.fcc-pill { background: var(--surface); border:1px solid var(--line);
  border-radius: 20px; padding: 8px 14px; font-size: 14px; color: var(--text); }
.fcc-pill b { color: var(--signal-soft); }

/* ===== 面包屑（置于与 H2 同容器内，左缘与 H2 文字一致） ===== */
.fcc-breadcrumb {
  padding: 14px 0 10px;
  margin-left: 0;
  font-size: 13px;
  color: var(--muted);
}
.fcc-breadcrumb ol { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; flex-wrap: wrap; }
.fcc-breadcrumb li::after { content: "›"; margin-left: 8px; color: var(--line); }
.fcc-breadcrumb li:last-child::after { content: ""; }
.fcc-breadcrumb a { color: var(--muted); }
.fcc-breadcrumb a:hover { color: var(--text); }

/* ===== 详情页布局 ===== */
.layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 36px;
  align-items: start;
  padding: 20px 0 60px;
}
.content-main { min-width: 0; }
.content-main h1 { font-size: 32px; margin: 8px 0 6px; }
.content-main h2 {
  font-size: 23px; margin: 34px 0 12px;
  scroll-margin-top: calc(var(--nav-h) + 16px);
  color: var(--text);
}
.content-main h3 { font-size: 19px; margin: 24px 0 10px; color: var(--signal-soft); }
.content-main p { margin: 12px 0; }
.content-main ul, .content-main ol { padding-left: 22px; }
.content-main li { margin: 6px 0; }
.content-main blockquote {
  border-left: 3px solid var(--amber);
  background: var(--surface);
  margin: 16px 0; padding: 12px 16px;
  color: var(--text); border-radius: 0 8px 8px 0;
}
.content-main code {
  background: var(--surface-2); padding: 2px 6px; border-radius: 4px;
  font-size: 14px; color: var(--teal);
}
.content-main .kw { color: var(--muted); font-size: 14px; }
.content-main .kw .tag-text {
  display: inline-block; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 2px 8px; margin: 0 6px 6px 0; font-size: 13px; color: var(--teal);
}
.content-main time { color: var(--muted); font-size: 13px; }

/* 表格：覆盖全部正文表格（含 Markdown 裸 table） */
.content-main table, .page-main table, table.fcc-spec {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 14px; border: 1px solid #cbd5e1;
}
.content-main table th, .page-main table th, table.fcc-spec th {
  background: var(--signal); color: #fff; text-align: left;
  padding: 9px 12px; border: 1px solid #cbd5e1; font-weight: 600;
}
.content-main table td, .page-main table td, table.fcc-spec td {
  padding: 8px 12px; border: 1px solid #cbd5e1; color: var(--text);
  background: var(--surface);
}
.content-main table tr:nth-child(even) td,
.page-main table tr:nth-child(even) td,
table.fcc-spec tr:nth-child(even) td { background: var(--surface-2); }

/* 结论块 */
.content-main .conclusion {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 4px solid var(--amber);
  border-radius: 8px; padding: 14px 18px; margin: 18px 0;
}
.content-main .conclusion h4 { margin: 0 0 8px; color: var(--amber); font-size: 16px; }
.content-main .conclusion ol { margin: 0; }

/* 实践经验 callout */
.content-main .case-study {
  border: 1px dashed var(--teal); border-radius: 8px;
  padding: 12px 16px; margin: 18px 0; background: rgba(43,212,196,0.06);
}
.content-main .case-study b { color: var(--teal); }

/* 相关阅读 / 相关产品 */
.fcc-related { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 18px; }
.fcc-related h3 { font-size: 18px; margin: 0 0 12px; }
.fcc-related ul { list-style: none; padding: 0; margin: 0; }
.fcc-related li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fcc-related .why { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }

/* ===== 详情页 TOC（原生 details） ===== */
.toc-aside { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - 100px); overflow-y: auto; }
.toc-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.toc-panel > summary {
  cursor: pointer; font-weight: 600; color: var(--text);
  list-style: none; padding: 4px 0; font-size: 15px;
}
.toc-panel > summary::-webkit-details-marker { display: none; }
.toc-panel > summary::after { content: "▾"; float: right; color: var(--muted); transition: transform .2s; }
.toc-panel:not([open]) > summary::after { content: "▸"; }
.toc-panel ol { list-style: none; padding-left: 0; margin: 8px 0 0; }
.toc-panel ol li { padding: 3px 0; font-size: 13px; }
.toc-panel ol li a { color: var(--muted); }
.toc-panel ol li a:hover { color: var(--signal-soft); }
.toc-panel ol ol { padding-left: 14px; }

/* ===== 列表 / 分类页 ===== */
.list-layout .layout-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 36px; align-items: start;
  padding: 20px 0 60px;
}
.cat-side { position: sticky; top: calc(var(--nav-h) + 16px); }
.cat-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.cat-panel > summary {
  cursor: pointer; font-weight: 600; list-style: none; padding: 4px 0;
}
.cat-panel > summary::-webkit-details-marker { display: none; }
.cat-panel > summary::after { content: "▾"; float: right; color: var(--muted); }
.cat-panel:not([open]) > summary::after { content: "▸"; }
ul.category-list { list-style: none; padding: 8px 0 0; margin: 0; }
ul.category-list li { padding: 7px 10px; border-radius: 6px; }
ul.category-list li a { color: var(--muted); display: block; }
ul.category-list li.active, ul.category-list li:hover { background: var(--surface-2); }
ul.category-list li.active a, ul.category-list li:hover a { color: var(--text); }

.cat-content h1 { font-size: 28px; margin: 6px 0 6px; }
.cat-content .cat-desc { color: var(--muted); margin-bottom: 20px; }
.cat-content .item-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cat-content .item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px;
}
.cat-content .item h3 { margin: 0 0 6px; font-size: 17px; }
.cat-content .item .meta { color: var(--muted); font-size: 13px; }
.cat-content .item p { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.cat-content .item .when { color: var(--muted); font-size: 12px; }

/* ===== FAQ（裸 details） ===== */
.content-main details.faq-item, .page-main details.faq-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; margin: 10px 0; padding: 4px 14px;
}
.content-main details.faq-item summary, .page-main details.faq-item summary {
  cursor: pointer; font-weight: 600; padding: 10px 0; list-style: none;
}
.content-main details.faq-item summary::-webkit-details-marker,
.page-main details.faq-item summary::-webkit-details-marker { display: none; }
.content-main details.faq-item summary::before,
.page-main details.faq-item summary::before {
  content: "Q"; color: var(--signal); font-weight: 700; margin-right: 8px;
}
.content-main details.faq-item[open] summary,
.page-main details.faq-item[open] summary { color: var(--signal-soft); }
.content-main details.faq-item p, .page-main details.faq-item p { margin: 6px 0 12px; color: var(--text); }

.faq-block { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 18px; }
.faq-block h2 { font-size: 22px; }

/* ===== 悬浮工具胶囊 ===== */
.fcc-float {
  position: fixed; right: 18px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 10px; z-index: 900;
}
.fcc-float a, .fcc-float button {
  width: 52px; height: 52px; border-radius: 26px;
  background: linear-gradient(135deg, var(--signal), var(--teal));
  color: #fff; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; gap: 1px; box-shadow: 0 4px 14px rgba(0,0,0,.4);
  text-decoration: none;
}
.fcc-float a span, .fcc-float button span { font-size: 10px; }
.fcc-float .ic { font-size: 18px; line-height: 1; }

/* 名片浮层 */
.fcc-card-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center; z-index: 1100;
}
.fcc-card-overlay[hidden] { display: none; }
.fcc-card-overlay img { border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.fcc-card-overlay .close {
  position: absolute; top: 20px; right: 24px; color: #fff;
  font-size: 28px; cursor: pointer; background: none; border: none;
}

/* ===== 页脚 ===== */
.fcc-footer { border-top: 1px solid var(--line); padding: 34px 0; color: var(--muted); font-size: 14px; }
.fcc-footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }
.fcc-footer a { color: var(--muted); }
.fcc-footer .cols { display: flex; gap: 40px; flex-wrap: wrap; }
.fcc-footer h4 { color: var(--text); margin: 0 0 10px; font-size: 15px; }

/* ===== 页面（叶子页） ===== */
.page-main { max-width: 820px; margin: 0 auto; padding: 20px 20px 60px; }
.page-main h1 { font-size: 30px; margin: 6px 0 16px; }
.page-main h2 { font-size: 22px; margin: 28px 0 10px; border-left: 4px solid var(--signal); padding-left: 12px; }
.page-main h3 { font-size: 18px; margin: 20px 0 8px; }
.page-main .page-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.page-breadcrumb { margin-left: var(--page-inset); }

/* ===== 归档 / 404 ===== */
.archive-list { columns: 2; column-gap: 30px; }
.archive-list li { break-inside: avoid; margin-bottom: 6px; }
.archive-list a { color: var(--text); }

/* ===== 响应式：≤1024 折叠 ===== */
@media (max-width: 1024px) {
  .fcc-nav .nav-links { display: none; position: absolute; top: var(--nav-h); right: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    flex-direction: column; padding: 12px; min-width: 200px; }
  .fcc-nav .nav-links.open { display: flex; }
  .fcc-nav .submenu { position: static; border: none; background: none; padding: 4px 0 4px 12px; }
  .fcc-burger { display: block; }
  .layout-grid, .list-layout .layout-grid { grid-template-columns: 1fr; }
  .toc-aside, .cat-side { position: static; max-height: none; top: auto; }
  /* 关键：手机端不得 display:none 隐藏目录/侧栏，仅由 <details> 折叠 */
  .fcc-hero h1 { font-size: 30px; }
  .archive-list { columns: 1; }
}
