/* ============================================================
   PLac 猪源乳酸杆菌全基因组数据库 —— 全局样式
   ============================================================ */

:root {
  --primary: #0e7c66;
  --primary-dark: #0a5c4d;
  --primary-light: #e4f3ef;
  --accent: #d97706;
  --accent-light: #fdf1e0;
  --bg: #f5f8f7;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --border: #e4e9e7;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 30px rgba(16, 24, 40, .12);
  --radius: 14px;
  --radius-sm: 8px;
  --green-badge: #e7f6ef;
  --green-text: #0b7a4b;
  --amber-badge: #fdf1e0;
  --amber-text: #9a5b06;
  --gray-badge: #eef1f0;
  --gray-text: #5b6672;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  min-width: 0;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #17a085);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .5px;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong { font-size: 16px; white-space: nowrap; }
.brand-text small { color: var(--muted); font-size: 12px; white-space: nowrap; }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--primary-light); color: var(--primary-dark); }
.site-nav a.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
}

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0b5e4e 0%, #0e7c66 52%, #1a9c80 100%);
  color: #fff;
  padding: 76px 0 84px;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
}

.hero::before { width: 380px; height: 380px; right: -120px; top: -150px; }
.hero::after { width: 260px; height: 260px; left: -80px; bottom: -120px; }

.hero .container { position: relative; z-index: 1; }

.hero-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  font-size: 13px;
  letter-spacing: 1px;
}

.hero h1 { font-size: 38px; line-height: 1.3; margin: 0 0 14px; font-weight: 800; }
.hero .lead { max-width: 720px; font-size: 17px; color: rgba(255, 255, 255, .92); margin: 0 0 26px; }

.hero-search {
  display: flex;
  max-width: 680px;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow-lg);
  gap: 6px;
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: transparent;
}

.hero-search button {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 12px 26px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
.hero-search button:hover { background: var(--primary-dark); }

.hero-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions a {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .45);
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 14px;
  transition: background .2s;
}
.hero-actions a:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---------- 统计条 ---------- */
.stats-strip { margin-top: -42px; position: relative; z-index: 2; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  text-align: center;
}

.stat-card .num {
  font-size: 30px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.stat-card .label { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------- 通用区块 ---------- */
.section { padding: 58px 0 20px; }
.section-head { margin-bottom: 26px; }
.section-head h2 { margin: 0 0 6px; font-size: 26px; }
.section-head p { margin: 0; color: var(--muted); max-width: 760px; }
.section-head .en { color: var(--primary); font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  transition: transform .2s, box-shadow .2s;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .icon { font-size: 30px; }
.card h3 { margin: 12px 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .more { display: inline-block; margin-top: 14px; font-size: 14px; font-weight: 600; }

/* ---------- 步骤 ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  counter-reset: step;
}

.step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
}

.step .step-num {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 800;
  border-radius: 10px;
  margin-bottom: 12px;
}

.step h3 { margin: 0 0 6px; font-size: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- 新闻卡片 ---------- */
.news-card { display: block; }
.news-date { color: var(--muted); font-size: 13px; }
.news-card h3 { margin: 6px 0 8px; font-size: 17px; line-height: 1.4; }

/* ---------- 表格 ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 24px;
}

/* ---------- 世界地图 ---------- */
.world-map-card { padding-top: 8px; }
.basemap-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 14px;
}
.basemap-picker select {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 12px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.map-help { margin-top: 12px; font-size: 14px; }
.map-help summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.map-help-table { margin-top: 10px; min-width: 0; }
.map-help-table th, .map-help-table td { font-size: 13px; }
#world-map { height: 560px; border-radius: 12px; }
#world-map .leaflet-container { border-radius: 12px; font-family: inherit; }
.plac-map-marker { background: transparent; border: 0; }
.plac-map-marker .pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.plac-popup { font-size: 13px; line-height: 1.7; }
.plac-popup-title { font-weight: 700; margin-bottom: 4px; font-size: 14px; }
.plac-popup a { display: block; color: var(--primary); }
.plac-popup .plac-gmaps { margin-top: 8px; font-weight: 600; }
.plac-legend {
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.9;
  color: var(--text);
}
.plac-legend b { display: block; margin-bottom: 4px; }
.plac-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
@media (max-width: 560px) {
  #world-map { height: 420px; }
}

/* ============================================================
   Design refinement — unified typography & visual rhythm
   ============================================================ */
:root {
  --font-sans: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --heading: #111827;
  --heading-sub: #374151;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  color: var(--heading);
  letter-spacing: -.015em;
  line-height: 1.3;
}

.section { padding: 68px 0 32px; }
.section-head { margin-bottom: 30px; }
.section-head .en {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--primary);
}
.section-head h2 { margin: 0 0 10px; font-size: 27px; font-weight: 800; }
.section-head p { font-size: 15px; line-height: 1.75; color: var(--muted); }

.hero h1 { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.hero .lead { font-size: 17px; line-height: 1.8; }

.page-head { padding: 46px 0 10px; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.page-head .sub { font-size: 15px; color: var(--muted); }

.card h3 { font-size: 17px; font-weight: 700; }
.panel > h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.panel > h2, .panel > h3 { margin-top: 0; }

.chart-card h3 {
  position: relative;
  padding-left: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
}
.chart-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #17a085);
}

.stat-card .num {
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-card .label { font-size: 14px; font-weight: 500; }

.overview-item .v { font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.overview-item .k { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }

.data-table th {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .35px;
  color: #475569;
  background: #f2f7f5;
}
.data-table tbody tr { transition: background .12s; }

.btn { border-radius: 10px; font-weight: 600; letter-spacing: .01em; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(14, 124, 102, .18); }
.btn-secondary:hover { box-shadow: 0 4px 10px rgba(14, 124, 102, .12); }
.btn-ghost:hover { transform: none; box-shadow: none; }

.step h3 { font-weight: 700; font-size: 16px; }
.news-card h3 { font-weight: 700; }
.footer-grid h3 { font-size: 15px; font-weight: 700; letter-spacing: .3px; }

.section-head h2, .page-head h1, .hero h1 { text-wrap: balance; }

/* ============================================================
   Home page layout — big framed sections
   ============================================================ */
.hero h1 { color: #fff; }
.hero .hero-kicker { color: rgba(255, 255, 255, .95); }
.section-head h2 { font-size: clamp(26px, 2.5vw, 34px); }

.home-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .07);
  padding: clamp(24px, 4vw, 46px);
  margin-bottom: 36px;
}
.home-box .section-head { margin-bottom: 28px; }
.home-box .card { background: #f7faf9; border-color: #e8efec; }
.home-box .news-card { background: #fff; }

.chart-tile {
  background: #f7faf9;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 10px;
}
.chart-tile h3 {
  position: relative;
  padding-left: 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--heading);
}
.chart-tile h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #17a085);
}

/* Charts: horizontal bars in the first row, vertical bars in the second row */
.chart-row { display: grid; gap: 18px; }
.chart-row-h { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chart-row-v { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-row + .chart-row { margin-top: 18px; }
@media (max-width: 1050px) {
  .chart-row-h { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .chart-row-v { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 640px) {
  .chart-row-h, .chart-row-v { grid-template-columns: 1fr; }
}

/* ============================================================
   Home page — large introduction + full-screen sampling map
   ============================================================ */
.intro {
  position: relative;
  overflow: hidden;
  padding: 92px 0 84px;
  color: #fff;
  background:
    radial-gradient(900px 520px at 88% 10%, rgba(255, 255, 255, .12), transparent 62%),
    radial-gradient(760px 480px at 6% 96%, rgba(23, 160, 133, .4), transparent 66%),
    linear-gradient(135deg, #0c7159 0%, #0a5c4d 46%, #083f35 100%);
}
.intro::after {
  content: "";
  position: absolute;
  right: -7%;
  top: 50%;
  width: min(1160px, 92%);
  height: min(620px, 92%);
  transform: translateY(-50%);
  background: url(../img/world-silhouette.svg) no-repeat center / contain;
  opacity: .6;
  pointer-events: none;
}
.intro-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(520px 300px at 30% 20%, rgba(255, 255, 255, .07), transparent 70%),
    radial-gradient(420px 260px at 75% 85%, rgba(255, 255, 255, .06), transparent 70%);
}
.intro-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 54px;
  align-items: center;
  max-width: 1340px;
}
.intro-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
}
.intro h1 {
  margin: 18px 0;
  color: #fff;
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.intro-lead {
  max-width: 830px;
  margin: 0 0 28px;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.85;
  color: rgba(255, 255, 255, .9);
}
.intro-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
.intro-chip {
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: rgba(255, 255, 255, .09);
}
.intro-chip strong { display: block; font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.intro-chip span { font-size: 12px; letter-spacing: .4px; color: rgba(255, 255, 255, .78); }

.intro-panel {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 20px;
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 18px 44px rgba(4, 32, 26, .28);
  backdrop-filter: blur(10px);
}
.intro-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.intro-panel-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .26);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.intro-panel-date { font-size: 12px; color: rgba(255, 255, 255, .72); }
.intro-panel-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .18);
  padding-top: 14px;
}
.intro-panel-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, .86);
}
.intro-panel-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8fe3c6;
}
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.intro-actions .btn { background: #fff; color: var(--primary-dark); }
.intro-actions .btn:hover { background: #eafaf4; color: var(--primary-dark); }
.intro-actions .btn-secondary {
  background: rgba(255, 255, 255, .12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .5);
}
.intro-actions .btn-secondary:hover { background: rgba(255, 255, 255, .22); color: #fff; }

.map-section { position: relative; }
.map-section { padding: 10px 0 44px; }
.map-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #eaf4fb;
  box-shadow: 0 14px 36px rgba(16, 24, 40, .12);
}
#world-map {
  width: 100%;
  height: min(88vh, 980px);
  min-height: 560px;
  border-radius: 0;
  background: #eaf4fb;
}
.map-caption { margin-top: 12px; max-width: 900px; }
.map-section .container { max-width: 1520px; }

.map-sidebar {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 600;
  width: min(360px, 42%);
  padding: 18px 18px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 24, 40, .2);
  overflow: auto;
}
.map-sidebar[hidden] { display: none; }
.map-sidebar h3 { margin: 0 0 4px; padding-right: 20px; font-size: 17px; font-weight: 800; }
.map-sidebar-meta { margin: 0 0 12px; color: var(--muted); font-size: 12.5px; }
.map-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 52%;
  margin-top: 12px;
  overflow: auto;
}
.map-sidebar-list a { padding: 5px 7px; border-radius: 7px; font-size: 12.5px; color: var(--primary-dark); }
.map-sidebar-list a:hover { background: var(--primary-light); }
.map-sidebar-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.map-sidebar-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.plac-loc-marker { cursor: pointer; }
.plac-label-anchor { background: transparent; border: 0; }
.plac-label {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 2px 6px rgba(16, 24, 40, .12);
  color: var(--primary-dark);
  font-size: 11.5px;
  font-weight: 600;
}
.plac-label::before { display: none; }
.plac-popup-sub { margin-bottom: 2px; color: var(--muted); font-size: 12px; }
.plac-popup-count { margin-bottom: 6px; font-weight: 700; color: var(--primary-dark); }
.plac-popup-more { margin-top: 4px; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
  .intro { padding: 68px 0 60px; }
  .intro-inner { grid-template-columns: 1fr; gap: 30px; }
  .intro::after { right: -24%; opacity: .32; }
  .intro-panel { padding: 20px; }
  #world-map { height: 68vh; min-height: 460px; }
  .map-sidebar { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 58%; }
}

/* ============================================================
   Home page — data board (metrics + mosaic bar charts)
   ============================================================ */
.container-wide { max-width: 1520px; margin: 0 auto; padding: 0 20px; }
.data-board-section { padding: 24px 0 64px; }
.board-head { max-width: 860px; margin-bottom: 26px; }
.board-head h2 {
  margin: 0 0 10px;
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 800;
  letter-spacing: -.02em;
}
.board-head p { margin: 0; font-size: 15px; line-height: 1.75; color: var(--muted); }

.metric-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.metric-tile {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .05);
}
.metric-tile strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--primary-dark);
  font-variant-numeric: tabular-nums;
}
.metric-tile span {
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--muted);
}

.board-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  grid-template-areas:
    "countries continents vregion"
    "countries gut stage"
    "breed breed breed";
  gap: 18px;
}
.board-card-countries { grid-area: countries; }
.board-card-continents { grid-area: continents; }
.board-card-vregion { grid-area: vregion; }
.board-card-gut { grid-area: gut; }
.board-card-stage { grid-area: stage; }
.board-card-wide { grid-area: breed; }

.board-card {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .06);
}
.board-card h3 {
  position: relative;
  margin: 0 0 12px;
  padding-left: 14px;
  font-size: 15px;
  font-weight: 700;
}
.board-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #17a085);
}
.board-chart { position: relative; height: 190px; }
.board-chart-tall { height: 440px; }
.board-chart-wide { height: 300px; }

.bar-list { display: flex; flex-direction: column; gap: 9px; }
.bar-list-wide { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 30px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(80px, 30%) 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
}
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.bar-track { height: 10px; border-radius: 6px; background: #eef3f1; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 6px; transition: width .3s ease; }
.bar-value { white-space: nowrap; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.bar-share { margin-left: 4px; color: #9aa6a2; }

@media (max-width: 1200px) {
  .metric-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "countries countries"
      "continents vregion"
      "gut stage"
      "breed breed";
  }
  .board-chart-tall { height: 380px; }
}
@media (max-width: 760px) {
  .metric-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "countries" "continents" "vregion" "gut" "stage" "breed";
  }
  .board-chart { height: 170px; }
  .board-chart-tall { height: 320px; }
  .board-chart-wide { height: 260px; }
  .bar-list-wide { grid-template-columns: 1fr; }
}

.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 860px; }
.data-table th {
  text-align: left;
  padding: 11px 12px;
  background: #f1f6f4;
  color: #374151;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table td { padding: 11px 12px; border-bottom: 1px solid #eef1f0; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfb; }
.data-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-green { background: var(--green-badge); color: var(--green-text); }
.badge-amber { background: var(--amber-badge); color: var(--amber-text); }
.badge-gray { background: var(--gray-badge); color: var(--gray-text); }
.badge-local { background: #e8efff; color: #2f5fd0; }

/* ---------- 搜索与筛选 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.search-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  border: 2px solid var(--primary);
  border-radius: 10px;
  background: #f2fbf8;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(14, 124, 102, .08);
  transition: border-color .15s, box-shadow .15s;
}

.search-box:focus-within {
  border-color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(14, 124, 102, .16);
}

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 10px 13px;
  font-size: 14px;
  background: transparent;
}

.search-box button {
  border: 0;
  background: #c9ecdf;
  color: var(--primary-dark);
  padding: 10px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  border-left: 1px solid var(--primary);
}
.search-box button:hover { background: #aee0cd; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters select {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.result-count { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.empty-tip { text-align: center; padding: 42px 10px; color: var(--muted); }
.empty-tip .big { font-size: 34px; display: block; margin-bottom: 8px; }

.pager { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.pager-info { color: var(--muted); font-size: 14px; }
.selection-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.selection-bar button:disabled { opacity: .55; cursor: not-allowed; }
.data-table td input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* Browse page: controls panel vs sample table panel */
.browse-controls {
  background: var(--primary);
  border: 1px solid var(--primary-dark);
  border-radius: 16px;
  padding: 16px 18px 12px;
  margin-bottom: 18px;
  color: #fff;
}
.browse-controls .toolbar { margin-bottom: 6px; }
.browse-controls .hint { margin: 10px 0 14px; color: rgba(255, 255, 255, .88); }
.browse-controls .filters { margin-bottom: 12px; }
.browse-controls .pager-info { color: #fff; }
.browse-controls .filters select {
  border: 1px solid #fff;
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.browse-controls .filters select option { color: var(--text); background: #fff; }
.browse-controls .search-box { background: #fff; }
.browse-controls .selection-bar {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .28);
}
.browse-controls .selection-bar .btn,
.browse-controls .selection-bar .btn-ghost {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid rgba(255, 255, 255, .6);
}
.browse-controls .selection-bar .btn:hover,
.browse-controls .selection-bar .btn-ghost:hover {
  background: #eafaf4;
  color: var(--primary-dark);
}
.browse-table-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px 16px;
}
.browse-table-box .result-count { margin-bottom: 6px; }

/* ---------- 统计图表 ---------- */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}
.chart-card h3 { margin: 0 0 12px; font-size: 17px; }
.chart-box { position: relative; height: 320px; }
@media (max-width: 560px) {
  .chart-box { height: 250px; }
}

/* ---------- 详情页 ---------- */
.page-head { padding: 40px 0 8px; }
.page-head h1 { margin: 6px 0 6px; font-size: 30px; }
.page-head .sub { color: var(--muted); margin: 0 0 8px; }
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--primary); }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.overview-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.overview-item .k { color: var(--muted); font-size: 12px; }
.overview-item .v { font-size: 20px; font-weight: 700; color: var(--primary-dark); margin-top: 2px; }

.detail-section { margin-bottom: 26px; }
.detail-section h2 {
  font-size: 19px;
  margin: 0 0 14px;
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

.info-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-table th {
  width: 180px;
  text-align: left;
  padding: 10px 14px;
  background: #f4f8f7;
  color: #45505a;
  font-weight: 600;
  border: 1px solid var(--border);
  vertical-align: top;
}
.info-table td { padding: 10px 14px; border: 1px solid var(--border); vertical-align: top; }
.info-table .wrap { word-break: break-all; }

.placeholder {
  color: #b45309;
  background: var(--accent-light);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 13px;
  white-space: nowrap;
}

.chip-list { display: flex; flex-wrap: wrap; gap: 10px; }
.trait-chip {
  border: 1px dashed #cbd5d1;
  border-radius: 9px;
  padding: 8px 14px;
  background: #fbfdfc;
  font-size: 13px;
  color: var(--muted);
}
.trait-chip strong { display: block; color: var(--text); font-size: 14px; }
.trait-chip .state { font-size: 12px; }

.file-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.file-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: #fbfdfc;
}
.file-item h3 { margin: 0 0 4px; font-size: 15px; }
.file-item p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.btn-disabled {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--gray-badge);
  color: var(--gray-text);
  font-size: 13px;
  cursor: not-allowed;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 9px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background .2s;
  text-align: center;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid var(--primary);
}
.btn-secondary:hover { background: var(--primary-light); color: var(--primary-dark); }
.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: #f5f8f7; color: var(--text); }
.btn-danger { background: #b42318; }
.btn-danger:hover { background: #912018; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.field label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 5px; }
.field label small { font-weight: 400; color: var(--muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  outline: 0;
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14, 124, 102, .12); }
.field textarea { min-height: 76px; resize: vertical; }

.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.notice {
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px;
  margin-bottom: 20px;
}
.notice-info { background: #eef7ff; border: 1px solid #bfe0ff; color: #1d4ed8; }
.notice-warn { background: var(--accent-light); border: 1px solid #f4cf9b; color: #92400e; }
.notice-success { background: var(--green-badge); border: 1px solid #bfe8d5; color: var(--green-text); }

.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* ---------- 数据录入页 ---------- */
.saved-table-wrap { overflow-x: auto; }
.saved-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.saved-table th { background: #f1f6f4; text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.saved-table td { padding: 9px 10px; border-bottom: 1px solid #eef1f0; }

code {
  background: #f1f5f4;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 13px;
}

.code-block {
  background: #12211d;
  color: #d6f5ea;
  border-radius: 10px;
  padding: 16px;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  max-height: 300px;
  white-space: pre;
  font-family: Consolas, "Courier New", monospace;
}

/* ---------- 下载中心 ---------- */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.download-card { display: flex; flex-direction: column; }
.download-card .file-icon { font-size: 32px; }
.download-card h3 { margin: 10px 0 6px; font-size: 17px; }
.download-card p { flex: 1; color: var(--muted); font-size: 14px; margin: 0 0 14px; }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 70px;
  background: #10231e;
  color: #c7d8d3;
  padding: 46px 0 0;
  font-size: 14px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding-bottom: 30px;
}

.footer-grid h3 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.footer-grid p { margin: 0; line-height: 1.8; }
.footer-grid a { color: #9fd8c8; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  padding: 16px 0;
  text-align: center;
  color: #8aa59d;
  font-size: 13px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 16px;
    box-shadow: var(--shadow-lg);
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 30px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 560px) {
  .brand-text small { display: none; }
  .hero { padding: 54px 0 66px; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .section { padding-top: 42px; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
}
