:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e0ea;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #b45309;
  --blue: #1d4ed8;
  --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, .10);
}

* { 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; }
select { cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(20, 184, 166, .45);
  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: 360px;
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(16,24,40,.92), rgba(16,24,40,.68) 46%, rgba(16,24,40,.20)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&fm=jpg&q=80&w=1800") center 48% / 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: #e4e7ec; 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,.28);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,.08);
  font-weight: 900;
}

.dashboard, .report-grid, .program-grid, .note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 22px;
  box-shadow: var(--shadow);
}
.stat-card, .report-card, .program-card, .note-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}
.stat-card span, .program-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.stat-card b {
  display: block;
  margin-top: 8px;
  color: var(--brand-dark);
  font-size: 28px;
  line-height: 1;
}
.stat-card p, .report-card p, .program-card p, .note-grid p {
  margin: 8px 0 0;
  color: var(--muted);
}
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
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;
}
.section-summary { color: var(--muted); margin: 12px 0 0; }

.report-card {
  display: grid;
  gap: 12px;
}
.report-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.report-card h3 { font-size: 17px; }
.result-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}
.result-badge.match { background: var(--brand-dark); }
.result-badge.challenge { background: var(--accent); }
.route-line {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}
.status-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}
.status-box b, .status-box span { display: block; }
.status-box span { color: var(--muted); font-size: 13px; }
.arrow { color: var(--brand); font-weight: 900; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.report-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.report-card footer a {
  color: var(--blue);
  font-weight: 900;
}
.translate-button {
  border: 1px solid rgba(15, 118, 110, .28);
  border-radius: 8px;
  background: #ecfdf3;
  color: var(--brand-dark);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 900;
}
.translate-button:hover {
  border-color: rgba(15, 118, 110, .50);
  background: #d1fae5;
}
.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  background: #fff;
}
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; }
code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  padding: 2px 5px;
}

@media (max-width: 980px) {
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    min-height: auto;
  }
  main { margin-left: 0; padding: 16px; }
  .dashboard, .report-grid, .program-grid, .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .section-head { align-items: stretch; flex-direction: column; }
  .dashboard, .report-grid, .program-grid, .note-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 28px; }
  .route-line { grid-template-columns: 1fr; }
  .arrow { display: none; }
  .report-card footer { align-items: flex-start; flex-direction: column; }
}
