:root {
  --bg: #f3f7f8;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d8e3e8;
  --brand: #0e7490;
  --brand-dark: #155e75;
  --accent: #c2410c;
  --green: #047857;
  --amber: #b45309;
  --surface-strong: rgba(255,255,255,.92);
  --radius: 12px;
  --transition: .25s cubic-bezier(.4,0,.2,1);
  --shadow: 0 16px 40px rgba(23, 32, 51, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(14, 116, 144, .35);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 100;
  transform: translateY(-140%);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  padding: 8px 12px;
  font-weight: 900;
  box-shadow: var(--shadow);
}
.skip-link:focus { transform: translateY(0); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 200px;
  padding: 24px 18px;
  background: var(--surface-strong);
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  display: flex;
  flex-direction: column;
  gap: 22px;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.54);
}
.brand:hover { background: rgba(255,255,255,.74); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg,var(--brand),#1d4ed8);
  color: #fff;
  font-weight: 900;
  box-shadow: var(--shadow);
}
.brand strong, .brand small { display: block; }
.brand strong {
  font-family: "Noto Serif SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",serif;
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
}
.brand small { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.nav { display: grid; gap: 2px; }
.nav a {
  padding: 11px 14px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  transition: all var(--transition);
}
.nav a.active, .nav a:hover {
  background: rgba(37,99,235,.08);
  color: var(--ink);
  transform: translateX(2px);
}

main { margin-left: 200px; padding: 24px; }
.workspace, .panel { max-width: 1440px; margin: 0 auto 22px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; line-height: 1.18; }
h1 { max-width: 760px; font-size: clamp(30px, 4vw, 54px); }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

.hero-panel {
  min-height: 380px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(9, 34, 45, .92), rgba(9, 34, 45, .66) 44%, rgba(9, 34, 45, .18)),
    url("https://images.unsplash.com/photo-1544551763-46a013bb70d5?auto=format&fit=crop&fm=jpg&q=80&w=1800") center 54% / cover no-repeat;
  display: grid;
  color: #fff;
  box-shadow: var(--shadow);
}
.hero-copy { padding: 44px; align-self: end; }
.hero-copy p:not(.eyebrow) { max-width: 700px; color: #e5f3f6; font-size: 17px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.quick-actions a {
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,.10);
  font-weight: 900;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  box-shadow: var(--shadow);
}
.section-summary { margin: 10px 0 0; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
select, .catalog-search {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 12px;
}
.catalog-search { width: 100%; margin-top: 16px; }

.dashboard, .site-grid, .marine-grid, .gear-grid, .guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.metric-card, .site-card, .marine-card, .gear-card, .guide-card, .cert-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
.metric-card b {
  display: block;
  color: var(--brand-dark);
  font-size: 30px;
  line-height: 1;
}
.metric-card span, .tag, .meta { color: var(--muted); font-size: 13px; }
.metric-card p, .site-card p, .marine-card p, .gear-card p, .guide-card p, .cert-card p {
  margin: 8px 0 0;
  color: var(--muted);
}
.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(14, 116, 144, .10);
  color: var(--brand-dark);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  border-radius: 999px;
  background: #eef4f6;
  padding: 4px 8px;
}
.tag-highlight {
  background: linear-gradient(135deg, rgba(14, 116, 144, .16), rgba(245, 158, 11, .18));
  border: 1px solid rgba(14, 116, 144, .22);
  color: #075985;
  font-weight: 900;
}
.site-card[data-level="进阶"] .pill, .site-card[data-level="专家"] .pill { background: rgba(194, 65, 12, .10); color: var(--accent); }

.cert-timeline {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.cert-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) minmax(320px, .9fr);
  gap: 14px;
  align-items: start;
}
.cert-agency {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}
.cert-stage {
  color: var(--brand-dark);
  display: block;
  margin-top: 3px;
  font-size: 18px;
  font-weight: 900;
}
.cert-meta {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}
.cert-meta span {
  border-left: 3px solid rgba(14, 116, 144, .30);
  padding-left: 8px;
}
.cert-facts {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.cert-facts b {
  color: var(--ink);
  font-size: 14px;
}
.cert-facts ul {
  margin: 0;
  padding-left: 18px;
}
.cert-facts li + li { margin-top: 5px; }

.marine-card {
  min-height: 250px;
  overflow: hidden;
  padding: 0;
}
.marine-visual {
  height: 160px;
  background: #0f2f3a;
  overflow: hidden;
}
.marine-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.marine-body { padding: 16px; }
.image-credit {
  font-size: 11px;
  line-height: 1.45;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

[data-theme="dark"] {
  --bg: #0f1720;
  --panel: #14212b;
  --surface-strong: rgba(15, 23, 42, .94);
  --ink: #edf6f9;
  --muted: #a7bbc4;
  --line: rgba(203, 230, 239, .16);
  --shadow: none;
}
[data-theme="dark"] .sidebar {
  background: var(--surface-strong);
  border-color: var(--line);
}
[data-theme="dark"] .brand,
[data-theme="dark"] .nav a.active,
[data-theme="dark"] .nav a:hover {
  background-color: rgba(15, 23, 42, .9);
  color: var(--ink);
}
body.dark-mode .sidebar {
  background: rgba(15, 23, 42, .94);
  border-color: rgba(255, 255, 255, .14);
  color: #e5e7eb;
}
body.dark-mode .brand,
body.dark-mode .nav a.active,
body.dark-mode .nav a:hover {
  background-color: rgba(15, 23, 42, .9);
  color: #e5e7eb;
}
body.dark-mode .brand strong { color: #e5e7eb; }
body.dark-mode .brand small,
body.dark-mode .nav a { color: #9ca3af; }
[data-theme="dark"] select,
[data-theme="dark"] .catalog-search,
[data-theme="dark"] .metric-card,
[data-theme="dark"] .site-card,
[data-theme="dark"] .marine-card,
[data-theme="dark"] .gear-card,
[data-theme="dark"] .guide-card,
[data-theme="dark"] .cert-card {
  background: #172733;
  color: var(--ink);
}
[data-theme="dark"] .tag { background: rgba(255,255,255,.08); }
[data-theme="dark"] .tag-highlight {
  background: linear-gradient(135deg, rgba(56, 189, 248, .20), rgba(251, 191, 36, .18));
  border-color: rgba(56, 189, 248, .30);
  color: #bae6fd;
}

@media (max-width: 1120px) {
  .dashboard, .site-grid, .marine-grid, .gear-grid, .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .sidebar { position: static; width: auto; }
  main { margin-left: 0; padding: 16px; }
  .hero-copy { padding: 28px; }
  .section-head, .cert-card { display: block; }
  .filters { justify-content: stretch; margin-top: 12px; }
  select { width: 100%; }
  .cert-facts { margin-top: 12px; }
}
@media (max-width: 620px) {
  .dashboard, .site-grid, .marine-grid, .gear-grid, .guide-grid { grid-template-columns: 1fr; }
  .hero-panel { min-height: 440px; }
  .panel { padding: 16px; }
}
