/* 逸媒出海 · 云控操作指南 —— 文档站样式 */
:root {
  --brand: #2f6df6;
  --brand-dark: #1d4fd0;
  --brand-soft: #eaf1ff;
  --brand-ring: rgba(47, 109, 246, .28);
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --bg-side: #fbfcfe;
  --border: #e6eaf0;
  --border-soft: #eef1f6;
  --text: #1c2434;
  --text-mid: #4a5568;
  --text-dim: #7b8698;
  --code-bg: #f4f6fa;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 18px 50px rgba(16, 24, 40, .16);
  --radius: 12px;
  --header-h: 60px;
  --side-w: 288px;
  --toc-w: 232px;
  --warn: #d97706;
  --warn-bg: #fff8ec;
  --warn-bd: #f6dfb4;
  --tip: #0e9f6e;
  --tip-bg: #ecfdf5;
  --tip-bd: #bdebd6;
  --info: #2f6df6;
  --info-bg: #eff5ff;
  --info-bd: #cddffd;
}

html[data-theme="dark"] {
  --brand: #6c9bff;
  --brand-dark: #8fb2ff;
  --brand-soft: #16233d;
  --brand-ring: rgba(108, 155, 255, .3);
  --bg: #0f1420;
  --bg-soft: #151b29;
  --bg-side: #111826;
  --border: #232c3d;
  --border-soft: #1c2434;
  --text: #e6eaf2;
  --text-mid: #a9b4c7;
  --text-dim: #78849b;
  --code-bg: #1a2233;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .6);
  --warn: #f0b429;
  --warn-bg: #2b2314;
  --warn-bd: #4a3a17;
  --tip: #34d399;
  --tip-bg: #10241d;
  --tip-bd: #1f4636;
  --info: #6c9bff;
  --info-bg: #141f36;
  --info-bd: #26365a;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

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

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- 顶栏 ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 60;
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #2f6df6, #22b8cf);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px rgba(47, 109, 246, .35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15px; color: var(--text); }
.brand-sub { font-size: 11px; color: var(--text-dim); letter-spacing: .04em; }
.brand:hover { text-decoration: none; }

.search-wrap { position: relative; flex: 1; max-width: 420px; margin-left: 8px; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 10px; transition: .18s;
}
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); background: var(--bg); }
.search-box svg { flex-shrink: 0; color: var(--text-dim); }
.search-box input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font-size: 14px; color: var(--text); font-family: inherit;
}
.search-box input::placeholder { color: var(--text-dim); }
.search-kbd {
  font-size: 11px; color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 5px; background: var(--bg);
}
.search-panel {
  position: absolute; top: 46px; left: 0; right: 0; z-index: 70;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); max-height: 60vh; overflow: auto; padding: 6px; display: none;
}
.search-panel.open { display: block; }
.search-item { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text); }
.search-item:hover { background: var(--brand-soft); text-decoration: none; }
.search-item b { color: var(--brand); }
.search-item .s-crumb { display: block; font-size: 11.5px; color: var(--text-dim); }
.search-empty { padding: 14px; text-align: center; color: var(--text-dim); font-size: 13px; }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 9px;
  color: var(--text-mid); transition: .18s;
}
.icon-btn:hover { background: var(--bg-soft); border-color: var(--border); color: var(--text); }
.menu-btn { display: none; }

/* ---------- 布局 ---------- */
.layout { display: flex; padding-top: var(--header-h); }

.sidebar {
  position: fixed; top: var(--header-h); bottom: 0; left: 0; width: var(--side-w);
  overflow-y: auto; padding: 22px 14px 60px;
  background: var(--bg-side); border-right: 1px solid var(--border);
  z-index: 40;
}
.side-group { margin-bottom: 18px; }
.side-group-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim); padding: 0 10px; margin-bottom: 6px;
}
.side-link {
  display: block; padding: 7px 12px; border-radius: 8px; font-size: 14px;
  color: var(--text-mid); border-left: 2px solid transparent; transition: .15s;
}
.side-link:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.side-link.active {
  background: var(--brand-soft); color: var(--brand); font-weight: 600;
  border-left-color: var(--brand);
}
.side-sub { margin-left: 12px; padding-left: 10px; border-left: 1px solid var(--border); }
.side-sub .side-link { font-size: 13.5px; padding: 6px 10px; }

.content-wrap { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; justify-content: center; }
.content { width: 100%; max-width: 840px; padding: 40px 40px 80px; }
.toc {
  position: sticky; top: calc(var(--header-h) + 32px); align-self: flex-start;
  width: var(--toc-w); flex-shrink: 0; max-height: calc(100vh - var(--header-h) - 80px);
  overflow-y: auto; padding: 40px 24px 40px 0;
}
.toc-title { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 10px; }
.toc a { display: block; font-size: 13px; color: var(--text-dim); padding: 4px 0 4px 12px; border-left: 2px solid var(--border); line-height: 1.5; }
.toc a:hover { color: var(--brand); text-decoration: none; }
.toc a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }

/* ---------- 正文 ---------- */
.crumb { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }
.crumb a { color: var(--text-dim); }
.crumb a:hover { color: var(--brand); }
.page-title { font-size: 32px; line-height: 1.3; font-weight: 800; letter-spacing: -.01em; margin: 0 0 10px; }
.page-desc { font-size: 16px; color: var(--text-mid); margin: 0 0 8px; }
.page-meta { font-size: 12.5px; color: var(--text-dim); padding-bottom: 22px; border-bottom: 1px solid var(--border-soft); margin-bottom: 28px; }

.doc h2 {
  font-size: 21px; font-weight: 700; margin: 40px 0 14px; padding-top: 6px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}
.doc h2::before { content: ""; display: block; height: 0; }
.doc p { margin: 0 0 16px; color: var(--text-mid); }
.doc strong { color: var(--text); font-weight: 600; }

.doc figure { margin: 22px 0 26px; }
.doc figure img {
  display: block; width: 100%; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg-soft);
  box-shadow: var(--shadow-sm); cursor: zoom-in; transition: .2s;
}
.doc figure img:hover { box-shadow: var(--shadow-md); }
.doc figcaption { margin-top: 8px; font-size: 12.5px; color: var(--text-dim); text-align: center; }

.note {
  display: flex; gap: 12px; margin: 20px 0; padding: 14px 16px;
  border: 1px solid var(--border); border-left: 3px solid var(--info);
  border-radius: 10px; background: var(--info-bg);
}
.note-icon { flex-shrink: 0; width: 20px; height: 20px; margin-top: 2px; color: var(--info); }
.note-body { flex: 1; font-size: 14.5px; color: var(--text-mid); }
.note-title { display: block; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.note p { margin: 0; color: var(--text-mid); }
.note.warn { border-color: var(--warn-bd); border-left-color: var(--warn); background: var(--warn-bg); }
.note.warn .note-icon { color: var(--warn); }
.note.tip { border-color: var(--tip-bd); border-left-color: var(--tip); background: var(--tip-bg); }
.note.tip .note-icon { color: var(--tip); }

.deflist { margin: 18px 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.deflist .row { display: flex; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.deflist .row:last-child { border-bottom: 0; }
.deflist dt { flex-shrink: 0; width: 90px; font-weight: 700; color: var(--text); font-size: 14px; }
.deflist dd { margin: 0; color: var(--text-mid); font-size: 14.5px; }

.steps { margin: 22px 0; counter-reset: st; }
.step { position: relative; padding: 0 0 22px 44px; }
.step::before {
  counter-increment: st; content: counter(st);
  position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px;
  display: grid; place-items: center; border: 1px solid var(--brand-ring);
}
.step::after {
  content: ""; position: absolute; left: 14px; top: 32px; bottom: 0; width: 1px; background: var(--border);
}
.step:last-child { padding-bottom: 0; }
.step:last-child::after { display: none; }
.step h4 { margin: 2px 0 4px; font-size: 15.5px; font-weight: 700; color: var(--text); }
.step p { margin: 0; font-size: 14.5px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 22px 0 26px; }
.card {
  display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); transition: .18s; color: var(--text);
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.card-title::after { content: "→"; color: var(--brand); font-size: 13px; }
.card-desc { font-size: 13.5px; color: var(--text-dim); line-height: 1.65; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  border-radius: 9px; font-size: 13px; font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-mid);
  transition: .18s; line-height: 1;
}
.btn:hover { color: var(--brand); border-color: var(--brand); text-decoration: none; }
.btn svg { flex-shrink: 0; }
.btn-ghost { background: var(--bg-soft); }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 2px 8px var(--brand-ring);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

/* ---------- 推荐渠道卡片（promo） ---------- */
.promo {
  display: flex; gap: 16px; align-items: flex-start; margin: 24px 0 28px;
  padding: 18px 20px; border-radius: 14px;
  border: 1px solid var(--brand-ring);
  background: linear-gradient(135deg, var(--brand-soft), var(--bg) 72%);
}
.promo-icon {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: var(--brand); color: #fff; display: grid; place-items: center;
  box-shadow: 0 4px 12px var(--brand-ring);
}
.promo-main { flex: 1; min-width: 0; }
.promo-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 15.5px; font-weight: 700; color: var(--text); margin-bottom: 5px;
}
.promo-badge {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--brand);
  border-radius: 999px; padding: 2px 9px; letter-spacing: .02em;
}
.promo-text { font-size: 14.5px; color: var(--text-mid); line-height: 1.8; }
.promo-text strong { color: var(--text); }
.promo-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 13px; }

/* ---------- 文末统一 CTA ---------- */
.site-cta {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  margin: 52px 0 0; padding: 22px 24px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg-soft);
}
.site-cta-main { flex: 1; min-width: 220px; }
.site-cta-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.site-cta-desc { font-size: 13.5px; color: var(--text-dim); line-height: 1.7; }
.site-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.footer-links { display: inline-flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--brand); font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }

.pager { display: flex; gap: 14px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.pager a {
  flex: 1; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  transition: .18s; color: var(--text);
}
.pager a:hover { border-color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.pager .p-label { font-size: 12px; color: var(--text-dim); display: block; }
.pager .p-title { font-weight: 600; font-size: 14.5px; }
.pager .next { text-align: right; }

.footer {
  margin-left: var(--side-w); padding: 28px 40px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 13px; background: var(--bg-side);
}
.footer-inner { max-width: 840px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- 图片灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  background: rgba(8, 12, 20, .88); padding: 40px; cursor: zoom-out;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; box-shadow: var(--shadow-lg); background: #fff; }
.lightbox-close { position: absolute; top: 18px; right: 22px; color: #fff; font-size: 28px; cursor: pointer; opacity: .8; }
.lightbox-close:hover { opacity: 1; }

.backdrop { display: none; position: fixed; inset: 0; background: rgba(8, 12, 20, .45); z-index: 45; }
.backdrop.show { display: block; }

/* ---------- 响应式 ---------- */
@media (max-width: 1360px) { .hd-btn { padding: 0 10px; } .hd-btn span { display: none; } }
@media (max-width: 1200px) { .toc { display: none; } }
@media (max-width: 960px) {
  .hd-btn { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .content-wrap, .footer { margin-left: 0; }
  .content { padding: 28px 20px 64px; }
  .page-title { font-size: 26px; }
  .search-wrap { max-width: none; }
  .brand-sub { display: none; }
  .search-kbd { display: none; }
}
@media (max-width: 560px) {
  .brand-text { display: none; }
  .cards { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .pager .next { text-align: left; }
  .promo { flex-direction: column; gap: 12px; padding: 16px; }
  .site-cta { padding: 18px; }
  .site-cta-actions .btn { flex: 1; justify-content: center; }
}
