* { box-sizing: border-box; }

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --text: #172033;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #7c3aed;
  --primary-soft: #ede9fe;
  --shadow: 0 12px 32px rgb(15 23 42 / 8%);
}

:root.dark {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #172033;
  --surface-muted: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #a78bfa;
  --primary-soft: #312e81;
  --shadow: 0 12px 32px rgb(0 0 0 / 24%);
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
.site-brand { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 700; }
.site-home-icon { color: var(--primary); font-size: 28px; line-height: 1; }
.site-actions { margin-left: auto; }
.theme-toggle { width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; font-size: 20px; }
.theme-toggle:hover { background: var(--surface-muted); }

main { min-height: calc(100vh - 145px); }
.hero { background: var(--surface); }
.hero-inner { display: grid; grid-template-columns: 1fr 420px; gap: 32px; max-width: 1200px; align-items: center; margin: 0 auto; padding: 72px 20px 56px; }
.hero h1 { max-width: 680px; margin: 0 0 16px; font-size: clamp(2.4rem, 6vw, 4.5rem); line-height: 1.1; letter-spacing: -0.04em; }
.hero p { max-width: 600px; margin: 0; color: var(--muted); font-size: 1.2rem; }
.hero-image { width: 100%; max-height: 280px; object-fit: contain; }

.block { max-width: 1200px; margin: 0 auto; padding: 18px 20px; }
.block-title { display: flex; align-items: center; gap: 16px; margin: 0 0 20px; color: var(--primary); font-size: 18px; }
.block-title::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.link-card { display: block; height: 100%; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.link-card:hover { transform: translateY(-3px); border-color: var(--primary); }
.link-card h3 { margin: 0 0 12px; font-size: 1.15rem; }
.link-card p { min-height: 3.2em; margin: 0; color: var(--muted); font-size: .95rem; }

.data-page { max-width: 1200px; margin: 0 auto; padding: 28px 20px; }
.data-panel { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.data-header { padding: 28px 20px 20px; text-align: center; border-bottom: 1px solid var(--border); }
.data-header h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.5rem); }
.data-header p { margin: 8px 0 14px; color: var(--muted); font-size: .9rem; }
.year-links { display: flex; justify-content: center; gap: 12px; }
.button { display: inline-block; padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-muted); color: var(--muted); cursor: pointer; }
.button[aria-current="page"] { border-color: var(--primary); background: var(--primary); color: #fff; cursor: default; }
.filters { display: flex; align-items: center; gap: 16px; padding: 16px; }
.control { width: 100%; max-width: 280px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); outline-color: var(--primary); }
.page-size-control { display: flex; align-items: center; gap: 8px; color: var(--muted); white-space: nowrap; font-size: .9rem; }
.page-size-control .control { width: auto; min-width: 72px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; text-align: center; border-top: 1px solid var(--border); }
th { background: var(--surface-muted); color: var(--muted); font-size: .9rem; font-weight: 600; }
td { white-space: normal; }
.sort-button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.sort-button:hover { color: var(--primary); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 18px; }
.pagination button { min-width: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; }
.pagination button:disabled { cursor: not-allowed; opacity: .45; }
.pagination span { color: var(--muted); font-size: .9rem; }
.empty { padding: 32px; color: var(--muted); text-align: center; }

.site-footer { padding: 18px 20px 24px; color: var(--muted); text-align: center; font-size: .875rem; }
.site-footer p { margin: 6px 0; }
.site-footer a:hover { color: var(--primary); }

@media (max-width: 800px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 48px; }
  .hero-image { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
  .control { max-width: none; }
  .desktop-only { display: none; }
  .data-page { padding: 0; }
  .data-panel { border-right: 0; border-left: 0; border-radius: 0; }
  .data-header h1 { font-size: 2rem; }
}
