/* 四季读书 · 文库最小前台（独立样式，不套夜雨聆风模板） */
:root {
  --bg: #f6f3ee;
  --card: #fffdf9;
  --ink: #2c2a26;
  --muted: #6b6560;
  --line: #e6e0d6;
  --brand: #2f6f4e;
  --brand-dark: #245a3e;
  --accent: #c4a35a;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(44, 42, 38, 0.06);
  --max: 1100px;
  --font: "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(47,111,78,.08), transparent 60%),
    radial-gradient(900px 300px at 100% 0%, rgba(196,163,90,.10), transparent 55%),
    var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px 48px; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(246,243,238,.88);
  border-bottom: 1px solid var(--line);
  overflow: visible;
}
.header-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.logo {
  font-weight: 700; font-size: 1.15rem; color: var(--ink);
  letter-spacing: .04em; white-space: nowrap;
}
.logo span { color: var(--brand); }
.logo:hover { text-decoration: none; }
.search-form {
  flex: 1 1 240px; min-width: 180px; max-width: 420px;
  margin-left: auto;
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-form:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,78,.12);
}
.search-form input[type=search] {
  flex: 1; min-width: 0; border: 0; border-radius: 0;
  padding: 9px 14px 9px 16px; font-size: 14px; background: transparent; color: var(--ink);
  outline: none;
}
.search-form input[type=search]:focus { box-shadow: none; }
.search-form .search-submit,
.search-form button {
  flex: 0 0 auto; border: 0; border-left: 1px solid var(--line); border-radius: 0;
  padding: 9px 14px; background: transparent; color: var(--brand);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.search-form .search-submit:hover,
.search-form button:hover { background: rgba(47,111,78,.08); color: var(--brand-dark); }
.hero {
  margin: 28px 0 18px;
}
.hero h1 { margin: 0 0 8px; font-size: 1.6rem; }
.hero p { margin: 0; color: var(--muted); }
.note {
  margin: 12px 0 18px; padding: 10px 14px; border-radius: 8px;
  background: #fff8e8; border: 1px solid #f0e0b8; color: #7a5b16; font-size: 14px;
}
.meta-bar {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; margin: 8px 0 14px; color: var(--muted); font-size: 14px; flex-wrap: wrap;
}
/* 文库多列卡片网格（封面在上 + 标题；列数偏稀，便于标题展开） */
.list, .doc-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  gap: 14px 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0; box-shadow: var(--shadow); overflow: hidden;
  min-width: 0;
}
.item-link {
  display: flex; flex-direction: column; gap: 0;
  padding: 0; color: inherit; text-decoration: none;
  height: 100%;
}
.item-link:hover { text-decoration: none; background: rgba(47,111,78,.03); }
.thumb-wrap {
  display: block; width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 0;
  overflow: hidden;
  background: #fff; border-bottom: 1px solid var(--line);
}
.thumb {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  background: #fff;
}
.item-body {
  flex: 1; min-width: 0;
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.item h2 {
  margin: 0; font-size: .98rem; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-word;
  min-height: calc(1.4em * 2);
}
.item h2, .item-link:hover h2 { color: var(--ink); }
.item-link:hover h2 { color: var(--brand); }
.item .sub {
  color: var(--muted); font-size: 12px;
  display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center;
  margin-top: auto;
}
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: rgba(47,111,78,.08); color: var(--brand); font-size: 11px;
}
@media (max-width: 379px) {
  /* 极窄手机：1 列 */
  .list, .doc-grid { grid-template-columns: 1fr; gap: 12px; }
  .item h2 { font-size: 1rem; }
}
@media (min-width: 720px) {
  /* 平板：3 列 */
  .list, .doc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 14px; }
}
@media (min-width: 1024px) {
  /* 桌面：最多 4 列（不再 5/6） */
  .list, .doc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 16px; }
  .item h2 { font-size: 1rem; }
}
.pager {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: 22px; justify-content: center;
}
.pager a, .pager span {
  display: inline-block; min-width: 36px; text-align: center;
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 14px;
}
.pager a:hover { border-color: var(--brand); text-decoration: none; }
.pager .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .disabled { color: #aaa; }
/* —— 文档详情（阅读区为主：大图竖排） —— */
.doc-card.doc-reader {
  background: transparent; border: 0; border-radius: 0;
  padding: 0; box-shadow: none; margin-top: 18px;
  overflow: visible; /* 勿 hidden，否则 sticky 失效 */
}
main.wrap {
  overflow: visible;
}
.doc-top {
  display: block;
  padding: 16px 20px; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  box-sizing: border-box;
}
.doc-top-main { min-width: 0; }
.doc-top-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px 16px;
}
.doc-top-main h1 {
  margin: 0; font-size: 1.38rem; line-height: 1.35; font-weight: 700;
  letter-spacing: .01em; flex: 1; min-width: 0;
}
.doc-top-home {
  flex: 0 0 auto; margin-top: 4px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  white-space: nowrap;
}
.doc-top-home:hover { color: var(--brand); text-decoration: none; }
.doc-top-main 
/* 侧栏文档简介（sjds_intro） */
.doc-meta-rail__intro {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.doc-meta-rail__intro .doc-meta-rail__title {
  margin-top: 0;
}
.doc-intro {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #3d3a35;
  font-size: 13.5px;
  line-height: 1.65;
  max-height: 280px;
  overflow: auto;
}
.doc-intro--empty {
  color: var(--muted);
  font-size: 13px;
}

.doc-desc { margin-top: 12px; }

/* 元信息条：芯片式，格式/页数更醒目 */
.doc-meta-bar {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
  align-items: center;
}
.doc-meta-chip {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; line-height: 1.35;
  background: #f0ebe3; color: #4a453f;
  border: 1px solid var(--line);
}
.doc-meta-chip--format {
  background: rgba(47,111,78,.12); color: var(--brand);
  border-color: rgba(47,111,78,.22);
}
.doc-meta-chip--pages {
  background: rgba(196,163,90,.16); color: #7a5f20;
  border-color: rgba(196,163,90,.35);
}
.doc-meta-extra {
  margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55;
  word-break: break-word;
}
.doc-desc {
  margin-top: 12px;
  white-space: pre-wrap; word-break: break-word;
  padding: 10px 12px; background: #faf7f2; border-radius: 8px;
  border: 1px solid var(--line); color: #3d3a35; font-size: 14px; line-height: 1.65;
}

/* 醒目下载占位区（即将开放，不可点） */
.doc-download-panel {
  display: flex; gap: 16px 20px; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  margin: 0 0 16px; padding: 16px 18px;
  background: linear-gradient(135deg, rgba(47,111,78,.10), rgba(196,163,90,.10));
  border: 1px solid rgba(47,111,78,.22);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.doc-download-panel__text {
  display: flex; flex-direction: column; gap: 4px; min-width: 200px; flex: 1;
}
.doc-download-panel__text strong {
  font-size: 1.05rem; color: var(--ink);
}
.doc-download-panel__text span {
  font-size: 13.5px; color: var(--muted); line-height: 1.5;
}
.doc-download-panel__actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.doc-download-panel__actions .btn { text-align: center; white-space: nowrap; }

/* 左预览 + 右信息侧栏
 * sticky 要点：grid 用 stretch，让 .doc-meta-rail 与预览列等高；
 * sticky 打在侧栏本身（或等高父级内的 inner），勿用 align-items:start 把侧栏高度收成内容高，否则无滚动余地。
 */
/* 左预览 + 右信息侧栏：侧栏加宽；列 stretch 保 sticky；首屏用更高侧栏卡片减少空荡 */
.doc-reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(268px, 300px);
  gap: 16px 20px;
  align-items: stretch; /* 侧栏列拉满行高，供 sticky 滑动 */
  max-width: none;
  width: 100%;
  margin: 0 0 8px;
  padding: 0 0 8px;
  overflow: visible;
  box-sizing: border-box;
}
.doc-reader-layout--meta-only {
  grid-template-columns: 1fr;
  max-width: none;
}
.doc-meta-rail {
  order: 2;
  min-width: 0;
  align-self: stretch;
  height: 100%;
  overflow: visible;
}
.doc-meta-rail__inner {
  position: sticky;
  top: 72px; /* 避开 .site-header 单行 */
  z-index: 5;
  padding: 18px 18px 20px;
  background: var(--card);
  border: 1px solid rgba(47, 111, 78, 0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background-image: linear-gradient(180deg, rgba(47,111,78,.07), transparent 42%);
  /* 首屏与预览视觉平衡：卡片至少接近视口高度，避免右侧大片空白 */
  min-height: min(calc(100vh - 96px), 720px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.doc-meta-rail__actions { flex: 0 0 auto; }
.doc-meta-rail__title { flex: 0 0 auto; }
.doc-meta-list { flex: 0 0 auto; }
.doc-meta-rail__foot {
  margin-top: auto;
  padding-top: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px dashed rgba(47,111,78,.14);
}
.doc-meta-rail__title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-dark);
  letter-spacing: .02em;
}
.doc-meta-rail__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(47, 111, 78, 0.12);
}
.doc-meta-rail__actions .btn-download {
  width: 100%;
  text-align: center;
  padding: 11px 16px;
  font-size: 14.5px;
}
.doc-meta-rail__actions .btn-ghost {
  width: 100%;
  text-align: center;
}
.doc-meta-rail__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.doc-meta-rail__home {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.doc-meta-rail__home:hover { color: var(--brand); text-decoration: none; }
.doc-meta-rail__title {
  margin-top: 0;
}

.doc-meta-rail .doc-meta-bar {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}
.doc-meta-rail .doc-meta-chip {
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}
.doc-meta-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-meta-list__row {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: 8px;
  align-items: start;
  font-size: 13px;
  line-height: 1.45;
}
.doc-meta-list__row--format dd {
  color: var(--brand);
  font-weight: 700;
}
.doc-meta-list__row--pages dd {
  color: #7a5f20;
  font-weight: 600;
}
.doc-meta-list__row dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.doc-meta-list__row dd {
  margin: 0;
  color: var(--ink);
  word-break: break-all;
}

/* 在线预览：竖版 contain，限制高度，避免绿底封面被拉成超高条 */
.doc-reader-pages {
  order: 1;
  max-width: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 0 28px;
  min-width: 0;
}
.doc-page {
  margin: 0;
}
.doc-page-frame {
  background: linear-gradient(180deg, #eaf4ee 0%, #f7faf8 55%, #fffdf9 100%);
  border: 1px solid rgba(47, 111, 78, 0.18);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(44, 42, 38, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.doc-page-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 880px);
  object-fit: contain;
  object-position: center top;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(44, 42, 38, 0.08);
  vertical-align: top;
}
/* 首屏封面：铺满预览列宽；限制最大高度，与右侧 sticky 栏更平衡 */
.doc-page--cover .doc-page-frame {
  width: 100%;
  max-width: none;
  margin: 0;
  aspect-ratio: auto;
  max-height: min(78vh, 860px);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-sizing: border-box;
}
.doc-page--cover .doc-page-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(74vh, 820px);
  object-fit: contain;
  object-position: center center;
  border-radius: 4px;
  box-shadow: 0 1px 6px rgba(44, 42, 38, 0.08);
  background: transparent;
}

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600;
  font-size: 14px; line-height: 1.2;
}
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn-ghost:hover { border-color: var(--brand); text-decoration: none; }
.btn-download {
  background: var(--brand); color: #fff; border-color: var(--brand);
  padding: 12px 28px; font-size: 15px;
  cursor: not-allowed; user-select: none;
  box-shadow: 0 4px 14px rgba(47,111,78,.22);
}
.btn-download.is-disabled {
  pointer-events: none;
  opacity: .78;
  background: #6f8f7c;
  border-color: #6f8f7c;
  box-shadow: none;
}

/* 相关推荐 */
.doc-related {
  margin: 8px 0 28px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.doc-related__title {
  margin: 12px 0 14px;
  font-size: 1.15rem; font-weight: 700; color: var(--ink);
}

/* 平板及以下：信息回到预览上方，取消 sticky，不挡阅读 */
@media (max-width: 900px) {
  .doc-reader-layout {
    display: flex;
    flex-direction: column;
    max-width: none;
    width: 100%;
    gap: 14px;
  }
  .doc-meta-rail { order: -1; width: 100%; }
  .doc-meta-rail__inner {
    position: static;
    top: auto;
    z-index: auto;
    /* 桌面用 min-height 把侧栏撑到接近一屏；手机信息在预览上方，撑高只会留出大片空白 */
    min-height: 0;
    height: auto;
  }
  .doc-meta-rail {
    height: auto;
    align-self: stretch;
  }
  .doc-meta-rail__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    align-items: start;
  }
  .doc-meta-rail__actions .btn-download { grid-column: 1 / -1; }
  .doc-meta-rail__hint { grid-column: 1 / -1; }
  .doc-meta-rail .doc-meta-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .doc-meta-rail .doc-meta-chip {
    width: auto;
    justify-content: center;
  }
  .doc-top-home { display: none; } /* 侧栏已有返回 */
  .doc-meta-list__row {
    grid-template-columns: 4.5em 1fr;
  }
  .doc-reader-pages { order: 1; }
}

@media (max-width: 640px) {
  .doc-top { padding: 14px; }
  .doc-top-main h1 { font-size: 1.15rem; }
  .doc-download-panel { padding: 14px; gap: 12px; }
  .doc-download-panel__actions { width: 100%; }
  .doc-download-panel__actions .btn-download { flex: 1; text-align: center; }
  .doc-reader-layout { max-width: none; width: 100%; }
  .doc-reader-pages { gap: 14px; padding-bottom: 20px; max-width: 100%; }
  .doc-page--cover .doc-page-frame { max-width: none; width: 100%; padding: 0; }
  .doc-page-frame { padding: 10px; }
  .doc-page-frame img { max-height: min(68vh, 760px); }
  .doc-meta-rail__inner { padding: 14px; }
}

.site-footer {
  margin-top: 40px; padding: 20px 16px 32px; text-align: center;
  color: var(--muted); font-size: 13px; border-top: 1px solid var(--line);
}
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }

/* —— P0+P1+P2 扩展 —— */
.header-user {
  display: flex; align-items: center; gap: 16px;
  margin-left: 4px; padding-left: 2px;
  font-size: 14px; white-space: nowrap; flex: 0 0 auto;
}
.header-user a { color: var(--muted); font-weight: 600; text-decoration: none; }
.header-user a:hover { color: var(--brand); text-decoration: none; }
.header-user .header-login,
.header-user .header-account { color: var(--ink); }
.header-user .header-login:hover,
.header-user .header-account:hover { color: var(--brand); }
.header-user .header-logout { color: var(--muted); font-weight: 500; }
.header-register {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px; border-radius: 999px; line-height: 1.2;
  background: var(--brand); color: #fff !important; font-weight: 600;
}
.header-register:hover { background: var(--brand-dark); color: #fff !important; }
.vip-pill {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: linear-gradient(135deg,#c4a35a,#e6c87a); color: #3a2e10;
  font-size: 11px; font-weight: 700;
}
.btn-block { display: block; width: 100%; text-align: center; }
.btn-outline {
  background: #fff; color: var(--brand); border: 1px solid var(--brand);
}
.btn-outline:hover { background: rgba(47,111,78,.06); text-decoration: none; }
.btn-download { cursor: pointer; pointer-events: auto; }
.btn-download:not(.is-disabled) { opacity: 1; }

/* 手机吸底 */
.mobile-dl-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,253,249,.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px rgba(44,42,38,.08);
}
@media (max-width: 720px) {
  .mobile-dl-bar { display: block; }
  body { padding-bottom: 72px; }
  .doc-download-panel__actions .btn-download { display: none; }
}

/* 空态 */
.empty-state { padding: 56px 16px; }
.empty-illu { font-size: 48px; line-height: 1; margin-bottom: 12px; }
.empty-title { margin: 0 0 8px; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.empty-hint { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.suggest-chips {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 600;
}
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

/* Modal */
.sjds-modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(30,28,24,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.sjds-modal {
  position: relative; width: min(420px, 100%);
  background: #fff; border-radius: 16px; padding: 28px 24px 20px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}
.sjds-modal h2 { margin: 0 0 12px; font-size: 1.25rem; }
.sjds-modal-text { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.sjds-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.sjds-modal-close {
  position: absolute; top: 10px; right: 12px;
  border: 0; background: transparent; font-size: 22px; cursor: pointer; color: #888;
}
.sjds-modal-cancel {
  display: block; width: 100%; margin-top: 12px;
  border: 0; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 8px;
}

/* Auth */
.auth-card {
  max-width: 420px; margin: 36px auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0 0 6px; font-size: 1.4rem; }
.auth-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
/* Tab 面板：必须压过 .auth-form 的 display:flex，否则 hidden 无效 */
.auth-form[hidden],
[data-auth-panel][hidden] {
  display: none !important;
}
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-form input {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; color: var(--ink);
}
.auth-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47,111,78,.12); }
.auth-foot { margin-top: 16px; font-size: 14px; color: var(--muted); text-align: center; }
.readonly {
  display: block; padding: 10px 12px; background: #f5f2ec; border-radius: 10px;
  color: var(--ink); font-weight: 500;
}

/* VIP */
.vip-grid {
  display: grid; gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .vip-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.vip-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.vip-card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.vip-price { font-size: 1.8rem; font-weight: 700; color: var(--brand); margin-bottom: 12px; }
.vip-card ul { margin: 0 0 18px; padding-left: 18px; color: var(--muted); font-size: 14px; }
.vip-todo { margin-top: 20px; color: var(--muted); font-size: 13px; }

/* Account */
.account-layout {
  display: grid; gap: 20px; margin-top: 20px;
}
@media (min-width: 800px) {
  .account-layout { grid-template-columns: 200px 1fr; }
}
.account-nav {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; height: fit-content;
}
.account-nav a {
  padding: 10px 12px; border-radius: 8px; color: var(--ink); font-weight: 600; font-size: 14px;
}
.account-nav a:hover { background: rgba(47,111,78,.06); text-decoration: none; }
.account-nav a.is-active { background: rgba(47,111,78,.12); color: var(--brand); }
.account-main h1 { margin: 0 0 8px; }
.account-stats {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, minmax(0,1fr));
  margin: 16px 0 20px;
}
@media (min-width: 720px) {
  .account-stats { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; display: flex; flex-direction: column; gap: 4px;
}
.stat strong { font-size: 1.2rem; }
.stat span { font-size: 12px; color: var(--muted); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.muted { color: var(--muted); font-size: 12px; }
.footer-links { display: flex; gap: 14px; justify-content: center; margin-bottom: 8px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 13px; }
.footer-beian { margin-top: 6px; color: #a39e96; font-size: 12px; }

@media (min-width: 1024px) {
  :root { --max: 1160px; }
}


/* 主导航：文库 / 资讯 */
.header-nav { display: flex; gap: 12px; align-items: center; margin-left: 8px; }
.header-nav a { color: var(--muted, #666); font-size: 14px; text-decoration: none; padding: 4px 2px; }
.header-nav a:hover, .header-nav a.is-active { color: var(--text, #222); font-weight: 600; }

/* 资讯详情 */
.zixun-detail { max-width: 860px; margin: 0 auto; }
.zixun-detail .crumb { color: var(--muted, #666); font-size: 13px; margin-bottom: 8px; }
.zixun-detail h1 { font-size: 1.45rem; line-height: 1.4; margin: 0 0 12px; }
.zixun-content { line-height: 1.75; overflow-wrap: anywhere; }
.zixun-content img { max-width: 100%; height: auto; }
.zixun-content section, .zixun-content pre { white-space: normal; }
.zixun-back { margin: 28px 0 8px; }

/* 资讯 SEO 列表：无封面无摘要；标题与时间同一行 */
.zixun-list { list-style: none; margin: 0; padding: 0; max-width: 860px; }
.zixun-list-item { border-bottom: 1px solid var(--line, #e8e4de); }
.zixun-list-link {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 14px 0; text-decoration: none; color: inherit;
}
.zixun-list-link:hover .zixun-list-title { color: var(--accent, #1a5fb4); }
.zixun-list-title {
  margin: 0; flex: 1 1 auto; min-width: 0;
  font-size: 1.08rem; line-height: 1.45; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zixun-list-time {
  flex: 0 0 auto; font-size: 13px; color: var(--muted, #999); white-space: nowrap;
}
.zixun-grid .thumb-wrap, .zixun-list .thumb-wrap { display: none !important; }
.zixun-content img { display: none !important; }

/* 资讯详情：上一篇 / 下一篇 */
.zixun-pager {
  display: flex; flex-direction: column; gap: 10px;
  margin: 28px 0 8px; padding: 16px 0 0;
  border-top: 1px solid var(--line, #e8e4de);
  font-size: 14px; line-height: 1.5;
}
.zixun-pager a { color: var(--text, #222); text-decoration: none; }
.zixun-pager a:hover { color: var(--accent, #1a5fb4); }
.zixun-pager-none { color: var(--muted, #999); }
.zixun-pager-prev, .zixun-pager-next {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 资讯详情：相关文档 — 手机1列/PC3列；封面用列表同款小图 URL，卡片内小竖图展示 */
.zixun-related {
  margin: 32px 0 4px;
  padding: 16px 14px 14px;
  background: var(--card, #fffdf9);
  border: 1px solid var(--line, #e6e0d6);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow, 0 8px 24px rgba(44,42,38,.06));
}
.zixun-related-title {
  margin: 0 0 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(47,111,78,.18);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand, #2f6f4e);
  letter-spacing: .02em;
}
.zixun-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .zixun-related-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
  }
}
.zixun-related-list > li {
  min-width: 0;
  border: 1px solid var(--line, #e6e0d6);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.zixun-rel-item {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  height: 100%;
  padding: 10px;
  color: inherit;
  text-decoration: none;
  transition: background .15s ease;
}
.zixun-rel-item:hover {
  background: rgba(47,111,78,.06);
  text-decoration: none;
}
/* 列表同款小图 URL；此处只控制展示尺寸（竖版加高），不换原图 */
.zixun-rel-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 90px; /* 竖版更高，约 3:4.25 */
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line, #e6e0d6);
  background: #f7f5f1;
}
.zixun-rel-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.zixun-rel-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}
.zixun-rel-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink, #2c2a26);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.zixun-rel-item:hover .zixun-rel-name {
  color: var(--brand, #2f6f4e);
}
.zixun-rel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin-top: auto;
  font-size: 11px;
  color: var(--muted, #6b6560);
}
.zixun-related .doc-grid { display: none !important; }

/* auth sms tabs */
.auth-tabs { display: flex; gap: 8px; margin: 0 0 16px; }
.auth-tab {
  flex: 1; border: 1px solid var(--border, #d8e0d9); background: #fff; color: var(--muted);
  border-radius: 8px; padding: 8px 10px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.auth-tab.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.auth-sms-row { display: flex; gap: 8px; align-items: stretch; }
.auth-sms-row input { flex: 1; min-width: 0; }
.auth-sms-row .btn { white-space: nowrap; flex-shrink: 0; }
.auth-hint { min-height: 1.2em; margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.auth-hint.is-error { color: #b42318; }
.btn-block { width: 100%; justify-content: center; }


/* header auth hierarchy 20261103 */
.header-inner { gap: 14px 18px; }
@media (max-width: 720px) {
  .search-form { flex: 1 1 100%; max-width: none; margin-left: 0; order: 3; }
  .header-user { margin-left: auto; }
  .header-nav { margin-left: 0; }
}

/* 登录页忘记密码 */
.auth-form label .auth-forgot-link {
  align-self: flex-end;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
}
.auth-form label .auth-forgot-link:hover { text-decoration: underline; }
.auth-sms-row { display: flex; gap: 8px; align-items: stretch; }
.auth-sms-row input { flex: 1; min-width: 0; }
.auth-sms-row .btn { flex: 0 0 auto; white-space: nowrap; }

/* 伪分类入口（首页分组 chips） */
.pseudo-cats {
  margin: 0 0 18px;
  padding: 12px 14px 10px;
  border: 1px solid var(--line, #e6e2da);
  border-radius: 12px;
  background: #fff;
}
.pseudo-cats__group + .pseudo-cats__group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line, #e6e2da);
}
.pseudo-cats__label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--muted, #888);
}
.pseudo-cats__chips {
  justify-content: flex-start;
}
.pseudo-cats .chip {
  padding: 6px 12px;
  font-size: 12px;
}
@media (max-width: 720px) {
  .pseudo-cats { padding: 10px; }
  .pseudo-cats .chip { padding: 6px 10px; font-size: 12px; }
}



/* 顶栏伪分类下拉（与主导航同一行） */
.header-pseudo {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 4px;
  border: 0;
  background: transparent;
  overflow: visible;
}
.header-pseudo__inner {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  /* 默认可见，避免 overflow-x:auto 连带裁切绝对定位下拉（CSS 规定一轴非 visible 则另一轴变 auto） */
  overflow: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.header-pseudo__inner.is-scrollable {
  overflow-x: auto;
}
/* 展开时强制不裁切（覆盖可能的横滑） */
.header-pseudo__inner:has(.topnav-dd.is-open),
.header-pseudo__inner:has(.topnav-dd:focus-within),
.header-pseudo__inner:has(.topnav-dd:hover) {
  /* 悬停/展开时必须 visible：否则 overflow-x:auto 会把另一轴也变成 auto，
     绝对定位菜单虽可能“看得见”但 elementFromPoint 命中穿透到 BODY，子项完全点不了 */
  overflow: visible;
}
.topnav-dd {
  position: relative;
  flex: 0 0 auto;
}
.topnav-dd__trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--muted, #666);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  line-height: 1.2;
  -webkit-tap-highlight-color: rgba(47,111,78,.12);
}
.topnav-dd.is-open > .topnav-dd__trigger,
.topnav-dd:focus-within > .topnav-dd__trigger {
  color: var(--brand);
  background: rgba(47,111,78,.06);
  text-decoration: none;
}
.topnav-dd__caret {
  display: inline-block;
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .55;
  transform: translateY(1px);
}
.topnav-dd.is-open > .topnav-dd__trigger .topnav-dd__caret {
  transform: translateY(1px) rotate(180deg);
}
.topnav-dd__menu {
  display: none;
  position: absolute;
  left: 0; top: calc(100% + 6px);
  z-index: 80;
  min-width: 132px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(44,42,38,.12);
  pointer-events: auto;
}
/* 填上 trigger 与菜单之间的 6px 空隙，避免鼠标移入时离开 .topnav-dd 导致 :hover 丢失、菜单立刻收起 */
.topnav-dd__menu::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -6px;
  height: 6px;
}
.topnav-dd.is-open > .topnav-dd__menu {
  display: block;
}
.topnav-dd__menu a {
  display: block;
  padding: 8px 14px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.topnav-dd__menu a:hover,
.topnav-dd__menu a:active {
  background: rgba(47,111,78,.08);
  color: var(--brand);
  text-decoration: none;
}
/* 仅精细指针设备：悬停展开（不依赖触屏 sticky :hover） */
@media (hover: hover) and (pointer: fine) {
  a.topnav-dd__trigger:hover,
  button.topnav-dd__trigger:hover,
  .topnav-dd:hover > .topnav-dd__trigger {
    color: var(--brand);
    background: rgba(47,111,78,.06);
    text-decoration: none;
  }
  .topnav-dd:hover > .topnav-dd__menu {
    display: block;
  }
}
/* 桌面：搜索仍靠右；分类吃中间空隙；过窄时可横滑 */
@media (min-width: 721px) {
  .header-inner { flex-wrap: nowrap; }
  .search-form { flex: 0 1 320px; margin-left: auto; }
  .header-user { margin-left: 0; flex: 0 0 auto; }
  .header-pseudo { flex: 1 1 auto; }
  /* 桌面默认 visible，保证下拉可点；仅显式 is-scrollable 时才横滑（且展开/悬停仍强制 visible） */
  .header-pseudo__inner { overflow: visible; }
  .header-pseudo__inner.is-scrollable { overflow-x: auto; }
}
@media (max-width: 720px) {
  .header-inner { overflow: visible; }
  .header-pseudo {
    flex: 1 1 100%;
    order: 4;
    margin-left: 0;
    overflow: visible;
  }
  .header-pseudo__inner {
    width: 100%;
    overflow: visible;
    justify-content: space-between;
    gap: 2px;
  }
  .topnav-dd__trigger { padding: 6px 8px; font-size: 12px; }
  .topnav-dd__menu {
    min-width: 120px;
    /* 窄屏防止贴边被裁：靠右的项右对齐 */
    max-width: min(220px, calc(100vw - 24px));
  }
  .topnav-dd:nth-last-child(-n+2) .topnav-dd__menu {
    left: auto;
    right: 0;
  }
  .doc-meta-rail__inner { top: 72px; }
}

/* ===== search results grid 5col desktop / 3col mobile + mobile title size 20261105 ===== */
/* 搜索结果页：内容区加宽配合五列；桌面5列；手机3列；窄屏缩小标题字号；首页不动 */
body.page-search {
  --max: 1120px;
}
@media (min-width: 1024px) {
  body.page-search {
    --max: 1280px; /* 五列封面卡约 230px+，避免过窄 */
  }
  body.page-search .list,
  body.page-search .doc-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px 14px;
  }
}
@media (max-width: 479px) {
  body.page-search .list,
  body.page-search .doc-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
  }
  /* 三列窄卡(~109px)：缩小标题/meta 字号 + 略增行数，显示更多字；桌面五列不变 */
  body.page-search .item-body {
    padding: 6px 6px 8px;
    gap: 4px;
  }
  body.page-search .item h2 {
    font-size: 11px; /* 覆盖全局 .98rem/~1rem，约多显 1 行字 */
    line-height: 1.35;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    min-height: calc(1.35em * 3);
  }
  body.page-search .item .sub {
    font-size: 10px;
    gap: 3px 5px;
  }
  body.page-search .badge {
    font-size: 9px;
    padding: 0 5px;
  }
}


/* 顶栏「分类」入口 + 全部分类弹窗（桌面/手机共用；首页不再直铺 chips） */
.topnav-cats-trigger {
  flex: 0 0 auto;
  margin-left: 2px;
}
.topnav-cats-trigger[aria-expanded="true"] {
  color: var(--brand);
  background: rgba(47,111,78,.06);
}
.sjds-cats-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(30,28,24,.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 12px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.sjds-cats-mask[hidden] {
  display: none !important;
}
.sjds-cats-dialog {
  position: relative;
  width: min(720px, 100%);
  margin: 0 auto 24px;
  background: #fff;
  border-radius: 16px;
  padding: 22px 18px 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.18);
}
.sjds-cats-dialog h2 {
  margin: 0 40px 14px 0;
  font-size: 1.15rem;
}
.pseudo-cats--modal {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.pseudo-cats--modal .pseudo-cats__group + .pseudo-cats__group {
  margin-top: 12px;
  padding-top: 12px;
}
html.sjds-cats-open,
html.sjds-cats-open body {
  overflow: hidden;
}
@media (max-width: 720px) {
  .sjds-cats-mask { padding: 48px 10px 20px; align-items: flex-start; }
  .sjds-cats-dialog { padding: 18px 12px 12px; border-radius: 14px; }
  .sjds-cats-dialog h2 { font-size: 1.05rem; margin-bottom: 10px; }
}
