/* 凌博知识库 · 网页版
   视觉与小程序 1:1（rpx/2 = px）
   浅色为默认，跟随系统深色，也可手动切换
*/

:root {
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --card-2: #EFF2F7;
  --line: rgba(16, 24, 40, 0.10);
  --text: #131A24;
  --text-soft: #3D4757;
  --muted: #6B7480;
  --dim: #98A1AE;
  --blue: #2F7BE8;
  --blue-hi: #1E63C8;
  --teal: #0FA37F;
  --teal-hi: #0B8A6B;
  --warn-bg: rgba(255, 176, 32, 0.10);
  --warn-line: rgba(255, 176, 32, 0.28);
  --warn-text: #8A5A00;
  --chip-bg: rgba(47, 123, 232, 0.10);
  --chip-line: rgba(47, 123, 232, 0.35);
  --danger: #D93A3A;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --tab-h: 52px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0E13; --card: #141A23; --card-2: #1A222D;
    --line: rgba(255, 255, 255, 0.08);
    --text: #E8EDF5; --text-soft: #B9C3D1;
    --muted: #7A8290; --dim: #5C6572;
    --blue: #3D8BFD; --blue-hi: #6FA8FF;
    --teal: #22D3A6; --teal-hi: #4BE3BE;
    --warn-bg: rgba(255, 190, 80, 0.08);
    --warn-line: rgba(255, 190, 80, 0.22);
    --warn-text: #FFD79A;
    --chip-bg: rgba(61, 139, 253, 0.16);
    --chip-line: rgba(61, 139, 253, 0.6);
    --danger: #FF6B6B;
  }
}

/* 手动主题：覆盖系统 */
html.t-light {
  --bg: #F5F7FA; --card: #FFFFFF; --card-2: #EFF2F7;
  --line: rgba(16,24,40,0.10); --text: #131A24; --text-soft: #3D4757;
  --muted: #6B7480; --dim: #98A1AE;
  --blue: #2F7BE8; --blue-hi: #1E63C8; --teal: #0FA37F; --teal-hi: #0B8A6B;
  --warn-bg: rgba(255,176,32,0.10); --warn-line: rgba(255,176,32,0.28); --warn-text: #8A5A00;
  --chip-bg: rgba(47,123,232,0.10); --chip-line: rgba(47,123,232,0.35);
}
html.t-dark {
  --bg: #0B0E13; --card: #141A23; --card-2: #1A222D;
  --line: rgba(255,255,255,0.08); --text: #E8EDF5; --text-soft: #B9C3D1;
  --muted: #7A8290; --dim: #5C6572;
  --blue: #3D8BFD; --blue-hi: #6FA8FF; --teal: #22D3A6; --teal-hi: #4BE3BE;
  --warn-bg: rgba(255,190,80,0.08); --warn-line: rgba(255,190,80,0.22); --warn-text: #FFD79A;
  --chip-bg: rgba(61,139,253,0.16); --chip-line: rgba(61,139,253,0.6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  transition: background .2s, color .2s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

#app { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 14px 30px; }
body { overflow-x: hidden; }

/* 顶栏 */
.topbar { display: flex; align-items: center; height: 44px; padding: 0 4px; margin-bottom: 4px; }
.topbar-title { flex: 1; text-align: center; font-size: 15px; font-weight: 600; }
.topbar-spacer { width: 32px; }
.theme-fab {
  width: 32px; height: 32px; border-radius: 16px; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft); font-size: 17px; cursor: pointer; padding: 0;
}

/* 提示条 */
.tip-bar {
  margin: 0 0 9px; padding: 7px 10px; border-radius: 6px;
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  color: var(--warn-text); font-size: 11px; line-height: 1.6;
}

/* 标题区 */
.hero { padding: 8px 0 4px; }
.kicker { font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.h1 { font-size: 22px; font-weight: 700; margin: 4px 0 3px; }
.sub { font-size: 12px; color: var(--muted); }

/* 列表项 */
.entry {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 9px; margin-bottom: 7px; cursor: pointer; transition: .15s;
}
.entry:hover { border-color: var(--chip-line); }
.entry-title { font-size: 14px; color: var(--text); }
.entry-sub { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
/* 长型号串不能把卡片撑破 */
.entry > div { min-width: 0; }
.entry-title, .entry-sub { overflow-wrap: anywhere; word-break: break-word; }
.chev { color: var(--dim); font-size: 16px; margin-left: 8px; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px; margin-bottom: 10px;
}

/* 按钮 */
.btn {
  display: flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 16px; border-radius: 9px;
  background: var(--card-2); color: var(--text); font-size: 14px;
  border: 0; cursor: pointer; width: 100%;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-sm { height: 32px; font-size: 12px; padding: 0 12px; }
.btn.dis, .btn[disabled] { opacity: .45; }

/* 选项块 */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 7px 13px; border-radius: 8px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; transition: .15s;
}
.chip.is-on { border-color: var(--chip-line); background: var(--chip-bg); color: var(--blue-hi); }

/* 搜索 */
.search {
  position: relative; display: flex; align-items: center;
  height: 40px; padding: 0 12px; border-radius: 9px;
  background: var(--card); border: 1px solid var(--line); margin: 8px 0;
}
.search input {
  flex: 1; height: 40px; border: 0; outline: 0; background: transparent;
  color: var(--text); font-size: 14px; font-family: inherit;
}
.search-clear {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 16px; padding: 0 5px; cursor: pointer;
}

/* 辅助 */
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.mono { font-family: var(--mono); }
.big { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--teal-hi); }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); font-size: 13px; }

.row-between { display: flex; align-items: center; justify-content: space-between; }

/* 文档 */
.doc-heading { font-size: 15px; font-weight: 700; margin: 13px 0 6px; color: var(--text); }
.doc-heading.sub { font-size: 13px; color: var(--blue-hi); }
.doc-label { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.doc-tag {
  margin-left: 5px; font-size: 10px; padding: 1px 5px; border-radius: 4px;
  background: var(--chip-bg); color: var(--blue-hi);
}
.doc-text { font-size: 13px; color: var(--text-soft); line-height: 1.8; }
.doc-row { padding: 6px 0; border-bottom: 1px solid var(--line); }
.doc-row:last-child { border-bottom: 0; }
.doc-row-name { font-size: 13px; }
.doc-row-val { font-size: 13px; color: var(--teal-hi); font-family: var(--mono); }
.doc-row-note { font-size: 11px; color: var(--muted); }
.doc-wm {
  position: fixed; right: 10px; bottom: calc(var(--tab-h) + 12px); z-index: 5;
  font-size: 10px; color: var(--dim); opacity: .5; pointer-events: none;
}

/* 参数行 */
.param-row { padding: 7px 0; border-bottom: 1px solid var(--line); }


/* 视频 */
.player-wrap { background: #000; border-radius: 11px; overflow: hidden; margin-bottom: 10px; }
.player-wrap video { width: 100%; display: block; max-height: 60vh; background: #000; }

/* 大图遮罩 */
.mask {
  position: fixed; inset: 0; z-index: 99; background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.mask img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.mask[hidden] { display: none; }

/* 桌面端：保持手机比例居中，不外扩 */
@media (min-width: 760px) {
  body { font-size: 14px; }
  #app { padding: 0 20px 30px; }
  }

/* 底部 tab（与小程序一致，四等分） */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 0 6px;
  color: #8A929E;
  font-size: 10px;
  min-width: 0;
  text-align: center;
}
html.t-dark .tabbar a { color: #7A8290; }
.tabbar a.active { color: #2F7BE8; }
html.t-dark .tabbar a.active { color: #3D8BFD; }
.tbi { width: 22px; height: 22px; display: block; object-fit: contain; }
html.t-dark .tabbar { background: #0D1118; }

/* 子页面导航条（模拟原生导航栏：返回箭头 + 居中标题） */
.navbar { display: flex; align-items: center; height: 44px; margin-bottom: 4px; }
.nav-back {
  width: 32px; height: 32px; flex: none; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1; color: var(--text-soft);
  cursor: pointer; padding: 0; margin-top: -2px;
}
.nav-title { flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: var(--text); padding-right: 32px; }

/* ---------- 激活页 ---------- */
.lock { padding-top: 4px; }
.notice-head { font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.msg { margin-top: 8px; font-size: 12px; }
.msg.bad { color: var(--danger); }
.msg.ok { color: var(--teal-hi); }
.tips { margin-top: 10px; }
.tips .t { font-size: 11px; color: var(--muted); line-height: 1.9; }
.contact { margin-top: 12px; font-size: 12px; color: var(--blue-hi); text-align: center; }
.foot { margin-top: 14px; }

/* ---------- 排查步骤 ---------- */
.step { display: flex; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-no {
  flex: none; width: 20px; height: 20px; border-radius: 10px;
  background: var(--chip-bg); color: var(--blue-hi);
  font-size: 11px; display: flex; align-items: center; justify-content: center;
}
.step-text { flex: 1; font-size: 13px; color: var(--text-soft); line-height: 1.7; }

/* ---------- 播放器 ---------- */
.vidbox { position: relative; background: #000; border-radius: 11px; overflow: hidden; margin-bottom: 10px; }
.vid { width: 100%; display: block; max-height: 62vh; background: #000; }
.vidbox.vid-full {
  position: fixed; inset: 0; z-index: 60; margin: 0; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
}
.vidbox.vid-full .vid { width: 100vw; height: 100vh; max-height: none; object-fit: contain; }
body.no-scroll { overflow: hidden; }

/* 长按加速热区：右侧 30%，高 75% */
.cv-zone { position: absolute; right: 0; top: 12.5%; width: 30%; height: 75%; z-index: 3; touch-action: none; }
.cv-badge {
  position: absolute; right: 10px; top: 10px;
  background: rgba(0,0,0,.6); color: #fff; font-size: 12px;
  padding: 2px 8px; border-radius: 6px;
}
.cv-hint {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.55); font-size: 11px; writing-mode: vertical-rl;
  letter-spacing: 2px; pointer-events: none;
}
.cv-glow {
  position: absolute; right: 0; top: 0; bottom: 0; width: 14%;
  pointer-events: none; z-index: 2;
  background: linear-gradient(to left, rgba(96,165,250,.55), rgba(96,165,250,0));
  animation: glowpulse 1.2s ease-in-out infinite;
}
@keyframes glowpulse { 0%,100% { opacity: .55 } 50% { opacity: 1 } }

.cv-backzone { position: absolute; left: 0; top: 0; bottom: 0; width: 26%; z-index: 4; touch-action: none; }
.cv-backhint {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.75); font-size: 12px; opacity: 0; transition: opacity .2s;
}
.cv-backzone.armed .cv-backhint { opacity: 1; }

.cv-bar { position: absolute; right: 10px; bottom: 46px; display: flex; gap: 8px; z-index: 5; }
.cv-btn {
  background: rgba(0,0,0,.55); color: #fff; font-size: 12px;
  padding: 4px 10px; border-radius: 7px; cursor: pointer; user-select: none;
}
.img-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.img-thumb { width: calc((100% - 12px) / 3); height: 100px; border-radius: 6px; object-fit: cover; background: #000; }

/* 未激活时隐藏底部导航，防止绕过 */
body.locked .tabbar { display: none; }
body.locked { padding-bottom: 20px; }
