/* =============================================================================
   族 table —— 清单型
   骨架：单栏容器 + 语义化 table（thead/tbody/th scope），行内两列（条目 / 更新）。
   与 dir 的区别：dir 是 ul>li>a 的目录索引；这里是有表头、有列语义的表格。
   ========================================================================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.table-page {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 15px; line-height: 1.75;
  display: flex; flex-direction: column; min-height: 100vh;
}
body.table-page > .table-main { flex: 1 0 auto; }
.table-page a { color: var(--accent-deep); text-decoration: none; }
.table-page img { max-width: 100%; height: auto; }

/* ------------------------------------------------------------------ header */
.table-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.table-head.is-center { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 20px 12px; }
.table-head.is-left { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 11px 22px; }
.table-head.is-stack {
  display: flex; align-items: center; gap: 18px;
  padding: 11px max(22px, calc(50% - 470px));
}
.table-bar { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; }
.table-rule { flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }
.table-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; white-space: nowrap; }
.table-mark { border-radius: 4px; }
/* 页头导航恒为一行：放不下就横向滑，不折行。
   折行会把刊头挤成高低不齐的两行（移动端最明显），而这里是全站唯一的主入口，
   一旦折掉就是「菜单看着断了一截」。滚动条隐掉，横滑不带动整页。 */
.table-nav {
  display: flex; flex-wrap: nowrap; gap: 4px 16px;
  min-width: 0; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none; overscroll-behavior-x: contain;
}
.table-nav::-webkit-scrollbar { display: none; }
.table-nav a { flex: 0 0 auto; white-space: nowrap; }
.table-nav a { transition: color .16s ease; font-size: 13px; color: var(--text-3); }
.table-nav-wide {
  flex: 0 1 auto; min-width: 0; margin: 0; padding: 0; border-top: 0; gap: 0;
}
.table-head.is-stack .table-nav-wide a { font-size: 12.5px; letter-spacing: .045em; }
.table-head.is-stack .table-nav-wide a + a {
  margin-left: 13px; padding-left: 13px; border-left: 1px solid var(--border);
}

/* -------------------------------------------------------------------- main */
.table-main { width: 100%; max-width: 940px; margin: 0 auto; padding: 26px 22px 56px; }
.table-intro { padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.table-title { margin: 0 0 4px; font-size: 27px; font-weight: 600; letter-spacing: .01em; }
.table-sub { margin: 0; color: var(--text-3); font-size: 14px; }
.table-stamp { margin: 8px 0 0; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.table-crumb { margin-bottom: 12px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; }
.table-sec { margin-top: 26px; }
.table-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.table-count { color: var(--muted); font-size: 12.5px; font-weight: 400; }

/* ------------------------------------------------------------------- table */
.table-tbl {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  font-size: 14.5px;
}
.table-tbl thead th {
  text-align: left; padding: 9px 14px; background: var(--surface-soft);
  font-size: 11.5px; font-weight: 500; letter-spacing: .14em; color: var(--muted);
  border-bottom: 1px solid var(--border); text-transform: uppercase;
}
.table-tbl tbody td { padding: 9px 14px; border-bottom: 1px solid var(--border-soft); }
.table-tbl tbody tr:last-child td { border-bottom: 0; }
.table-tbl tbody tr:nth-child(even) { background: var(--surface-soft); }
.table-tbl a { color: var(--text); }
.table-tbl a:hover { color: var(--accent); }
.table-cell-d { text-align: right; white-space: nowrap; color: var(--muted); font-size: 13px; }
.table-cell { color: var(--text-2); }

/* -------------------------------------------------------------------- post */
.table-post { max-width: 46em; }
.table-meta { margin: 4px 0 16px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.table-dot { color: var(--border); }
.table-body { font-size: 16px; line-height: 1.9; color: var(--text-2); }
.table-body p { margin: 0 0 1.05em; }
.table-body h2 { margin: 1.7em 0 .6em; padding-bottom: 5px; border-bottom: 1px solid var(--border); font-size: 20px; color: var(--text); }
.table-meta-tbl {
  width: 100%; max-width: 420px; border-collapse: collapse; margin: 0 0 22px;
  font-size: 13.5px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.table-meta-tbl th {
  width: 88px; text-align: left; padding: 7px 10px; color: var(--muted);
  font-weight: 400; letter-spacing: .08em; background: var(--surface-soft);
}
.table-meta-tbl td { padding: 7px 10px; color: var(--text-2); }

/* ---------------------------------------------------------------- related */
.table-rel { margin-top: 30px; }
.table-rel-h { margin: 0 0 8px; font-size: 14px; }
.table-rel-list { margin: 0; padding-left: 18px; color: var(--text-2); }
.table-rel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.table-rel-tile { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.table-rel-img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.table-rel-t { font-size: 13.5px; color: var(--text); }
.table-code { margin: 0; font-size: 56px; font-weight: 700; color: var(--accent-soft); }

/* ------------------------------------------------------------------ footer */
.table-foot { margin-top: 40px; background: var(--surface); border-top: 1px solid var(--border); padding: 22px; font-size: 13px; color: var(--text-3); }
.table-foot.is-min { text-align: center; }
.table-foot-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 940px; margin: 0 auto 10px; }
.table-foot-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.table-foot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 940px; margin: 0 auto 14px; }
.table-foot-h { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.table-foot-t { margin: 0; }
.table-foot-col { display: flex; flex-direction: column; gap: 4px; }
.table-friends { display: flex; gap: 4px 14px; flex-wrap: wrap; justify-content: center; max-width: 940px; margin: 0 auto; }
.table-copy { margin: 0; text-align: center; color: var(--muted); font-size: 12.5px; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 720px) {
  .table-main { padding: 18px 14px 44px; }
  .table-title { font-size: 23px; }
  .table-tbl { font-size: 14px; }
  .table-tbl thead th, .table-tbl tbody td { padding: 8px 10px; }
  .table-cell-d { font-size: 12px; }
  .table-foot-grid { grid-template-columns: 1fr; }
  .table-rel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .table-tbl thead th:nth-child(2), .table-tbl tbody td:nth-child(2) { display: none; }
}

@media (max-width: 680px) {
  /* is-left 是「站名 + 导航」同排：站名过长自身省略，导航拿剩余宽度横滑，不拆行。 */
  .table-head.is-left { flex-wrap: nowrap; gap: 10px; padding: 10px 14px 9px; }
  .table-head.is-left .table-bar { flex: 0 1 auto; min-width: 0; }
  .table-head.is-left .table-brand { min-width: 0; overflow: hidden; }
  .table-head.is-left .table-brand span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table-head.is-left .table-nav { flex: 1 1 auto; min-width: 0; gap: 4px 16px; }
  /* stack 窄屏也是「站名 + 导航」同排：站名过长自身省略，宽导航拿剩余宽度横滑。
     拆成两行会让刊头孤零零占一行、频道条贴在下边，视觉上明显更难看。 */
  .table-head.is-stack { flex-wrap: nowrap; gap: 10px; padding: 12px 14px; }
  .table-head.is-stack .table-bar { flex: 0 1 auto; min-width: 0; }
  .table-head.is-stack .table-rule { display: none; }
  .table-head.is-stack .table-brand { min-width: 0; overflow: hidden; }
  .table-head.is-stack .table-brand span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table-head.is-stack .table-nav-wide {
    flex: 1 1 auto; min-width: 0; gap: 4px 14px; margin-top: 0; padding-top: 0; border-top: 0;
  }
  .table-head.is-stack .table-nav-wide a + a { margin-left: 0; padding-left: 0; border-left: 0; }
}

/* 居中变体：导航撑满整行再居中。不撑满的话盒宽按 fit-content 走，
   导航一 nowrap 就把页头撑出屏幕；safe center 保证溢出时首项滚得到。 */
.table-head.is-center .table-nav { align-self: stretch; justify-self: stretch; justify-content: safe center; }

.table-nav a[aria-current="page"] {
  color: var(--accent-deep);
  text-decoration: underline; text-decoration-thickness: 1.5px;
  text-underline-offset: 5px; text-decoration-color: var(--accent);
}

/* 极窄屏（≤480）：站名与导航保持同一行，站名过长时自身省略，导航拿剩余宽度横滑。
   拆成两行会让刊头孤零零占一行、导航贴在下边，视觉上明显更难看。 */
@media (max-width: 480px) {
  .table-head.is-left { flex-wrap: nowrap; gap: 10px; padding-left: 14px; padding-right: 14px; }
  .table-head.is-left .table-bar { flex: 0 1 auto; min-width: 0; }
  .table-head.is-left .table-brand { min-width: 0; overflow: hidden; }
  .table-head.is-left .table-brand span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .table-head.is-left .table-nav { flex: 1 1 auto; min-width: 0; }
}
