/* 资源论坛 — 受保护阅读器 */

/* ── 学员登录 · Luxe 门禁 ── */
.kb-gate {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px 24px;
  overflow: hidden;
}

.kb-gate-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 15% 18%, rgba(201, 160, 82, 0.16) 0%, transparent 58%),
    radial-gradient(ellipse 55% 48% at 88% 72%, rgba(45, 108, 223, 0.1) 0%, transparent 55%),
    linear-gradient(180deg, #fffdf8 0%, #fafcff 48%, #eef4fb 100%);
}

.kb-gate-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(10, 37, 64, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.45;
  pointer-events: none;
}

.kb-gate-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 520px;
}

.kb-gate-home {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 700;
  color: #4a6278;
  text-decoration: none;
  transition: color 0.2s ease;
}

.kb-gate-home:hover {
  color: #b8892a;
  text-decoration: none;
}

.kb-gate-card {
  padding: clamp(28px, 5vw, 36px);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(201, 160, 82, 0.28);
  box-shadow:
    0 24px 64px rgba(10, 37, 64, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.kb-gate-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.kb-gate-mark {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(145deg, #b8892a 0%, #d4af6a 48%, #b8892a 100%);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  line-height: 56px;
  text-align: center;
  letter-spacing: -0.04em;
  box-shadow: 0 12px 32px rgba(201, 160, 82, 0.32);
}

.kb-gate-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b8892a;
}

.kb-gate-title {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", Georgia, serif;
  font-size: clamp(1.625rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #0a2540;
}

.kb-gate-lead {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.65;
  color: #4a6278;
}

.kb-gate-lead strong {
  color: #0a2540;
  font-weight: 800;
}

.kb-gate-delivery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 18px;
  padding: 14px 16px;
  text-decoration: none;
  border-radius: 14px;
  border: 1px solid rgba(138, 115, 64, 0.35);
  background: linear-gradient(120deg, rgba(61, 46, 18, 0.96) 0%, rgba(26, 20, 8, 0.96) 45%, rgba(27, 42, 74, 0.95) 100%);
  box-shadow: 0 10px 28px rgba(26, 20, 8, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kb-gate-delivery:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(26, 20, 8, 0.24);
}

.kb-gate-delivery-badge {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #3d2e12;
  background: #e8c56a;
  padding: 4px 8px;
  border-radius: 999px;
}

.kb-gate-delivery-title {
  flex: 1 1 180px;
  font-size: 14px;
  font-weight: 700;
  color: #fff8e8;
  line-height: 1.4;
}

.kb-gate-delivery-go {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: #e8c56a;
}

.kb-gate-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.kb-gate-features li {
  font-size: 12px;
  font-weight: 700;
  color: #0a2540;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(238, 244, 251, 0.95);
  border: 1px solid rgba(10, 37, 64, 0.08);
}

.kb-gate-form {
  margin-bottom: 12px;
}

.kb-gate-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0a2540;
}

.kb-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.kb-gate-actions .t-button--theme-primary {
  background: linear-gradient(135deg, #0a2540 0%, #143552 55%, #1a4060 100%) !important;
  border: 1px solid rgba(201, 160, 82, 0.35) !important;
  font-weight: 800;
  height: 44px;
}

.kb-gate-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: #6b8499;
  line-height: 1.5;
}

.kb-gate-error {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #e34d59;
}

.kb-gate-foot {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(10, 37, 64, 0.08);
  font-size: 12px;
  line-height: 1.55;
  color: #6b8499;
  text-align: center;
}

.kb-gate-icp {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  font-size: 12px;
  text-align: center;
}

.kb-gate-icp a {
  color: #6b8499;
  text-decoration: none;
}

.kb-gate-icp a:hover {
  color: #b8892a;
}

@media (max-width: 480px) {
  .kb-gate {
    padding: 20px 12px 16px;
  }

  .kb-gate-card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .kb-gate-mark {
    width: 48px;
    height: 48px;
    line-height: 48px;
    font-size: 16px;
  }
}

/* ── 总目录页 ── */
.kb-index-page {
  max-width: 960px;
  margin: 0 auto;
}

.kb-delivery-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 20px;
  margin: 0 0 22px;
  padding: 18px 20px;
  text-decoration: none;
  border-radius: 16px;
  border: 1px solid rgba(212, 168, 75, 0.4);
  background: linear-gradient(115deg, #3d2e12 0%, #1a1408 42%, #1b2a4a 100%);
  box-shadow: 0 12px 28px rgba(26, 20, 8, 0.14);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kb-delivery-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(26, 20, 8, 0.2);
}

.kb-delivery-banner-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #e8c56a;
  margin-bottom: 6px;
}

.kb-delivery-banner-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff8e8;
  line-height: 1.35;
  margin-bottom: 6px;
}

.kb-delivery-banner-desc {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 248, 232, 0.72);
}

.kb-delivery-banner-cta {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 800;
  color: #3d2e12;
  background: #e8c56a;
  padding: 10px 16px;
  border-radius: 999px;
}

.kb-index-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.kb-index-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
}

.kb-index-desc {
  margin: 0;
  font-size: 13px;
  color: var(--no-text-secondary);
  line-height: 1.5;
}

.kb-index-search {
  flex: 1 1 240px;
  max-width: 360px;
}

.kb-index-tree {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kb-index-module {
  background: var(--no-surface);
  border: 1px solid var(--no-border);
  border-radius: var(--no-radius);
  box-shadow: var(--no-shadow);
  overflow: hidden;
}

.kb-index-module-head,
.kb-index-sub-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 0.15s;
}

.kb-index-module-head {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--no-text);
}

.kb-index-module-head:hover,
.kb-index-sub-head:hover {
  background: var(--no-primary-bg);
}

.kb-index-sub-head {
  padding: 10px 16px 10px 36px;
  font-size: 14px;
  font-weight: 500;
  color: var(--no-text);
  border-top: 1px solid var(--no-border);
}

.kb-index-module-body {
  border-top: 1px solid var(--no-border);
}

.kb-index-subgroup:first-child .kb-index-sub-head {
  border-top: none;
}

.kb-index-chevron {
  flex: 0 0 14px;
  font-size: 11px;
  color: var(--no-text-secondary);
  transition: transform 0.15s;
}

.kb-index-chevron.sm {
  flex-basis: 12px;
  font-size: 10px;
}

.kb-index-chevron.open {
  transform: rotate(90deg);
}

.kb-index-module-name,
.kb-index-sub-name {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.kb-index-module-count {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--no-text-secondary);
  background: #f5f7fb;
  border: 1px solid var(--no-border);
  border-radius: 999px;
  padding: 2px 10px;
}

.kb-index-articles {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kb-index-articles-nested {
  border-top: 1px solid var(--no-border);
}

.kb-index-articles-nested .kb-index-article-btn {
  padding-left: 52px;
}

.kb-index-article-btn {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: none;
  border-top: 1px solid #eef1f6;
  background: transparent;
  padding: 10px 16px 10px 52px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: var(--no-text);
  transition: background 0.15s;
}

.kb-index-subgroup + .kb-index-articles .kb-index-article-btn:first-child,
.kb-index-articles > li:first-child .kb-index-article-btn {
  border-top: 1px solid var(--no-border);
}

.kb-index-article-btn:hover {
  background: #fafbfd;
  color: var(--no-primary, #0052d9);
}

.kb-index-article-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
}

.kb-index-article-meta {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--no-text-secondary);
}

.kb-index-section {
  margin-bottom: 28px;
}

.kb-index-path {
  margin: 0 0 12px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--no-primary, #0052d9);
  background: #eef3fb;
  border-radius: var(--no-radius-sm);
  border-left: 3px solid var(--no-primary, #0052d9);
}

.kb-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

.kb-index-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  border: 1px solid var(--no-border);
  background: var(--no-surface);
  border-radius: var(--no-radius);
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  color: var(--no-text);
  box-shadow: var(--no-shadow);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.kb-index-card:hover {
  border-color: var(--no-primary, #0052d9);
  box-shadow: 0 4px 12px rgba(0, 82, 217, 0.12);
  transform: translateY(-1px);
}

.kb-index-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.kb-index-card-meta {
  font-size: 12px;
  color: var(--no-text-secondary);
}

/* ── 阅读页：左侧 sticky 目录（不遮挡正文） ── */
.kb-reader-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-height: 60vh;
}

.kb-reader-main {
  min-width: 0;
}

.kb-sidebar-float {
  position: sticky;
  top: 16px;
  width: 280px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  z-index: 2;
  padding: 12px;
  align-self: start;
}

.kb-sidebar-head {
  margin-bottom: 10px;
}

.kb-sidebar-float .kb-catalog {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.kb-catalog-compact .kb-catalog-path {
  font-size: 11px;
  padding: 5px 8px;
}

.kb-catalog-compact .kb-catalog-articles button {
  font-size: 12px;
  padding: 6px 8px;
}

@media (max-width: 900px) {
  .kb-reader-layout {
    grid-template-columns: 1fr;
  }

  .kb-sidebar-float {
    position: static;
    width: 100%;
    max-height: 280px;
    margin-bottom: 0;
  }
}

.kb-shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .kb-shell {
    grid-template-columns: 1fr;
  }
}

.kb-sidebar {
  background: var(--no-surface);
  border-radius: var(--no-radius);
  border: 1px solid var(--no-border);
  box-shadow: var(--no-shadow);
  padding: 16px;
  position: sticky;
  top: 16px;
}

.kb-sidebar h2 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
}

.kb-notice {
  font-size: 12px;
  color: var(--no-text-secondary);
  background: #fff7e8;
  border: 1px solid #ffd591;
  border-radius: var(--no-radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.kb-sidebar-toolbar {
  margin-bottom: 12px;
}

.kb-catalog {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 4px;
}

.kb-catalog-section {
  margin-bottom: 14px;
}

.kb-catalog-section:last-child {
  margin-bottom: 0;
}

.kb-catalog-path {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0 0 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--no-primary, #0052d9);
  background: #eef3fb;
  border-radius: var(--no-radius-sm);
  border-left: 3px solid var(--no-primary, #0052d9);
}

.kb-catalog-articles {
  list-style: none;
  margin: 0;
  padding: 0 0 0 4px;
  border-left: 1px solid #e7ebf3;
}

.kb-catalog-articles li {
  margin: 0;
}

.kb-catalog-articles button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 7px 8px;
  border-radius: var(--no-radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--no-text);
  text-align: left;
  transition: background 0.15s;
}

.kb-catalog-articles button:hover {
  background: var(--no-primary-bg);
}

.kb-catalog-articles button.active {
  background: var(--no-primary-bg);
  color: var(--no-primary, #0052d9);
  font-weight: 600;
}

.kb-catalog-articles button .meta {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--no-text-secondary);
  font-weight: 400;
}

.kb-catalog-empty {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--no-text-secondary);
  text-align: center;
}

.kb-tree {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  padding-right: 4px;
}

.kb-tree-children {
  margin-left: 4px;
}

.kb-tree-subgroup {
  margin-bottom: 2px;
}

.kb-tree-section {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  padding: 6px 10px 6px 14px;
  border-radius: var(--no-radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--no-text-secondary);
  text-align: left;
  transition: background 0.15s;
}

.kb-tree-section:hover {
  background: var(--no-primary-bg);
  color: var(--no-text);
}

.kb-tree-articles-nested {
  margin-left: 12px !important;
  padding-left: 10px !important;
  border-left-color: #dce3ef !important;
}

.kb-tree-articles-nested button {
  font-size: 12px !important;
  padding: 6px 8px !important;
}

.kb-tree-group {
  margin-bottom: 4px;
}

.kb-tree-module {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: #f5f7fb;
  padding: 8px 10px;
  border-radius: var(--no-radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--no-text);
  text-align: left;
  transition: background 0.15s;
}

.kb-tree-module:hover {
  background: var(--no-primary-bg);
}

.kb-tree-chevron {
  flex: 0 0 14px;
  font-size: 11px;
  color: var(--no-text-secondary);
  transition: transform 0.15s;
}

.kb-tree-chevron.open {
  transform: rotate(90deg);
}

.kb-tree-label {
  flex: 1;
  min-width: 0;
}

.kb-tree-count {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--no-text-secondary);
  background: #fff;
  border: 1px solid var(--no-border);
  border-radius: 999px;
  padding: 1px 7px;
}

.kb-tree-articles {
  list-style: none;
  margin: 4px 0 8px;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--no-border);
}

.kb-tree-articles li {
  margin-bottom: 2px;
}

.kb-tree-articles button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 7px 10px 7px 8px;
  border-radius: var(--no-radius-sm);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--no-text);
  transition: background 0.15s;
  line-height: 1.4;
}

.kb-tree-articles button:hover {
  background: var(--no-primary-bg);
}

.kb-tree-articles button.active {
  background: var(--no-primary-bg);
  color: var(--no-primary);
  font-weight: 600;
}

.kb-tree-articles .meta {
  display: block;
  font-size: 11px;
  color: var(--no-text-secondary);
  margin-top: 2px;
  font-weight: 400;
}

.kb-list-count {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--no-text-secondary);
  text-align: center;
}

.kb-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.kb-article-list li {
  margin-bottom: 6px;
}

.kb-article-list button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: var(--no-radius-sm);
  cursor: pointer;
  font: inherit;
  color: var(--no-text);
  transition: background 0.15s;
}

.kb-article-list button:hover {
  background: var(--no-primary-bg);
}

.kb-article-list button.active {
  background: var(--no-primary-bg);
  color: var(--no-primary);
  font-weight: 600;
}

.kb-article-list .meta {
  display: block;
  font-size: 11px;
  color: var(--no-text-secondary);
  margin-top: 4px;
}

.kb-main {
  min-width: 0;
}

.kb-empty {
  background: var(--no-surface);
  border-radius: var(--no-radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--no-text-secondary);
  border: 1px dashed var(--no-border);
}

.kb-reader-wrap {
  position: relative;
  background: var(--no-surface);
  border-radius: var(--no-radius);
  border: 1px solid var(--no-border);
  box-shadow: var(--no-shadow);
  overflow: hidden;
}

.kb-reader-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--no-border);
}

.kb-reader-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.35;
}

.kb-reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 13px;
  color: var(--no-text-secondary);
}

.kb-tree-articles button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.kb-page-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
  padding: 12px 14px;
  background: #f5f7fb;
  border: 1px solid var(--no-border);
  border-radius: var(--no-radius-sm);
}

.kb-page-nav-top {
  margin-bottom: 16px;
}

.kb-page-nav-bottom {
  margin-top: 28px;
  flex-direction: column;
  align-items: stretch;
}

.kb-page-nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
}

.kb-page-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--no-text);
  min-width: 120px;
  text-align: center;
}

.kb-page-hint {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.6;
  color: #8c4a00;
  text-align: center;
}

.kb-lazy-sentinel {
  display: none;
}

.kb-lazy-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin: 24px 0 8px;
  padding: 14px;
  background: #f5f7fb;
  border-radius: var(--no-radius-sm);
  font-size: 13px;
  color: var(--no-text-secondary);
}

.kb-lazy-done {
  margin: 20px 0 0;
  padding: 10px 14px;
  text-align: center;
  font-size: 12px;
  color: var(--no-text-secondary);
  background: #f5f7fb;
  border-radius: var(--no-radius-sm);
}

.kb-chunk-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: #f5f7fb;
  border-radius: var(--no-radius-sm);
  font-size: 13px;
  color: var(--no-text-secondary);
}

.kb-reader-body {
  position: relative;
  padding: 24px 28px 32px;
}

.kb-watermark-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

/* 受保护区域：正文禁选；代码块/行内代码可复制 */
.kb-protected {
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.kb-protected .kb-code-copyable,
.kb-protected .kb-code-copyable .kb-code-lines,
.kb-protected .kb-code-copyable .tx,
.kb-protected .kb-inline-code {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

.kb-protected .kb-code-copyable .ln,
.kb-protected .kb-code-copyable .kb-code-header {
  user-select: none;
  -webkit-user-select: none;
}

.kb-protected img,
.kb-protected svg {
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
}

.kb-protected .kb-figure {
  margin: 0 0 20px;
}

.kb-protected .kb-block-image {
  border-radius: 12px;
  border: 1px solid var(--no-border);
  box-shadow: 0 8px 24px rgba(10, 37, 64, 0.08);
}

.kb-protected .kb-figure-caption {
  margin-top: 8px;
  text-align: center;
  font-size: 13px;
  color: #6b7280;
}

.kb-protected .kb-block-heading {
  margin: 28px 0 12px;
  font-weight: 600;
  color: var(--no-text);
  line-height: 1.4;
}

.kb-protected .kb-block-heading.level-2 {
  font-size: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--no-border);
}

.kb-protected .kb-block-heading.level-3 {
  font-size: 16px;
}

.kb-protected .kb-block-paragraph {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.75;
  color: #2c3340;
}

.kb-protected .kb-block-paragraph strong {
  color: #003cab;
  font-weight: 600;
}

.kb-protected .kb-table-wrap {
  overflow-x: auto;
  margin: 0 0 16px;
}

.kb-protected .kb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.6;
}

.kb-protected .kb-table th,
.kb-protected .kb-table td {
  border: 1px solid var(--no-border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.kb-protected .kb-table th {
  background: #f5f7fb;
  font-weight: 600;
  color: #1a2744;
}

.kb-protected .kb-inline-code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.9em;
  background: #eef2f8;
  color: #c0392b;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #dce3ef;
  white-space: nowrap;
}

.kb-protected .kb-callout .kb-inline-code {
  background: rgba(255, 255, 255, 0.65);
}

.kb-protected .kb-callout {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: var(--no-radius-sm);
  font-size: 14px;
  line-height: 1.6;
  border-left: 4px solid;
}

.kb-protected .kb-callout.warning {
  background: #fff7e8;
  border-color: #e37318;
  color: #8c4a00;
}

.kb-protected .kb-callout.info {
  background: #ecf2fe;
  border-color: #0052d9;
  color: #003cab;
}

.kb-protected .kb-svg-wrap {
  margin: 16px 0;
  padding: 12px;
  background: #fafbfc;
  border-radius: var(--no-radius-sm);
  border: 1px solid var(--no-border);
  overflow-x: auto;
}

/* 代码块：逐行渲染 */
.kb-code-block {
  margin: 16px 0;
  background: #1e1e2e;
  border-radius: var(--no-radius-sm);
  overflow: hidden;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.55;
}

.kb-code-copy-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #e8e8f0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.kb-code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
}

.kb-code-copy-btn.is-copied {
  background: rgba(152, 195, 121, 0.22);
  border-color: rgba(152, 195, 121, 0.45);
  color: #98c379;
}

.kb-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: #2d2d3d;
  color: #a0a0b0;
  font-size: 12px;
}

.kb-code-lines {
  padding: 12px 0;
  overflow-x: auto;
}

.kb-code-line {
  display: flex;
  padding: 0 14px;
  min-height: 1.55em;
}

.kb-code-line .ln {
  flex: 0 0 2.5em;
  color: #5c6370;
  text-align: right;
  padding-right: 14px;
  user-select: none;
}

.kb-code-line .tx {
  flex: 1;
  white-space: pre;
  background: transparent !important;
  padding: 0;
}

/* 正文有序/无序列表（常见坑、步骤等） */
.kb-protected .kb-block-list {
  margin: 12px 0 20px;
  padding-left: 1.4em;
  color: var(--no-text, #1f2329);
  line-height: 1.75;
}

.kb-protected .kb-block-list li {
  margin: 6px 0;
  padding-left: 4px;
}

.kb-protected .kb-block-list-ol {
  list-style: decimal;
}

.kb-protected .kb-block-list-ul {
  list-style: disc;
}

.kb-protected .kb-block-list .kb-inline-code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
}

/* highlight.js 语法着色（Atom One Dark 色系，作用域限定在代码块内） */
.kb-protected .kb-code-block .hljs {
  color: #abb2bf;
  background: transparent !important;
}

.kb-protected .kb-code-block .hljs-comment,
.kb-protected .kb-code-block .hljs-quote {
  color: #5c6370;
  font-style: italic;
}

.kb-protected .kb-code-block .hljs-keyword,
.kb-protected .kb-code-block .hljs-selector-tag,
.kb-protected .kb-code-block .hljs-literal,
.kb-protected .kb-code-block .hljs-section,
.kb-protected .kb-code-block .hljs-link {
  color: #c678dd;
}

.kb-protected .kb-code-block .hljs-string,
.kb-protected .kb-code-block .hljs-regexp,
.kb-protected .kb-code-block .hljs-addition,
.kb-protected .kb-code-block .hljs-attribute,
.kb-protected .kb-code-block .hljs-meta-string {
  color: #98c379;
}

.kb-protected .kb-code-block .hljs-number,
.kb-protected .kb-code-block .hljs-symbol,
.kb-protected .kb-code-block .hljs-bullet {
  color: #d19a66;
}

.kb-protected .kb-code-block .hljs-title,
.kb-protected .kb-code-block .hljs-title.class_,
.kb-protected .kb-code-block .hljs-function,
.kb-protected .kb-code-block .hljs-built_in {
  color: #61afef;
}

.kb-protected .kb-code-block .hljs-variable,
.kb-protected .kb-code-block .hljs-template-variable,
.kb-protected .kb-code-block .hljs-type,
.kb-protected .kb-code-block .hljs-params {
  color: #e06c75;
}

.kb-protected .kb-code-block .hljs-meta,
.kb-protected .kb-code-block .hljs-selector-id,
.kb-protected .kb-code-block .hljs-selector-class {
  color: #e6c07b;
}

.kb-protected .kb-code-block .hljs-name,
.kb-protected .kb-code-block .hljs-tag {
  color: #e06c75;
}

.kb-protected .kb-code-block .hljs-emphasis {
  font-style: italic;
}

.kb-protected .kb-code-block .hljs-strong {
  font-weight: 700;
}

.kb-mermaid-wrap {
  margin: 16px 0 20px;
  border: 1px solid rgba(0, 82, 217, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.kb-mermaid-wrap .kb-code-header {
  border-bottom: 1px solid rgba(0, 82, 217, 0.08);
}

.kb-mermaid-diagram {
  padding: 16px 12px;
  overflow-x: auto;
  background: linear-gradient(180deg, #fafbfd 0%, #fff 100%);
}

.kb-mermaid-diagram svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.kb-mermaid-error {
  margin: 0;
  padding: 14px 16px;
  color: #b42318;
  background: #fff5f5;
  font-size: 13px;
}

/* 动态水印层 */
.kb-watermark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.kb-watermark-layer span {
  position: absolute;
  font-size: 13px;
  color: rgba(0, 82, 217, 0.08);
  white-space: nowrap;
  transform: rotate(-22deg);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.kb-shield-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #8c4a00;
  background: #fff7e8;
  border: 1px solid #ffd591;
  border-radius: 999px;
  padding: 4px 12px;
  margin-top: 8px;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  body::after {
    visibility: visible !important;
    display: block;
    content: 'NiceOffer 内部资料禁止打印';
    position: fixed;
    inset: 0;
    font-size: 24px;
    text-align: center;
    padding-top: 40vh;
    color: #e34d59;
  }
}

.site-icp-footer {
  margin-top: 24px;
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}

.site-icp-footer a {
  color: inherit;
  text-decoration: none;
}

.site-icp-footer a:hover {
  text-decoration: underline;
}
