/* Arsenal Wiki — main.css
   Color tokens from data/club.json: Arsenal Red #EF0107 + 白 + 海军蓝/金 */

:root {
  --red: #EF0107;
  --red-dark: #C4000A;
  --red-soft: #FFE5E6;
  --ink: #1A1F36;
  --ink-soft: #4A4F6B;
  --muted: #6B7088;
  --line: #E5E7EE;
  --bg: #F7F8FB;
  --card: #ffffff;
  --navy: #0E1B3D;
  --gold: #B8902A;
  --gold-soft: #F5D67A;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
code, pre { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
.muted { color: var(--muted); }
small.muted { font-size: 0.85em; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand__crest { width: 32px; height: 32px; object-fit: contain; }
.brand__name em { color: var(--red); font-style: normal; }

.nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.nav a:hover {
  background: var(--red-soft);
  color: var(--red-dark);
  text-decoration: none;
}
.nav a.active {
  background: var(--red);
  color: white;
}

.search {
  position: relative;
  flex: 0 0 280px;
}
.search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
  outline: none;
  transition: all 0.15s;
}
.search input:focus {
  border-color: var(--red);
  background: white;
  box-shadow: 0 0 0 3px var(--red-soft);
}
.search__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 360px;
  overflow-y: auto;
  z-index: 60;
}
.search__results a {
  display: block;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
}
.search__results a:hover { background: var(--red-soft); text-decoration: none; }
.search__results a small { color: var(--muted); display: block; margin-top: 2px; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Main / app ---------- */
.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.app > section { margin-bottom: 32px; }
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}

.page-head {
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0 0 6px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.page-head h1 small { font-size: 0.5em; color: var(--muted); font-weight: 500; }
.lede {
  margin: 0;
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* ---------- Hero (home) ---------- */
.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  color: white;
  background: var(--navy);
}
.hero__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 80% 30%, rgba(239, 1, 7, 0.55), transparent 50%),
    linear-gradient(135deg, var(--navy) 0%, #1B2350 100%);
}
.hero__bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.hero__content {
  position: relative;
  padding: 56px 48px;
  display: grid;
  gap: 16px;
  max-width: 720px;
}
.hero__crest img { width: 64px; height: 80px; object-fit: contain; }
.hero__title {
  margin: 0;
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.05;
}
.hero__sub {
  margin: 0;
  font-size: 18px;
  color: rgba(255,255,255,0.75);
}
.hero__chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  backdrop-filter: blur(6px);
}
.chip b { color: white; font-weight: 600; }
.hero__cta {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
}
.btn:hover { background: rgba(255,255,255,0.2); text-decoration: none; }
.btn--primary {
  background: var(--red);
  border-color: var(--red);
}
.btn--primary:hover { background: var(--red-dark); border-color: var(--red-dark); }

/* ---------- Cards / grid ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
}
.card .lead {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 16px;
}
.card--accent { background: linear-gradient(135deg, #FFF8EE 0%, #FFFAF1 100%); border-color: var(--gold-soft); }

.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bullets {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
}
.bullets li { margin: 4px 0; }
.kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  font-size: 14px;
}
.kv > div { display: flex; gap: 6px; align-items: baseline; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; }

.tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  color: var(--ink);
  transition: all 0.15s;
}
.tile:hover {
  border-color: var(--red);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(239, 1, 7, 0.12);
  text-decoration: none;
}
.tile__num {
  font-size: 38px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: -1px;
  line-height: 1;
}
.tile__label {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 600;
}
.tile__hint {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Feed (recent updates) ---------- */
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.feed li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.feed li:last-child { border: none; }
.feed time {
  flex: 0 0 110px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.feed .feed__tag {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--red-soft);
  color: var(--red-dark);
  font-size: 12px;
  border-radius: 999px;
}

/* ---------- Timeline (history) ---------- */
.timeline {
  position: relative;
  padding-left: 32px;
  border-left: 2px solid var(--line);
}
.timeline__era {
  margin: 28px 0;
}
.timeline__era h2 {
  margin: 0 0 4px;
  font-size: 22px;
  color: var(--ink);
  position: relative;
}
.timeline__era h2::before {
  content: "";
  position: absolute;
  left: -38px;
  top: 8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--red);
  border: 3px solid white;
  box-shadow: 0 0 0 1px var(--red);
}
.timeline__era .summary {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 15px;
}
.timeline__event {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.timeline__year {
  font-weight: 700;
  color: var(--red);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}
.timeline__event h3 {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
}
.timeline__event p { margin: 0; color: var(--ink-soft); font-size: 14px; }

/* ---------- Honors ---------- */
.totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.totals__item {
  text-align: center;
  padding: 16px 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.totals__num {
  font-size: 30px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}
.totals__label {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.honors-list { display: grid; gap: 16px; }
.honor-cat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.honor-cat__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.honor-cat h2 {
  margin: 0;
  font-size: 19px;
}
.honor-cat__sub {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.honor-cat__count {
  font-size: 22px;
  font-weight: 800;
  color: var(--red);
}
.honor-years {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.honor-years span {
  padding: 3px 8px;
  background: var(--red-soft);
  color: var(--red-dark);
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.honor-highlights { list-style: none; padding: 0; margin: 8px 0 0; }
.honor-highlights li {
  padding: 6px 0;
  font-size: 14px;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
}
.honor-highlights li:first-child { border: none; }
.honor-highlights b { color: var(--ink); }
.honor-highlights .tag {
  display: inline-block;
  padding: 1px 7px;
  background: var(--gold-soft);
  color: #6A4F0E;
  border-radius: 999px;
  font-size: 11px;
  margin-right: 6px;
  font-weight: 600;
}

/* ---------- Squad grid ---------- */
.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.squad-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.squad-card__num {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.squad-card__name {
  font-weight: 600;
  font-size: 15px;
}
.squad-card__meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.squad-card__note {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 4px;
  line-height: 1.45;
}
.squad-section h2 {
  margin: 24px 0 12px;
  font-size: 18px;
  color: var(--ink-soft);
  border-left: 3px solid var(--red);
  padding-left: 10px;
}

/* ---------- Managers ---------- */
.manager-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.manager {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
}
.manager__name {
  font-weight: 700;
  font-size: 16px;
}
.manager__tenure {
  font-size: 12px;
  color: var(--muted);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  margin: 2px 0 8px;
}
.manager__note {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.manager__trophies {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 12px;
  color: var(--red);
  font-weight: 600;
}
.manager--icon {
  border-left-color: var(--gold);
  background: linear-gradient(135deg, #FFFAF1 0%, #ffffff 60%);
}

/* ---------- Legends ---------- */
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.legend {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.legend__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.legend__name {
  font-weight: 700;
  font-size: 16px;
}
.legend__pos {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--red-soft);
  color: var(--red-dark);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.legend__meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.legend__nums {
  display: flex;
  gap: 14px;
  margin: 8px 0;
  font-size: 13px;
}
.legend__nums b {
  font-size: 18px;
  color: var(--red);
  display: block;
  line-height: 1;
}
.legend__nums span { color: var(--muted); font-size: 11px; }
.legend__highlight {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.legend--icon {
  border-color: var(--gold-soft);
  background: linear-gradient(135deg, #FFFAF1 0%, #ffffff 60%);
}

/* ---------- Stadium ---------- */
.stadium {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.stadium__block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.stadium__block h2 { margin-top: 0; font-size: 20px; }
.stadium__block h3 {
  margin: 20px 0 8px;
  font-size: 15px;
  color: var(--ink-soft);
}
.stadium__block ul {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 14px;
}
.stadium__block li { margin: 3px 0; }
.kv-stadium {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  margin: 12px 0;
  font-size: 14px;
}
.kv-stadium span { color: var(--muted); }
.kv-stadium b { font-weight: 600; }

/* ---------- Matches ---------- */
.matches { display: grid; gap: 12px; }
.match {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}
.match--icon {
  border-color: var(--gold-soft);
  background: linear-gradient(135deg, #FFFAF1 0%, #ffffff 70%);
}
.match__date {
  font-size: 12px;
  color: var(--muted);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  margin-bottom: 4px;
}
.match__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
}
.match__comp {
  font-size: 12px;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.match__vs {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 4px 0;
}
.match__vs b { color: var(--ink); }
.match__summary {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 6px 0 8px;
  line-height: 1.55;
}
.match__score {
  font-size: 28px;
  font-weight: 800;
  color: var(--red);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: -1px;
  text-align: center;
  align-self: center;
}
.match__score small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}
.match__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.match__tags span {
  font-size: 11px;
  padding: 2px 7px;
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: 4px;
}

/* ---------- Stats ---------- */
.stats { display: grid; gap: 24px; }
.stats__block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.stats__block h2 {
  margin: 0 0 12px;
  font-size: 19px;
  border-left: 3px solid var(--red);
  padding-left: 10px;
}
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.rank-table th,
.rank-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.rank-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
}
.rank-table td:first-child {
  font-weight: 700;
  color: var(--red);
  width: 40px;
  text-align: center;
}
.rank-table tr:hover { background: var(--bg); }
.stat-kv {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 24px;
  font-size: 14px;
}
.stat-kv > div { display: flex; gap: 6px; }
.stat-kv span { color: var(--muted); }
.stat-kv b { font-weight: 600; }

/* ---------- Culture ---------- */
.culture { display: grid; gap: 16px; }
.culture__block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.culture__block h2 { margin-top: 0; }
.culture__block p { color: var(--ink-soft); }

/* ---------- Update (prose) ---------- */
.prose { max-width: 720px; }
.prose h2 { margin-top: 28px; font-size: 22px; }
.prose code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--red-dark);
}
.prose pre {
  background: var(--navy);
  color: #E5E7EE;
  padding: 16px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
}
.prose pre code {
  background: transparent;
  border: none;
  color: inherit;
  padding: 0;
}
.prose ul, .prose ol { padding-left: 20px; color: var(--ink-soft); }
.prose li { margin: 4px 0; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  background: white;
  padding: 24px;
  margin-top: 64px;
}
.footer__inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .grid-2, .grid-3, .stadium { grid-template-columns: 1fr; }
  .hero__content { padding: 36px 28px; }
  .hero__title { font-size: 36px; }
  .search { flex: 1; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    margin: 0;
    border-bottom: 1px solid var(--line);
    display: none;
    max-height: 70vh;
    overflow-y: auto;
  }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .match { grid-template-columns: 1fr; }
  .match__score { text-align: left; }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- Photo + Link enhancements ---------- */

/* Squad card with photo */
.squad-card {
  flex-direction: row;
  align-items: flex-start;
}
.squad-card__img {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--red);
  background: var(--red);
}
.squad-card__num {
  flex: 0 0 30px;
  height: 30px;
  font-size: 12px;
  margin-top: 0;
  position: absolute;
  margin-left: 42px;
  margin-top: 38px;
  border: 2px solid white;
}

/* Legend card with photo */
.legend { display: flex; flex-direction: column; }
.legend__photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg) 0%, #ECEEF4 100%);
  margin-bottom: 10px;
  display: grid;
  place-items: center;
}
.legend__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.legend__wiki {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-soft);
}
.legend__wiki:hover { background: var(--red-soft); color: var(--red-dark); text-decoration: none; }

/* Manager card with photo */
.manager {
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
}
.manager__img {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--red);
  border: 2px solid var(--gold-soft);
}
.manager__body { flex: 1; min-width: 0; }
.manager__wiki {
  display: inline-block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* Stadium figure */
.stadium__figure {
  margin: 12px 0 16px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
}
.stadium__figure img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}
.stadium__figure figcaption {
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  background: white;
  border-top: 1px solid var(--line);
}

/* Link chips (for matches + songs) */
.match__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.link-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--line);
  transition: all 0.15s;
}
.link-chip:hover {
  background: var(--red-soft);
  color: var(--red-dark);
  border-color: var(--red);
  text-decoration: none;
}
.link-chip--yt {
  background: #FFE5E6;
  color: #C4000A;
  border-color: #F5A8AB;
}
.link-chip--yt:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
}

/* Rank table images */
.rank-table__img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--red);
  display: block;
}
.rank-table td:first-child {
  width: 50px;
}

/* Songs grid */
.songs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.song {
  display: flex;
  gap: 14px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.song:hover {
  border-color: var(--red);
  box-shadow: 0 8px 20px rgba(239, 1, 7, 0.08);
}
.song__cover {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  display: grid;
  place-items: center;
}
.song__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.song__body { flex: 1; min-width: 0; }
.song__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.song__head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}
.song__year {
  font-size: 12px;
  color: var(--muted);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.song__artist {
  font-size: 13px;
  color: var(--red);
  font-weight: 500;
  margin: 2px 0 6px;
}
.song__role {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-style: italic;
}
.song__story {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin: 6px 0 8px;
}
.song__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}
.song__tags span {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: 3px;
}
.song__links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

@media (max-width: 880px) {
  .songs { grid-template-columns: 1fr; }
}

/* ---------- Internal wiki links ---------- */
.wiki-link {
  color: var(--red-dark);
  text-decoration: none;
  border-bottom: 1px dashed var(--red);
  padding-bottom: 1px;
  transition: all 0.15s;
}
.wiki-link:hover {
  color: white;
  background: var(--red);
  border-bottom-color: var(--red);
  text-decoration: none;
  border-radius: 2px;
  padding: 0 4px;
  margin: 0 -4px;
}

/* ---------- Kits page ---------- */
.kit-eras {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.kit-era {
  padding: 14px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--red);
}
.kit-era h3 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--ink);
}
.kit-era p {
  margin: 2px 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.kit-era p b { color: var(--ink); }
.kit-era .muted {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.5;
}

.kit-controls {
  margin-top: 16px;
}
.kit-filters {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-soft);
}
.kit-filters label {
  display: flex;
  gap: 6px;
  align-items: center;
}
.kit-filters select {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 13px;
  cursor: pointer;
}

.kits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.kit-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.15s;
}
.kit-card:hover {
  border-color: var(--red);
  box-shadow: 0 8px 20px rgba(239, 1, 7, 0.08);
  transform: translateY(-2px);
}
.kit-card__svg {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 4/5;
}
.kit-svg {
  width: 100%;
  height: auto;
  display: block;
}
.kit-card__meta {
  width: 100%;
  margin-top: 10px;
  text-align: center;
}
.kit-card__season {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.kit-card__mfr {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.kit-card__note {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
  line-height: 1.4;
}
.kit-card__img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  display: block;
}
.kit-card__tag {
  display: inline-block;
  font-size: 9px;
  padding: 1px 6px;
  margin-left: 6px;
  background: #E6F4E1;
  color: #2E7D32;
  border-radius: 3px;
  font-weight: 600;
  vertical-align: middle;
}
.kit-card__tag--svg {
  background: var(--bg);
  color: var(--muted);
}

.callout {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  border-left: 3px solid var(--red);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.6;
}
.callout--info {
  background: #FFF8E5;
  border-left-color: #B8902A;
}
.callout code {
  background: white;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  border: 1px solid var(--gold-soft);
  color: var(--gold);
}

/* ============================================================
   Mobile polish (追加于 2026-06-03)
   - Sticky header with shadow on scroll
   - Larger touch targets (44x44 min)
   - Full-width search on mobile
   - Tables horizontally scrollable
   - Larger tap-friendly nav items
   ============================================================ */
@media (max-width: 880px) {
  /* Sticky header that gets shadow on scroll */
  .header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  }
  .header.scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08); }

  /* Hero: smaller padding, tighter title */
  .hero { padding: 16px 0; }
  .hero__content { padding: 24px 20px; }
  .hero__title { font-size: 26px; line-height: 1.15; }
  .hero__sub { font-size: 14px; }
  .hero__chips { gap: 6px; }
  .hero__chip { padding: 4px 10px; font-size: 11px; }

  /* Nav: full width on mobile, bigger touch targets */
  .nav a {
    padding: 14px 16px;
    font-size: 15px;
    min-height: 44px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
  }
  .nav a:last-child { border-bottom: none; }

  /* Search: full width when nav open, sticky on top */
  .search {
    width: 100%;
    margin-top: 8px;
  }
  .search input {
    font-size: 16px; /* prevents iOS zoom on focus */
    padding: 12px 14px;
  }

  /* Page head: tighter */
  .page-head { padding: 16px 0 12px; }
  .page-head h1 { font-size: 24px; }
  .page-head h1 small { font-size: 0.55em; }

  /* Card grids: tighter gaps */
  .grid-2, .grid-3, .stadium { gap: 12px; }

  /* Tables: horizontal scroll on overflow */
  .stats-table, .matches-table, table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .match { grid-template-columns: 1fr; gap: 6px; }
  .match__score { text-align: left; font-size: 16px; }

  /* Cards: reduce padding on small screens */
  .card { padding: 14px 16px; }
  .card h2, .card h3 { font-size: 16px; }

  /* Body: avoid horizontal scroll */
  body { overflow-x: hidden; }
  main { padding: 0 14px; }

  /* Squad/Legend: smaller photos on mobile */
  .squad-card__img { width: 48px; height: 48px; flex: 0 0 48px; }
  .squad-card { gap: 10px; }
  .squad-card__num { font-size: 10px; width: 22px; height: 22px; line-height: 22px; }

  /* Bottom padding so content doesn't hide under fixed elements */
  main { padding-bottom: 24px; }

  /* Floating "back to top" button on long pages */
  .to-top {
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--red);
    color: white;
    border: none;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 30;
    display: none;
  }
  .to-top.show { display: block; }
}

/* Extra small screens (iPhone SE etc) */
@media (max-width: 380px) {
  .hero__title { font-size: 22px; }
  .page-head h1 { font-size: 20px; }
  main { padding: 0 10px; }
}
