  * { box-sizing: border-box; }
  body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--text-1); background: linear-gradient(180deg, #f8fafc, #f0fafd); }
  a { color: inherit; text-decoration: none; }
  button, input { font: inherit; }
  .container { width: min(1280px, calc(100vw - 48px)); margin: 0 auto; }
  .nav { position: sticky; top: 0; z-index: 1000; background: rgba(255,255,255,.9); border-bottom: 1px solid rgba(148,163,184,.18); backdrop-filter: blur(14px); }
  .nav-inner {
    min-height: 76px;
    display: grid;
    grid-template-columns: 260px minmax(420px, 1fr) 300px;
    align-items: center;
    gap: 20px;
    padding: 14px 0;
  }
  .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 260px;
  }
  .logo-mark { width: 42px; height: 42px; border-radius: 12px; background: #fff; border: 1px solid rgba(148, 163, 184, .18); display: grid; place-items: center; overflow: hidden; box-shadow: 0 14px 28px rgba(0,172,235,.12); }
  .logo-mark img { width: 78%; height: 78%; object-fit: contain; display: block; }
  .logo-copy strong { display: block; font-size: 16px; }
  .logo-copy span { display: block; font-size: 12px; color: var(--text-3); }
  .nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: center;
    min-width: 0;
  }
  .nav-menu a { position: relative; padding: 8px 0; font-size: 14px; color: var(--text-2); white-space: nowrap; }
  .nav-menu a.active { color: var(--primary); font-weight: 600; }
  .nav-menu a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, #00aceb, #6fd4f4); }
  .nav-note {
    width: 300px;
    justify-self: end;
    text-align: right;
    font-size: 12px;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .hero { padding: 30px 0 18px; }
  .hero-shell { border-radius: 24px; padding: 28px; background: linear-gradient(135deg, #00202e, #003b52 54%, #0a3a58); color: #f8fafc; box-shadow: 0 24px 70px rgba(7,17,31,.18); }
  .hero-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; margin-bottom: 18px; }
  .hero-head h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.1; }
  .hero-head p { margin: 0; max-width: 760px; color: rgba(226,232,240,.78); font-size: 14px; line-height: 1.8; }
  .hero-badge { height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 999px; background: rgba(255,255,255,.1); color: #d6f0fa; font-size: 12px; border: 1px solid rgba(255,255,255,.12); }
  .hero-updated { margin: -8px 0 14px; color: rgba(226,232,240,.55); font-size: 12px; line-height: 1.6; }
  .kb-search { display: grid; grid-template-columns: minmax(0, 1fr) 132px; gap: 12px; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .kb-search input { width: 100%; height: 46px; border: 0; outline: 0; border-radius: 12px; padding: 0 14px; background: #f0fafd; color: var(--text-1); }
  .kb-search button { border: 0; border-radius: 12px; background: linear-gradient(135deg, #00aceb, #6fd4f4); color: #002e3d; font-weight: 700; cursor: pointer; }
  .filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
  .filter-chip { height: 32px; border: 1px solid rgba(0,172,235,.34); border-radius: 999px; background: rgba(255,255,255,.50); color: #003b52; padding: 0 12px; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.68), 0 10px 24px rgba(0,46,61,.06); cursor: pointer; }
  .filter-chip.active { background: rgba(255,255,255,.76); border-color: rgba(0,172,235,.64); color: #003b52; box-shadow: inset 0 1px 0 rgba(255,255,255,.78), 0 10px 24px rgba(0,46,61,.08); }
  .content { display: grid; gap: 18px; padding: 10px 0 42px; }
  .section { background: rgba(255,255,255,.94); border: 1px solid rgba(148,163,184,.16); border-radius: 18px; box-shadow: 0 18px 46px rgba(15,23,42,.055); overflow: hidden; }
  .section-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; padding: 20px 22px 0; }
  .section-head h2 { margin: 0 0 6px; font-size: 22px; }
  .section-head p { margin: 0; color: var(--text-3); font-size: 13px; line-height: 1.7; }
  .term-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 14px; padding: 18px 22px 22px; }
  .term-card { --term-card-inset: 16px; position: relative; height: var(--knowledge-card-height, auto); min-height: 0; max-height: none; border: 1px solid rgba(148,163,184,.16); border-radius: 16px; background: #fff; padding: var(--term-card-inset); display: flex; flex-direction: column; gap: 12px; overflow: hidden; align-self: start; transition: height .24s ease, box-shadow .24s ease; }
  .term-grid.term-grid-auto { align-items: start; }
  .term-grid-auto .term-card { height: auto; min-height: 0; max-height: none; overflow: visible; align-self: start; }
  .term-card.hidden, .section.hidden { display: none; }
  .section-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0 22px 20px; border-top: 0; border-bottom: 1px solid rgba(148,163,184,.12); }
  .pager-info { display: none; }
  .pager-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: max-content; white-space: nowrap; }
  .pager-actions button { min-width: 34px; height: 32px; border: 1px solid rgba(148,163,184,.22); border-radius: 10px; background: #fff; color: var(--text-2); cursor: pointer; }
  .pager-actions button.active { color: #002e3d; border-color: #00aceb; background: linear-gradient(135deg, #00aceb, #6fd4f4); }
  .pager-actions button:disabled { cursor: not-allowed; opacity: .42; }
  .term-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
  .term-title strong { font-size: 17px; line-height: 1.4; }

  .knowledge-image-notice { margin-top: 12px; padding: 10px 16px; border: 1px solid rgba(148,163,184,.18); border-radius: 12px; background: rgba(255,255,255,.72); box-shadow: 0 10px 28px rgba(15,23,42,.04); }
  .knowledge-image-notice p { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.65; }
  .knowledge-image-notice strong { color: var(--text-2); font-weight: 700; }
  .term-media { width: 100%; flex: 0 0 auto; margin: 0; overflow: hidden; border: 1px solid rgba(148,163,184,.16); border-radius: 10px; background: rgba(241,245,249,.72); }
  .term-media-visual { aspect-ratio: 1672 / 941; overflow: hidden; }
  .term-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .term-media-note { display: block; padding: 6px 10px 7px; border-top: 1px solid rgba(148,163,184,.14); color: var(--text-3); background: rgba(248,250,252,.72); font-size: 11px; line-height: 1.45; text-align: left; }
  /* 每个词条先展示概念配图，再进入正文，避免图片被默认的行内布局和卡片高度裁掉。 */
  .term-card-content > .term-image { display: block; width: 100%; aspect-ratio: 16 / 9; flex: 0 0 auto; object-fit: contain; border: 1px solid rgba(148,163,184,.16); border-radius: 10px; background: linear-gradient(135deg, rgba(248,250,252,.98), rgba(239,246,255,.9)); box-shadow: 0 8px 18px rgba(15,23,42,.06); }
  .term-title, .term-card-content { min-width: 0; margin-inline: 0; }
  .term-card-content { flex: 0 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
  .term-card.is-overflowing:not(.is-expanded) .term-card-content { flex: 1 1 auto; }
  .term-card.is-overflowing:not(.is-expanded) .term-card-content { -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 36px), transparent 100%); }
  .term-grid-auto .term-card-content, .term-card.is-expanded .term-card-content { overflow: visible; }
  .term-card.is-expanded { height: auto; min-height: 0; max-height: none; overflow: visible; }
  .term-expand { flex: 0 0 auto; align-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: auto; min-height: 28px; padding: 4px 8px; border: 0 !important; border-radius: 0; background: transparent !important; box-shadow: none !important; color: #245cae !important; font-size: 13px; font-weight: 700; cursor: pointer; }
  .term-expand { position: relative; text-decoration: none; white-space: nowrap; }
  .term-expand[hidden] { display: none !important; }
  .term-expand::before { content: ''; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 1px; background: currentColor; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
  .term-expand::after { content: '↓'; font-size: 16px; line-height: 1; transition: transform .2s ease; }
  .term-expand[aria-expanded="true"]::after { content: '↑'; }
  .term-expand:hover { background: transparent !important; color: #174a8b !important; text-decoration: none; }
  .term-expand:is(:hover, :active, :focus-visible, [aria-expanded="true"])::before { opacity: .55; }
  .term-expand:focus-visible { outline: 2px solid rgba(0,172,235,.45); outline-offset: 3px; border-radius: 4px; }
  .term-card p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.8; }
  .term-mechanism { padding: 10px 11px; border-left: 3px solid rgba(0,172,235,.44); border-radius: 0 9px 9px 0; background: rgba(239,246,255,.72); color: #40536e !important; }
  .term-mechanism strong { color: #1e4f91; }
  .term-context { padding: 10px 11px; border-left: 3px solid rgba(14,116,144,.38); border-radius: 0 9px 9px 0; background: rgba(240,253,250,.8); color: #40536e !important; }
  .term-context strong { color: #0f5f68; }
  .term-source { min-height: 28px; margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(148,163,184,.14); color: var(--text-3); font-size: 11px; line-height: 1.65; }
  .term-source-label { white-space: nowrap; }
  .term-source-separator { color: #94a3b8; }
  .empty-state { display: none; padding: 40px 24px; text-align: center; color: var(--text-3); }
  .empty-state.visible { display: block; }
  .empty-state strong { display: block; font-size: 18px; color: var(--text-1); margin-bottom: 8px; }
  .empty-state p { margin: 0 auto 16px; max-width: 520px; font-size: 14px; line-height: 1.7; color: var(--text-3); }
  .empty-state-actions { margin-top: 4px; }
  .kb-empty-reset { height: 40px; padding: 0 20px; border-radius: 12px; border: 1px solid rgba(0,172,235,.32); background: rgba(255,255,255,.86); color: #2f6fe0; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 8px 20px rgba(0,172,235,.10); transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
  .kb-empty-reset:hover { background: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 12px 26px rgba(0,172,235,.16); transform: translateY(-1px); }
  @media (max-width: 1100px) { .term-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero-head { grid-template-columns: 1fr; } }
  @media (max-width: 760px) { .section-pager { flex-direction: row; align-items: center; justify-content: center; overflow-x: auto; } .pager-actions { gap: 3px; } .pager-actions button { min-width: 30px; padding: 0 5px; font-size: 12px; white-space: nowrap; } .pager-actions button[data-page="prev"], .pager-actions button[data-page="next"] { min-width: 46px; } .container { width: min(100vw - 28px, 1280px); } .nav-inner { min-height: auto; flex-wrap: wrap; padding: 16px 0; } .nav-menu { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; } .nav-note { width: 100%; white-space: normal; } .kb-search { grid-template-columns: 1fr; } .kb-search button { height: 44px; } .term-grid { grid-template-columns: 1fr; } .section-head { flex-direction: column; align-items: flex-start; } }

@media (max-width: 960px) {
    .nav-inner {
      grid-template-columns: 1fr;
      align-items: start;
}

    .logo { width: auto; }
    .nav-menu {
      width: 100%;
      justify-content: flex-start;
      overflow-x: auto;
    }
    .nav-note {
      width: 100%;
      justify-self: start;
      text-align: left;
      white-space: normal;
    }
  }

/* PC 端分类导航独立于检索卡片，位于检索区与词条内容之间；移动端保持原布局。 */
@media (min-width: 761px) {
  body[data-page="knowledge"]:not(.mobile-page) .knowledge-category-nav {
    margin-top: 12px;
    padding: 0 0 2px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body[data-page="knowledge"]:not(.mobile-page) .knowledge-category-head {
    display: flex;
    align-items: center;
    min-height: 52px;
    padding: 8px 0 6px;
    border-bottom: 0;
  }

  body[data-page="knowledge"]:not(.mobile-page) .knowledge-category-head > div {
    position: relative;
    padding-left: 14px;
  }

  body[data-page="knowledge"]:not(.mobile-page) .knowledge-category-head > div::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    bottom: 3px;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, #00aceb, #6fd4f4);
  }

  body[data-page="knowledge"]:not(.mobile-page) .knowledge-category-head h2 {
    margin: 0 0 3px;
    color: var(--text-1);
    font-size: 18px;
    line-height: 1.35;
  }

  body[data-page="knowledge"]:not(.mobile-page) .knowledge-category-head p {
    margin: 0;
    color: var(--text-3);
    font-size: 12px;
    line-height: 1.5;
  }

  body[data-page="knowledge"]:not(.mobile-page) .knowledge-category-nav .filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 8px 0 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

}

@media (min-width: 761px) {
  body[data-page="knowledge"]:not(.mobile-page) .content {
    padding-top: 0;
  }

  body[data-page="knowledge"]:not(.mobile-page) .content .section-head,
  body[data-page="knowledge"]:not(.mobile-page) .content .term-grid {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}
