/* ============================================================
   族信 · 发布版视觉校准层
   说明：此文件只做视觉、响应式与可访问性增强，不改业务数据。
   ============================================================ */

html:root {
  --polish-max: 1200px;
  --polish-header: 68px;
  --polish-panel: color-mix(in srgb, var(--surface-2) 94%, var(--ink) 6%);
  --polish-panel-strong: color-mix(in srgb, var(--surface-2) 88%, var(--ink) 12%);
  --polish-rule: color-mix(in srgb, var(--ink) 13%, transparent);
  --polish-rule-strong: color-mix(in srgb, var(--ink) 22%, transparent);
  --polish-muted: color-mix(in srgb, var(--ink) 68%, transparent);
  --polish-faint: color-mix(in srgb, var(--ink) 52%, transparent);
  --polish-warm: #e3b85c;
  --polish-danger: #f47772;
  --polish-radius-sm: 8px;
  --polish-radius: 12px;
  --polish-radius-lg: 18px;
  --polish-shadow: 0 20px 58px rgba(0, 0, 0, .26);
}

html { background: var(--bg); }
body.page-polished {
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.page-polished:not(.page-tree-view):not(.page-admin) {
  font-size: 16px;
}

body.page-polished,
body.page-polished * {
  scrollbar-color: color-mix(in srgb, var(--accent) 55%, transparent) transparent;
}

body.page-polished .page-enter,
body.page-polished.page-enter {
  animation: none !important;
}

body.page-polished :focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 3px !important;
}

body.page-polished button,
body.page-polished .btn,
body.page-polished [role="button"] {
  min-height: 40px;
}

body.page-polished:not(.page-tree-view) button:hover,
body.page-polished:not(.page-tree-view) .btn:hover,
body.page-polished:not(.page-tree-view) [class*="btn"]:hover {
  transform: none !important;
  filter: none !important;
}

body.page-polished:not(.page-tree-view) .card:hover,
body.page-polished:not(.page-tree-view) .family-card:hover,
body.page-polished:not(.page-tree-view) .surname-card:hover,
body.page-polished:not(.page-tree-view) [class*="card"]:hover {
  transform: none !important;
}

body.page-polished .card,
body.page-polished .family-card,
body.page-polished .surname-card,
body.page-polished .modal,
body.page-polished .modal-box,
body.page-polished .search-pop,
body.page-polished .search-drop,
body.page-polished .tooltip,
body.page-polished .panel {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

body.page-polished input,
body.page-polished select,
body.page-polished textarea {
  font-size: 15px;
}

body.page-polished .theme-toggler .zt-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--polish-rule-strong);
  background: var(--polish-panel);
  box-shadow: none;
}

body.page-polished .theme-toggler .zt-btn::before {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
}

body.page-polished .theme-toggler .zt-btn:hover {
  transform: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

body.page-polished .theme-toggler .zt-num {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  color: var(--btn-solid-text);
  background: transparent;
}

/* ---------- 首页 ---------- */
body.page-home .rl {
  opacity: 1 !important;
  transform: none !important;
  transition: border-color .2s ease, box-shadow .2s ease, color .2s ease !important;
  will-change: auto !important;
}

body.page-home .head {
  height: var(--polish-header);
  background: color-mix(in srgb, var(--bg) 96%, var(--ink) 4%);
  border-bottom: 1px solid var(--polish-rule);
  color: var(--ink);
}

body.page-home .head.scrolled {
  background: var(--bg);
  box-shadow: 0 10px 35px rgba(0, 0, 0, .16);
}

body.page-home .head .in {
  min-height: var(--polish-header);
  padding-top: 0;
  padding-bottom: 0;
  gap: 22px;
}

body.page-home .head .brand img { width: 40px !important; height: 40px !important; }
body.page-home .brand-txt b { font-size: 18px; letter-spacing: 4px; }
body.page-home .brand-txt i { margin-top: 1px; color: var(--polish-faint); }
body.page-home .head nav a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 13px; }

body.page-home .head .search-wrap input {
  height: 42px;
  min-width: 320px;
  padding: 0 82px 0 16px;
  border-radius: var(--polish-radius-sm);
  background: var(--polish-panel);
  border-color: var(--polish-rule-strong);
  box-shadow: none;
}

body.page-home .head .search-wrap button {
  right: 4px;
  min-height: 34px;
  padding: 6px 14px;
}

body.page-home .head .login {
  min-height: 40px;
  padding: 0 17px;
  border-color: var(--polish-rule-strong);
  background: var(--polish-panel);
}

body.page-home .hero {
  /* 站主令 09-30 终：min-height:100vh/100svh !important 删除——这是星系下方 ~900px 空档的真凶（!important 压过 index.html 内所有 min-height 改动）；hero 高度=内容高，journey 紧跟 */
  border-bottom: 1px solid var(--polish-rule);
}

body.page-home .hero-txt {
  padding: 0;
  max-width: 590px;
}

body.page-home .eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 4px;
  opacity: 1 !important;
  animation: none !important;
}

/* hero h1 restored to online slogan size (clamp(48px, 7.5vw, 100px)) */
body.page-home .hero h1 {
  margin: 14px 0 8px;
  font-size: clamp(48px, 7.5vw, 100px);
  line-height: 1.08;
  letter-spacing: 5px;
}

body.page-home .hero h1 .row,
body.page-home .hero .sub,
body.page-home .hero .cta,
body.page-home .hero-visual {
  opacity: 1 !important;
  animation: none !important;
  transform: none !important;
}

body.page-home .hero .sub {
  max-width: 40em;
  color: var(--polish-muted);
  font-size: 16px;
  line-height: 1.95;
}

body.page-home .hero .cta {
  margin-top: 28px;
  gap: 12px;
}

body.page-home .hero .btn {
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--polish-radius-sm);
  letter-spacing: 1px;
  font-family: inherit;
  font-weight: 700;
  box-shadow: none;
}

body.page-home .hero .btn.solid {
  background: var(--accent);
  color: var(--btn-solid-text);
  border: 1px solid var(--accent);
}

body.page-home .hero .btn.ghost {
  color: var(--ink);
  background: var(--polish-panel);
  border: 1px solid var(--polish-rule-strong);
}

body.page-home .hero .btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

body.page-home .hero-visual { min-width: 0; }
/* galaxy-wrap restored to online size/position: base absolute rule in index.html applies */

body.page-home .journey-strip {
  position: relative;
  z-index: 2;
  padding: 0;
  border-bottom: 1px solid var(--polish-rule);
  background: color-mix(in srgb, var(--surface-1) 92%, var(--ink) 8%);
}

body.page-home .journey-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: var(--polish-max);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 40px);
}

body.page-home .journey-step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 108px;
  padding: 22px 28px;
  border-right: 1px solid var(--polish-rule);
}

body.page-home .journey-step:first-child { border-left: 1px solid var(--polish-rule); }
body.page-home .journey-no {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-glow);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
body.page-home .journey-step b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 3px; }
body.page-home .journey-step span:last-child { color: var(--polish-faint); font-size: 13px; line-height: 1.55; }

body.page-home .product-proof {
  position: relative;
  z-index: 2;
  padding: 80px 0;
  border-bottom: 1px solid var(--polish-rule);
}

body.page-home .proof-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  min-height: 480px;
  overflow: hidden;
  background: var(--polish-panel);
  border: 1px solid var(--polish-rule);
  border-radius: var(--polish-radius-lg);
  box-shadow: var(--polish-shadow);
}

body.page-home .proof-media {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  background: #c6b494;
}

body.page-home .proof-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 42% center;
  filter: saturate(.72) contrast(1.02) brightness(.82);
}

body.page-home .proof-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 55%, color-mix(in srgb, var(--polish-panel) 94%, transparent));
  pointer-events: none;
}

body.page-home .proof-tag {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 2;
  padding: 9px 13px;
  border-radius: 7px;
  background: #f3ead8;
  color: #352a1d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

body.page-home .proof-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 5vw, 68px);
}

body.page-home .proof-kicker {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 3px;
}

body.page-home .proof-copy h2 {
  margin: 0 0 18px;
  font-family: "STKaiti", "KaiTi", serif;
  color: var(--ink);
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 3px;
}

body.page-home .proof-copy > p {
  margin: 0 0 26px;
  color: var(--polish-muted);
  line-height: 1.9;
}

body.page-home .proof-list { display: grid; gap: 13px; margin-bottom: 30px; }
body.page-home .proof-item { display: flex; align-items: flex-start; gap: 11px; color: var(--polish-muted); font-size: 14px; line-height: 1.65; }
body.page-home .proof-item i { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-glow); color: var(--accent); font-style: normal; font-size: 12px; font-weight: 800; }
body.page-home .proof-link { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; padding: 0 18px; border: 1px solid var(--polish-rule-strong); border-radius: var(--polish-radius-sm); color: var(--ink); font-size: 14px; font-weight: 700; }
body.page-home .proof-link:hover { border-color: var(--accent); color: var(--accent); opacity: 1 !important; }

body.page-home .sec,
body.page-home .sec-alt {
  padding: 72px 0 !important;
  background: transparent;
}

body.page-home .sec-alt {
  border-top: 1px solid var(--polish-rule);
  border-bottom: 1px solid var(--polish-rule);
  background: color-mix(in srgb, var(--surface-1) 93%, var(--ink) 7%);
}

body.page-home .sec-head {
  align-items: center;
  margin-bottom: 10px;
}

body.page-home .sec-head h2 {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 27px !important;
  font-weight: 600;
  letter-spacing: 2px;
}

body.page-home .sec-head h2::after { display: none !important; }
body.page-home .sec-head .more { min-height: 40px; padding: 0 11px; color: var(--polish-faint); }
body.page-home .sec-lede { margin: 0 0 26px !important; max-width: 760px !important; color: var(--polish-muted) !important; font-size: 14px !important; }

body.page-home .news-rank-grid { gap: 18px; }
body.page-home .news-rank-grid > .card,
body.page-home .compact-knowledge > .card,
body.page-home .families-grid .card {
  background: var(--polish-panel);
  border-color: var(--polish-rule);
  border-radius: var(--polish-radius);
  box-shadow: none;
}
body.page-home .news-rank-grid > .card:hover,
body.page-home .compact-knowledge > .card:hover,
body.page-home .families-grid .card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--polish-rule));
  box-shadow: 0 0 0 3px var(--accent-glow);
}

body.page-home .families-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
  max-width: 820px;
  margin: 0 auto;
}

body.page-home .families-grid .card { min-height: 240px; padding: 28px; }
body.page-home .families-grid .card p { color: var(--polish-muted); font-size: 14px; }
body.page-home .compact-knowledge { gap: 16px; }
body.page-home .compact-knowledge .card { min-height: 170px; padding: 24px; }
body.page-home .compact-knowledge .card p { color: var(--polish-muted) !important; }

body.page-home .surname-ticker {
  padding: 22px 0;
  border-top: 1px solid var(--polish-rule);
  border-bottom: 1px solid var(--polish-rule);
  background: var(--bg);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
body.page-home .surname-ticker .item { background: var(--polish-panel); border-color: var(--polish-rule); }
body.page-home .surname-ticker .item,
body.page-home .surname-ticker .item:hover { transform: none !important; }

body.page-home .statstrip {
  padding: 50px 0;
  background: color-mix(in srgb, var(--surface-1) 90%, var(--ink) 10%);
  border-color: var(--polish-rule);
}
body.page-home .statstrip::before,
body.page-home .statstrip::after { display: none; }
body.page-home .stat b { font-size: 40px; }
body.page-home .stat small { margin-top: 9px; color: var(--polish-faint); }

body.page-home .foot { padding-top: 64px; border-color: var(--polish-rule); }
body.page-home .foot p,
body.page-home .foot .links a,
body.page-home .foot .bottom { color: var(--polish-faint); }

/* ---------- 谱库 ---------- */
body.page-library .nav,
body.page-upload .nav,
body.page-family-detail .nav,
body.page-profile .nav,
body.page-knowledge-detail .nav,
body.page-news-detail .nav,
body.page-v6-self-register .nav {
  height: var(--polish-header);
  padding: 0 max(24px, calc((100vw - var(--polish-max)) / 2 + 40px));
  background: var(--bg);
  border-bottom: 1px solid var(--polish-rule);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.page-library .nav-l,
body.page-upload .nav-l,
body.page-family-detail .nav-l,
body.page-profile .nav-l { gap: 10px; font-weight: 650; }

body.page-library .nav-r,
body.page-upload .nav-r,
body.page-family-detail .nav-r,
body.page-profile .nav-r { gap: 5px; }

body.page-library .nav-r a,
body.page-library .nav-r button,
body.page-upload .nav-r a,
body.page-family-detail .nav-r a,
body.page-profile .nav-r a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: var(--polish-radius-sm);
}

body.page-library .page { padding: 50px 0 72px; }
body.page-library .lib-head { align-items: flex-end; margin-bottom: 26px; }
body.page-library .lib-head h1 {
  display: block;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 42px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 4px;
}
body.page-library .lib-head h1 small { display: block; margin-top: 8px; font-family: inherit; font-size: 14px; letter-spacing: 1px; color: var(--polish-muted); }
body.page-library .search-wrap { width: min(420px, 100%); max-width: 420px; flex-basis: 420px; }
body.page-library .search-wrap input { height: 48px; border-radius: var(--polish-radius-sm); background: var(--polish-panel); border-color: var(--polish-rule-strong); }

body.page-library .filter-bar { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--polish-rule); }
body.page-library .filter-tab { min-height: 40px; padding: 0 17px; border-color: var(--polish-rule-strong); background: var(--polish-panel); }
body.page-library .filter-tab.active { background: var(--accent); color: var(--btn-solid-text); }
body.page-library .result-meta { margin-bottom: 12px; }
body.page-library .result-meta .count-label { color: var(--polish-muted); font-size: 14px; }

body.page-library .alpha-bar { gap: 6px !important; }
body.page-library .alpha-bar b {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  color: var(--polish-faint);
  border-color: var(--polish-rule);
  background: var(--polish-panel);
}
body.page-library .alpha-bar b.has { color: var(--ink); border-color: color-mix(in srgb, var(--accent) 55%, var(--polish-rule)); }
body.page-library .btn-create { min-height: 44px; padding: 0 20px; border-radius: var(--polish-radius-sm); box-shadow: none; }

body.page-library .surname-grid {
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
body.page-library .surname-card {
  min-height: 132px;
  padding: 19px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--polish-panel);
  border-color: var(--polish-rule);
  border-radius: var(--polish-radius);
}
body.page-library .surname-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
body.page-library .surname-card .sc-char { margin-bottom: 7px; font-size: 30px; }
body.page-library .surname-card .sc-count,
body.page-library .surname-card .sc-members { font-size: 12px; }
body.page-library .surname-card .sc-meta { margin-top: 3px; font-size: 11px; color: var(--polish-faint); }
body.page-library .family-grid { gap: 14px; }
body.page-library .family-card { background: var(--polish-panel); border-color: var(--polish-rule); border-radius: var(--polish-radius); }

/* ---------- 世系图 ---------- */
body.page-tree-view {
  --tree-head: 64px;
  --header-bg: var(--bg);
  --card-bg: var(--polish-panel);
  --card-border: var(--polish-rule);
  --text: var(--ink);
}

body.page-tree-view .header {
  height: var(--tree-head);
  padding: 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--polish-rule);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.16);
}
body.page-tree-view .header-l { gap: 10px; min-width: 0; }
body.page-tree-view .header-l { flex: 1 1 auto; }
body.page-tree-view .header-r { flex: 0 0 auto; }
body.page-tree-view .header-l .logo { width: 30px; height: 30px; background: transparent; box-shadow: none; }
body.page-tree-view .header-l .logo img { width: 30px !important; height: 30px !important; }
body.page-tree-view .header-l h1 { font-size: 16px; letter-spacing: 1px; }
body.page-tree-view .header-l .sub { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--polish-muted); }
body.page-tree-view .stats { margin-left: 4px; }
body.page-tree-view .stats { position: relative; flex: 0 0 auto; }
body.page-tree-view .stats-toggle { min-height: 36px; padding: 0 10px; border: 1px solid var(--polish-rule); border-radius: 7px; background: var(--polish-panel); color: var(--ink); font: inherit; font-size: 12px; cursor: pointer; }
body.page-tree-view .stats-detail.open {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 160;
  min-width: 190px;
  margin: 0;
  padding: 9px;
  background: var(--polish-panel);
  border: 1px solid var(--polish-rule-strong);
  border-radius: 8px;
  box-shadow: var(--polish-shadow);
}
body.page-tree-view .search-box { margin-left: 4px; }
body.page-tree-view .search-box::before { content: "⌕"; left: 11px; top: 6px; color: var(--polish-muted); font-size: 17px; }
body.page-tree-view .search-box input { width: 230px; height: 38px; padding-left: 32px; border-radius: 7px; background: var(--polish-panel); border-color: var(--polish-rule); }
body.page-tree-view .search-pop { top: 44px; background: var(--polish-panel); border-color: var(--polish-rule); }
body.page-tree-view .header-r { gap: 6px; }
body.page-tree-view .header-r .btn { min-height: 36px; height: 36px; padding: 0 11px; border: 1px solid var(--polish-rule); border-radius: 7px; background: var(--polish-panel); color: var(--polish-muted); }
body.page-tree-view .header-r .btn:hover { border-color: var(--accent); color: var(--ink); }
body.page-tree-view .header-r .sep { background: var(--polish-rule); }
body.page-tree-view .tree-stage { top: var(--tree-head); }
body.page-tree-view .polish-mobile-search { display: none; }

body.page-tree-view .toolbar { right: 18px; gap: 7px; }
body.page-tree-view .toolbar .btn { width: 40px; height: 40px; min-height: 40px; border-radius: 8px; background: var(--polish-panel); border-color: var(--polish-rule-strong); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
body.page-tree-view .toolbar .btn:hover { border-color: var(--accent); color: var(--accent); }
body.page-tree-view .toolbar .zoom-output {
  display: block;
  min-width: 40px;
  padding: 3px 0 1px;
  color: var(--polish-faint);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
body.page-tree-view .toolbar #verifyBtn { margin-top: 3px; }
body.page-tree-view .toolbar .pd-btn { width: 40px; height: 40px; margin: 0; padding: 0; border: 1px solid var(--polish-rule-strong); border-radius: 8px; background: var(--polish-panel); color: var(--accent); box-shadow: 0 6px 18px rgba(0,0,0,.18); font: inherit; font-size: 12px; cursor: pointer; }
body.page-tree-view .toolbar #verifyBtn[hidden],
body.page-tree-view .toolbar .pd-btn[hidden] { display: none !important; }

body.page-tree-view .minimap { top: 80px; left: 18px; width: 232px; background: var(--polish-panel); border-color: var(--polish-rule-strong); border-radius: 10px; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 12px 32px rgba(0,0,0,.24); }
body.page-tree-view .mm-head { min-height: 44px; padding: 2px 6px 2px 10px; border-color: var(--polish-rule); }
body.page-tree-view .mm-head .mm-locate { min-width: 88px; min-height: 40px; padding: 0 10px; }
body.page-tree-view .mm-head #mmToggle { min-width: 40px; min-height: 40px; padding: 0; }
body.page-tree-view .mm-canvas-wrap { height: 106px; }

body.page-tree-view #demoBadges { left: 18px !important; top: 238px !important; gap: 8px !important; }
body.page-tree-view #demoBadges span,
body.page-tree-view #demoBadges a { min-height: 40px; display: inline-flex !important; align-items: center; border-radius: 8px !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* 10-03 修复：原 top:328px 正落在第 2-3 世节点上，横幅压住人名。
   改为贴底（bottom:56px，避开图例条），行数 2→3 让长文案少被截断。
   注意：必须显式写 position:fixed —— 10-03 首次修时把内联 style 里的
   position 一并删掉了，polish.css 又没声明，导致横幅 position:static
   掉进文档流、糊在页头中间（把 ICP 备案号都顶歪了）。此坑勿重犯。 */
body.page-tree-view .family-note { position: fixed !important; z-index: 98; left: 18px !important; top: auto !important; bottom: 56px !important; width: 232px !important; max-width: 232px !important; padding: 8px 12px !important; border-radius: 8px !important; background: var(--polish-panel) !important; border-color: var(--polish-rule) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; font-size: 12px !important; line-height: 1.55 !important; white-space: normal !important; text-align: left !important; pointer-events: auto !important; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden !important; }

body.page-tree-view .gen-labels { right: 72px; top: 68px; }
body.page-tree-view .gen-label { color: var(--polish-muted); }
body.page-tree-view .gen-label.edge { padding: 2px 8px; background: var(--polish-panel); }

body.page-tree-view .legend {
  bottom: 14px;
  max-width: calc(100vw - 170px);
  padding: 7px 9px;
  gap: 7px;
  border-radius: 10px;
  background: var(--polish-panel);
  border-color: var(--polish-rule-strong);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
body.page-tree-view .legend-item { font-size: 11px; color: var(--polish-muted); }
body.page-tree-view .legend .legend-item:nth-of-type(n+4) { display: none; }
body.page-tree-view .legend.show-all .legend-item:nth-of-type(n+4) { display: flex; }
body.page-tree-view .legend-toggle,
body.page-tree-view .gloss-btn { min-height: 28px; height: 28px; margin-left: 2px; padding: 0 9px; border: 1px solid var(--polish-rule-strong); border-radius: 6px; background: transparent; color: var(--polish-muted); font: inherit; font-size: 11px; cursor: pointer; }
body.page-tree-view .legend-toggle:hover,
body.page-tree-view .gloss-btn:hover { border-color: var(--accent); color: var(--accent); }

@media (min-width: 941px) {
  body.page-tree-view .legend.show-all {
    width: min(1120px, calc(100vw - 176px));
    max-width: calc(100vw - 176px);
    flex-wrap: wrap;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
  }
  body.page-tree-view .legend.show-all .legend-item {
    flex: 0 1 auto;
    max-width: 480px;
    white-space: normal;
    line-height: 1.45;
  }
}

body.page-tree-view .node:hover { transform: none !important; }
body.page-tree-view .node-card {
  background: color-mix(in srgb, var(--polish-panel) 88%, var(--gc) 12%);
  border: 1px solid var(--polish-rule-strong);
  border-top: 2px solid color-mix(in srgb, var(--gc) 58%, var(--ink));
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
}
body.page-tree-view .node.female .node-card .name { color: var(--ink); }
body.page-tree-view .tooltip,
body.page-tree-view .relation-panel,
body.page-tree-view .verify-panel,
body.page-tree-view .gloss-pop,
body.page-tree-view .edit-panel { background: var(--polish-panel); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: var(--polish-rule-strong); }
body.page-tree-view.embed .tree-stage { top: 0; }
body.page-tree-view.embed .gen-labels { top: 4px; }
body.page-tree-view.embed .minimap { top: 12px; }

@media (max-width: 1180px) {
  body.page-tree-view #famSub { display: none; }
  body.page-tree-view .search-box input { width: 190px; }
}

@media (max-width: 940px) {
  body.page-tree-view .stats { display: none; }
}

/* ---------- 登录拦截 / 上传 / OCR ---------- */
body.page-upload .auth-overlay,
body.page-ocr .auth-overlay {
  background:
    radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 32%),
    var(--bg) !important;
  gap: 14px !important;
}
body.page-upload .auth-overlay .icon,
body.page-ocr .auth-overlay > div:first-child { font-size: 0 !important; width: 62px; height: 62px; border: 1px solid var(--polish-rule-strong); border-radius: 16px; background: var(--polish-panel); position: relative; opacity: 1 !important; }
body.page-upload .auth-overlay .icon::before,
body.page-ocr .auth-overlay > div:first-child::before { content: ""; position: absolute; left: 20px; top: 27px; width: 22px; height: 18px; border: 2px solid var(--polish-muted); border-radius: 4px; }
body.page-upload .auth-overlay .icon::after,
body.page-ocr .auth-overlay > div:first-child::after { content: ""; position: absolute; left: 25px; top: 16px; width: 12px; height: 13px; border: 2px solid var(--polish-muted); border-bottom: 0; border-radius: 8px 8px 0 0; }
body.page-upload .auth-overlay h2,
body.page-ocr .auth-overlay h2 { margin: 10px 0 0; font-family: "STKaiti", "KaiTi", serif; font-size: 30px !important; letter-spacing: 2px; }
body.page-upload .auth-overlay p,
body.page-ocr .auth-overlay p { max-width: 460px !important; margin: 0 0 10px; color: var(--polish-muted) !important; line-height: 1.85 !important; font-size: 15px !important; }
body.page-upload .auth-overlay .btn,
body.page-ocr .auth-overlay .btn { min-height: 46px; padding: 0 22px; border-radius: 8px; background: var(--accent); color: var(--btn-solid-text); border: 1px solid var(--accent); font-weight: 750; text-decoration: none; }

body.page-upload .container { max-width: 920px; padding-top: 48px; }
body.page-upload .container > .card { margin-bottom: 18px; padding: 28px; background: var(--polish-panel); border-color: var(--polish-rule); border-radius: var(--polish-radius); }
body.page-upload .upload-zone { min-height: 240px; border-radius: var(--polish-radius); border-color: var(--polish-rule-strong); background: color-mix(in srgb, var(--surface-1) 94%, var(--ink) 6%); }

body.page-ocr { min-height: 100vh; padding: 70px 20px; }
body.page-ocr > .wrap { max-width: 880px; }
body.page-ocr h1 { color: var(--ink) !important; font-family: "STKaiti", "KaiTi", serif; font-size: 38px !important; letter-spacing: 2px; }
body.page-ocr .desc { color: var(--polish-muted) !important; }
body.page-ocr .upload-box,
body.page-ocr .stat-card,
body.page-ocr .result pre { background: var(--polish-panel) !important; border-color: var(--polish-rule-strong) !important; border-radius: var(--polish-radius) !important; }
body.page-ocr .upload-box { min-height: 280px; display: grid; place-content: center; }

/* ---------- 内容页与表单页 ---------- */
body.page-review .wrap,
body.page-about .wrap,
body.page-privacy .wrap,
body.page-terms .wrap { max-width: 920px; }

body.page-review header,
body.page-about header,
body.page-privacy header,
body.page-terms header { padding-top: 48px; }

body.page-review section,
body.page-about main,
body.page-privacy main,
body.page-terms main { background: transparent; }

body.page-review section,
body.page-v6-self-register .card,
body.page-profile .card,
body.page-family-detail .card { border-color: var(--polish-rule); background: var(--polish-panel); border-radius: var(--polish-radius); }

body.page-knowledge-detail article,
body.page-news-detail article { max-width: 820px; font-size: 17px; line-height: 1.95; }

/* ---------- 轻量跳转页 / 404 ---------- */
body.page-family-home,
body.page-news-list,
body.page-404 { background: var(--bg) !important; color: var(--ink) !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  body.page-home .head .search-wrap { display: none; }
  body.page-home .proof-shell { grid-template-columns: 1fr 1fr; }
  body.page-tree-view .header-l .sub { display: none; }
  body.page-tree-view .search-box input { width: 190px; }
}

@media (max-width: 760px) {
  html:root { --polish-header: 60px; }
  body.page-polished:not(.page-tree-view) { font-size: 15px; }

  body.page-home .head .in { min-height: 60px; padding: 0 14px; }
  body.page-home .head .brand img { width: 34px !important; height: 34px !important; }
  body.page-home .brand-txt b { font-size: 16px; }
  body.page-home .brand-txt i { display: none; }
  body.page-home .head .theme-toggler { display: none; }
  body.page-home .head .login { margin-left: auto; }
  body.page-home .head .mbtn { min-height: 38px; }

  body.page-home .hero { min-height: 730px !important; padding-top: 60px !important; }
  body.page-home .hero .in { min-height: 670px; flex-direction: column; justify-content: center; padding: 36px 20px 22px; gap: 18px; }
  body.page-home .hero-txt { order: 1; text-align: center; }
  body.page-home .hero-visual { order: 2; width: 100%; }
  body.page-home .eyebrow { justify-content: center; letter-spacing: 3px; }
  body.page-home .hero h1 { margin: 14px auto 13px; font-size: clamp(43px, 13vw, 58px); line-height: 1.1; letter-spacing: 5px; }
  body.page-home .hero .sub { margin: 0 auto; max-width: 31em; font-size: 14px; line-height: 1.8; }
  body.page-home .hero .cta { justify-content: center; margin-top: 20px; }
  body.page-home .hero .btn { min-height: 44px; padding: 0 18px; }
  body.page-home .galaxy-wrap { max-width: 350px; margin: -6px auto 0; }

  body.page-home .journey-grid { grid-template-columns: 1fr; padding: 0 18px; }
  body.page-home .journey-step { min-height: 82px; padding: 16px 8px; border-right: 0; border-bottom: 1px solid var(--polish-rule); }
  body.page-home .journey-step:first-child { border-left: 0; }
  body.page-home .journey-step:last-child { border-bottom: 0; }

  body.page-home .product-proof { padding: 54px 0; }
  body.page-home .proof-shell { grid-template-columns: 1fr; margin: 0 18px; }
  body.page-home .proof-media { min-height: 300px; }
  body.page-home .proof-media::after { background: linear-gradient(180deg, transparent 65%, var(--polish-panel)); }
  body.page-home .proof-copy { padding: 32px 24px 36px; }
  body.page-home .proof-copy h2 { font-size: 34px; }

  body.page-home .sec,
  body.page-home .sec-alt { padding: 52px 0 !important; }
  body.page-home .sec-head { align-items: center; text-align: left; }
  body.page-home .sec-head h2 { font-size: 24px !important; }
  body.page-home .news-rank-grid { grid-template-columns: 1fr !important; }
  body.page-home .families-grid { grid-template-columns: 1fr !important; }
  body.page-home .families-grid .card { min-height: 0; }
  body.page-home .surname-ticker { mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
  body.page-home .statstrip .in { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 16px; }

  body.page-library .nav,
  body.page-upload .nav,
  body.page-family-detail .nav,
  body.page-profile .nav,
  body.page-knowledge-detail .nav,
  body.page-news-detail .nav,
  body.page-v6-self-register .nav { height: 60px; padding: 0 16px; }
  body.page-library .nav-r { max-width: 64vw; overflow-x: auto; }
  body.page-library .page { padding-top: 34px; }
  body.page-library .lib-head { align-items: stretch; }
  body.page-library .lib-head h1 { font-size: 34px; }
  body.page-library .search-wrap { width: 100%; max-width: none; flex-basis: auto; }
  body.page-library .filter-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 14px; }
  body.page-library .alpha-bar { flex-wrap: nowrap !important; overflow-x: auto; padding-bottom: 6px; }
  body.page-library .alpha-bar b { flex: 0 0 34px; }
  body.page-library .surname-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.page-library .surname-card { min-height: 120px; }

  body.page-tree-view { --tree-head: 56px; }
  body.page-tree-view .header { height: 56px; padding: 0 9px; }
  body.page-tree-view .header-l { gap: 7px; }
  body.page-tree-view .header-l .logo,
  body.page-tree-view .header-l .logo img { width: 26px !important; height: 26px !important; }
  body.page-tree-view .header-l h1 { font-size: 14px; }
  body.page-tree-view .stats,
  body.page-tree-view .search-box,
  body.page-tree-view .header-r .zoom-label,
  body.page-tree-view .header-r .sep,
  body.page-tree-view #editModeHint { display: none !important; }
  body.page-tree-view .header-r .btn { min-width: 44px; min-height: 44px; height: 44px; padding: 0 9px; font-size: 10px; }
  body.page-tree-view .header-r .theme-toggler { display: none; }
  body.page-tree-view .polish-mobile-search { display: inline-flex; align-items: center; justify-content: center; width: 44px; padding: 0; }
  body.page-tree-view .polish-mobile-search svg { width: 18px; height: 18px; }
  body.page-tree-view.mobile-search-open .search-box {
    display: block !important;
    position: fixed;
    left: 10px;
    right: 10px;
    top: 64px;
    z-index: 180;
    margin: 0;
    padding: 8px;
    border: 1px solid var(--polish-rule-strong);
    border-radius: 10px;
    background: var(--polish-panel);
    box-shadow: var(--polish-shadow);
  }
  body.page-tree-view.mobile-search-open .search-box input { width: 100%; height: 44px; }
  body.page-tree-view.mobile-search-open .search-pop { left: 0; right: 0; top: 58px; width: auto; }
  body.page-tree-view .toolbar { right: 8px; }
  body.page-tree-view .toolbar .btn,
  body.page-tree-view .toolbar .pd-btn { width: 44px; height: 44px; min-height: 44px; }
  body.page-tree-view .gen-labels { right: 60px; top: 58px; }
  body.page-tree-view #demoBadges { top: 68px !important; left: 10px !important; flex-direction: row !important; max-width: calc(100vw - 60px); overflow-x: auto; }
  body.page-tree-view #demoBadges span,
  body.page-tree-view #demoBadges a { flex: none; min-height: 44px; padding: 6px 10px !important; font-size: 11px !important; }
  /* 10-03：移动端横幅原 top:110px 会压住世系图上方节点；改贴底，
     bottom:76px 让开底部横向工具条（bottom:14px + 44px 按钮高）。 */
  body.page-tree-view .family-note { position: fixed !important; top: auto !important; bottom: 76px !important; left: 10px !important; right: 62px !important; width: auto !important; max-width: none !important; white-space: normal !important; overflow: hidden !important; text-overflow: clip !important; -webkit-line-clamp: 3; }

  /* 10-03 移动端工具条：原 right:18px 竖排，与同在右侧的世代标签（right:60px）
     以及「适配/图例」浮标抢位，实测压住第 6-8 世人名。改为底部横向条，
     按钮 44px 触控区；世代标签让到左侧，三者互不重叠。 */
  body.page-tree-view .toolbar {
    right: auto !important; left: 50% !important; top: auto !important; bottom: 12px !important;
    transform: translateX(-50%) !important;
    flex-direction: row !important; gap: 8px !important;
    padding: 5px 10px !important; border-radius: 999px !important;
    background: var(--polish-panel) !important; border: 1px solid var(--polish-rule) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,.28) !important;
    max-width: calc(100vw - 100px) !important;
  }
  body.page-tree-view .toolbar .btn { width: 44px !important; height: 44px !important; min-height: 44px !important; border-radius: 50% !important; font-size: 17px !important; }
  body.page-tree-view .toolbar #verifyBtn { margin-top: 0 !important; }
  body.page-tree-view .gen-labels { right: auto !important; left: 10px !important; top: 62px !important; }
  /* 浮标上移，让开底部工具条 */
  body.page-tree-view .m-fab-fit { right: 10px !important; bottom: 74px !important; }
  body.page-tree-view .m-fab-legend { right: 10px !important; bottom: 20px !important; }
  body.page-tree-view .legend { left: 8px; right: 52px; bottom: 8px; width: auto; max-width: none; transform: none; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; }
  body.page-tree-view .legend-item { flex: 0 0 auto; }
  body.page-tree-view .legend-toggle,
  body.page-tree-view .gloss-btn { min-height: 44px; height: 44px; flex: 0 0 auto; }
  body.page-tree-view .legend.show-all { flex-direction: column; align-items: stretch; gap: 9px; max-height: 40vh; padding: 12px; overflow-x: hidden; overflow-y: auto; border-radius: 12px; }
  body.page-tree-view .legend.show-all .legend-item { display: flex; flex: 0 0 auto; width: 100%; white-space: normal; line-height: 1.5; }
  body.page-tree-view .legend.show-all .legend-toggle,
  body.page-tree-view .legend.show-all .gloss-btn { width: 100%; margin: 0; }

  body.page-upload .auth-overlay,
  body.page-ocr .auth-overlay { padding: 24px !important; }
}

/* ---------- 演示部署提示 ---------- */
body.page-polished .demo-mode-note,
body.page-polished .deployment-note {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, var(--polish-panel));
  color: var(--polish-muted);
  font-size: 12px;
  line-height: 1.6;
}
body.page-polished .demo-mode-note { margin: 0 0 16px; }
body.page-polished .deployment-note { max-width: 760px; margin: 0 auto 18px; }
body.page-family-detail .public-demo-note { margin-top: 58px; }

/* 404 由服务器响应到任意嵌套路径时也不产生横向滚动。 */
body.page-this-page-does-not-exist,
body.page-404 { width: 100%; max-width: 100vw; overflow: hidden !important; }
body.page-this-page-does-not-exist .nav,
body.page-404 .nav { width: 100%; max-width: 100vw; }
@media (max-width: 600px) {
  body.page-this-page-does-not-exist .nav,
  body.page-404 .nav { padding: 0 14px; }
  body.page-this-page-does-not-exist .error-wrap,
  body.page-404 .error-wrap { width: 100%; max-width: 100vw; padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  body.page-polished *,
  body.page-polished *::before,
  body.page-polished *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}



/* 站主令 09-30：logo 双色随主题切换 + 渐变换图与全站主题过渡同步——
   双图绝对定位叠放，opacity 渐变时长 var(--dur-theme)（默认 1.2s，深浅互切 1.7s），与「族信」文字 color 过渡完全同步；prefers-reduced-motion 时随全局 transition:none 关闭 */
.logo-stack { position: relative; display: inline-block; flex: none; vertical-align: middle; }
.logo-stack img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity var(--dur-theme, 1.2s) ease !important; } /* !important 压过 theme.css body.theme-transition * 的通配 transition（不含 opacity），否则 logo 仍瞬间切换 */
.logo-on-light { opacity: 0; }
html[data-theme="3"] .logo-on-dark { opacity: 0; }
html[data-theme="3"] .logo-on-light { opacity: 1; }


/* ============================================================
   UI 升级 v2 · 移动端增强（2026-09-30）
   全站 polish.css 尾部追加，改一处、所有页面同时生效。
   ============================================================ */
@media (max-width: 768px) {
  /* 首页姓氏星系：保留设计，缩小占位，不再吃掉半屏 */
  .galaxy-wrap { width: min(260px, 60vw) !important; height: 260px !important; }
  .galaxy-wrap canvas { width: 100% !important; height: 100% !important; }
  .hero { padding-top: 8px !important; }
  .hero-txt h1 { font-size: clamp(28px, 9vw, 40px) !important; }

  /* 通用：多列栅格降为单列，卡片留白压缩 */
  .families-grid, .news-rank-grid, .grid-3, .grid-4 { grid-template-columns: 1fr !important; }
  .grid-2 { grid-template-columns: 1fr !important; }
  .wrap, .in { padding-left: 14px !important; padding-right: 14px !important; }
  .sec, .sec-alt { padding-top: 36px !important; padding-bottom: 36px !important; }

  /* 触控目标下限（WCAG 2.5.5） */
  .ux-nav a, .btn, button { min-height: 44px; }

  /* 世系图：图例收窄、节点放大到可读尺寸 */
  .legend { max-width: 94vw !important; flex-wrap: wrap !important; justify-content: center !important;
            font-size: 11px !important; padding: 4px 10px !important; bottom: 8px !important; }
  /* 实测节点在手机上已是 90x47 可读尺寸，此处不再强制字号，避免把原本更大的字压小 */
}

@media (max-width: 420px) {
  .galaxy-wrap { width: min(210px, 54vw) !important; height: 210px !important; }
}

/* ===== UI 升级 v2（2026-10-01）：手机端字母索引改横向滑动条 =====
   26 个 24px 方块在 390 宽下要折 2~3 行，占掉小半屏；改为横滑 + 触控尺寸放大。 */
@media (max-width: 768px) {
  .alpha-bar { flex-wrap: nowrap !important; overflow-x: auto !important;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
  .alpha-bar::-webkit-scrollbar { display: none; }
  .alpha-bar b { flex: none !important; min-width: 34px !important; height: 34px !important; font-size: 13px; }
  .alpha-bar.is-compact { overflow-x: visible !important; }
}

/* ===== UI 升级 v2（2026-10-01）：条款/隐私/退款 三页视觉增强 =====
   目标：纯文本法律页面增加层次感、可读性和品牌一致性。 */
.terms-page .card,
.privacy-page .card,
.refund-page .card {
  border-left: 3px solid var(--accent);
  padding-left: 1.75rem;
}
.terms-page .card:hover,
.privacy-page .card:hover,
.refund-page .card:hover {
  border-left-width: 4px;
}
.terms-page .section-label,
.privacy-page .section-label,
.refund-page .section-label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.terms-page .section-label::before,
.privacy-page .section-label::before,
.refund-page .section-label::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  flex-shrink: 0;
}
.terms-page h2,
.privacy-page h2,
.refund-page h2 {
  font-size: 1.08rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: .75rem;
}
.terms-page ul li,
.privacy-page ul li,
.refund-page ul ul li {
  position: relative;
  padding-left: 1.25em;
}
.terms-page ul li::before,
.privacy-page ul li::before,
.refund-page ul li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1em;
}
.terms-page .highlight-box,
.privacy-page .highlight-box,
.refund-page .highlight-box {
  border-left: 3px solid var(--state-warn, #e0a050);
  background: color-mix(in srgb, var(--state-warn, #e0a050) 6%, transparent);
}
.terms-page .last-updated,
.privacy-page .last-updated,
.refund-page .page-subtitle {
  opacity: .7;
}
/* 条款页 hero 区域微调 */
.terms-page .hero-section .seal-large,
.privacy-page .hero-section .seal-large {
  animation: sealFloat 3s ease-in-out infinite;
}
@keyframes sealFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
