:root {
  color-scheme: light;
  --bg: #f4efe4;
  --paper: #fbf7ed;
  --panel: #fffaf0;
  --panel-2: #f0e7d8;
  --text: #15120e;
  --muted: #70685c;
  --line: #d8c9b2;
  --line-strong: #b99762;
  --accent: #8b5e18;
  --accent-2: #2d4c53;
  --danger: #9c2f2f;
  --shadow: 0 22px 70px rgba(54, 39, 19, 0.1);
  --radius: 2px;
  font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
}

:root[data-mode="dark"] {
  color-scheme: dark;
  --bg: #111111;
  --paper: #161412;
  --panel: #1d1a16;
  --panel-2: #252018;
  --text: #f2eadc;
  --muted: #b2a694;
  --line: #3b3328;
  --line-strong: #8a6b38;
  --accent: #d6ad63;
  --accent-2: #a6b8ba;
  --danger: #e17b72;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--line), transparent 72%) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(0deg, color-mix(in srgb, var(--line), transparent 78%) 1px, transparent 1px) 0 0 / 44px 44px,
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  overflow-x: hidden;
  text-rendering: geometricPrecision;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

code,
pre,
.brand,
.category-heading span,
.json-preview {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.mast {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel), transparent 4%), color-mix(in srgb, var(--paper), transparent 12%));
  border-bottom: 1px solid var(--line);
  padding: 18px clamp(18px, 4vw, 56px) 42px;
}

.mast.compact {
  padding-bottom: 28px;
}

.mast-bar {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1220px;
}

.brand {
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mast-links {
  align-items: center;
  display: flex;
  gap: 10px;
}

.mast-links a,
.icon-button {
  background: color-mix(in srgb, var(--panel), transparent 24%);
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 38px;
  padding: 7px 13px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.mast-links a:hover,
.icon-button:hover {
  background: var(--panel);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.icon-button {
  min-width: 38px;
}

.hero {
  margin: 82px auto 0;
  max-width: 1220px;
}

.admin-hero,
.internal-hero {
  margin-top: 52px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(48px, 9vw, 128px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.92;
  margin-bottom: 24px;
  max-width: 980px;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.internal-hero h1,
.admin-hero h1 {
  font-size: clamp(42px, 7vw, 86px);
  max-width: 1120px;
}

.hero-copy {
  border-left: 4px solid var(--line-strong);
  color: var(--muted);
  font-size: 18px;
  max-width: 760px;
  padding-left: 16px;
}

.layout {
  margin: 0 auto;
  max-width: 1220px;
  padding: 30px clamp(18px, 4vw, 56px) 64px;
}

.search-panel,
.tool-panel,
.editor-form,
.notice,
.internal-page {
  background: color-mix(in srgb, var(--panel), transparent 5%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 20px;
}

.search-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

input,
textarea {
  background: color-mix(in srgb, var(--paper), transparent 8%);
  border: 1px solid var(--line);
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.primary-button,
.secondary-button,
.danger-button,
.file-button {
  align-items: center;
  border: 1px solid var(--line);
  display: inline-flex;
  justify-content: center;
  min-height: 44px;
  padding: 9px 16px;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
  font-weight: 800;
}

.secondary-button,
.file-button {
  background: var(--panel-2);
  color: var(--text);
}

.danger-button {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger), var(--line) 45%);
  color: var(--danger);
}

.full {
  width: 100%;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.segmented label {
  align-items: center;
  background: color-mix(in srgb, var(--paper), transparent 22%);
  border: 1px solid var(--line);
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  min-height: 36px;
  min-width: 88px;
  padding: 4px 12px;
  white-space: nowrap;
}

.hint,
.muted,
.category-desc {
  color: var(--muted);
}

.hint {
  font-size: 13px;
  margin: 12px 0 0;
}

.section {
  margin-top: 38px;
}

.section-head {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
}

.section-head h2 {
  font-size: 27px;
  line-height: 1.2;
  margin-bottom: 0;
}

.quick-grid,
.link-grid {
  display: grid;
  gap: 12px;
}

.quick-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.link-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-card,
.link-card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel), transparent 10%), color-mix(in srgb, var(--paper), transparent 22%));
  border: 1px solid var(--line);
  display: block;
  min-height: 64px;
  padding: 14px 14px 13px;
  position: relative;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.quick-card::before,
.link-card::before {
  background: var(--line-strong);
  content: "";
  height: 2px;
  left: 14px;
  opacity: 0;
  position: absolute;
  right: 14px;
  top: 10px;
  transition: opacity 160ms ease;
}

.quick-card:hover,
.link-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(61, 43, 18, 0.1);
  transform: translateY(-2px);
}

.quick-card:hover::before,
.link-card:hover::before {
  opacity: 1;
}

.quick-card strong,
.link-card strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.45;
  padding-top: 4px;
  text-wrap: pretty;
}

.navigation-shell {
  align-items: start;
  display: grid;
  gap: 26px;
  grid-template-columns: 196px minmax(0, 1fr);
}

.category-tabs {
  align-self: start;
  background: color-mix(in srgb, var(--paper), transparent 30%);
  border: 1px solid var(--line);
  display: grid;
  gap: 0;
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 8px;
  position: sticky;
  top: 18px;
}

.category-tab {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.category-tab:last-child {
  border-bottom: 0;
}

.category-tab:hover,
.category-tab.active {
  color: var(--text);
}

.category-tab.active {
  background: var(--panel);
  box-shadow: inset 3px 0 0 var(--line-strong);
  font-weight: 800;
}

.category-list {
  display: grid;
  gap: 24px;
}

.category-block {
  scroll-margin-top: 18px;
}

.category-heading {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.category-heading h3 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 0;
}

.category-heading span {
  color: var(--accent);
}

.empty-state {
  border: 1px dashed var(--line);
  color: var(--muted);
  padding: 26px;
  text-align: center;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  padding: 20px clamp(18px, 4vw, 56px);
}

.admin-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: 300px 1fr;
  margin: 0 auto;
  max-width: 1220px;
  padding: 30px clamp(18px, 4vw, 56px) 64px;
}

.admin-lock {
  max-width: 620px;
}

.admin-lock-panel {
  padding: 24px;
}

.admin-lock-panel h2 {
  font-size: 28px;
  margin-bottom: 10px;
}

.admin-lock-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
  margin-top: 18px;
}

.admin-side {
  align-self: start;
  display: grid;
  gap: 16px;
  position: sticky;
  top: 18px;
}

.tool-panel,
.editor-form {
  padding: 18px;
}

.file-button {
  margin-bottom: 10px;
  position: relative;
  width: 100%;
}

.file-button input {
  border: 0;
  display: none;
  height: 1px;
  min-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.category-admin-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.category-admin-list button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 10px;
  text-align: left;
}

.category-admin-list button.active {
  background: var(--panel);
  border-color: var(--line-strong);
}

.category-admin-list span {
  color: var(--muted);
  font-size: 12px;
}

.editor-area {
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid label {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 6px;
}

.wide {
  grid-column: 1 / -1;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.item-editor-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.item-editor {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 12px;
}

.item-editor-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.compact-buttons {
  margin-top: 0;
}

.compact-buttons button {
  min-height: 32px;
  padding: 4px 8px;
}

.json-preview {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

.notice {
  padding: 18px;
}

.internal-page {
  padding: 26px;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.detail-list div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: 120px 1fr;
  padding-bottom: 14px;
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
}

.inline-action {
  width: auto;
}

.page-actions {
  align-items: center;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 18px;
}

.copy-status {
  min-height: 24px;
}

.law-content {
  color: var(--text);
  font-size: 18px;
  line-height: 1.95;
  margin-inline: auto;
  max-width: 880px;
  text-wrap: pretty;
}

.law-content p,
.law-content div {
  margin-bottom: 0.9em;
}

.law-content a {
  color: var(--accent);
}

.law-content h1,
.law-content h2,
.law-content h3,
.law-content h4 {
  border-bottom: 1px solid var(--line);
  line-height: 1.35;
  margin: 1.5em 0 0.75em;
  padding-bottom: 0.28em;
}

.law-content table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  width: 100%;
}

.law-content td,
.law-content th {
  border: 1px solid var(--line);
  padding: 8px;
}

@media (max-width: 980px) {
  .quick-grid,
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .navigation-shell {
    grid-template-columns: 158px minmax(0, 1fr);
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: static;
  }
}

@media (max-width: 640px) {
  .mast-bar,
  .section-head,
  .category-heading,
  .footer,
  .item-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .mast-links {
    flex-wrap: wrap;
  }

  .hero {
    margin-top: 48px;
  }

  h1 {
    font-size: 42px;
    word-break: break-word;
  }

  .search-row,
  .admin-lock-form,
  .quick-grid,
  .link-grid,
  .navigation-shell,
  .detail-list div,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .category-tabs {
    max-height: none;
    position: static;
  }

  .law-content {
    font-size: 17px;
  }
}

/* 首页参考图风格：暗色网格、左侧卷宗栏、右侧工作区 */
:where(.home-page, body:has(#categoryTabs)) {
  --bg: #0d0c0a;
  --paper: #12100d;
  --panel: #17130f;
  --panel-2: #1c1711;
  --text: #f4ecdc;
  --muted: #a79b88;
  --line: #34291c;
  --line-strong: #8a6a34;
  --accent: #d8ae61;
  --accent-2: #d8ae61;
  --shadow: none;
  background:
    linear-gradient(90deg, rgba(150, 117, 61, 0.12) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(0deg, rgba(150, 117, 61, 0.09) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(circle at 64% 0%, rgba(216, 174, 97, 0.08), transparent 28%),
    var(--bg);
  min-height: 100vh;
}

:where(.home-page, body:has(#categoryTabs))::before,
:where(.home-page, body:has(#categoryTabs))::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

:where(.home-page, body:has(#categoryTabs))::before {
  background:
    linear-gradient(90deg, transparent 0 44%, rgba(255, 255, 255, 0.028) 44% 45%, transparent 45% 100%),
    linear-gradient(90deg, transparent 0 54%, rgba(255, 255, 255, 0.024) 54% 55%, transparent 55% 100%),
    linear-gradient(0deg, transparent 0 28%, rgba(255, 255, 255, 0.024) 28% 29%, transparent 29% 100%),
    linear-gradient(0deg, transparent 0 36%, rgba(255, 255, 255, 0.02) 36% 37%, transparent 37% 100%);
}

:where(.home-page, body:has(#categoryTabs))::after {
  background: linear-gradient(90deg, rgba(13, 12, 10, 0.04), rgba(13, 12, 10, 0.56) 76%, rgba(13, 12, 10, 0.98));
}

:where(.home-page, body:has(#categoryTabs)) .mast {
  background: linear-gradient(90deg, rgba(18, 16, 13, 0.96), rgba(18, 16, 13, 0.72));
  border: 0;
  bottom: 0;
  left: clamp(20px, 7.4vw, 152px);
  padding: 26px 14px 40px 24px;
  position: fixed;
  top: 0;
  width: 322px;
  z-index: 5;
}

:where(.home-page, body:has(#categoryTabs)) .mast::before {
  background: #090908;
  content: "";
  left: 0;
  position: absolute;
  top: 36px;
  bottom: 98px;
  width: 25px;
}

:where(.home-page, body:has(#categoryTabs)) .mast::after {
  background: linear-gradient(180deg, rgba(216, 174, 97, 0.16), transparent 42%);
  content: "";
  left: 25px;
  opacity: 0.45;
  position: absolute;
  top: 100px;
  bottom: 82px;
  width: 1px;
}

:where(.home-page, body:has(#categoryTabs)) .mast-bar {
  display: block;
  max-width: none;
}

:where(.home-page, body:has(#categoryTabs)) .brand {
  display: none;
}

:where(.home-page, body:has(#categoryTabs)) .mast-links {
  display: flex;
  gap: 8px;
  position: fixed;
  right: clamp(22px, 30vw, 610px);
  top: 14px;
  z-index: 10;
}

:where(.home-page, body:has(#categoryTabs)) .mast-links a,
:where(.home-page, body:has(#categoryTabs)) .icon-button {
  background: rgba(18, 16, 13, 0.82);
  border-color: var(--line);
  color: var(--text);
  min-height: 34px;
  padding: 6px 12px;
}

:where(.home-page, body:has(#categoryTabs)) .hero {
  margin: 0 0 0 24px;
  max-width: none;
  position: relative;
  z-index: 1;
}

:where(.home-page, body:has(#categoryTabs)) h1 {
  color: var(--text);
  font-size: 48px;
  line-height: 1.08;
  margin: 0 0 10px;
  max-width: 280px;
  text-shadow: 0 0 24px rgba(244, 236, 220, 0.14);
}

:where(.home-page, body:has(#categoryTabs)) .hero-copy {
  border-left: 3px solid var(--accent);
  color: color-mix(in srgb, var(--muted), transparent 15%);
  font-size: 11px;
  line-height: 1.5;
  margin-bottom: 38px;
  max-width: 250px;
  padding-left: 9px;
}

:where(.home-page, body:has(#categoryTabs)) .layout {
  margin: 0;
  max-width: none;
  padding: 20px 0 80px;
  position: relative;
  width: min(820px, calc(100vw - clamp(20px, 7.4vw, 152px) - 390px));
  margin-left: calc(clamp(20px, 7.4vw, 152px) + 342px);
}

:where(.home-page, body:has(#categoryTabs)) .search-panel,
:where(.home-page, body:has(#categoryTabs)) .tool-panel,
:where(.home-page, body:has(#categoryTabs)) .editor-form,
:where(.home-page, body:has(#categoryTabs)) .notice,
:where(.home-page, body:has(#categoryTabs)) .internal-page {
  background: rgba(23, 19, 15, 0.92);
  border-color: var(--line);
  box-shadow: none;
}

:where(.home-page, body:has(#categoryTabs)) .search-panel {
  margin-bottom: 0;
  padding: 14px;
}

:where(.home-page, body:has(#categoryTabs)) .search-row {
  grid-template-columns: 1fr 58px;
}

:where(.home-page, body:has(#categoryTabs)) input,
:where(.home-page, body:has(#categoryTabs)) textarea {
  background: #0f0d0b;
  border-color: var(--line);
  color: var(--text);
  min-height: 34px;
  padding: 7px 10px;
}

:where(.home-page, body:has(#categoryTabs)) .primary-button {
  color: #17110a;
  min-height: 34px;
  padding: 6px 12px;
}

:where(.home-page, body:has(#categoryTabs)) .segmented {
  gap: 6px;
  margin-top: 10px;
}

:where(.home-page, body:has(#categoryTabs)) .segmented label {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
  font-size: 12px;
  min-height: 40px;
  min-width: 64px;
}

:where(.home-page, body:has(#categoryTabs)) .hint {
  color: color-mix(in srgb, var(--accent), var(--muted) 28%);
  font-size: 10px;
  margin-top: 9px;
}

:where(.home-page, body:has(#categoryTabs)) .section {
  margin-top: 0;
}

:where(.home-page, body:has(#categoryTabs)) .section-head {
  border: 0;
  margin: 0 0 8px;
  padding: 0;
}

:where(.home-page, body:has(#categoryTabs)) .section-head h2,
:where(.home-page, body:has(#categoryTabs)) .category-heading h3 {
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
}

:where(.home-page, body:has(#categoryTabs)) .quick-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

:where(.home-page, body:has(#categoryTabs)) .link-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

:where(.home-page, body:has(#categoryTabs)) .quick-grid,
:where(.home-page, body:has(#categoryTabs)) .link-grid {
  gap: 8px;
}

:where(.home-page, body:has(#categoryTabs)) .quick-card,
:where(.home-page, body:has(#categoryTabs)) .link-card {
  background: rgba(20, 17, 13, 0.76);
  border-color: var(--line);
  min-height: 34px;
  padding: 8px 12px;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

:where(.home-page, body:has(#categoryTabs)) .quick-card::before,
:where(.home-page, body:has(#categoryTabs)) .link-card::before {
  display: none;
}

:where(.home-page, body:has(#categoryTabs)) .quick-card:hover,
:where(.home-page, body:has(#categoryTabs)) .link-card:hover {
  background: rgba(30, 24, 17, 0.92);
  border-color: var(--line-strong);
  box-shadow: none;
  transform: translateY(-1px);
}

:where(.home-page, body:has(#categoryTabs)) .quick-card strong,
:where(.home-page, body:has(#categoryTabs)) .link-card strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  padding: 0;
  text-shadow: 1px 0 rgba(255, 0, 0, 0.32), -1px 0 rgba(0, 180, 255, 0.18);
}

:where(.home-page, body:has(#categoryTabs)) #quickTitle {
  margin-top: 2px;
}

:where(.home-page, body:has(#categoryTabs)) #navigation {
  margin-top: 24px;
}

:where(.home-page, body:has(#categoryTabs)) #navigation > .section-head {
  display: none;
}

:where(.home-page, body:has(#categoryTabs)) .category-list {
  display: block;
}

:where(.home-page, body:has(#categoryTabs)) .category-block {
  scroll-margin-top: 24px;
}

:where(.home-page, body:has(#categoryTabs)) .category-heading {
  margin-bottom: 12px;
}

:where(.home-page, body:has(#categoryTabs)) .category-tabs {
  background: rgba(18, 16, 13, 0.58);
  border: 1px solid var(--line);
  display: grid;
  gap: 0;
  margin-top: 38px;
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding: 14px 12px;
  position: static;
  width: 296px;
}

:where(.home-page, body:has(#categoryTabs)) .category-tab {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  font-size: 28px;
  justify-content: flex-start;
  min-height: 82px;
  padding: 12px 16px;
}

:where(.home-page, body:has(#categoryTabs)) .category-tab:last-child {
  border-bottom: 0;
}

:where(.home-page, body:has(#categoryTabs)) .category-tab.active {
  background: rgba(26, 21, 15, 0.8);
  box-shadow: inset 4px 0 0 var(--line-strong);
  color: var(--text);
  font-weight: 900;
}

:where(.home-page, body:has(#categoryTabs)) .footer {
  background: transparent;
  border: 0;
  bottom: 18px;
  color: var(--muted);
  font-size: 12px;
  left: 40px;
  padding: 0;
  position: fixed;
}

@media (max-width: 1180px) {
  :where(.home-page, body:has(#categoryTabs)) .mast {
    left: 18px;
    width: 322px;
  }

  :where(.home-page, body:has(#categoryTabs)) .layout {
    margin-left: 360px;
    width: calc(100vw - 386px);
  }

  :where(.home-page, body:has(#categoryTabs)) .mast-links {
    right: 20px;
  }
}

@media (max-width: 820px) {
  :where(.home-page, body:has(#categoryTabs)) .mast {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    left: 0;
    padding: 18px;
    position: relative;
    width: auto;
  }

  :where(.home-page, body:has(#categoryTabs)) .mast::before,
  :where(.home-page, body:has(#categoryTabs)) .mast::after {
    display: none;
  }

  :where(.home-page, body:has(#categoryTabs)) .mast-links {
    position: static;
    justify-content: flex-end;
    margin-bottom: 18px;
  }

  :where(.home-page, body:has(#categoryTabs)) h1 {
    font-size: 42px;
    max-width: none;
  }

  :where(.home-page, body:has(#categoryTabs)) .category-tabs {
    max-height: none;
    margin-top: 22px;
    width: auto;
  }

  :where(.home-page, body:has(#categoryTabs)) .category-tab {
    font-size: 22px;
    min-height: 58px;
  }

  :where(.home-page, body:has(#categoryTabs)) .layout {
    margin-left: 0;
    padding: 18px;
    width: auto;
  }

  :where(.home-page, body:has(#categoryTabs)) .quick-grid,
  :where(.home-page, body:has(#categoryTabs)) .link-grid {
    grid-template-columns: 1fr;
  }

  :where(.home-page, body:has(#categoryTabs)) .footer {
    position: static;
    padding: 16px 18px 24px;
  }
}

/* 首页字号增强层：保持当前框架，只放大阅读与点击尺寸 */
:where(.home-page, body:has(#categoryTabs)) h1 {
  font-size: 51px;
  max-width: none;
  white-space: nowrap;
}

:where(.home-page, body:has(#categoryTabs)) .hero-copy {
  font-size: 13px;
  max-width: 270px;
}

:where(.home-page, body:has(#categoryTabs)) .search-panel {
  padding: 16px;
}

:where(.home-page, body:has(#categoryTabs)) .search-row {
  grid-template-columns: 1fr 76px;
}

:where(.home-page, body:has(#categoryTabs)) input,
:where(.home-page, body:has(#categoryTabs)) textarea {
  font-size: 15px;
  min-height: 42px;
  padding: 9px 12px;
}

:where(.home-page, body:has(#categoryTabs)) .primary-button {
  font-size: 15px;
  min-height: 42px;
  padding: 8px 14px;
  white-space: nowrap;
}

:where(.home-page, body:has(#categoryTabs)) .segmented label {
  font-size: 14px;
  min-height: 46px;
  min-width: 78px;
}

:where(.home-page, body:has(#categoryTabs)) .hint {
  font-size: 12px;
}

:where(.home-page, body:has(#categoryTabs)) .section-head h2,
:where(.home-page, body:has(#categoryTabs)) .category-heading h3 {
  font-size: 26px;
}

:where(.home-page, body:has(#categoryTabs)) .quick-grid,
:where(.home-page, body:has(#categoryTabs)) .link-grid {
  gap: 10px;
}

:where(.home-page, body:has(#categoryTabs)) .quick-card,
:where(.home-page, body:has(#categoryTabs)) .link-card {
  min-height: 52px;
  padding: 12px 14px;
}

:where(.home-page, body:has(#categoryTabs)) .quick-card strong,
:where(.home-page, body:has(#categoryTabs)) .link-card strong {
  font-size: 16px;
  line-height: 1.35;
}

:where(.home-page, body:has(#categoryTabs)) .category-tab {
  font-size: 32px;
  min-height: 86px;
  padding: 12px 18px;
}

:where(.home-page, body:has(#categoryTabs)) .category-tabs {
  margin-top: 24px;
}

@media (max-width: 820px) {
  :where(.home-page, body:has(#categoryTabs)) h1 {
    font-size: 46px;
  }

  :where(.home-page, body:has(#categoryTabs)) .category-tab {
    font-size: 24px;
    min-height: 62px;
  }

  :where(.home-page, body:has(#categoryTabs)) .quick-card strong,
  :where(.home-page, body:has(#categoryTabs)) .link-card strong {
    font-size: 17px;
  }
}
