/* ==========================================================================
   BVK — Brazzein Variant Knowledgebase
   科研数据库风格，零外部依赖。

   配色（docs/annex/A1 §八）：
     深蓝 数据库与规范数据 ｜ 青绿 增甜 ｜ 橙 减甜 ｜ 紫 结构与机制
     琥珀 证据冲突 ｜ 灰 未知或证据不足
   刻意不用红/绿对比，以兼顾色觉障碍用户。
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  /* 间距阶（4px 基准） */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  /* 字号阶 */
  --t-xs: 11.5px; --t-sm: 12.5px; --t-md: 13.5px;
  --t-base: 15px; --t-lg: 17px;   --t-xl: 21px; --t-2xl: 26px;

  --radius: 5px;
  --radius-sm: 3px;
  --maxw: 1400px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;

  --shadow: 0 1px 2px rgba(10, 35, 55, .045);
  --shadow-raised: 0 4px 14px rgba(4, 28, 48, .10);
  --ring: 0 0 0 3px rgba(0, 126, 134, .24);

  /* 浅色主题 */
  --bg:        #f6f8fa;
  --bg-accent: #f6f8fa;
  --surface:   #ffffff;
  --surface-2: #f2f5f7;
  --border:    #d4dde3;
  --border-strong: #aebec8;
  --text:      #102533;
  --text-dim:  #405866;
  --text-mute: #586e7b;

  --navy:      #0b2f4a;
  --navy-2:    #17689f;
  --teal:      #007f83;
  --orange:    #c2570c;
  --purple:    #6d28d9;
  --amber:     #a16207;

  --teal-bg:   #d6f0ec;
  --orange-bg: #fbe7d6;
  --purple-bg: #e9e1fb;
  --amber-bg:  #f9edd2;
  --grey-bg:   #e6eaf1;

  --nav-bg:    #0b2f4a;
  --nav-fg:    #ffffff;
  --brand-deep:#08243a;
  --brand-mid: #0d3b5c;
  --brand-accent:#12b8b2;
  --positive:  #087f78;
  --negative:  #bd5c13;
  --patent:    #9a3f2d;
  --patent-bg: #f4e0da;
  --patent-neutral: #5f6f7e;
  --patent-neutral-bg: #edf1f4;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0d131c;
    --bg-accent: #131c27;
    --surface:   #151e2a;
    --surface-2: #1c2634;
    --border:    #2a3749;
    --border-strong: #3a4a60;
    --text:      #e5edf6;
    --text-dim:  #93a4b9;
    --text-mute: #93a4b9;

    --navy:      #7fa8d8;
    --navy-2:    #8fb5e0;
    --teal:      #4fd6c4;
    --orange:    #fb9a4b;
    --purple:    #b79ef5;
    --amber:     #e3bc5a;

    --teal-bg:   #0f3730;
    --orange-bg: #3a2513;
    --purple-bg: #2a2145;
    --amber-bg:  #372c12;
    --grey-bg:   #212c3b;
    --patent:    #e18470;
    --patent-bg: #40221e;
    --patent-neutral: #93a4b9;
    --patent-neutral-bg: #202b39;

    --nav-bg:    #101822;
    --nav-fg:    #e5edf6;

    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .2);
    --ring: 0 0 0 3px rgba(127, 168, 216, .3);
  }
}

/* 手动切换覆盖（必须能压过系统偏好） */
:root[data-theme="dark"] {
  --bg:#0d131c; --bg-accent:#131c27; --surface:#151e2a; --surface-2:#1c2634;
  --border:#2a3749; --border-strong:#3a4a60;
  --text:#e5edf6; --text-dim:#aab8c9; --text-mute:#93a4b9;
  --navy:#7fa8d8; --navy-2:#8fb5e0; --teal:#4fd6c4; --orange:#fb9a4b;
  --purple:#b79ef5; --amber:#e3bc5a;
  --teal-bg:#0f3730; --orange-bg:#3a2513; --purple-bg:#2a2145;
  --amber-bg:#372c12; --grey-bg:#212c3b;
  --nav-bg:#101822; --nav-fg:#e5edf6;
  --brand-deep:#07131f; --brand-mid:#102b3f; --brand-accent:#3cd4cc;
  --positive:#4fd6c4; --negative:#fb9a4b;
  --patent:#e18470; --patent-bg:#40221e;
  --patent-neutral:#93a4b9; --patent-neutral-bg:#202b39;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.2);
  --shadow-raised: 0 18px 48px rgba(0,0,0,.35);
  --ring: 0 0 0 3px rgba(127,168,216,.3);
}
:root[data-theme="light"] {
  --bg:#f6f8fa; --bg-accent:#f6f8fa; --surface:#ffffff; --surface-2:#f2f5f7;
  --border:#d4dde3; --border-strong:#aebec8;
  --text:#102533; --text-dim:#405866; --text-mute:#586e7b;
  --navy:#0b2f4a; --navy-2:#17689f; --teal:#007f83; --orange:#c2570c;
  --purple:#6d28d9; --amber:#a16207;
  --teal-bg:#d6f0ec; --orange-bg:#fbe7d6; --purple-bg:#e9e1fb;
  --amber-bg:#f9edd2; --grey-bg:#e6eaf1;
  --nav-bg:#0b2f4a; --nav-fg:#ffffff;
  --brand-deep:#08243a; --brand-mid:#0d3b5c; --brand-accent:#12b8b2;
  --positive:#087f78; --negative:#bd5c13;
  --patent:#9a3f2d; --patent-bg:#f4e0da;
  --patent-neutral:#5f6f7e; --patent-neutral-bg:#edf1f4;
  --shadow:0 1px 2px rgba(10,35,55,.045);
  --shadow-raised:0 4px 14px rgba(4,28,48,.10);
  --ring:0 0 0 3px rgba(0,126,134,.24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--t-base)/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 var(--s5);
  display: flex; align-items: center; gap: var(--s1);
  flex-wrap: wrap; min-height: 54px;
}
.brand {
  color: var(--nav-fg); font-weight: 700; letter-spacing: .05em;
  text-decoration: none; margin-right: var(--s5); font-size: var(--t-lg);
  line-height: 1.15; padding: var(--s2) 0;
}
.brand small {
  display: block; font-weight: 400; font-size: 10.5px;
  opacity: .68; letter-spacing: .02em; margin-top: 1px;
}
.nav .item {
  color: rgba(255, 255, 255, .78); text-decoration: none;
  padding: 7px var(--s3); border-radius: var(--radius-sm);
  font-size: var(--t-md); white-space: nowrap;
  transition: background .12s, color .12s;
}
:root[data-theme="dark"] .nav .item,
:root[data-theme="dark"] .brand { color: rgba(229, 237, 246, .8); }
.nav .item:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav .item[aria-current="page"] {
  background: rgba(255, 255, 255, .18); color: #fff; font-weight: 600;
}
.nav .spacer { flex: 1; }
.nav .ver {
  color: rgba(255, 255, 255, .55); font-size: var(--t-xs);
  font-family: var(--mono); margin-right: var(--s2);
}
.theme-btn {
  background: rgba(255, 255, 255, .12); border: 0; color: #fff;
  border-radius: var(--radius-sm); padding: 6px 10px;
  cursor: pointer; font-size: var(--t-md); line-height: 1;
}
.theme-btn:hover { background: rgba(255, 255, 255, .2); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

/* ---------- 布局 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: var(--s6) var(--s5) var(--s8); }

h1 {
  font-size: var(--t-2xl); margin: 0 0 var(--s2);
  letter-spacing: -.015em; line-height: 1.25; font-weight: 700;
}
h2 {
  font-size: var(--t-xl); margin: var(--s7) 0 var(--s3);
  padding-bottom: var(--s2); border-bottom: 1px solid var(--border);
  letter-spacing: -.01em; font-weight: 650;
}
h3 { font-size: var(--t-base); margin: var(--s5) 0 var(--s2); font-weight: 650; }
.lede { color: var(--text-dim); margin: 0 0 var(--s5); max-width: 80ch; }
p { margin: 0 0 var(--s3); }

a { color: var(--navy-2); text-decoration-color: color-mix(in srgb, var(--navy-2) 35%, transparent); text-underline-offset: 2px; }
a:hover { text-decoration-color: currentColor; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s4) var(--s5);
  margin-bottom: var(--s3); box-shadow: var(--shadow);
}

/* ---------- 统计块 ---------- */
.stats {
  display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: var(--s3);
}
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--s3) var(--s4);
  box-shadow: var(--shadow);
}
.stat .n {
  font-size: 28px; font-weight: 700; font-family: var(--mono);
  line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.stat .k { font-size: var(--t-sm); color: var(--text-dim); margin-top: 3px; }
.stat.hl .n   { color: var(--teal); }
.stat.warn .n { color: var(--orange); }

/* ---------- 序列位点图 ---------- */
.seqwrap { overflow-x: auto; padding-bottom: var(--s2); }
.seqgrid {
  display: grid;
  grid-template-columns: repeat(27, 32px);
  gap: 3px;
  min-width: max-content;
}
@media (max-width: 1100px) { .seqgrid { grid-template-columns: repeat(18, 32px); } }
@media (max-width: 760px)  { .seqgrid { grid-template-columns: repeat(9, 32px); } }

/* 二级结构轨道 */
.sstrack {
  height: 15px; border-radius: 3px; display: flex;
  align-items: center; justify-content: center;
  font-size: 9px; font-family: var(--mono); letter-spacing: .03em;
  color: var(--text-mute); background: transparent;
}
.sstrack.beta  { background: var(--purple-bg); color: var(--purple); font-weight: 700; }
.sstrack.helix { background: var(--teal-bg);   color: var(--teal);   font-weight: 700; }

.res {
  height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--grey-bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--mono); position: relative;
  text-decoration: none; color: var(--text);
  transition: transform .1s, box-shadow .1s;
}
.res .aa { font-size: 13px; font-weight: 700; line-height: 1; }
.res .p  {
  font-size: 8.5px; color: var(--text-mute); line-height: 1;
  margin-top: 2px; font-variant-numeric: tabular-nums;
}
.res.enhanced        { background: var(--teal-bg);   border-color: var(--teal); }
.res.enhanced .aa    { color: var(--teal); }
.res.decreased       { background: var(--orange-bg); border-color: var(--orange); }
.res.decreased .aa   { color: var(--orange); }
.res.reflike         { background: var(--surface-2); border-color: var(--border-strong); }
.res.conflict        { background: var(--amber-bg);  border-color: var(--amber); }
.res.conflict .aa    { color: var(--amber); }
.res.mixed-effects {
  border-color: #6d7380;
  background: linear-gradient(135deg, var(--teal-bg) 0 48%, var(--orange-bg) 52% 100%);
}
.res.mixed-effects .aa { color: var(--navy); }
.res.cys             { background: var(--purple-bg); border-color: var(--purple); }
.res.cys .aa         { color: var(--purple); }
.res.patent-blocked  { background: var(--patent-bg); border-color: var(--patent); }
.res.patent-blocked .aa { color: var(--patent); }
.res.patent-watch    { background: var(--amber-bg); border-color: var(--amber); }
.res.patent-prior-art { background: #e6edf3; border-color: #7890a2; }
.res.patent-uncovered { background: var(--patent-neutral-bg); border-color: var(--border-strong); }
a.res:hover { transform: translateY(-2px); box-shadow: 0 3px 8px rgba(0,0,0,.16); }

/* 右上角 FTO 圆点 */
.res .fto {
  position: absolute; top: -3px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  border: 1.5px solid var(--surface);
}
.res .fto.blocked { background: var(--patent); }
.res .fto.watch   { background: var(--amber); }
.res .measurement-conflict {
  position: absolute;
  top: -5px;
  left: -5px;
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--surface);
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  font: 800 8px/1 var(--sans);
}
/* 左下角二硫键配对编号 */
.res .ss {
  position: absolute; bottom: -5px; left: -4px;
  font-size: 8px; padding: 0 3px; border-radius: 6px;
  background: var(--purple); color: #fff; line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.legend {
  display: flex; flex-wrap: wrap; gap: var(--s4) var(--s5);
  font-size: var(--t-sm); color: var(--text-dim); margin-top: var(--s3);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw {
  width: 13px; height: 13px; border-radius: 3px;
  border: 1px solid var(--border-strong); flex: none;
}
.sw.dot { border-radius: 50%; }

/* ---------- 表格 ---------- */
.tablewrap {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow);
}
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--t-md); }
th, td {
  padding: 9px var(--s3); text-align: left;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
th {
  background: var(--surface-2); font-weight: 650; font-size: var(--t-sm);
  white-space: nowrap; position: static;
  border-bottom: 1px solid var(--border-strong);
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--navy-2); }
th .arrow { opacity: .4; font-size: 10px; margin-left: 2px; }
tbody tr:hover { background: var(--bg-accent); }
tbody tr:last-child td { border-bottom: 0; }
td.mono, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- 徽标 ---------- */
.tag {
  display: inline-block; padding: 2px 9px; border-radius: 11px;
  font-size: var(--t-xs); font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; line-height: 1.5;
}
.tag.enhanced      { background: var(--teal-bg);   color: var(--teal);   border-color: var(--teal); }
.tag.decreased     { background: var(--orange-bg); color: var(--orange); border-color: var(--orange); }
.tag.reflike,
.tag[class~="reference-like"] { background: var(--grey-bg); color: var(--text-dim); }
.tag.conflict      { background: var(--amber-bg);  color: var(--amber);  border-color: var(--amber); }
.tag.not_reported  {
  background: transparent; color: var(--text-mute);
  border-color: var(--border-strong); font-weight: 400; font-style: italic;
}
.tag.struct  { background: var(--purple-bg); color: var(--purple); border-color: var(--purple); }
.tag.grade   { background: var(--surface-2); color: var(--text-dim); font-family: var(--mono); }
.tag.pred    { background: transparent; color: var(--purple); border: 1px dashed var(--purple); }
.tag.patent-active {
  color: var(--patent);
  border-color: var(--patent);
  background: var(--patent-bg);
}
.tag.patent-pending {
  color: var(--amber);
  border-color: var(--amber);
  background: var(--amber-bg);
}

/* ---------- 筛选面板 ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--s5); align-items: start; }
@media (max-width: 940px) { .layout { grid-template-columns: 1fr; } }
.filters { position: sticky; top: 74px; }
.filters .grp { margin-bottom: var(--s4); }
.filters label {
  display: block; font-size: var(--t-sm); color: var(--text-dim);
  margin-bottom: 5px; font-weight: 600;
}
.filters select, .filters input[type="text"], .filters input:not([type]) {
  width: 100%; padding: 7px 9px; font-size: var(--t-md); color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit;
}
.filters .check { display: flex; align-items: center; gap: 7px; font-weight: 500; }
.filters .check input { width: auto; margin: 0; }

.btn {
  display: inline-block; padding: 8px 14px; font-size: var(--t-md);
  cursor: pointer; background: var(--navy-2); color: #fff; border: 0;
  border-radius: var(--radius-sm); text-decoration: none;
  font-family: inherit; font-weight: 500; transition: filter .12s;
}
.btn:hover { filter: brightness(1.1); }
.btn.ghost {
  background: transparent; color: var(--navy-2);
  border: 1px solid var(--border-strong);
}
.btn.ghost:hover { background: var(--surface-2); filter: none; }

/* ---------- 证据卡片 ---------- */
.evi {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--navy-2);
  border-radius: var(--radius); padding: var(--s3) var(--s4);
  margin-bottom: var(--s3); box-shadow: var(--shadow);
}
.evi.enhanced  { border-left-color: var(--teal); }
.evi.decreased { border-left-color: var(--orange); }
.evi .hdr { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s2); }
.evi .raw {
  font-family: var(--mono); font-size: var(--t-sm); background: var(--surface-2);
  padding: 8px 10px; border-radius: var(--radius-sm); margin: var(--s2) 0 0;
  white-space: pre-wrap; word-break: break-word; line-height: 1.55;
}

.kv { display: grid; grid-template-columns: 170px 1fr; gap: 5px var(--s4); font-size: var(--t-md); margin: 0; }
@media (max-width: 620px) { .kv { grid-template-columns: 1fr; gap: 2px; } }
.kv dt { color: var(--text-dim); }
.kv dd { margin: 0; }
.na { color: var(--text-mute); font-style: italic; }

.seqbox {
  font-family: var(--mono); font-size: var(--t-md); word-break: break-all;
  background: var(--surface-2); padding: var(--s3) var(--s4);
  border-radius: var(--radius-sm); line-height: 2; letter-spacing: .06em;
  border: 1px solid var(--border);
}
.seqbox b {
  color: var(--teal); background: var(--teal-bg);
  padding: 1px 2px; border-radius: 3px; font-weight: 700;
}

.note {
  background: var(--amber-bg); border: 1px solid var(--amber);
  border-radius: var(--radius); padding: var(--s3) var(--s4);
  font-size: var(--t-md); margin: var(--s4) 0; line-height: 1.7;
}
.note b { color: var(--amber); }

.foot {
  margin-top: var(--s7); padding-top: var(--s4);
  border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: var(--t-sm); line-height: 1.7;
}
code {
  font-family: var(--mono); font-size: .92em; background: var(--surface-2);
  padding: 1.5px 5px; border-radius: 4px; border: 1px solid var(--border);
}
.loading { color: var(--text-mute); padding: var(--s6) 0; text-align: center; }

/* ==========================================================================
   v0.5 数据库界面重构
   信息架构借鉴成熟生命科学数据库的稳定范式：
   search first · entity navigation · faceted results · evidence-first entry
   ========================================================================== */

.sr-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important; border: 0 !important;
}
.skip-link {
  position: fixed; z-index: 999; top: 8px; left: 8px;
  transform: translateY(-150%);
  padding: 8px 12px; color: #fff; background: var(--brand-deep);
  border: 2px solid var(--brand-accent); border-radius: var(--radius-sm);
  font-weight: 700; text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

body { min-height: 100vh; background:
  linear-gradient(180deg, var(--bg-accent) 0, var(--bg) 220px, var(--bg) 100%); }
button, input, select { font: inherit; }
.nav-shell { width: min(100% - 40px, var(--maxw)); margin-inline: auto; }

.site-header {
  position: relative; z-index: 40;
  color: #fff; background: var(--brand-deep);
  box-shadow: 0 5px 18px rgba(1, 24, 40, .12);
}
.utility-bar {
  min-height: 30px; background: rgba(0, 0, 0, .16);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.utility-inner {
  min-height: 30px; display: flex; align-items: center; justify-content: space-between;
  gap: 20px; color: rgba(255, 255, 255, .64);
  font: 600 10.5px/1.2 var(--sans); letter-spacing: .07em; text-transform: uppercase;
}
.utility-meta { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.utility-meta b { color: #fff; }
.utility-meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--brand-accent); }

.masthead { background:
  radial-gradient(circle at 76% -120%, rgba(27, 203, 194, .22), transparent 42%),
  linear-gradient(105deg, var(--brand-deep), var(--brand-mid)); }
.masthead-inner {
  min-height: 86px; display: grid;
  grid-template-columns: minmax(250px, .72fr) minmax(360px, 1.55fr) auto;
  align-items: center; gap: 30px;
}
.site-header .brand {
  display: inline-flex; align-items: center; gap: 12px;
  min-width: 0; margin: 0; padding: 0; color: #fff;
  text-decoration: none; letter-spacing: 0;
}
.brand-mark {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 46px; height: 46px; border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 12px 4px 12px 4px;
  color: var(--brand-deep); background: var(--brand-accent);
  font: 800 15px/1 var(--mono); letter-spacing: -.08em;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .12);
}
.brand-copy { min-width: 0; }
.brand-copy b { display: block; font-size: 22px; line-height: 1; letter-spacing: .08em; }
.site-header .brand-copy small {
  display: block; margin-top: 5px; color: rgba(255, 255, 255, .62);
  font-size: 10px; font-weight: 600; letter-spacing: .035em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.global-search {
  display: grid; grid-template-columns: 1fr auto; min-width: 0;
  background: #fff; border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0, 15, 28, .18);
}
.global-search:focus-within { box-shadow: 0 0 0 3px rgba(18, 184, 178, .35), 0 8px 28px rgba(0, 15, 28, .18); }
.global-search input {
  min-width: 0; border: 0; outline: 0; padding: 12px 16px;
  color: #173041; background: transparent; font-size: 14px;
}
.global-search input::placeholder { color: #758a98; }
.global-search button {
  margin: 4px; padding: 7px 20px; border: 0; border-radius: 7px;
  color: #fff; background: #087f83; cursor: pointer; font-weight: 700;
}
.global-search button:hover { background: #056d71; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-link, .theme-btn {
  min-height: 36px; display: inline-grid; place-items: center;
  padding: 0 12px; border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 8px; color: rgba(255, 255, 255, .86);
  background: rgba(255, 255, 255, .07); text-decoration: none;
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.theme-btn { width: 38px; padding: 0; }
.header-link:hover, .theme-btn:hover { color: #fff; background: rgba(255, 255, 255, .15); }

.primary-nav {
  min-height: 43px; background: #fff; color: #183140;
  border-bottom: 1px solid var(--border);
}
.primary-inner { min-height: 43px; display: flex; align-items: stretch; }
.primary-links { display: flex; align-items: stretch; gap: 2px; }
.primary-links .item {
  position: relative; display: inline-flex; align-items: center;
  padding: 0 13px; color: #455e6d; text-decoration: none;
  font-size: 13px; font-weight: 650; white-space: nowrap;
}
.primary-links .item:hover { color: var(--navy); background: #f2f7f8; }
.primary-links .item[aria-current="page"] { color: var(--navy); background: #eef6f6; }
.primary-links .item[aria-current="page"]::after {
  content: ""; position: absolute; height: 3px; left: 12px; right: 12px; bottom: 0;
  border-radius: 3px 3px 0 0; background: var(--teal);
}
.menu-btn {
  display: none; align-items: center; justify-content: space-between;
  width: 100%; border: 0; padding: 11px 0; color: var(--text);
  background: transparent; font-weight: 700; cursor: pointer;
}
.nav-context {
  margin-left: auto; display: flex; align-items: center; gap: 7px;
  color: #718491; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #16a39e; box-shadow: 0 0 0 3px #d9f3f1; }

.wrap {
  width: min(100%, var(--maxw)); max-width: none;
  padding: 34px 20px 72px; margin-inline: auto;
}
h1 { font-size: clamp(27px, 3vw, 38px); letter-spacing: -.035em; }
h2 {
  margin-top: 42px; padding-bottom: 10px;
  font-size: clamp(19px, 2vw, 24px); border-color: var(--border);
}
h3 { font-size: 15px; }
.lede { max-width: 92ch; font-size: 14.5px; line-height: 1.75; }
.card { border-radius: var(--radius); box-shadow: var(--shadow); }

.breadcrumbs {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  color: var(--text-mute); font-size: 11.5px; font-weight: 650;
}
.breadcrumbs a { color: var(--text-dim); text-decoration: none; }
.breadcrumbs span[aria-hidden] { color: var(--border-strong); }
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 28px; margin-bottom: 26px;
}
.page-head h1 { margin-bottom: 8px; }
.page-kicker {
  margin-bottom: 7px; color: var(--teal);
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
}
.page-actions { display: flex; align-items: center; gap: 8px; padding-top: 18px; flex: 0 0 auto; }
.page-meta {
  display: flex; flex-wrap: wrap; gap: 7px 16px; margin-top: 13px;
  color: var(--text-dim); font-size: 12px;
}
.page-meta span { display: inline-flex; align-items: center; gap: 6px; }
.page-meta i { width: 5px; height: 5px; border-radius: 50%; background: var(--brand-accent); }

.hero {
  position: relative; overflow: hidden; width: 100vw;
  margin: -34px 0 0 calc(50% - 50vw);
  padding: 58px max(20px, calc((100vw - var(--maxw)) / 2 + 20px)) 42px;
  color: #fff; background:
    radial-gradient(circle at 82% 18%, rgba(45, 218, 206, .18), transparent 28%),
    linear-gradient(116deg, #092941 0%, #0d3b59 52%, #0a4b5d 100%);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.hero::after {
  content: ""; position: absolute; right: -80px; bottom: -180px;
  width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%; box-shadow: 0 0 0 64px rgba(255,255,255,.025), 0 0 0 128px rgba(255,255,255,.018);
  pointer-events: none;
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .6fr); gap: 60px; align-items: center; }
.hero .page-kicker { color: #63ddd6; }
.hero h1 { max-width: 18ch; margin-bottom: 16px; color: #fff; font-size: clamp(36px, 5vw, 62px); line-height: 1.06; }
.hero-lede { max-width: 70ch; color: rgba(255,255,255,.74); font-size: 16px; line-height: 1.75; }
.hero-lede strong { color: #fff; }
.hero-search {
  display: grid; grid-template-columns: 1fr auto; max-width: 790px;
  margin-top: 28px; padding: 5px; background: #fff; border-radius: 12px;
  box-shadow: 0 16px 42px rgba(0,0,0,.24);
}
.hero-search input { min-width: 0; padding: 13px 15px; border: 0; outline: 0; color: #173041; background: transparent; }
.hero-search button {
  padding: 0 24px; border: 0; border-radius: 8px;
  color: #fff; background: var(--teal); cursor: pointer; font-weight: 750;
}
.hero-examples { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; color: rgba(255,255,255,.55); font-size: 11.5px; }
.hero-examples a { color: rgba(255,255,255,.82); text-decoration-color: rgba(255,255,255,.25); }
.hero-snapshot {
  position: relative; padding: 22px; border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px; background: rgba(1, 20, 34, .32); backdrop-filter: blur(8px);
}
.snapshot-label { color: #62ddd6; font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.snapshot-version { margin: 5px 0 18px; font: 700 24px/1.2 var(--mono); }
.snapshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.snapshot-item { padding-top: 11px; border-top: 1px solid rgba(255,255,255,.12); }
.snapshot-item b { display: block; color: #fff; font: 700 21px/1.15 var(--mono); }
.snapshot-item span { color: rgba(255,255,255,.56); font-size: 11px; }
.snapshot-foot { margin-top: 18px; color: rgba(255,255,255,.55); font-size: 11px; line-height: 1.6; }

.home-section { padding-top: 36px; }
.section-heading {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  margin: 0 0 16px;
}
.section-heading h2 { margin: 0; padding: 0; border: 0; }
.section-heading p { margin: 4px 0 0; color: var(--text-dim); font-size: 13px; }
.section-heading a { flex: 0 0 auto; font-size: 12.5px; font-weight: 700; text-decoration: none; }

.entity-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.entity-card {
  position: relative; min-height: 156px; overflow: hidden;
  padding: 20px; border: 1px solid var(--border); border-radius: 13px;
  color: var(--text); background: var(--surface); box-shadow: var(--shadow);
  text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.entity-card:hover { transform: translateY(-3px); border-color: #91bfc2; box-shadow: var(--shadow-raised); text-decoration: none; }
.entity-code {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 25px; padding: 0 8px; border-radius: 6px;
  color: var(--teal); background: var(--teal-bg);
  font: 800 10.5px/1 var(--mono); letter-spacing: .04em;
}
.entity-card h3 { margin: 17px 0 5px; font-size: 17px; }
.entity-card p { margin: 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.6; }
.entity-count { position: absolute; top: 18px; right: 18px; color: var(--text-mute); font: 700 12px/1 var(--mono); }
.entity-arrow { position: absolute; right: 18px; bottom: 14px; color: var(--teal); font-size: 18px; }

.metric-strip, .stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
}
.metric-strip { margin: 22px 0 0; }
.metric, .stats .stat {
  min-height: 90px; padding: 17px 18px; border: 0; border-right: 1px solid var(--border);
  border-radius: 0; background: transparent; box-shadow: none;
}
.metric:last-child, .stats .stat:last-child { border-right: 0; }
.metric b, .stat .n { display: block; color: var(--navy); font: 750 26px/1.1 var(--mono); }
.metric span, .stat .k { display: block; margin-top: 7px; color: var(--text-dim); font-size: 11.5px; }
.stat.hl .n { color: var(--teal); }
.stat.warn .n { color: var(--orange); }
.stat.patent-warn .n { color: var(--patent); }
.stat.neutral .n { color: var(--patent-neutral); }

.surface-panel {
  padding: 22px; border: 1px solid var(--border); border-radius: 13px;
  background: var(--surface); box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-head h2, .panel-head h3 { margin: 0; padding: 0; border: 0; }
.panel-head p { margin: 5px 0 0; color: var(--text-dim); font-size: 12.5px; }
.panel-badge { flex: 0 0 auto; padding: 5px 9px; border-radius: 6px; color: var(--teal); background: var(--teal-bg); font: 700 10.5px/1.2 var(--mono); }

.insight-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 16px; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.principle {
  padding: 19px; border-top: 3px solid var(--teal);
  border-radius: 0 0 11px 11px; background: var(--surface); box-shadow: var(--shadow);
}
.principle:nth-child(2) { border-color: var(--purple); }
.principle:nth-child(3) { border-color: var(--amber); }
.principle b { display: block; margin-bottom: 6px; font-size: 14px; }
.principle p { margin: 0; color: var(--text-dim); font-size: 12.5px; line-height: 1.65; }

.callout {
  padding: 14px 16px; border: 1px solid #badfdd; border-left: 4px solid var(--teal);
  border-radius: 9px; background: #edf8f7; font-size: 13px; line-height: 1.7;
}
.callout.warning { border-color: #ead3a8; border-left-color: var(--amber); background: #fff8e9; }
.callout strong { color: var(--text); }

.layout { grid-template-columns: 264px minmax(0, 1fr); gap: 22px; }
.filters { top: 14px; }
.filters .card { padding: 0 !important; overflow: hidden; }
.facet-head {
  padding: 15px 16px; color: #fff; background: var(--brand-mid);
  font-size: 12px; font-weight: 750; letter-spacing: .025em;
}
.facet-body { padding: 15px; }
.filters .grp { margin-bottom: 15px; }
.filters label { color: var(--text); font-size: 11.5px; font-weight: 700; }
.filters select, .filters input[type="text"], .filters input:not([type]) {
  padding: 9px 10px; border-color: var(--border-strong); border-radius: 7px;
  background: var(--surface); font-size: 12.5px;
}
.filters select:focus, .filters input:focus { border-color: var(--teal); outline: 0; box-shadow: var(--ring); }
.result-toolbar {
  min-height: 48px; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 0 4px 10px;
}
.result-count { color: var(--text); font-size: 13px; font-weight: 700; }
.result-count span { color: var(--text-dim); font-weight: 500; }
.result-tools { display: flex; gap: 8px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text-dim); background: var(--surface); font-size: 10.5px;
}

.tablewrap { border-radius: 11px; box-shadow: var(--shadow); }
table { font-size: 12.5px; }
th, td { padding: 10px 12px; }
th { color: #405563; background: #eef3f5; font-size: 10.5px; letter-spacing: .02em; text-transform: none; }
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: #f0f7f7; }
.table-id { color: var(--navy-2); font-weight: 750; text-decoration: none; }
.table-primary { display: block; color: var(--text); font-weight: 700; }
.table-secondary { display: block; margin-top: 3px; color: var(--text-dim); font-size: 11px; line-height: 1.45; }
.data-source-note { margin: 8px 0 0; color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.table-empty { padding: 34px !important; text-align: center; color: var(--text-dim); }

.btn {
  border-radius: 7px; background: var(--teal); font-weight: 700;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.btn:hover { filter: brightness(.95); }
.btn.ghost { color: var(--navy); background: var(--surface); border-color: var(--border-strong); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 6px 10px; font-size: 11.5px; }

.tag { padding: 2px 8px; border-radius: 999px; font-size: 10px; }
.tag.grade { border-color: var(--border); }
.note {
  border: 1px solid #e7d4ad; border-left: 4px solid var(--amber);
  border-radius: 9px; background: #fff9ed; color: var(--text);
}
.note b { color: #805007; }
.evi { border-radius: 10px; box-shadow: none; }
.evi .raw { border: 1px solid var(--border); }
.seqbox { border-radius: 9px; background: #f5f8fa; }

.tabs {
  display: flex; align-items: center; gap: 4px; overflow-x: auto;
  margin: 24px 0 16px; padding: 5px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  scrollbar-width: thin;
}
.tab {
  flex: 0 0 auto; padding: 8px 12px; border: 0; border-radius: 7px;
  color: var(--text-dim); background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 700;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-selected="true"] { color: #fff; background: var(--teal); }
.tab .tab-count { margin-left: 5px; opacity: .72; font-family: var(--mono); }
.data-section { scroll-margin-top: 12px; }
.data-section[hidden] { display: none; }
.data-section > h2 { margin-top: 22px; }

.entry-layout { display: grid; grid-template-columns: 315px minmax(0, 1fr); gap: 22px; align-items: start; }
.entry-aside { position: sticky; top: 14px; }
.entry-summary {
  overflow: hidden; border: 1px solid var(--border); border-radius: 13px;
  background: var(--surface); box-shadow: var(--shadow);
}
.entry-summary-head { padding: 20px; color: #fff; background: linear-gradient(135deg, var(--brand-deep), var(--brand-mid)); }
.entry-summary-head .mono { color: rgba(255,255,255,.62); font-size: 11px; }
.entry-summary-head h1 { margin: 6px 0 10px; color: #fff; font: 750 34px/1.1 var(--mono); }
.summary-list { margin: 0; padding: 8px 18px 16px; }
.summary-list div { padding: 11px 0; border-bottom: 1px solid var(--border); }
.summary-list div:last-child { border-bottom: 0; }
.summary-list dt { color: var(--text-mute); font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.summary-list dd { margin: 3px 0 0; color: var(--text); font-size: 12.5px; }
.entry-main > h2:first-child { margin-top: 0; }
.entry-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- 本地三维结构查看器 ---------- */
.structure-explorer { margin-bottom: 38px; scroll-margin-top: 16px; }
.variant-structure-panel { margin-top: 24px; scroll-margin-top: 16px; }
.structure-viewer {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
.structure-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.7fr) minmax(155px, .65fr) minmax(130px, .5fr);
  gap: 10px;
  align-items: end;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.structure-control { display: grid; gap: 5px; min-width: 0; }
.structure-control > span {
  color: var(--text-mute);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.structure-control select {
  width: 100%;
  height: 36px;
  padding: 0 31px 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  font: 650 11.5px/1.2 var(--sans);
}
.structure-control select:focus {
  border-color: var(--teal);
  outline: 0;
  box-shadow: var(--ring);
}
.structure-control.is-disabled { opacity: .54; }
.structure-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 2px;
}
.structure-actions .is-disabled {
  pointer-events: none;
  opacity: .5;
}
.structure-stage-frame {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,.35), transparent 46%),
    #edf3f6;
}
.structure-stage {
  width: 100%;
  height: clamp(440px, 48vw, 620px);
  min-height: 440px;
  transition: opacity .16s ease;
}
.structure-viewer.compact .structure-stage {
  height: clamp(390px, 41vw, 510px);
  min-height: 390px;
}
.structure-stage canvas { display: block; }
.structure-stage canvas:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: -3px; }
.structure-viewer.is-loading .structure-stage { opacity: .58; }
.structure-status {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  max-width: min(78%, 620px);
  padding: 7px 10px;
  border: 1px solid rgba(10,47,74,.13);
  border-radius: 7px;
  color: #274354;
  background: rgba(255,255,255,.9);
  box-shadow: 0 3px 14px rgba(8,36,58,.09);
  backdrop-filter: blur(8px);
  font: 700 11.5px/1.35 var(--mono);
}
.structure-status.loading::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border: 2px solid #8fbfc0;
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: structure-spin .8s linear infinite;
}
.structure-status.success { color: #12665f; border-color: #a7d8d1; background: rgba(235,250,247,.92); }
.structure-status.error { color: #8a4d09; border-color: #e3c78f; background: rgba(255,248,232,.95); }
@keyframes structure-spin { to { transform: rotate(360deg); } }
.structure-legend {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 13px;
  max-width: calc(100% - 24px);
  padding: 7px 10px;
  border: 1px solid rgba(10,47,74,.11);
  border-radius: 7px;
  color: #405865;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(7px);
  font-size: 11.5px;
}
.structure-legend span { display: inline-flex; align-items: center; gap: 5px; }
.structure-legend i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
.legend-ribbon { background: linear-gradient(135deg, #236da0, #8b5fc7); }
.legend-cys { background: #e6c03a; }
.legend-site { background: #f3a712; box-shadow: 0 0 0 2px rgba(243,167,18,.25) !important; }
.structure-help {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 13px;
  color: rgba(34,57,72,.65);
  font-size: 11.5px;
  pointer-events: none;
}
.structure-meta { padding: 14px; background: var(--surface); }
.structure-meta-grid {
  display: grid;
  grid-template-columns: .55fr 1.25fr .8fr .8fr;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}
.structure-meta-grid > div { min-width: 0; padding: 10px 12px; border-right: 1px solid var(--border); }
.structure-meta-grid > div:last-child { border-right: 0; }
.structure-meta-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-mute);
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.structure-meta-grid b {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.45;
}
.structure-description { display: grid; gap: 2px; padding: 13px 2px 8px; }
.structure-description b { font-size: 13px; }
.structure-description span { color: var(--text-dim); font-size: 12px; line-height: 1.55; }
.structure-relation {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 7px;
  background: var(--surface-2);
}
.structure-relation > span {
  color: var(--text);
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.structure-relation p { margin: 0; color: var(--text-dim); font-size: 11px; line-height: 1.55; }
.structure-relation.matched { border-left-color: var(--purple); background: var(--purple-bg); }
.structure-relation.reference { border-left-color: var(--amber); background: var(--amber-bg); }
.structure-relation.catalogue { border-left-color: var(--teal); }
.viewer-boundary {
  margin-top: 12px;
  padding: 9px 11px;
  border-left: 3px solid var(--purple);
  color: var(--text-dim);
  background: var(--purple-bg);
  font-size: 11px;
  line-height: 1.55;
}
.viewer-boundary b { color: var(--text); }
.structure-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 32px;
  text-align: center;
  color: var(--text-dim);
}
.structure-fallback b { color: var(--text); font-size: 16px; }
.structure-fallback small { color: var(--text-mute); }
.pdb-actions { display: grid; justify-items: start; gap: 5px; }
.table-3d-button {
  padding: 3px 7px;
  border: 1px solid #b8c9d3;
  border-radius: 5px;
  color: var(--purple);
  background: var(--surface);
  cursor: pointer;
  font: 750 9.5px/1.2 var(--sans);
}
.table-3d-button:hover { border-color: var(--purple); background: var(--purple-bg); }
.table-3d-button:focus-visible { outline: 0; box-shadow: var(--ring); }
.structure-viewer:fullscreen {
  overflow: auto;
  padding: 16px;
  color: var(--text);
  background: var(--surface);
}
.structure-viewer.is-fullscreen .structure-stage {
  height: calc(100vh - 285px);
  min-height: 460px;
}

.source-citation { max-width: 58ch; }
.source-title { color: var(--text); font-weight: 700; line-height: 1.45; }
.source-meta { margin-top: 4px; color: var(--text-dim); font-size: 12px; line-height: 1.5; }
.identifier-stack { display: grid; gap: 4px; }
.identifier-stack a,
.identifier-stack span { font-family: var(--mono); font-size: 12px; }
.contribution-badges { display: flex; flex-wrap: wrap; gap: 4px; }

.search-summary {
  padding: 20px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow);
}
.hero-search.search-summary { max-width: none; margin: 0; padding: 5px; }
.search-summary strong { font-family: var(--mono); color: var(--teal); }
.search-group { margin-top: 26px; }
.search-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.search-group-head h2 { margin: 0; padding: 0; border: 0; font-size: 18px; }
.search-group-head span { color: var(--text-dim); font: 700 11px/1 var(--mono); }
.search-results { display: grid; gap: 8px; }
.search-result {
  display: grid; grid-template-columns: 86px minmax(0, 1fr) auto; gap: 16px;
  align-items: start; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 9px;
  color: var(--text); background: var(--surface); text-decoration: none;
}
.search-result:hover { border-color: #8dbfc1; background: #f8fbfb; text-decoration: none; }
.result-type { color: var(--teal); font: 750 10px/1.3 var(--mono); text-transform: uppercase; }
.result-title { font-weight: 700; line-height: 1.45; }
.result-snippet { margin-top: 4px; color: var(--text-dim); font-size: 11.5px; line-height: 1.5; }
.result-arrow { color: var(--teal); }
.empty-state {
  padding: 48px 20px; border: 1px dashed var(--border-strong); border-radius: 12px;
  text-align: center; color: var(--text-dim); background: var(--surface);
}
.empty-state b { display: block; margin-bottom: 7px; color: var(--text); font-size: 16px; }

.subnav {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 22px;
}
.subnav a {
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px;
  color: var(--text-dim); background: var(--surface); text-decoration: none; font-size: 11.5px; font-weight: 650;
}
.subnav a:hover { color: var(--teal); border-color: #9fc9c8; }
.sticky-subnav {
  position: sticky;
  top: 0;
  z-index: 24;
  padding: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px);
}
.qc-table th:first-child,
.qc-table td:first-child { width: 170px; }
.qc-table th:last-child,
.qc-table td:last-child { width: 190px; }
.foot { font-size: 11.5px; }

/* dark theme for the new shell */
:root[data-theme="dark"] body { background: var(--bg); }
:root[data-theme="dark"] .primary-nav { color: var(--text); background: var(--surface); }
:root[data-theme="dark"] .primary-links .item:hover,
:root[data-theme="dark"] .primary-links .item[aria-current="page"] { background: var(--surface-2); }
:root[data-theme="dark"] .status-dot { box-shadow: 0 0 0 3px #153c3a; }
:root[data-theme="dark"] .hero { background: linear-gradient(116deg, #071c2b, #102c3f 55%, #123b43); }
:root[data-theme="dark"] .callout { border-color: #245a58; background: #102f2d; }
:root[data-theme="dark"] .callout.warning,
:root[data-theme="dark"] .note { border-color: #655026; background: #302814; }
:root[data-theme="dark"] .note b { color: var(--amber); }
:root[data-theme="dark"] th { color: var(--text-dim); background: var(--surface-2); }
:root[data-theme="dark"] tbody tr:hover,
:root[data-theme="dark"] .search-result:hover { background: var(--bg-accent); }
:root[data-theme="dark"] .seqbox { background: var(--surface-2); }
:root[data-theme="dark"] .structure-stage-frame { background: #111a25; }
:root[data-theme="dark"] .structure-status {
  color: #c7d6e0; border-color: rgba(147,164,185,.26); background: rgba(21,30,42,.91);
}
:root[data-theme="dark"] .structure-status.success {
  color: #8de3d7; border-color: #245a58; background: rgba(15,55,48,.93);
}
:root[data-theme="dark"] .structure-status.error {
  color: #f0cc72; border-color: #655026; background: rgba(48,40,20,.95);
}
:root[data-theme="dark"] .structure-legend {
  color: #c4d1dd; border-color: rgba(147,164,185,.22); background: rgba(21,30,42,.88);
}
:root[data-theme="dark"] .structure-help { color: rgba(205,219,232,.58); }

@media (max-width: 1100px) {
  .masthead-inner { grid-template-columns: 230px minmax(300px, 1fr) auto; gap: 18px; }
  .brand-copy small { max-width: 165px; }
  .primary-links .item { padding-inline: 9px; font-size: 12px; }
  .entity-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { gap: 32px; }
  .principle-grid { grid-template-columns: 1fr; }
  .structure-meta-grid { grid-template-columns: repeat(2, 1fr); }
  .structure-meta-grid > div:nth-child(2) { border-right: 0; }
  .structure-meta-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 860px) {
  .nav-shell { width: min(100% - 28px, var(--maxw)); }
  .utility-inner > span:first-child { display: none; }
  .utility-inner { justify-content: flex-end; }
  .masthead-inner { grid-template-columns: 1fr auto; padding-block: 14px; }
  .global-search { grid-column: 1 / -1; grid-row: 2; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .primary-inner { display: block; }
  .menu-btn { display: flex; }
  .primary-links { display: none; flex-wrap: wrap; padding: 0 0 10px; }
  .primary-links.is-open { display: flex; }
  .primary-links .item { min-height: 37px; border-radius: 6px; }
  .primary-links .item[aria-current="page"]::after { display: none; }
  .nav-context { display: none; }
  .hero { padding-top: 44px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-snapshot { display: none; }
  .insight-grid, .entry-layout { grid-template-columns: 1fr; }
  .entry-aside { position: static; }
  .metric-strip, .stats { grid-template-columns: repeat(3, 1fr); }
  .metric:nth-child(3n), .stats .stat:nth-child(3n) { border-right: 0; }
  .metric, .stats .stat { border-bottom: 1px solid var(--border); }
  .structure-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .structure-control-wide { grid-column: 1 / -1; }
  .structure-help { display: none; }
  .structure-relation { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 620px) {
  .nav-shell { width: min(100% - 22px, var(--maxw)); }
  .masthead-inner { gap: 10px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-copy b { font-size: 19px; }
  .site-header .brand-copy small, .header-link { display: none; }
  .global-search input { padding-inline: 12px; font-size: 12.5px; }
  .global-search button { padding-inline: 15px; }
  .wrap { padding: 25px 14px 56px; }
  .hero { margin: -25px 0 0 calc(50% - 50vw); padding: 38px 14px 34px; }
  .hero h1 { font-size: 38px; }
  .hero-lede { font-size: 14px; }
  .entity-grid { grid-template-columns: 1fr; }
  .metric-strip, .stats { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3n), .stats .stat:nth-child(3n) { border-right: 1px solid var(--border); }
  .metric:nth-child(2n), .stats .stat:nth-child(2n) { border-right: 0; }
  .page-head { display: block; }
  .page-actions { padding-top: 8px; }
  .section-heading { align-items: flex-start; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; }
  .search-result { grid-template-columns: 66px minmax(0, 1fr); }
  .result-arrow { display: none; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: 7px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .structure-toolbar { grid-template-columns: 1fr; }
  .structure-control-wide { grid-column: auto; }
  .structure-actions .btn { flex: 1 1 calc(50% - 7px); text-align: center; }
  .structure-stage,
  .structure-viewer.compact .structure-stage { height: 390px; min-height: 390px; }
  .structure-status { max-width: calc(100% - 24px); }
  .structure-meta-grid { grid-template-columns: 1fr; }
  .structure-meta-grid > div { border-right: 0; border-bottom: 1px solid var(--border); }
  .structure-meta-grid > div:nth-child(2) { border-right: 0; }
  .structure-meta-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .structure-meta-grid > div:last-child { border-bottom: 0; }
  .structure-legend { font-size: 9px; }
}

/* ==========================================================================
   v0.7 entry-centric database interface
   Compact two-level shell, search-first home, position entries and dense
   evidence records. Decorative cards are intentionally minimized.
   ========================================================================== */

body {
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.58;
}

.site-header {
  box-shadow: none;
  border-bottom: 1px solid #9eb0bb;
}
.utility-bar { display: none; }
.masthead {
  background: #08324a;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.masthead-inner {
  min-height: 61px;
  grid-template-columns: minmax(220px, .55fr) minmax(360px, 1.45fr) auto;
  gap: 24px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 2px;
  color: #073047;
  background: #51c7c2;
  box-shadow: none;
  font-size: 16px;
  letter-spacing: 0;
}
.brand-copy b { font-size: 20px; letter-spacing: .06em; }
.site-header .brand-copy small {
  margin-top: 3px;
  color: rgba(255,255,255,.72);
  font-size: 10.5px;
  letter-spacing: .02em;
}
.global-search {
  border: 0;
  border-radius: 3px;
  box-shadow: none;
}
.global-search:focus-within {
  box-shadow: 0 0 0 3px rgba(76,205,197,.34);
}
.global-search input { padding: 9px 12px; font-size: 13.5px; }
.global-search button {
  margin: 3px;
  padding: 6px 17px;
  border-radius: 2px;
  background: #087b80;
  font-size: 12.5px;
}
.header-actions { gap: 12px; }
.release-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.72);
  font: 650 10.5px/1.2 var(--sans);
  white-space: nowrap;
}
.release-meta > i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #50cec7;
}
.theme-btn {
  width: 32px;
  min-height: 32px;
  border-radius: 3px;
}
.primary-nav { min-height: 40px; }
.primary-inner { min-height: 40px; }
.primary-links .item {
  min-height: 40px;
  padding-inline: 13px;
  font-size: 12.5px;
  font-weight: 650;
}
.primary-links .item[aria-current="page"] { background: #edf4f5; }
.primary-links .item[aria-current="page"]::after {
  left: 10px;
  right: 10px;
  height: 2px;
  border-radius: 0;
}
.nav-divider {
  align-self: center;
  width: 1px;
  height: 18px;
  margin: 0 5px;
  background: var(--border);
}
.primary-links .secondary-item {
  color: #6a7d88;
  font-size: 11.5px;
  font-weight: 600;
}
.nav-context { font-size: 10.5px; }

.wrap { padding: 24px 20px 64px; }
h1 { font-size: clamp(27px, 2.5vw, 34px); }
h2 { margin-top: 34px; font-size: clamp(19px, 1.7vw, 23px); }
.breadcrumbs { margin-bottom: 12px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-bottom: 6px; }
.page-kicker { font-size: 10.5px; letter-spacing: .085em; }
.lede {
  max-width: 88ch;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.68;
}
.page-meta { margin-top: 10px; font-size: 11.5px; }
.page-actions { padding-top: 13px; }
.compact-page-head { margin-bottom: 14px; }

.card,
.surface-panel,
.tablewrap,
.metric-strip,
.stats,
.tabs,
.entry-summary,
.structure-viewer {
  border-radius: 4px;
  box-shadow: none;
}
.surface-panel { padding: 20px; }
.panel-badge { border-radius: 2px; }
.track-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.track-toggle input { margin: 0; accent-color: var(--navy-2); }
.code-panel { padding: 0; overflow: hidden; }
.code-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 6px 10px 6px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--surface-2);
  font: 650 12px/1 var(--mono);
}
.code-panel pre {
  overflow: auto;
  margin: 0;
  padding: 14px 16px;
  color: var(--text);
  background: var(--surface);
  font: 12.5px/1.75 var(--mono);
  white-space: pre;
}
.code-panel pre code { padding: 0; border: 0; background: transparent; }
.btn { border-radius: 3px; box-shadow: none; }
.tag { border-radius: 2px; }
.callout,
.note,
.evi,
.seqbox { border-radius: 3px; }

/* Homepage */
.home-page .wrap { padding-top: 0; }
.home-page .masthead-inner { grid-template-columns: 1fr auto; }
.home-page .masthead .global-search { display: none; }
.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
  gap: 42px;
  padding: 38px 40px 34px;
  border: 1px solid var(--border);
  border-top: 0;
  background: var(--surface);
}
.intro-main { align-self: center; max-width: 820px; }
.home-intro h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.intro-subtitle {
  margin: 5px 0 13px;
  color: var(--teal);
  font-size: 16px;
  font-weight: 650;
}
.intro-lede {
  max-width: 70ch;
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.7;
}
.home-search {
  display: grid;
  grid-template-columns: 1fr auto;
  max-width: 760px;
  margin-top: 20px;
  border: 2px solid #0a6478;
  background: var(--surface);
}
.home-search:focus-within { box-shadow: var(--ring); }
.home-search input {
  min-width: 0;
  padding: 11px 13px;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 13.5px;
}
.home-search button {
  min-width: 112px;
  border: 0;
  color: #fff;
  background: #086f78;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
}
.search-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  margin-top: 9px;
  color: var(--text-mute);
  font-size: 11.5px;
}
.search-examples a { color: var(--navy-2); }
.release-panel {
  align-self: stretch;
  padding-left: 26px;
  border-left: 1px solid var(--border);
}
.release-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 2px solid var(--navy);
}
.release-heading span {
  color: var(--text-mute);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.release-heading strong { color: var(--navy); font: 700 13px/1.2 var(--mono); }
.release-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.release-stats > div { padding: 12px 0; border-bottom: 1px solid var(--border); }
.release-stats > div:nth-child(odd) { border-right: 1px solid var(--border); }
.release-stats > div:nth-child(even) { padding-left: 16px; }
.release-stats > div:nth-last-child(-n+2) { border-bottom: 0; }
.release-stats b { display: block; color: var(--text); font: 750 20px/1.1 var(--mono); }
.release-stats span { color: var(--text-dim); font-size: 10.5px; }
.release-reference { margin: 12px 0 0; }
.release-reference div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  padding: 3px 0;
  font-size: 10.5px;
}
.release-reference dt { color: var(--text-mute); }
.release-reference dd { margin: 0; color: var(--text-dim); }
.release-reference code { padding: 0; border: 0; background: none; }
.home-section { padding-top: 30px; }
.section-heading { margin-bottom: 12px; }
.section-heading p { font-size: 12.5px; }
.database-directory {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--surface);
}
.directory-item {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 72px;
  gap: 12px;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}
.directory-item:hover { background: var(--surface-2); text-decoration: none; }
.database-directory .entity-code {
  flex: 0 0 auto;
  min-width: 38px;
  height: 22px;
  border-radius: 2px;
  font-size: 9.5px;
}
.directory-copy { display: grid; min-width: 0; gap: 2px; }
.directory-copy b { color: var(--text); font-size: 13.5px; }
.directory-copy small {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.database-directory .entity-count {
  position: static;
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--text-mute);
  font-size: 10.5px;
}
.metric-strip { margin-top: 12px; }
.metric, .stats .stat { min-height: 72px; padding: 13px 15px; }
.metric b, .stat .n { font-size: 22px; }
.metric span, .stat .k { margin-top: 5px; font-size: 10.5px; }
.evidence-policy {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--surface);
}
.evidence-policy > div {
  min-height: 82px;
  padding: 14px 16px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.evidence-policy b { display: block; margin-bottom: 4px; font-size: 12.5px; }
.evidence-policy span { color: var(--text-dim); font-size: 11.5px; line-height: 1.55; }

/* Catalogue tables */
.layout { gap: 18px; }
@media (min-width: 941px) {
  .layout { grid-template-columns: 238px minmax(0, 1fr); }
}
.filters .card { border-radius: 3px; }
.facet-head {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
  background: var(--surface-2);
  font-size: 11.5px;
}
.facet-body { padding: 12px; }
.filters .grp { margin-bottom: 12px; }
.result-toolbar { min-height: 40px; padding-bottom: 7px; }
.table-scroll {
  max-height: 68vh;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.data-section > .table-scroll { max-height: 65vh; }
table { border-collapse: separate; border-spacing: 0; }
.table-scroll > table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: inset 0 -1px var(--border);
}
th, td { padding: 9px 10px; }
th { color: #324b5b; background: #edf2f4; font-size: 10.5px; }
.table-primary { font-size: 12.5px; }
.table-secondary { color: var(--text-dim); font-size: 10.5px; }
.plain-meta { color: var(--text-dim); font-size: 11.5px; }
.status-text,
.quality-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 11.5px;
  white-space: nowrap;
}
.status-text i,
.quality-text i {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--surface);
}
.status-text.enhanced { color: var(--teal); }
.status-text.enhanced i { background: var(--teal); }
.status-text.decreased { color: var(--orange); }
.status-text.decreased i { background: var(--orange); }
.status-text.mixed-effects { color: var(--navy-2); }
.status-text.mixed-effects i {
  background: linear-gradient(135deg, var(--teal) 0 48%, var(--orange) 52% 100%);
}
.status-text.conflict { color: var(--amber); }
.status-text.conflict i { background: var(--amber); }
.status-text.reflike,
.status-text.not_reported,
.status-text.uncovered { color: var(--text-mute); }
.quality-text.verified { color: var(--teal); }
.quality-text.verified i { background: var(--teal); }
.quality-text.pending { color: var(--amber); }
.quality-text.pending i { background: var(--amber); }
.measurement-conflict-label {
  display: block;
  width: max-content;
  margin-top: 4px;
  color: var(--amber);
  font-size: 11.5px;
  font-weight: 650;
}
.measurement-conflict-label::before { content: "!"; margin-right: 5px; font-weight: 800; }
.mixed-sw {
  border-color: #6d7380;
  background: linear-gradient(135deg, var(--teal-bg) 0 48%, var(--orange-bg) 52% 100%);
}
.legend-conflict-mark {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  font: 800 10px/1 var(--sans);
}

/* Variant and position entries */
.entry-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 28px;
  padding: 22px 24px 0;
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy);
  background: var(--surface);
}
.entry-id { color: var(--text-mute); font-size: 11px; }
.entry-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 3px; }
.entry-title-line h1 { margin: 0; color: var(--navy); font: 750 36px/1.05 var(--mono); }
.entry-subtitle { margin: 5px 0 0; color: var(--text-dim); font-size: 12px; }
.entry-actions { display: flex; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.entry-meta-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 -24px;
  border-top: 1px solid var(--border);
}
.entry-meta-grid > div { min-width: 0; padding: 11px 14px; border-right: 1px solid var(--border); }
.entry-meta-grid > div:last-child { border-right: 0; }
.entry-meta-grid dt {
  color: var(--text-mute);
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.entry-meta-grid dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.entry-meta-grid dd > span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 450;
  text-overflow: ellipsis;
}
.entry-jump {
  display: flex;
  gap: 0;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-top: 0;
  background: var(--surface-2);
}
.entry-jump a {
  padding: 8px 14px;
  border-right: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 650;
  text-decoration: none;
}
.entry-jump a:hover { color: var(--navy); background: var(--surface); }
.entry-jump span { color: var(--text-mute); font-family: var(--mono); }
.record-section {
  margin-top: 16px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  background: var(--surface);
  scroll-margin-top: 12px;
}
.record-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}
.record-section-head > div:first-child {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 9px;
}
.record-section-head h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 18px;
}
.record-section-head p {
  grid-column: 2;
  margin: 3px 0 0;
  color: var(--text-dim);
  font-size: 11.5px;
}
.record-section-head > a { flex: 0 0 auto; font-size: 11.5px; font-weight: 650; text-decoration: none; }
.section-index {
  color: var(--teal);
  font: 750 9.5px/1 var(--mono);
  letter-spacing: .06em;
}
.record-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 20px;
}
.compact-kv { margin: 0; }
.record-provenance {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px 14px;
  border-left: 3px solid var(--teal);
  background: var(--surface-2);
}
.record-provenance b { font-size: 11.5px; }
.record-provenance span { color: var(--text-dim); font-size: 11px; }
.record-provenance code {
  overflow-wrap: anywhere;
  padding: 0;
  border: 0;
  color: var(--text-mute);
  background: none;
  font-size: 9px;
}
.sequence-heading { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; }
.sequence-heading h3 { margin: 0 0 6px; }
.sequence-heading span { color: var(--text-mute); font: 650 10px/1 var(--mono); }
.entry-sequence {
  padding: 13px 15px;
  letter-spacing: .055em;
  line-height: 1.8;
}
.entry-sequence b { color: #004f55; background: #a8e6df; }
.record-section .evi { margin-bottom: 10px; }
.variant-structure-panel { margin-top: 16px; }
.structure-viewer.compact .structure-stage {
  height: 420px;
  min-height: 420px;
}

.position-map-section { margin-top: 0; }
.position-entry-header {
  display: grid;
  grid-template-columns: auto minmax(200px, .65fr) minmax(0, 1.35fr);
  align-items: stretch;
  margin-top: 16px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy);
  background: var(--surface);
}
.position-symbol {
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 96px;
  padding: 16px;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
}
.position-symbol span { color: var(--navy); font: 800 34px/1 var(--mono); }
.position-symbol b { margin-top: 4px; color: var(--text-mute); font: 650 12px/1 var(--mono); }
.position-identity { align-self: center; padding: 15px 20px; }
.position-identity h2 { margin: 3px 0 7px; padding: 0; border: 0; font-size: 24px; }
.position-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-left: 1px solid var(--border);
}
.position-meta > div { display: grid; align-content: center; padding: 12px 14px; border-right: 1px solid var(--border); }
.position-meta > div:last-child { border-right: 0; }
.position-meta dt { color: var(--text-mute); font-size: 9.5px; font-weight: 700; }
.position-meta dd { margin: 4px 0 0; color: var(--text); font-size: 12px; font-weight: 650; }
.fto-text { font-size: 11.5px; }
.fto-text.blocked { color: var(--patent); }
.fto-text.watch { color: var(--amber); }
.fto-text.prior_art,
.fto-text.free { color: var(--text-dim); }

/* Structure catalogue workbench */
.structure-explorer { padding: 18px; }
.structure-workbench {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
}
.structure-index {
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}
.structure-index-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  color: var(--navy);
  background: var(--surface-2);
  font-size: 11.5px;
}
.structure-index-head span { color: var(--text-mute); font: 650 11.5px/1 var(--mono); }
.structure-index-list { max-height: 665px; overflow: auto; }
.structure-index-group + .structure-index-group {
  border-top: 2px solid var(--border-strong);
}
.structure-index-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 6px 10px;
  color: var(--text-dim);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 750;
}
.structure-index-group-title b {
  color: var(--text-mute);
  font: 650 11.5px/1 var(--mono);
}
.structure-index-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  width: 100%;
  gap: 2px 8px;
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.structure-index-item:hover { background: var(--surface-2); }
.structure-index-item.is-active {
  box-shadow: inset 3px 0 var(--teal);
  background: color-mix(in srgb, var(--teal-bg) 48%, var(--surface));
}
.structure-index-item .mono {
  grid-row: 1 / span 2;
  color: var(--navy-2);
  font-size: 12px;
  font-weight: 750;
}
.structure-index-item b { font-size: 12.5px; }
.structure-index-item small {
  overflow: hidden;
  color: var(--text-dim);
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag.derived-model,
.derived-model-badge {
  color: var(--patent);
  border-color: var(--patent);
  background: var(--patent-bg);
}
.claim-review {
  display: inline-flex;
  width: max-content;
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-dim);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 650;
}
.claim-review.located { color: var(--navy-2); border-color: #8fb2cc; background: #edf5fa; }
.claim-review.unlocatable,
.claim-review.not-reviewed { color: var(--patent-neutral); }
.claim-review.ambiguous { color: var(--amber); border-color: var(--amber); background: var(--amber-bg); }
:root[data-theme="dark"] .claim-review.located {
  color: var(--navy-2);
  border-color: #456b86;
  background: #142938;
}
.structure-workbench .viewer-boundary { margin-top: 8px; }

@media (max-width: 1100px) {
  .masthead-inner { grid-template-columns: 205px minmax(280px, 1fr) auto; }
  .primary-links .item { padding-inline: 9px; }
  .database-directory { grid-template-columns: repeat(2, 1fr); }
  .entry-meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry-meta-grid > div:nth-child(3n) { border-right: 0; }
  .entry-meta-grid > div:nth-child(-n+3) { border-bottom: 1px solid var(--border); }
  .position-entry-header { grid-template-columns: auto 1fr; }
  .position-meta { grid-column: 1 / -1; border-top: 1px solid var(--border); border-left: 0; }
}

@media (max-width: 860px) {
  .masthead-inner {
    min-height: 56px;
    grid-template-columns: 1fr auto;
    padding-block: 10px;
  }
  .global-search { grid-column: 1 / -1; grid-row: 2; }
  .header-actions { grid-column: 2; grid-row: 1; }
  .release-meta { display: none; }
  .primary-inner { display: block; min-height: 40px; }
  .menu-btn { min-height: 40px; padding: 0; }
  .primary-links { padding-bottom: 8px; }
  .primary-links .item { min-height: 34px; padding-inline: 10px; }
  .nav-divider { display: none; }
  .home-page .masthead-inner { grid-template-columns: 1fr auto; }
  .home-intro { grid-template-columns: 1fr; gap: 24px; padding: 30px; }
  .release-panel { padding: 18px 0 0; border-top: 1px solid var(--border); border-left: 0; }
  .record-columns { grid-template-columns: 1fr; }
  .structure-workbench { grid-template-columns: 1fr; }
  .structure-index-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 230px;
  }
  .structure-index-item:nth-child(odd) { border-right: 1px solid var(--border); }
}

@media (max-width: 620px) {
  .nav-shell { width: min(100% - 24px, var(--maxw)); }
  .brand-mark { width: 32px; height: 32px; }
  .brand-copy b { font-size: 18px; }
  .site-header .brand-copy small { display: none; }
  .global-search input { padding: 9px 10px; }
  .wrap { padding: 18px 12px 50px; }
  .home-page .wrap { padding-top: 0; }
  .home-intro { margin-inline: -12px; padding: 25px 14px 23px; border-left: 0; border-right: 0; }
  .home-intro h1 { font-size: 32px; }
  .intro-subtitle { font-size: 14px; }
  .intro-lede { font-size: 13px; }
  .home-search { grid-template-columns: minmax(0, 1fr) auto; }
  .home-search input { padding: 10px; font-size: 12px; }
  .home-search button { min-width: 92px; font-size: 11.5px; }
  .release-stats b { font-size: 18px; }
  .database-directory { grid-template-columns: 1fr; }
  .directory-item { min-height: 60px; padding: 9px 11px; }
  .metric-strip, .stats { grid-template-columns: repeat(2, 1fr); }
  .evidence-policy { grid-template-columns: 1fr; }
  .evidence-policy > div { min-height: 0; }
  .surface-panel,
  .record-section { padding: 15px 12px; }
  .panel-head,
  .record-section-head { display: block; }
  .panel-badge { display: inline-flex; margin-top: 8px; }
  .record-section-head > div:first-child { grid-template-columns: auto 1fr; }
  .record-section-head > a { display: inline-block; margin: 8px 0 0 25px; }
  .entry-header { grid-template-columns: 1fr; padding: 16px 14px 0; }
  .entry-actions { justify-content: flex-start; }
  .entry-title-line h1 { font-size: 31px; }
  .entry-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 -14px;
  }
  .entry-meta-grid > div { border-bottom: 1px solid var(--border); }
  .entry-meta-grid > div:nth-child(2n) { border-right: 0; }
  .entry-meta-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
  .entry-jump { overflow-x: auto; }
  .entry-jump a { flex: 0 0 auto; padding: 8px 11px; }
  .compact-kv { grid-template-columns: 1fr; }
  .record-provenance { border-left-width: 2px; }
  .entry-sequence { overflow-wrap: anywhere; font-size: 11.5px; letter-spacing: .035em; }
  .structure-viewer.compact .structure-stage { height: 330px; min-height: 330px; }
  .position-entry-header { grid-template-columns: 74px 1fr; }
  .position-symbol { min-width: 74px; padding: 12px; }
  .position-symbol span { font-size: 28px; }
  .position-identity { padding: 12px; }
  .position-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .position-meta > div:nth-child(2) { border-right: 0; }
  .position-meta > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .col-origin,
  .col-measurements,
  .col-quality { display: none; }
  .layout table { min-width: 620px; }
  .structure-index-list { grid-template-columns: 1fr; max-height: 210px; }
  .structure-index-item:nth-child(odd) { border-right: 0; }
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--surface);
}
.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  font-size: 10.5px;
}
.site-footer-inner > span b { color: var(--text); font-family: var(--mono); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--navy-2); text-decoration: underline; }

@media (max-width: 620px) {
  .sticky-subnav { position: static; padding: 0; border: 0; background: transparent; }
  .site-footer-inner { display: block; padding-block: 13px; }
  .site-footer nav { margin-top: 7px; gap: 12px; }
}

/* ==========================================================================
   v0.7.1 semantic and readability patch
   Endpoint-specific labels, canonical design-space identity and page scrolling.
   ========================================================================== */

.page-kicker { font-size: 11.5px; }
.page-meta { font-size: 12px; }
.release-meta,
.nav-context { font-size: 11.5px; }
.site-header .brand-copy small { font-size: 11.5px; }
.directory-copy small,
.database-directory .entity-count,
.release-stats span,
.metric span,
.stat .k { font-size: 11.5px; }
.release-reference div { font-size: 11.5px; }

table { font-size: 13px; }
th { font-size: 11.5px; }
.table-primary { font-size: 13.5px; }
.table-secondary { font-size: 11.5px; }
.tag { font-size: 11.5px; line-height: 1.3; }
.status-text,
.quality-text,
.plain-meta { font-size: 12px; }
.entry-id { font-size: 12px; }
.entry-subtitle { font-size: 12.5px; }
.entry-meta-grid dt,
.position-meta dt { font-size: 11.5px; }
.entry-meta-grid dd,
.position-meta dd { font-size: 13px; }
.entry-meta-grid dd > span { font-size: 11.5px; }
.record-section-head p,
.record-section-head > a,
.record-provenance span { font-size: 12px; }
.record-provenance b { font-size: 12.5px; }
.measurement-id { color: var(--text-dim); font-size: 12px; }
.compact-empty { padding: 18px; }

/* 只有显式的 .table-scroll 容器固定表头；普通小表始终使用静态表头。 */

.position-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 12px;
}
.position-filter-bar button {
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  background: var(--surface);
  font: 650 12px/1.25 var(--sans);
  cursor: pointer;
}
.position-filter-bar button:hover { border-color: var(--brand-accent); color: var(--navy); }
.position-filter-bar button.is-active {
  border-color: var(--navy-2);
  color: #fff;
  background: var(--navy-2);
}
.design-status {
  display: inline-flex;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 650;
}
.design-status.mutable { color: var(--teal); }
.design-status.native_cysteine_protected { color: var(--purple); }
.design-status.not_in_canonical_construct { color: var(--text-mute); }
.position-meta > div:nth-child(-n+4) { border-bottom: 1px solid var(--border); }
.position-meta > div:nth-child(4n) { border-right: 0; }

.evidence-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.evidence-filters label { display: grid; gap: 3px; }
.evidence-filters label > span {
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 650;
}
.evidence-filters select {
  max-width: 310px;
  min-width: 150px;
  padding: 6px 28px 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
}
.evidence-filter-count {
  margin-left: auto;
  padding: 7px 2px;
  color: var(--text-dim);
  font: 650 12px/1 var(--mono);
}
.source-compact {
  display: grid;
  gap: 3px;
  margin-top: 5px;
}
.source-compact > b { color: var(--navy-2); font-size: 12px; }
.source-compact > span:not(.tag) { color: var(--text-dim); font-size: 12px; }
.source-compact .tag { width: max-content; }
.evidence-details { margin-top: 7px; }
.evidence-details summary {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--navy-2);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.evidence-details summary::after {
  content: "＋";
  float: right;
  color: var(--text-mute);
}
.evidence-details[open] summary::after { content: "−"; }
.source-group-row th {
  padding: 7px 9px;
  border-top: 2px solid var(--border-strong);
  color: var(--text-dim);
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 500;
  white-space: normal;
}
.source-group-row:first-child th { border-top: 0; }
.source-group-row th > * { margin-right: 10px; }
.source-group-row th > span:nth-child(3) {
  color: var(--text-mute);
}
.data-section .table-scroll td { padding-block: 7px; }
.evidence-details .kv {
  margin-top: 7px;
  padding: 9px 10px;
  border-left: 2px solid var(--brand-accent);
  background: var(--surface-2);
}
.evidence-result { line-height: 1.55; }

.search-starters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--surface);
}
.search-starters section {
  min-height: 150px;
  padding: 18px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.search-starters h2 { margin: 0 0 11px; font-size: 16px; }
.starter-links { display: flex; flex-wrap: wrap; gap: 7px; }
.starter-links a {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--navy-2);
  background: var(--surface-2);
  font: 650 12px/1.3 var(--mono);
  text-decoration: none;
}
.search-starters ul { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 12.5px; }
.search-starters li + li { margin-top: 5px; }

@media (max-width: 860px) {
  .search-starters { grid-template-columns: 1fr; }
  .search-starters section { min-height: 0; }
}

@media (max-width: 620px) {
  .position-meta > div { border-bottom: 1px solid var(--border); }
  .position-meta > div:nth-child(2n) { border-right: 0; }
  .position-meta > div:nth-last-child(-n+2) { border-bottom: 0; }
  .evidence-filters { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .evidence-filters select { width: 100%; min-width: 0; max-width: none; }
  .evidence-filter-count { margin-left: 0; }
  .tag { font-size: 11px; }
}

/* ==========================================================================
   v0.8 internal Source / Construct entries and stable deep links
   ========================================================================== */

.bibliographic-entry .entry-title-line h1 {
  max-width: 920px;
  font: 750 25px/1.25 var(--sans);
  letter-spacing: -.015em;
}
.bibliographic-entry .entry-subtitle {
  max-width: 980px;
  color: var(--text-dim);
  font-family: var(--sans);
  line-height: 1.55;
}
.source-locator-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 12px;
}
.contribution-matrix {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
}
.contribution-matrix > div {
  display: grid;
  gap: 3px;
  min-height: 70px;
  align-content: center;
  padding: 12px 14px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.contribution-matrix > div.has-records { background: var(--surface); }
.contribution-matrix b { color: var(--navy); font: 750 22px/1 var(--mono); }
.contribution-matrix span { color: var(--text-dim); font-size: 11.5px; }
.subsection-title {
  margin: 18px 0 8px;
  color: var(--navy);
  font-size: 14px;
}
.construct-directory-panel { margin-top: 20px; padding: 18px; }
.tag.design {
  color: #174c88;
  border-color: #9bbce0;
  background: #edf5ff;
}

.construct-alignment {
  overflow-x: auto;
  padding-bottom: 7px;
}
.alignment-row,
.alignment-ruler {
  display: grid;
  grid-template-columns: 150px minmax(864px, 1fr);
  min-width: 1014px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.alignment-row:last-child { border-bottom: 0; }
.alignment-row > b,
.alignment-row > a,
.alignment-ruler > b {
  overflow: hidden;
  padding: 7px 10px 7px 0;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.alignment-row > a { color: var(--navy-2); text-decoration: none; }
.alignment-row code,
.alignment-ruler code {
  display: grid;
  grid-template-columns: repeat(54, minmax(16px, 1fr));
  min-width: 864px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: none;
  font-size: 12px;
}
.alignment-row code span,
.alignment-ruler code span {
  display: grid;
  min-height: 25px;
  place-items: center;
  border-left: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.alignment-ruler code span {
  min-height: 21px;
  color: var(--text-mute);
  font-size: 9px;
}
.alignment-row code span.cys {
  color: var(--purple);
  background: var(--purple-bg);
  font-weight: 800;
}
.alignment-row code span.difference {
  color: #7d4b00;
  background: var(--amber-bg);
  font-weight: 800;
}
.alignment-row code span.gap {
  color: var(--text-mute);
  background: var(--grey-bg);
}
.alignment-row.reference-row { background: var(--surface-2); }
.entry-alignment { margin-bottom: 12px; }
.sequence-difference-summary {
  margin-top: 10px;
  padding: 9px 11px;
  border-left: 3px solid var(--amber);
  color: var(--text-dim);
  background: var(--amber-bg);
  font-size: 12px;
}
.sequence-difference-summary b { margin-right: 6px; color: var(--text); }

.evidence-target-row > td {
  background: color-mix(in srgb, var(--amber-bg) 72%, var(--surface));
  box-shadow: inset 0 2px var(--amber), inset 0 -2px var(--amber);
}
.evidence-target-row > td:first-child { box-shadow: inset 3px 0 var(--amber), inset 0 2px var(--amber), inset 0 -2px var(--amber); }

@media (max-width: 860px) {
  .contribution-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bibliographic-entry .entry-title-line h1 { font-size: 21px; }
}

@media (max-width: 620px) {
  .contribution-matrix { grid-template-columns: 1fr 1fr; }
  .construct-directory-panel { padding: 12px; }
}
