/* ============================================================
   锋锋外贸助手 · 图文教程知识库  样式表
   配色沿用官网主色： #2563eb / #165DFF / #0f172a / #f8fafc
   ============================================================ */
:root {
  --brand: #2563eb;
  --brand-deep: #1e40af;
  --brand-nav: #165DFF;
  --accent: #06b6d4;
  --ink: #0f172a;
  --ink-soft: #334155;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --bg: #f8fafc;
  --paper: #ffffff;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --radius: 14px;
  --shadow: 0 12px 30px -12px rgba(15, 23, 42, .16);
  --shadow-sm: 0 4px 14px -6px rgba(15, 23, 42, .14);
  --side-w: 286px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

img { max-width: 100%; height: auto; border: 0; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-deep); }

/* ---------- 顶部导航（原站 aoyun.css 官方样式，与主站逐字一致） ---------- */
.db-header-navbar {
    background: #fff !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05) !important;
    padding: 10px 0 !important;
    transition: all 0.3s ease !important;
    z-index: 999 !important;
}
.db-logo-img {
    max-height: 48px !important;
    width: auto !important;
}
.db-header-navbar .nav-link {
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #222 !important;
    padding: 8px 15px !important;
    margin: 0 3px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}
.db-header-navbar .nav-link:hover {
    color: #165DFF !important;
    background: #f5f7ff !important;
}
.db-header-navbar .nav-item.active .nav-link {
    color: #165DFF !important;
    background: #e8f3ff !important;
    font-weight: 600 !important;
}
.db-header-navbar .navbar-toggler {
    border: 0 !important;
    outline: none !important;
}
.db-header-placeholder {
    height: 72px !important;
}
/* 主站导航用 bootstrap .navbar，品牌区不留内边距，避免与主站出现 1px 级差异 */
.db-header-navbar .navbar-brand { padding: 0; display: inline-block; margin-right: 16px; line-height: inherit; white-space: nowrap; }

/* ---------- 搜索条（头部下方，全站统一） ---------- */
/* 吸顶固定：滚动页面时搜索框始终可见。顶部让开 fixed-top 主导航的高度
   （--kb-navh 由 kb.js 按导航实际高度动态写入，避免出现缝隙或重叠） */
.kb-searchbar {
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-bottom: 1px solid var(--line-soft);
  padding: 9px 12px;
  position: sticky; top: var(--kb-navh, 72px); z-index: 65;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .06);
}
.kb-searchbar .kb-search {
  max-width: 560px; margin: 0 auto; padding: 0 4px;
  position: relative; display: flex; flex: 1 1 auto;
}
.kb-tocbtn {
  display: none; margin-left: 10px; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; padding: 9px 13px; font-size: 13.5px;
  color: var(--ink); cursor: pointer; font-weight: 600; flex: 0 0 auto;
}

/* ---------- 搜索框 ---------- */
.kb-search {
  position: relative; flex: 1 1 auto; width: 100%;
}
.kb-search input {
  width: 100%; height: 40px; border-radius: 10px;
  border: 1px solid var(--line); background: #f8fafc;
  padding: 0 36px 0 34px; font-size: 14px; color: var(--ink);
  outline: none; transition: .18s;
}
.kb-search input:focus {
  background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.kb-search .ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--gray-light); font-size: 14px; pointer-events: none;
}
.kb-search .kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--gray-light); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; background: #fff; pointer-events: none;
}
.kb-results {
  position: absolute; left: 0; right: 0; top: 46px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 420px; overflow: auto; display: none;
  padding: 6px;
}
.kb-results.open { display: block; }
.kb-results .r-item {
  display: block; padding: 9px 11px; border-radius: 8px; color: var(--ink);
}
.kb-results .r-item:hover, .kb-results .r-item.cur { background: #f1f5fd; }
.kb-results .r-t { font-size: 14px; font-weight: 600; }
.kb-results .r-t em { font-style: normal; color: #d97706; background: #fef3c7; border-radius: 3px; padding: 0 2px; }
.kb-results .r-s { font-size: 12px; color: var(--gray); margin-top: 2px; }
.kb-results .r-empty { padding: 14px 12px; color: var(--gray); font-size: 13.5px; }

/* ---------- 布局 ---------- */
.kb-shell {
  max-width: 1240px; margin: 0 auto; padding: 22px 16px 56px;
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); gap: 26px;
}
.kb-side {
  position: sticky; top: calc(var(--kb-navh, 72px) + 68px); align-self: start;
  max-height: calc(100vh - 160px); overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 10px 18px; box-shadow: var(--shadow-sm);
}
.kb-side::-webkit-scrollbar { width: 6px; }
.kb-side::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.kb-side .side-head {
  font-size: 12px; letter-spacing: .08em; color: var(--gray-light);
  padding: 4px 8px 8px; font-weight: 700;
}
.g-block { margin-bottom: 4px; }
.g-title {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px; border-radius: 8px; font-size: 14.5px; font-weight: 700;
  color: var(--ink); cursor: pointer; user-select: none;
}
.g-title:hover { background: #f6f8fc; }
.g-title .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.g-title .cnt { margin-left: auto; font-size: 11.5px; color: var(--gray-light); font-weight: 500; }
.g-title .arw { font-size: 10px; color: var(--gray-light); transition: .2s; }
.g-block.collapsed .arw { transform: rotate(-90deg); }
.g-block.collapsed .g-body { display: none; }
.g-body { padding-left: 6px; }
.s-title {
  font-size: 12.5px; color: var(--gray); font-weight: 700;
  padding: 7px 9px 4px; letter-spacing: .02em;
}
.a-link {
  display: block; padding: 6px 10px 6px 14px; border-radius: 7px;
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.5;
  border-left: 2px solid transparent;
}
.a-link:hover { background: #f5f7ff; color: var(--brand-nav); }
.a-link.on {
  background: #e8f3ff; color: var(--brand-nav); font-weight: 700;
  border-left-color: var(--brand-nav);
}

/* ---------- 正文 ---------- */
.kb-main { min-width: 0; }
.crumb { font-size: 13px; color: var(--gray); margin-bottom: 12px; }
.crumb a { color: var(--gray); }
.crumb a:hover { color: var(--brand); }
.crumb .sep { margin: 0 6px; color: #cbd5e1; }

.paper {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 34px 34px; box-shadow: var(--shadow-sm);
}
.paper h1 {
  font-size: 26px; line-height: 1.45; margin: 0 0 6px; font-weight: 800;
  letter-spacing: -.01em; color: var(--ink);
}
.paper .meta {
  display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center;
  font-size: 12.5px; color: var(--gray); padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft); margin-bottom: 22px;
}
.paper .meta .tag {
  background: #eef4ff; color: var(--brand-deep); border-radius: 999px;
  padding: 2px 10px; font-weight: 600;
}
.paper .lede {
  background: #f6f9ff; border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0; padding: 11px 15px; margin: 0 0 22px;
  font-size: 14.5px; color: var(--ink-soft);
}

.art h2 {
  font-size: 18.5px; font-weight: 700; margin: 30px 0 12px;
  padding-left: 13px; position: relative; line-height: 1.55; color: var(--ink);
}
.art h2::before {
  content: ""; position: absolute; left: 0; top: .28em; bottom: .28em;
  width: 4px; border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--accent));
}
.art h3 { font-size: 16.5px; font-weight: 700; margin: 24px 0 10px; color: var(--ink); }
.art p { margin: 0 0 15px; color: var(--ink-soft); font-size: 15.5px; }
.art ul, .art ol { margin: 0 0 16px; padding-left: 24px; color: var(--ink-soft); }
.art li { margin-bottom: 7px; font-size: 15.5px; }
.art blockquote {
  margin: 0 0 18px; padding: 12px 16px; background: #fffbeb;
  border: 1px solid #fde68a; border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0; color: #78350f; font-size: 14.5px;
}
.art blockquote p { color: #78350f; margin: 0 0 8px; }
.art blockquote p:last-child { margin-bottom: 0; }
.art blockquote strong { color: #92400e; }
.art code {
  background: #eef2f7; color: #be123c; border-radius: 4px;
  padding: 1.5px 6px; font-size: .9em; font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace;
}
.art pre {
  background: #0f172a; color: #e2e8f0; border-radius: 10px;
  padding: 14px 16px; overflow: auto; font-size: 13.5px; margin: 0 0 18px;
}
.art pre code { background: none; color: inherit; padding: 0; }
.art strong { color: var(--ink); font-weight: 700; }
.art .step-num {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; background: var(--brand); color: #fff;
  font-size: 12.5px; font-weight: 700; margin-right: 8px; vertical-align: 1px;
}

.art figure { margin: 0 0 20px; }
/* 图片按源图原始尺寸显示：覆盖静态页生成时写入的 width="1000" 属性，
   不再放大；超大图仍受 max-width 限制自动缩小 */
.art img, .paper img, .art figure img {
  width: auto;
}
.art figure img {
  display: block; max-width: 100%; height: auto;
  border: 1px solid var(--line);
  border-radius: 10px; background: #fbfcfe;
}
.art figcaption {
  font-size: 12.5px; color: var(--gray-light); text-align: center;
  margin-top: 7px;
}

/* 章节导航页 */
.chap-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.chap-list a {
  display: flex; align-items: center; gap: 10px; padding: 12px 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
  color: var(--ink); font-size: 15px; transition: .18s;
}
.chap-list a:hover { border-color: var(--brand); background: #f7faff; color: var(--brand-deep); }
.chap-list .n {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px;
  background: #eef4ff; color: var(--brand-deep); display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
}
.chap-list .d { margin-left: auto; font-size: 12.5px; color: var(--gray-light); }

/* 上/下一篇 */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.pager a {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 15px;
  background: #fff; color: var(--ink); font-size: 14px; transition: .18s;
}
.pager a:hover { border-color: var(--brand); background: #f7faff; }
.pager .k { display: block; font-size: 12px; color: var(--gray-light); margin-bottom: 3px; }
.pager .v { display: block; font-weight: 600; }
.pager .next { text-align: right; }

/* ---------- 首页 Banner（与全站列表页 .ff-page-hero 深空蓝风格统一） ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(820px 380px at 82% -20%, rgba(34,211,238,.18), transparent 60%),
    radial-gradient(680px 340px at 12% 120%, rgba(37,99,235,.32), transparent 58%),
    linear-gradient(158deg, #0a1830 0%, #0f2547 55%, #123061 100%);
  color: #fff; padding: 66px 0 58px; margin-bottom: 0;
  text-align: center; overflow: hidden;
}
/* 细网格纹理（与全站横幅一致） */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.06) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(70% 80% at 50% 45%, #000 25%, transparent 100%);
  mask-image: radial-gradient(70% 80% at 50% 45%, #000 25%, transparent 100%);
  pointer-events: none;
}
.hero-in { max-width: 1240px; margin: 0 auto; padding: 0 16px; position: relative; }
.hero h1 {
  font-size: clamp(1.55rem, 2.6vw, 2.15rem); font-weight: 800; margin: 0 0 10px;
  letter-spacing: .01em; color: #f8fafc; animation: kbFadeDown .55s ease both;
}
.hero p {
  font-size: 15px; color: rgba(203,213,225,.85); max-width: 780px;
  margin: 0 auto 22px; letter-spacing: .03em; line-height: 1.85;
  animation: kbFadeDown .65s ease both;
}
.hero .stats {
  display: flex; flex-wrap: wrap; gap: 30px; margin-top: 24px; justify-content: center;
}
.hero .stat b { display: block; font-size: 24px; font-weight: 800; color: #f8fafc; }
.hero .stat span { font-size: 12.5px; color: rgba(186,205,235,.85); letter-spacing: .04em; }
.hero .btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; animation: kbFadeDown .7s ease both; }
.hero .btn {
  display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 24px;
  border-radius: 999px; font-size: 14.5px; font-weight: 600;
  transition: transform .2s ease, filter .2s ease, background .2s ease, border-color .2s ease;
}
.hero .btn.p {
  background: linear-gradient(135deg, #2f6bff 0%, #2563eb 55%, #1d4ed8 100%);
  color: #fff; box-shadow: 0 12px 26px -10px rgba(37,99,235,.65);
}
.hero .btn.p:hover { filter: brightness(1.08); transform: translateY(-2px); color: #fff; }
.hero .btn.s {
  border: 1px solid rgba(255,255,255,.3); color: #e8eefb;
  background: rgba(255,255,255,.07); backdrop-filter: blur(8px);
}
.hero .btn.s:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.45); transform: translateY(-2px); color: #fff; }
@keyframes kbFadeDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

.sec-title {
  font-size: 20px; font-weight: 800; margin: 34px 0 16px; color: var(--ink);
  display: flex; align-items: center; gap: 10px;
}
.sec-title small { font-size: 13px; font-weight: 500; color: var(--gray); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; transition: .2s; display: block; color: var(--ink);
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.card .ct { font-size: 16.5px; font-weight: 700; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.card .cd { font-size: 13.5px; color: var(--gray); line-height: 1.65; min-height: 44px; }
.card .cn { font-size: 12px; color: var(--brand-deep); background: #eef4ff; border-radius: 999px; padding: 2px 9px; font-weight: 700; margin-left: auto; }

.faq-teaser {
  margin-top: 30px; background: linear-gradient(120deg, #f0f6ff, #eefbfd);
  border: 1px solid #d6e6ff; border-radius: var(--radius); padding: 22px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
}
.faq-teaser h3 { margin: 0; font-size: 18px; font-weight: 800; }
.faq-teaser p { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.faq-teaser .go {
  margin-left: auto; background: var(--brand); color: #fff; border-radius: 10px;
  padding: 11px 22px; font-weight: 700; font-size: 14.5px;
}
.faq-teaser .go:hover { background: var(--brand-deep); color: #fff; }

/* ---------- FAQ 页 ---------- */
.faq-topic { margin-bottom: 26px; }
.faq-topic > h2 {
  font-size: 18px; font-weight: 800; margin: 0 0 12px; color: var(--ink);
  padding-bottom: 9px; border-bottom: 2px solid var(--line-soft);
  display: flex; align-items: center; gap: 9px;
}
.faq-topic > h2 .dot { width: 9px; height: 9px; border-radius: 50%; }
.qa { border: 1px solid var(--line); border-radius: 11px; background: #fff; margin-bottom: 9px; overflow: hidden; }
.qa > summary {
  cursor: pointer; padding: 13px 16px 13px 40px; font-size: 15px; font-weight: 600;
  color: var(--ink); position: relative; list-style: none;
}
.qa > summary::-webkit-details-marker { display: none; }
.qa > summary::before {
  content: "Q"; position: absolute; left: 14px; top: 13px;
  width: 19px; height: 19px; border-radius: 6px; background: #eef4ff;
  color: var(--brand-deep); font-size: 11.5px; font-weight: 800;
  display: grid; place-items: center;
}
.qa[open] > summary { background: #f7faff; border-bottom: 1px solid var(--line-soft); }
.qa .ans { padding: 14px 18px 4px 40px; font-size: 15px; color: var(--ink-soft); }
.qa .ans p { margin: 0 0 12px; }
.qa .tags { padding: 0 18px 14px 40px; display: flex; flex-wrap: wrap; gap: 6px; }
.qa .tags i {
  font-style: normal; font-size: 11.5px; color: var(--gray);
  background: #f1f5f9; border-radius: 999px; padding: 2px 9px;
}
.qa.hide { display: none; }

/* ---------- 页脚（原站 aoyun.css 官方样式，全 db- 前缀无冲突） ---------- */
.db-site-footer {
    background-color: #1A1A2E;
    color: #e0e0e0;
    font-family: "Microsoft YaHei", sans-serif;
}
.db-footer-top {
    padding: 70px 0 50px;
}
.db-footer-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}
.db-footer-col {
    flex: 1;
    min-width: 260px;
}
.db-footer-title {
    font-size: 18px;
    color: #ffffff;
    margin-bottom: 25px;
    padding-bottom: 10px;
    position: relative;
    font-weight: 600;
}
.db-footer-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background: #409EFF;
}
.db-footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    line-height: 2.2;
}
.db-footer-list li {
    margin-bottom: 8px;
}
.db-footer-list span {
    color: #409EFF;
    font-weight: 500;
}
.db-footer-list a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
}
.db-footer-list a:hover {
    color: #409EFF;
}
/* 二维码 */
.db-qr-code {
    text-align: center;
}
.db-qr-box img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    margin-bottom: 10px;
}
.db-qr-box p {
    margin: 0;
    font-size: 13px;
    color: #ccc;
}
/* 版权 */
.db-footer-copyright {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 22px 0;
    text-align: center;
    font-size: 14px;
    color: #999;
}

/* ---------- 移动端 ---------- */
.kb-mask {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 70;
}
.kb-mask.open { display: block; }

@media (max-width: 991px) {
  /* 头部折叠菜单由主站 Bootstrap 的 .navbar-expand-lg + collapse 控制，无需额外样式 */
  /* 内容布局 */
  .kb-shell { grid-template-columns: 1fr; padding-top: 14px; }
  .kb-side {
    position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-height: none;
    border-radius: 0; z-index: 80; transform: translateX(-102%);
    transition: transform .25s ease; padding-top: 18px;
  }
  .kb-side.open { transform: translateX(0); }
  .kb-tocbtn { display: block; }
  .paper { padding: 22px 18px 26px; }
  .paper h1 { font-size: 21px; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 23px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}

/* 页脚移动端（原站官方规则） */
@media (max-width: 768px) {
  .db-footer-top {
    padding: 40px 0 30px;
  }
  .db-footer-col {
    min-width: 100%;
    text-align: center;
  }
  .db-footer-title::after {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* 打印 */
@media print {
  .db-header-navbar, .db-header-placeholder, .kb-searchbar,
  .kb-side, .pager, .db-site-footer, .kb-mask, .kb-tocbtn { display: none !important; }
  .kb-shell { grid-template-columns: 1fr; padding: 0; }
  .paper { border: 0; box-shadow: none; padding: 0; }
}
