:root {
  color-scheme: light;
  --ink: #1f2428;
  --muted-ink: #5d6670;
  --line: #d9ded9;
  --paper: #fffdf7;
  --surface: #ffffff;
  --soft: #f2f5ef;
  --accent: #8f2f28;
  --accent-dark: #68201c;
  --gold: #b2863b;
  --green: #426d5a;
  --shadow: 0 14px 40px rgba(31, 36, 40, 0.12);
  /* 统一缓动曲线：自然减速，高级感（用于导航抽屉/卡片/按钮/链接） */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  /* 分层阴影：hover/抬升态更明显 */
  --shadow-hover: 0 20px 52px rgba(31, 36, 40, 0.16);
  --shadow-press: 0 6px 18px rgba(31, 36, 40, 0.14);
  --header-h: 56px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(31, 36, 40, 0.1);
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1160px;
  min-height: 56px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 18px;
}

.brand {
  font-weight: 800;
  text-decoration: none;
  color: var(--accent-dark);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted-ink);
  font-size: 16px;
}

.nav-links a {
  text-decoration: none;
}

.nav-user {
  border-radius: 999px;
  background: #edf3ed;
  color: var(--green);
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 900;
}

  .link-button {
    border: 0;
    background: transparent;
    color: var(--muted-ink);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    padding: 0;
  }

  /* === 汉堡菜单（手机端导航）=== */
  .nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    margin: 0 auto;
    background: var(--accent-dark, #2f3430);
    border-radius: 2px;
    transition: transform .3s ease, opacity .3s ease;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  @media (max-width: 768px) {
    .nav-toggle {
      display: flex;
    }
    .site-header .nav {
      position: relative;
    }
    .nav-links {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      margin: 0;
      padding: 0 20px;
      background: rgba(255, 253, 247, 0.98);
      backdrop-filter: blur(12px);
      border-bottom: 1px solid rgba(31, 36, 40, 0.12);
      box-shadow: 0 14px 28px rgba(0, 0, 0, 0.1);
      max-height: 0;
      overflow: hidden;
      opacity: 0;
      transform: translateY(-8px);
      pointer-events: none;
      transition: max-height .34s var(--ease), opacity .26s var(--ease),
        transform .34s var(--ease);
    }
    .nav-links.open {
      max-height: 460px;
      opacity: 1;
      transform: translateY(0);
      pointer-events: auto;
    }
    .nav-links a {
      padding: 14px 4px;
      min-height: 44px;
      display: flex;
      align-items: center;
      font-size: 15px;
      border-bottom: 1px solid rgba(31, 36, 40, 0.06);
    }
    .nav-links a:last-child {
      border-bottom: 0;
    }
  }

.hero {
  position: relative;
  min-height: 58vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  background: #2f3430;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 18, 16, 0.82), rgba(20, 18, 16, 0.42), rgba(20, 18, 16, 0.08)),
    url("/hero.svg") center / cover no-repeat;
}

.hero-content {
  position: relative;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
  padding: 84px 20px 56px;
  color: #fffdf7;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(36px, 5.2vw, 64px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  margin: 16px 0 0;
  color: rgba(255, 253, 247, 0.86);
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 20px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: white;
}

.button.secondary {
  border-color: rgba(143, 47, 40, 0.25);
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent-dark);
}

.section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 52px 20px;
}

.page-hero {
  max-width: 1160px;
  margin: 0 auto;
  padding: 52px 20px 26px;
}

.page-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: 38px;
  line-height: 1.16;
  letter-spacing: 0;
}

.page-hero p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted-ink);
  font-size: 17px;
}

.section.muted {
  max-width: none;
  background: var(--soft);
}

.section.muted > * {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2,
.admin-top h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow),
.admin-top p {
  max-width: 720px;
  color: var(--muted-ink);
}

.notice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.notice-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.notice-grid h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
}

.notice-grid p {
  margin: 0;
  color: var(--muted-ink);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.module-card {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.module-card span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.module-card h3 {
  margin: 8px 0 6px;
  color: var(--accent-dark);
  font-size: 20px;
}

.module-card p {
  margin: 0;
  color: var(--muted-ink);
}

.culture-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.culture-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.culture-grid span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.culture-grid h3 {
  margin: 6px 0 8px;
  color: var(--accent-dark);
}

.culture-grid p {
  margin: 0;
  color: var(--muted-ink);
}

.page-actions {
  margin-top: 18px;
}

.ancestor-hero h1 {
  max-width: 900px;
}

.promo-hero h1 {
  max-width: 760px;
}

.promo-lead {
  max-width: 920px;
  margin: 0 auto 24px;
  border-left: 4px solid var(--gold);
  background: #fff8e9;
  padding: 18px 20px;
}

.promo-lead p {
  margin: 0;
  color: #59452a;
  font-size: 18px;
}

.promo-lead p + p {
  margin-top: 12px;
}

.promo-highlights {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.promo-highlights article,
.promo-side,
.proof-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.promo-highlights article {
  padding: 18px;
}

.promo-highlights strong,
.promo-highlights span,
.promo-side strong,
.promo-side span {
  display: block;
}

.promo-highlights strong,
.promo-side strong {
  color: var(--accent-dark);
  font-size: 18px;
}

.promo-highlights span,
.promo-side span {
  margin-top: 6px;
  color: var(--muted-ink);
}

.promo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
}

.promo-article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 30px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.promo-article h2 {
  margin: 0 0 22px;
  color: var(--accent-dark);
  font-size: 32px;
  line-height: 1.25;
}

.promo-article h3 {
  margin: 28px 0 10px;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.3;
}

.promo-article p {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.promo-article p + p {
  margin-top: 12px;
}

.promo-side {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 0;
  padding: 4px 18px;
}

.promo-side div {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.promo-side div:last-child {
  border-bottom: 0;
}

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

.proof-card {
  padding: 22px;
}

.proof-card h2 {
  margin: 0 0 10px;
  color: var(--accent-dark);
  font-size: 24px;
  line-height: 1.25;
}

.proof-card p:not(.eyebrow) {
  margin: 0;
  color: var(--muted-ink);
}

.ancestor-topic {
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.95), rgba(255, 253, 247, 0.98)),
    radial-gradient(circle at top left, rgba(178, 134, 59, 0.14), transparent 34%);
}

.report-hero {
  background:
    linear-gradient(135deg, rgba(255, 248, 233, 0.92), rgba(242, 245, 239, 0.96)),
    repeating-linear-gradient(90deg, rgba(104, 32, 28, 0.05) 0 1px, transparent 1px 58px);
}

.report-hero-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  max-width: 860px;
  margin-top: 22px;
}

.report-hero-strip span {
  border: 1px solid rgba(143, 47, 40, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  color: var(--muted-ink);
}

.report-hero-strip strong {
  display: block;
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1.1;
}

.report-mindmap {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mindmap-center,
.mindmap-node,
.profile-card-main,
.profile-facts,
.lineage-step,
.kinship-panel,
.career-stage,
.evidence-card,
.branch-root,
.branch-route article,
.descendant-strip,
.heritage-wall article,
.genealogy-versions,
.pending-board,
.source-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.mindmap-center {
  grid-column: span 2;
  display: grid;
  align-content: center;
  min-height: 156px;
  border-color: rgba(143, 47, 40, 0.25);
  background: linear-gradient(135deg, #fff8e9, #ffffff);
  padding: 22px;
}

.mindmap-center span,
.branch-root span,
.career-stage span,
.evidence-card span,
.heritage-wall span,
.branch-route span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.mindmap-center strong {
  color: var(--accent-dark);
  font-size: 34px;
  line-height: 1.15;
}

.mindmap-center em,
.branch-root em {
  color: var(--muted-ink);
  font-style: normal;
}

.mindmap-node {
  position: relative;
  min-height: 118px;
  padding: 18px;
}

.mindmap-node::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -15px;
  width: 15px;
  border-top: 2px solid rgba(178, 134, 59, 0.35);
}

.mindmap-node strong {
  display: block;
  color: var(--accent-dark);
  font-size: 18px;
}

.mindmap-node span {
  display: block;
  margin-top: 8px;
  color: var(--muted-ink);
}

.profile-board {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.profile-card-main {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  align-items: center;
  padding: 24px;
}

.ancestor-seal {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 8px double rgba(143, 47, 40, 0.72);
  border-radius: 50%;
  color: var(--accent-dark);
  font-size: 28px;
  font-weight: 900;
  writing-mode: vertical-rl;
  letter-spacing: 0;
}

.profile-card-main h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 28px;
}

.profile-card-main p:not(.eyebrow),
.profile-facts span,
.kinship-panel span,
.career-stage p,
.evidence-card p,
.branch-route p,
.descendant-strip span,
.heritage-wall p,
.pending-board span,
.source-board strong {
  color: var(--muted-ink);
}

.profile-facts {
  display: grid;
  padding: 4px 18px;
}

.profile-facts div,
.kinship-panel div,
.pending-board div,
.source-board div {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.profile-facts div:last-child,
.kinship-panel div:last-child,
.pending-board div:last-child,
.source-board div:last-child {
  border-bottom: 0;
}

.profile-facts strong,
.kinship-panel strong,
.pending-board strong {
  display: block;
  color: var(--accent-dark);
}

.lineage-visual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 16px;
}

.lineage-chain {
  display: grid;
  gap: 18px;
}

.lineage-step {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 16px;
  padding: 18px;
}

.lineage-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 92px;
  bottom: -19px;
  height: 19px;
  border-left: 3px solid rgba(178, 134, 59, 0.45);
}

.lineage-step strong {
  color: var(--accent-dark);
  font-size: 24px;
}

.lineage-step.featured {
  border-color: rgba(143, 47, 40, 0.25);
  background: #fff8e9;
}

.kinship-panel {
  display: grid;
  padding: 4px 18px;
}

.career-river {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.career-stage {
  position: relative;
  padding: 18px;
}

.career-stage:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 34px;
  right: -15px;
  width: 15px;
  border-top: 3px solid rgba(178, 134, 59, 0.45);
}

.career-stage strong {
  display: block;
  margin: 7px 0 8px;
  color: var(--accent-dark);
  font-size: 26px;
}

.career-stage p,
.evidence-card p,
.branch-route p,
.heritage-wall p {
  margin: 0;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.evidence-card {
  padding: 18px;
}

.evidence-card.tall {
  grid-column: span 2;
}

.evidence-card h3,
.branch-route h3,
.heritage-wall h3,
.pending-board h3,
.source-board h3 {
  margin: 7px 0 8px;
  color: var(--accent-dark);
  font-size: 21px;
  line-height: 1.25;
}

.evidence-card blockquote {
  margin: 10px 0 12px;
  border-left: 4px solid var(--gold);
  padding-left: 12px;
  color: #5f4a25;
  font-weight: 800;
}

.branch-map {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.branch-root {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 220px;
  padding: 22px;
  background: #fff8e9;
}

.branch-root::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -19px;
  width: 19px;
  border-top: 3px solid rgba(178, 134, 59, 0.45);
}

.branch-root strong {
  color: var(--accent-dark);
  font-size: 30px;
}

.branch-route {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.branch-route article {
  padding: 18px;
}

.descendant-strip {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
}

.descendant-strip strong {
  color: var(--accent-dark);
}

.heritage-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.heritage-wall article {
  padding: 18px;
}

.generation-line {
  color: var(--accent-dark) !important;
  font-weight: 900;
}

.genealogy-versions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
}

.genealogy-versions div {
  border-right: 1px solid var(--line);
  padding: 4px 10px;
}

.genealogy-versions div:last-child {
  border-right: 0;
}

.genealogy-versions strong {
  display: block;
  color: var(--accent-dark);
  font-size: 22px;
}

.genealogy-versions span {
  color: var(--muted-ink);
}

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

.pending-board,
.source-board {
  padding: 6px 20px 10px;
}

.source-board span {
  display: block;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.source-board strong {
  display: block;
  font-size: 15px;
}

.md-promo-page {
  display: grid;
  grid-template-columns: 260px minmax(0, 900px);
  gap: 22px;
  align-items: start;
  max-width: 1220px;
  margin: 0 auto;
  padding: 34px 20px 54px;
}

.md-report-toc {
  position: sticky;
  top: 76px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.md-report-toc strong {
  display: block;
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1.25;
}

.md-report-switcher {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.md-report-switcher a {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfa;
  color: var(--muted-ink);
  padding: 8px 10px;
  text-decoration: none;
  font-weight: 800;
}

.md-report-switcher a.active {
  border-color: rgba(143, 47, 40, 0.26);
  background: #fff8e9;
  color: var(--accent-dark);
}

.md-report-toc nav {
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 170px);
  margin-top: 12px;
  overflow-y: auto;
}

.md-report-toc a {
  border-left: 3px solid transparent;
  color: var(--muted-ink);
  padding: 4px 0 4px 9px;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
}

.md-report-toc a:hover {
  border-color: var(--gold);
  color: var(--accent-dark);
}

.md-report-toc .level-3 {
  margin-left: 12px;
  font-size: 13px;
}

.md-report-toc .level-4 {
  margin-left: 24px;
  color: #74806f;
  font-size: 12px;
}

.md-report {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 34px;
  box-shadow: var(--shadow);
}

.md-report h1 {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 42px;
  line-height: 1.12;
}

.md-report h1::after {
  content: "原文宣传版";
  display: inline-flex;
  margin-left: 10px;
  border-radius: 999px;
  background: #fff8e9;
  color: var(--gold);
  padding: 5px 9px;
  font-size: 13px;
  vertical-align: middle;
}

.md-report h2 {
  margin: 34px 0 14px;
  border-top: 2px solid rgba(178, 134, 59, 0.32);
  padding-top: 22px;
  color: var(--accent-dark);
  font-size: 28px;
  line-height: 1.22;
}

.md-report h3 {
  margin: 24px 0 10px;
  color: var(--green);
  font-size: 22px;
  line-height: 1.25;
}

.md-report h4 {
  display: inline-flex;
  margin: 18px 0 10px;
  border: 1px solid rgba(178, 134, 59, 0.26);
  border-radius: 999px;
  background: #fff8e9;
  color: var(--accent-dark);
  padding: 6px 12px;
  font-size: 16px;
  line-height: 1.35;
}

.md-report p {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 16px;
}

.md-report > p:first-of-type {
  border-left: 4px solid var(--gold);
  background: #fff8e9;
  color: #5f4a25;
  padding: 12px 14px;
}

.md-report strong {
  color: var(--accent-dark);
}

.md-report hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.md-report blockquote {
  margin: 14px 0;
  border: 1px solid rgba(178, 134, 59, 0.28);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background: #fff8e9;
  color: #5f4a25;
  padding: 16px 18px;
  font-weight: 800;
}

.md-report ul,
.md-report ol {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
  padding-left: 22px;
}

.md-report li {
  color: var(--muted-ink);
}

.md-table-wrap {
  max-width: 100%;
  min-width: 0;
  margin: 14px 0 20px;
  overflow-x: auto;
}

.md-table-wrap table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.md-table-wrap th,
.md-table-wrap td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.md-table-wrap th:last-child,
.md-table-wrap td:last-child {
  border-right: 0;
}

.md-table-wrap tr:last-child td {
  border-bottom: 0;
}

.md-table-wrap th {
  background: #f2f5ef;
  color: var(--accent-dark);
  font-weight: 900;
}

.md-table-wrap td {
  color: var(--muted-ink);
}

.md-code {
  max-width: 100%;
  min-width: 0;
  margin: 14px 0 20px;
  overflow-x: auto;
  border: 1px solid rgba(66, 109, 90, 0.24);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--ink);
  padding: 16px;
  line-height: 1.55;
}

.md-code code {
  font-family: Consolas, "Microsoft YaHei", monospace;
  white-space: pre;
}

.md-code.visual-code {
  background:
    linear-gradient(90deg, rgba(178, 134, 59, 0.12), transparent 1px),
    #fbfcfa;
  background-size: 42px 100%;
}

.ancestor-profile {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.ancestor-profile-main,
.ancestor-fact-list,
.branch-grid article,
.source-grid article,
.pending-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.ancestor-profile-main {
  padding: 22px;
}

.ancestor-profile-main h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 28px;
  line-height: 1.22;
}

.ancestor-profile-main p:not(.eyebrow) {
  color: var(--muted-ink);
}

.ancestor-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.ancestor-badges span {
  border-radius: 999px;
  background: #edf3ed;
  color: var(--green);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 900;
}

.ancestor-fact-list {
  display: grid;
  gap: 0;
  padding: 4px 18px;
}

.ancestor-fact-list div {
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.ancestor-fact-list div:last-child {
  border-bottom: 0;
}

.ancestor-fact-list strong,
.ancestor-fact-list span {
  display: block;
}

.ancestor-fact-list strong {
  color: var(--accent-dark);
}

.ancestor-fact-list span {
  color: var(--muted-ink);
}

.ancestor-timeline div {
  grid-template-columns: 110px 1fr;
}

.branch-grid,
.source-grid,
.pending-grid,
.topic-columns,
.research-columns {
  display: grid;
  gap: 14px;
}

.branch-grid,
.source-grid,
.topic-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pending-grid,
.research-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.branch-grid article,
.source-grid article,
.pending-grid div,
.topic-columns article,
.research-columns article {
  padding: 18px;
}

.topic-columns article,
.research-columns article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.branch-grid span,
.topic-columns span,
.research-columns span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.branch-grid h3,
.source-grid h3,
.topic-columns h3,
.research-columns h3 {
  margin: 7px 0 8px;
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1.25;
}

.branch-grid p,
.source-grid p,
.topic-columns p,
.research-columns p,
.pending-grid span {
  margin: 0;
  color: var(--muted-ink);
}

.pending-grid strong {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
}

.process {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.process div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.process strong {
  color: var(--accent-dark);
}

.process span {
  color: var(--muted-ink);
}

.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(143, 47, 40, 0.18);
  border-radius: 8px;
  background: #fff8e9;
  padding: 18px;
}

.callout p {
  margin: 0;
  color: #5f4a25;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.14fr);
  gap: 34px;
  align-items: center;
}

.split-copy h2 {
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 1.25;
}

.split-copy p:not(.eyebrow) {
  color: var(--muted-ink);
}

.lineage-figure {
  margin: 0;
}

.lineage-figure img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lineage-figure figcaption {
  margin-top: 10px;
  color: var(--muted-ink);
  font-size: 13px;
}

.lineage-source-section {
  align-items: start;
}

.lineage-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.lineage-notes-grid article,
.lineage-text-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.lineage-notes-grid span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.lineage-notes-grid h3,
.lineage-text-panel h3 {
  margin: 6px 0 8px;
  color: var(--accent-dark);
}

.lineage-notes-grid p {
  margin: 0;
  color: var(--muted-ink);
}

.lineage-text-panel {
  margin-top: 14px;
}

.lineage-plain-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding-left: 22px;
}

.tree-scroll {
  overflow-x: auto;
  padding: 6px 0 12px;
}

.tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 10px;
  color: var(--muted-ink);
  font-size: 13px;
}

.tree-toolbar .button {
  width: auto;
  min-height: 34px;
  padding: 7px 12px;
  font-size: 13px;
}

.family-tree {
  min-width: 980px;
  display: block;
  text-align: center;
}

.tree-node,
.room {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  color: var(--accent-dark);
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.05);
  position: relative;
  z-index: 1;
}

.tree-node strong {
  display: block;
}

.tree-node small,
.room small {
  display: block;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 700;
}

.tree-node.root {
  width: 190px;
  margin: 0 auto;
  background: #fff8e9;
  border-color: rgba(178, 134, 59, 0.45);
  font-size: 22px;
}

.tree-node.major {
  width: 160px;
  margin: 0 auto;
  background: #edf3ed;
  color: var(--green);
}

.muted-node {
  color: var(--muted-ink);
}

.tree-branches {
  display: grid;
  gap: 22px;
}

.tree-branches.two {
  grid-template-columns: 1.25fr 1fr;
}

.tree-branch {
  display: grid;
  gap: 14px;
}

.tree-children {
  display: grid;
  gap: 12px;
  align-items: start;
}

.tree-children.three {
  grid-template-columns: 0.8fr 1fr 1.4fr;
}

.tree-children.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tree-group {
  display: grid;
  gap: 8px;
  align-content: start;
}

.tree-row,
.room-grid {
  display: grid;
  gap: 8px;
}

.tree-row {
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
}

.tree-node.leaf {
  color: var(--ink);
  font-weight: 800;
}

.ten-rooms {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.room-grid {
  grid-template-columns: repeat(10, minmax(86px, 1fr));
}

.dynamic-family-tree {
  width: max-content;
  min-width: 100%;
  padding: 10px 0 4px;
}

.dynamic-tree-group {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  min-width: 132px;
  padding-top: 0;
}

.dynamic-tree-children {
  --tree-gap: 14px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: var(--tree-gap);
  margin-top: 24px;
  padding-top: 24px;
  width: max-content;
}

.dynamic-tree-group.has-children > .tree-node::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -25px;
  width: 1px;
  height: 24px;
  background: var(--line);
}

.dynamic-tree-children > .dynamic-tree-group::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 50%;
  width: 1px;
  height: 24px;
  background: var(--line);
}

.dynamic-tree-children > .dynamic-tree-group::after {
  content: "";
  position: absolute;
  top: -24px;
  left: calc(var(--tree-gap) / -2);
  right: calc(var(--tree-gap) / -2);
  height: 1px;
  background: var(--line);
}

.dynamic-tree-children > .dynamic-tree-group:first-child::after {
  left: 50%;
}

.dynamic-tree-children > .dynamic-tree-group:last-child::after {
  right: 50%;
}

.dynamic-tree-children.single > .dynamic-tree-group::after {
  display: none;
}

.dynamic-tree-children.many {
  --tree-gap: 10px;
}

.tree-node-note {
  display: block;
  margin-top: 6px;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.tree-node em {
  display: inline-flex;
  justify-content: center;
  margin-top: 6px;
  border-radius: 999px;
  background: #fff8e9;
  color: #7b5a21;
  padding: 2px 7px;
  font-size: 11px;
  font-style: normal;
}

.tree-node.room-node {
  color: var(--ink);
  width: 118px;
  padding: 9px 8px;
  font-size: 14px;
}

.lineage-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.lineage-outline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  margin-bottom: 14px;
  padding: 14px;
}

.outline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.outline-stats span {
  border: 1px solid rgba(178, 134, 59, 0.25);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-dark);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.lineage-outline ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 7px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 260px;
  overflow: auto;
}

.lineage-outline li {
  border-left: 2px solid rgba(178, 134, 59, 0.35);
  padding-left: calc(8px + var(--level-indent, 0px));
  min-height: 28px;
}

.lineage-outline li button {
  display: inline-block;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  font-weight: 900;
  padding: 0;
  text-align: left;
}

.lineage-outline li button:hover,
.lineage-outline li button:focus {
  color: var(--accent);
  text-decoration: underline;
}

.lineage-outline li small {
  display: block;
  color: var(--muted-ink);
  font-size: 12px;
}

.lineage-node-cards {
  display: none;
}

.lineage-node-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.05);
}

.lineage-node-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.lineage-node-card h3 {
  margin: 6px 0 2px;
  color: var(--accent-dark);
  font-size: 18px;
}

.lineage-node-card p {
  margin: 0;
  color: var(--muted-ink);
  font-size: 12px;
}

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

.lineage-card-grid label span,
.compact-check span {
  display: block;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 4px;
}

.compact-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.compact-check span {
  margin: 0;
}

.compact-check input {
  width: 18px;
  height: 18px;
}

.lineage-node-card .table-actions {
  margin-top: 12px;
}

.lineage-editor-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.lineage-editor-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

.lineage-editor-table th,
.lineage-editor-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  vertical-align: top;
}

.lineage-editor-table th {
  color: var(--accent-dark);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.lineage-editor-table td {
  min-width: 120px;
}

.lineage-editor-table td:first-child {
  min-width: 210px;
}

.lineage-level-cell small {
  display: block;
  max-width: 240px;
  color: var(--muted-ink);
  font-size: 12px;
  line-height: 1.45;
}

.level-badge {
  display: inline-flex;
  border-radius: 999px;
  background: #edf3ed;
  color: var(--green);
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}

.lineage-name-cell {
  min-width: 180px;
}

.lineage-name-cell .tree-prefix {
  display: inline-block;
  width: calc(24px + var(--level-indent, 0px));
  color: var(--gold);
  font-weight: 900;
}

.lineage-name-cell input {
  width: calc(100% - 30px - var(--level-indent, 0px));
  min-width: 98px;
}

.lineage-editor-table tr.row-highlight td {
  animation: rowPulse 1.6s ease;
}

.lineage-node-card.row-highlight {
  animation: rowPulse 1.6s ease;
}

.button.dirty {
  box-shadow: 0 0 0 3px rgba(178, 134, 59, 0.18);
}

@keyframes rowPulse {
  0% {
    background: #fff3cf;
  }
  100% {
    background: transparent;
  }
}

.depth-row-1 {
  background: #fffdf7;
}

.depth-row-2,
.depth-row-3,
.depth-row-4 {
  background: #fcfaf4;
}

.lineage-editor-table textarea {
  min-height: 58px;
}

.check-cell {
  text-align: center;
}

.check-cell input {
  width: 18px;
  height: 18px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.button.danger {
  border-color: rgba(143, 47, 40, 0.25);
  color: var(--accent);
}

.announcement {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 24px;
}

.announcement > p {
  margin: 0 0 20px;
  color: var(--muted-ink);
}

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

.announcement-grid div,
.principles div {
  border-left: 3px solid var(--gold);
  background: #fffaf0;
  padding: 14px;
}

.announcement-grid strong,
.principles strong {
  display: block;
  color: var(--accent-dark);
  margin-bottom: 6px;
}

.announcement-grid span,
.principles span {
  color: var(--muted-ink);
  font-size: 14px;
}

.notice-actions {
  margin-top: 18px;
}

.collect-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.search-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.search-grid h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
}

.search-grid p {
  margin: 0;
  color: var(--muted-ink);
}

.collect-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.collect-list h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
}

.collect-list p {
  margin: 0;
  color: var(--muted-ink);
}

.collect-start-section {
  padding-top: 16px;
}

.collect-start-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.share-copy-box,
.collect-rules article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.05);
}

.share-copy-box {
  display: grid;
  gap: 12px;
}

.share-copy-box textarea {
  min-height: 190px;
  background: #fffdf7;
  font-size: 14px;
  line-height: 1.55;
}

.collect-rules {
  display: grid;
  gap: 10px;
}

.collect-rules article span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.collect-rules article strong {
  display: block;
  color: var(--accent-dark);
  margin-top: 6px;
  font-size: 17px;
  line-height: 1.25;
}

.collect-rules article p {
  margin: 6px 0 0;
  color: var(--muted-ink);
  font-size: 14px;
}

.offline-sheet {
  width: min(980px, calc(100vw - 28px));
  margin: 24px auto 42px;
  border: 1px solid #2f3430;
  background: #fff;
  color: #171917;
  padding: 24px;
}

.offline-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 2px solid #171917;
  padding-bottom: 14px;
}

.offline-sheet-head p {
  margin: 0;
  font-weight: 900;
  letter-spacing: 0;
}

.offline-sheet-head h1 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.2;
}

.offline-code {
  min-width: 130px;
  border: 1px solid #171917;
  padding: 10px;
  text-align: center;
}

.offline-code span,
.offline-code strong {
  display: block;
}

.offline-code strong {
  margin-top: 8px;
  font-size: 18px;
}

.offline-note,
.photo-rules {
  border: 1px solid #9aa19a;
  background: #f8f8f4;
  margin-top: 14px;
  padding: 10px;
  font-size: 14px;
  line-height: 1.55;
}

.offline-block {
  margin-top: 16px;
}

.offline-block h2 {
  margin: 0 0 8px;
  border-left: 4px solid #171917;
  padding-left: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.paper-grid {
  display: grid;
  border-top: 1px solid #171917;
  border-left: 1px solid #171917;
}

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

.paper-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.paper-grid label,
.signature-row label {
  display: grid;
  grid-template-columns: 88px 1fr;
  min-height: 42px;
  border-right: 1px solid #171917;
  border-bottom: 1px solid #171917;
  color: #171917;
  font-size: 14px;
}

.paper-grid label span,
.signature-row label span {
  border-right: 1px solid #171917;
  background: #f3f3ee;
  padding: 10px 8px;
  font-weight: 900;
}

.paper-grid label em,
.signature-row label em {
  display: block;
  min-height: 40px;
}

.paper-lines {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.paper-lines label {
  display: grid;
  gap: 7px;
  color: #171917;
  font-size: 14px;
}

.paper-lines span {
  font-weight: 900;
}

.paper-lines em {
  display: block;
  height: 20px;
  border-bottom: 1px solid #171917;
}

.paper-lines.tall em {
  height: 24px;
}

.paper-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  border: 1px solid #171917;
  padding: 10px;
  color: #171917;
  font-size: 14px;
}

.paper-checks span {
  font-weight: 900;
}

.paper-checks.stack {
  display: grid;
  gap: 8px;
}

.signature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid #171917;
  border-left: 1px solid #171917;
  margin-top: 12px;
}

.public-stats {
  max-width: 680px;
}

.public-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 220px;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin: 16px 0 8px;
  padding: 14px;
}

.public-filter-bar .result-summary {
  grid-column: 1 / -1;
  margin: 0;
}

.public-list {
  display: grid;
  gap: 14px;
}

.public-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 14px;
}

.public-section-head h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 24px;
  line-height: 1.25;
}

.public-section-head p:not(.eyebrow) {
  max-width: 520px;
  margin: 0;
  color: var(--muted-ink);
  font-size: 14px;
}

.public-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.lead-public-card {
  border-left: 4px solid var(--green);
}

.public-note {
  border-radius: 8px;
  background: #f4f5f2;
  color: var(--muted-ink);
  margin: -4px 0 14px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 800;
}

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

.public-card-head span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.public-card-head h2 {
  margin: 3px 0 0;
  color: var(--accent-dark);
  font-size: 24px;
  line-height: 1.25;
}

.public-card-head strong {
  border-radius: 999px;
  background: #eef3ed;
  color: var(--green);
  padding: 5px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.public-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
}

.workstation-head {
  padding-bottom: 24px;
}

.workstation-head h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.form-section {
  padding-top: 36px;
}

.form {
  display: grid;
  gap: 14px;
}

.compact-form {
  margin-bottom: 28px;
}

.quality-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.05);
}

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

.quality-head span,
.quality-head em {
  color: var(--muted-ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.quality-head strong {
  display: block;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.1;
}

.quality-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4f5f2;
}

.quality-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.quality-panel ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.quality-panel li {
  border-left: 3px solid #d9ded9;
  padding-left: 8px;
}

.quality-panel li.ok {
  border-left-color: var(--green);
}

.quality-panel li strong {
  display: block;
  color: var(--accent-dark);
  font-size: 13px;
}

.quality-panel li span {
  display: block;
  color: var(--muted-ink);
  font-size: 12px;
  line-height: 1.45;
}

fieldset {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

legend {
  padding: 0 8px;
  color: var(--accent-dark);
  font-weight: 900;
}

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

.public-field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted-ink);
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd7d0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 9px 10px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(178, 134, 59, 0.35);
  border-color: var(--gold);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.file-box {
  min-height: 96px;
  align-items: center;
  justify-content: center;
  border: 1px dashed #aebaae;
  border-radius: 8px;
  background: #fbfcfa;
  padding: 18px;
  text-align: center;
}

.help-text {
  margin: 10px 0 0;
  color: var(--muted-ink);
  font-size: 14px;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.file-pill {
  border-radius: 999px;
  background: #edf3ed;
  padding: 6px 10px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.privacy-box {
  border-left: 4px solid var(--gold);
  background: #fff8e9;
  padding: 14px 16px;
  color: #5f4a25;
}

.privacy-box p {
  margin: 0 0 6px;
}

.privacy-box p:last-child {
  margin-bottom: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.form-message {
  margin: 0;
  color: var(--green);
  font-weight: 800;
}

.form-message.error {
  color: var(--accent);
}

.form-message a {
  color: var(--accent-dark);
  font-weight: 900;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.timeline strong {
  color: var(--accent-dark);
}

.timeline span {
  color: var(--muted-ink);
}

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 24px;
  color: var(--muted-ink);
  text-align: center;
}

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(20, 18, 16, 0.72), rgba(20, 18, 16, 0.25)),
    url("/hero.svg") center / cover no-repeat;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  align-items: center;
  justify-content: end;
  padding: 32px;
}

.login-panel {
  width: min(440px, calc(100vw - 40px));
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
  padding: 34px;
}

.login-panel h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
}

.login-panel p {
  color: var(--muted-ink);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.admin-main {
  background: var(--soft);
  min-height: calc(100vh - 64px);
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.dashboard-stats {
  margin-bottom: 22px;
}

.health-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  margin-bottom: 22px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.05);
}

.health-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.health-panel-head h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.25;
}

.health-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.health-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  padding: 12px;
}

.health-stat strong {
  display: block;
  color: var(--accent-dark);
  font-size: 24px;
  line-height: 1.1;
}

.health-stat span,
.health-stat em {
  display: block;
  color: var(--muted-ink);
  font-size: 12px;
  font-style: normal;
}

.health-warning-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.health-warning-list p {
  border-radius: 8px;
  margin: 0;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 800;
}

.health-warning-list .ok {
  background: #edf3ed;
  color: var(--green);
}

.health-warning-list .warning {
  background: #fff8e9;
  color: #7b5a21;
}

.health-warning-list .info {
  background: #f4f5f2;
  color: var(--muted-ink);
}

.health-files {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.health-files div {
  display: grid;
  gap: 2px;
}

.health-files strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.health-files span {
  color: var(--muted-ink);
  font-size: 12px;
}

.audit-list {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 12px;
}

.audit-list h3 {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 16px;
}

.audit-list div {
  display: grid;
  grid-template-columns: 150px 150px 1fr;
  gap: 10px;
  border-bottom: 1px solid rgba(217, 222, 217, 0.65);
  padding: 8px 0;
}

.audit-list div:last-child {
  border-bottom: 0;
}

.audit-list strong {
  color: var(--accent-dark);
  font-size: 13px;
}

.audit-list span,
.audit-list p {
  margin: 0;
  color: var(--muted-ink);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 30px;
}

.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.dashboard-card span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.dashboard-card h2 {
  margin: 8px 0 6px;
  color: var(--accent-dark);
  font-size: 21px;
  line-height: 1.25;
}

.dashboard-card p {
  margin: 0;
  color: var(--muted-ink);
}

.work-queue {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.queue-list {
  display: grid;
  gap: 10px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 0.34fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  color: inherit;
  text-decoration: none;
}

.queue-item strong {
  color: var(--accent-dark);
}

.queue-item span {
  color: var(--muted-ink);
}

.queue-item em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #edf3ed;
  color: var(--green);
  font-style: normal;
  font-weight: 900;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.stat strong {
  display: block;
  color: var(--accent-dark);
  font-size: 24px;
}

.stat span {
  color: var(--muted-ink);
  font-size: 13px;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: 180px 220px 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.research-toolbar {
  grid-template-columns: 180px 180px 1fr;
  margin-top: 26px;
}

.publish-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.publish-note a {
  flex: 0 0 auto;
  color: inherit;
  font-weight: 900;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -4px 0 12px;
}

.info-badge {
  border-radius: 999px;
  background: #f4f5f2;
  color: var(--muted-ink);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.info-badge.ok {
  background: #edf3ed;
  color: var(--green);
}

.info-badge.warn {
  background: #fff8e9;
  color: #7b5a21;
}

.publish-note.ready {
  background: #edf3ed;
  color: var(--green);
}

.publish-note.warning {
  background: #fff8e9;
  color: #7b5a21;
}

.publish-note.muted {
  background: #f4f5f2;
  color: var(--muted-ink);
}

.lineage-readiness {
  display: grid;
  gap: 4px;
  border-radius: 8px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  font-size: 13px;
}

.lineage-readiness strong {
  color: inherit;
}

.lineage-readiness span {
  color: inherit;
  opacity: 0.9;
}

.lineage-readiness.ready {
  background: #edf3ed;
  color: var(--green);
}

.lineage-readiness.warning {
  background: #fff8e9;
  color: #7b5a21;
}

.lineage-readiness.muted {
  background: #f4f5f2;
  color: var(--muted-ink);
}

.research-stats {
  margin-bottom: 10px;
}

.offline-stats {
  margin: 22px 0 12px;
}

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

.offline-toolbar {
  grid-template-columns: 180px 1fr;
}

.offline-review-row {
  grid-template-columns: 150px 150px 170px 1fr auto;
}

.origin-summary-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 14px;
  border: 1px solid rgba(66, 109, 90, 0.24);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 16px;
  margin-bottom: 16px;
}

.origin-summary-panel h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.25;
}

.origin-summary-panel p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted-ink);
}

.origin-decision-grid {
  display: grid;
  gap: 8px;
}

.origin-decision-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
}

.origin-decision-grid strong,
.origin-decision-grid span {
  display: block;
}

.origin-decision-grid strong {
  color: var(--accent-dark);
}

.origin-decision-grid span {
  color: var(--muted-ink);
  font-size: 13px;
}

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

.origin-stats {
  margin-bottom: 10px;
}

.origin-toolbar {
  grid-template-columns: 170px 170px 1fr;
}

.origin-review-row {
  grid-template-columns: 150px 130px 180px 1fr auto;
}

.result-summary {
  margin: 0 0 14px;
  color: var(--muted-ink);
  font-size: 14px;
  font-weight: 800;
}

.status-helper-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

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

.status-helper-panel div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  padding: 12px;
}

.status-helper-panel span {
  display: inline-flex;
  border-radius: 999px;
  background: #edf3ed;
  color: var(--green);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.status-helper-panel strong {
  display: block;
  color: var(--accent-dark);
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.25;
}

.status-helper-panel p {
  margin: 5px 0 0;
  color: var(--muted-ink);
  font-size: 13px;
  line-height: 1.45;
}

.workbuddy-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid rgba(66, 109, 90, 0.24);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 16px;
  margin-bottom: 16px;
}

.workbuddy-panel h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.25;
}

.workbuddy-panel p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted-ink);
}

.workbuddy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.workbuddy-meta span {
  border-radius: 999px;
  background: #edf3ed;
  color: var(--green);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.workbuddy-brief {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.workbuddy-brief textarea {
  min-height: 170px;
  background: #fffdf7;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.workbuddy-import {
  display: grid;
  gap: 10px;
}

.workbuddy-schedule {
  margin-bottom: 22px;
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.batch-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.05);
}

.batch-grid span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.batch-grid h3 {
  margin: 6px 0 6px;
  color: var(--accent-dark);
  font-size: 18px;
  line-height: 1.25;
}

.batch-grid p {
  margin: 0;
  color: var(--muted-ink);
  font-size: 14px;
}

.submission-list {
  display: grid;
  gap: 14px;
}

.submission-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.submission-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.submission-head h2 {
  margin: 0;
  font-size: 22px;
}

.status {
  display: inline-flex;
  align-items: center;
  height: 28px;
  border-radius: 999px;
  background: #eef3ed;
  color: var(--green);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px 16px;
}

.detail {
  min-width: 0;
}

.detail span {
  display: block;
  color: var(--muted-ink);
  font-size: 12px;
  font-weight: 800;
}

.detail strong,
.detail p {
  margin: 0;
  overflow-wrap: anywhere;
}

.wide {
  grid-column: span 2;
}

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

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

.attachments a {
  border-radius: 999px;
  background: #f4eee2;
  color: #6d501f;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.review-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 10px;
  margin-top: 16px;
  align-items: end;
}

.review-message {
  min-height: 22px;
  margin: 8px 0 0;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.review-message.error {
  color: var(--accent);
}

.empty {
  border: 1px dashed #b9c1ba;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  padding: 34px;
  color: var(--muted-ink);
  text-align: center;
}

.guide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.guide-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(31, 36, 40, 0.06);
}

.guide-panel h2 {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 22px;
}

.guide-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 0 0 10px;
}

.guide-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.guide-list strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #edf3ed;
  color: var(--green);
}

.guide-list span,
.guide-panel p,
.guide-panel dd {
  color: var(--muted-ink);
}

.status-dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.status-dl dt {
  color: var(--accent-dark);
  font-weight: 900;
}

.status-dl dd {
  margin: 2px 0 0;
}

@media (max-width: 900px) {
  .notice-grid,
  .module-grid,
  .culture-grid,
  .promo-highlights,
  .report-hero-strip,
  .report-mindmap,
  .career-river,
  .evidence-grid,
  .branch-route,
  .heritage-wall,
  .genealogy-versions,
  .branch-grid,
  .source-grid,
  .pending-grid,
  .topic-columns,
  .research-columns,
  .announcement-grid,
  .collect-list,
  .search-grid,
  .principles,
  .lineage-notes-grid,
  .field-grid,
  .public-field-grid,
  .stats,
  .dashboard-grid,
  .batch-grid,
  .status-helper-panel,
  .lead-helper-panel,
  .offline-helper-panel,
  .origin-helper-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .promo-side {
    position: static;
  }

  .profile-board,
  .lineage-visual,
  .branch-map,
  .md-promo-page,
  .verify-layout {
    grid-template-columns: 1fr;
  }

  .md-report-toc {
    position: static;
  }

  .md-report-toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }

  .mindmap-center {
    grid-column: span 2;
  }

  .branch-root {
    min-height: auto;
  }

  .branch-root::after,
  .career-stage::after {
    display: none;
  }

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

  .public-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-row,
  .offline-review-row,
  .admin-toolbar,
  .research-toolbar,
  .offline-toolbar,
  .origin-toolbar,
  .origin-summary-panel,
  .origin-review-row,
  .workbuddy-panel,
  .ancestor-profile,
  .collect-start-grid,
  .guide-grid,
  .lineage-editor-toolbar {
    grid-template-columns: 1fr;
  }

  .callout {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .split-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav {
    align-items: center;
    min-height: auto;
    padding: 10px 14px;
    gap: 8px;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    gap: 10px;
    padding: 0 0 4px;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .brand {
    font-size: 16px;
  }

  .hero {
    min-height: 46vh;
  }

  .hero-content {
    padding: 58px 14px 36px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero-copy {
    font-size: 15px;
  }

  .hero-actions {
    gap: 8px;
    margin-top: 18px;
  }

  .button {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 14px;
  }

  .section {
    padding: 34px 14px;
  }

  .page-hero {
    padding: 34px 14px 18px;
  }

  .page-hero h1,
  .section-heading h2,
  .admin-top h1 {
    font-size: 26px;
  }

  .page-hero p:not(.eyebrow),
  .section-heading p:not(.eyebrow),
  .admin-top p {
    font-size: 15px;
  }

  .notice-grid,
  .module-grid,
  .culture-grid,
  .promo-highlights,
  .promo-proof,
  .report-hero-strip,
  .report-mindmap,
  .profile-board,
  .lineage-visual,
  .career-river,
  .evidence-grid,
  .branch-map,
  .branch-route,
  .heritage-wall,
  .genealogy-versions,
  .verify-layout,
  .branch-grid,
  .source-grid,
  .pending-grid,
  .topic-columns,
  .research-columns,
  .announcement-grid,
  .collect-list,
  .search-grid,
  .principles,
  .lineage-notes-grid,
  .field-grid,
  .public-field-grid,
  .stats,
  .dashboard-grid,
  .batch-grid,
  .status-helper-panel,
  .lead-helper-panel,
  .offline-helper-panel,
  .origin-helper-panel,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .promo-lead {
    padding: 16px;
  }

  .promo-lead p,
  .promo-article p {
    font-size: 15px;
  }

  .promo-article {
    padding: 20px;
  }

  .promo-article h2 {
    font-size: 24px;
  }

  .promo-article h3 {
    font-size: 19px;
  }

  .mindmap-center {
    grid-column: auto;
    min-height: 130px;
  }

  .md-promo-page {
    padding: 20px 14px 38px;
  }

  .md-report {
    padding: 22px 18px;
  }

  .md-report h1 {
    font-size: 30px;
  }

  .md-report h1::after {
    margin: 8px 0 0;
  }

  .md-report h2 {
    font-size: 23px;
  }

  .md-report h3 {
    font-size: 19px;
  }

  .md-report h4 {
    display: flex;
    border-radius: 8px;
    font-size: 15px;
  }

  .md-report p {
    font-size: 15px;
  }

  .md-report-toc nav {
    grid-template-columns: 1fr;
  }

  .md-table-wrap table {
    min-width: 520px;
  }

  .mindmap-center strong {
    font-size: 28px;
  }

  .mindmap-node::before,
  .lineage-step::after,
  .branch-root::after,
  .career-stage::after {
    display: none;
  }

  .profile-card-main,
  .lineage-step,
  .descendant-strip {
    grid-template-columns: 1fr;
  }

  .ancestor-seal {
    width: 132px;
    margin: 0 auto;
  }

  .evidence-card.tall {
    grid-column: auto;
  }

  .genealogy-versions div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 8px 4px;
  }

  .genealogy-versions div:last-child {
    border-bottom: 0;
  }

  .public-detail-grid {
    grid-template-columns: 1fr;
  }

  .ancestor-profile {
    grid-template-columns: 1fr;
  }

  .health-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .health-panel-head .button {
    width: 100%;
  }

  .health-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .health-files {
    grid-template-columns: 1fr;
  }

  .origin-summary-panel,
  .origin-toolbar,
  .origin-review-row {
    grid-template-columns: 1fr;
  }

  .public-filter-bar {
    grid-template-columns: 1fr;
  }

  .offline-sheet {
    width: calc(100vw - 28px);
    padding: 16px;
  }

  .offline-sheet-head,
  .signature-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .offline-code {
    width: 100%;
  }

  .paper-grid.three,
  .paper-grid.four {
    grid-template-columns: 1fr;
  }

  .lineage-plain-list {
    grid-template-columns: 1fr;
  }

  .tree-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .tree-toolbar .button {
    width: 100%;
  }

  .lineage-outline ol {
    grid-template-columns: 1fr;
    max-height: 220px;
  }

  .lineage-node-cards {
    display: grid;
    gap: 12px;
  }

  .lineage-editor-table-wrap {
    display: none;
  }

  .lineage-card-grid {
    grid-template-columns: 1fr;
  }

  .lineage-node-card .table-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  fieldset {
    padding: 14px;
  }

  .quality-panel ul {
    grid-template-columns: 1fr;
  }

  .module-card,
  .notice-grid article,
  .culture-grid article,
  .collect-list article,
  .search-grid article,
    .submission-card,
    .public-card,
  .workbuddy-panel,
  .share-copy-box,
  .collect-rules article {
    padding: 14px;
  }

  .module-card {
    min-height: auto;
  }

  .module-card h3,
  .submission-head h2,
  .dashboard-card h2,
  .public-card-head h2,
  .workbuddy-panel h2 {
    font-size: 19px;
  }

  .public-card-head {
    flex-direction: column;
    gap: 8px;
  }

  .publish-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .queue-item {
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
  }

  .queue-item span {
    grid-column: 1 / -1;
  }

  .workstation-head h1 {
    font-size: 26px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .admin-toolbar {
    gap: 10px;
  }

  .review-row {
    gap: 8px;
  }

  .timeline div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .process div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .login-shell {
    justify-content: center;
    padding: 20px;
  }

  .login-panel {
    padding: 24px;
  }

  .submission-head,
  .admin-top {
    flex-direction: column;
    gap: 10px;
  }

  .empty {
    padding: 22px 14px;
  }
}

  /* ===== 手机端增强：导航触控友好 + 族谱原图横滑 ===== */
  @media (max-width: 640px) {
    .nav-links a {
      padding: 9px 2px;
      min-height: 40px;
      display: inline-flex;
      align-items: center;
    }
    .lineage-figure {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      border-radius: 8px;
    }
    .lineage-figure img {
      width: auto;
      min-width: 640px;
      max-width: none;
    }
    .lineage-figure figcaption {
      padding: 0 2px;
    }
    .footer-v2 .footer-inner {
      gap: 8px;
    }
  }

/* === 美工升级集中块（统一缓动 / 焦点态 / 按钮 / 导航下划线 / 锚点）=== */

/* 全局键盘焦点可见化：金线描边，精致且无障碍 */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 按钮：统一过渡 + 悬浮微光 + 按压下陷 */
.button {
  transition: background .25s var(--ease), box-shadow .25s var(--ease),
    transform .12s var(--ease-soft);
}
.button:hover {
  box-shadow: var(--shadow-hover);
}
.button:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-press);
}

/* 桌面端导航链接：金色渐变下划线从左滑入 */
@media (min-width: 769px) {
  .nav-links a {
    position: relative;
    transition: color .2s var(--ease);
  }
  .nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: linear-gradient(90deg, var(--gold), var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s var(--ease);
  }
  .nav-links a:hover {
    color: var(--accent-dark);
  }
  .nav-links a:hover::after {
    transform: scaleX(1);
  }
}

/* 锚点定位不被吸顶导航遮挡 */
[id] {
  scroll-margin-top: calc(var(--header-h) + 14px);
}

@media print {
  @page {
    size: A4;
    margin: 10mm;
  }

  body {
    background: #fff;
  }

  .no-print,
  .site-header,
  .footer,
  .page-hero {
    display: none !important;
  }

  .offline-sheet {
    width: auto;
    margin: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .offline-sheet-head h1 {
    font-size: 22px;
  }

  .offline-note,
  .photo-rules {
    background: #fff;
    font-size: 12px;
    padding: 6px;
  }

  .offline-block {
    break-inside: avoid;
    margin-top: 10px;
  }

  .offline-block h2 {
    font-size: 15px;
    margin-bottom: 5px;
  }

  .paper-grid label,
  .signature-row label {
    min-height: 32px;
    font-size: 12px;
  }

  .paper-grid label span,
  .signature-row label span {
    padding: 7px 6px;
  }

  .paper-grid label em,
  .signature-row label em {
    min-height: 30px;
  }

  .paper-lines {
    gap: 5px;
  }

  .paper-lines em {
    height: 16px;
  }

  .paper-lines.tall em {
    height: 18px;
  }

  .paper-checks {
    font-size: 12px;
    gap: 6px 12px;
    padding: 6px;
  }
}

/* ===== 加群浮窗 ===== */
.float-join {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.float-join-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 20px;
  min-width: 220px;
  box-shadow: 0 12px 36px rgba(31,36,40,0.18);
  text-align: center;
}
.float-join-panel.open { display: flex; }
.float-join-panel h4 { margin: 0 0 4px; font-size: 16px; color: var(--accent-dark); }
.float-join-panel p { margin: 0; font-size: 14px; color: var(--muted-ink); line-height: 1.55; }
.float-join-panel .qr-placeholder {
  display: grid;
  place-items: center;
  width: 140px;
  height: 140px;
  margin: 8px auto;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--soft);
  color: var(--muted-ink);
  font-size: 13px;
}
.float-join-btn {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #2d5a42);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(66,109,90,0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.float-join-btn:hover { transform: scale(1.08); box-shadow: 0 10px 28px rgba(66,109,90,0.45); }
.float-join-btn:active { transform: scale(0.95); }
