/* ============================================================
   Global Radio — editorial design system
   Palette: paper #F7F3EA / ink #16130E / signal #E34A22 / mute #8A8378
   Type: Fraunces (display) + Instrument Sans (body) + mono digits
   ============================================================ */
:root {
  --paper: #F7F3EA;
  --paper-2: #FFFDF8;
  --ink: #16130E;
  --ink-2: #403A30;
  --mute: #8A8378;
  --line: #D8D1C2;
  --line-strong: #16130E;
  --signal: #E34A22;
  --signal-dark: #C03A16;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --max: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 88px; /* player bar */
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }

/* ---------- header ---------- */
.site-head {
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper);
  position: sticky; top: 0; z-index: 50;
}
.site-head .wrap { display: flex; align-items: center; gap: 26px; height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--signal);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.brand b { font-family: var(--serif); font-weight: 600; font-size: 20px; letter-spacing: .2px; }
.brand small { font-family: var(--mono); font-size: 10px; color: var(--mute); letter-spacing: 1.5px; }

nav.main { display: flex; gap: 22px; margin-left: 8px; }
nav.main a {
  font-size: 13.5px; font-weight: 600; letter-spacing: .4px;
  padding: 6px 2px; border-bottom: 2px solid transparent;
}
nav.main a.on, nav.main a:hover { border-bottom-color: var(--signal); }

.head-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.random-btn {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--line-strong);
  padding: 7px 14px; border-radius: 999px;
  background: var(--paper-2);
  transition: transform .12s ease, background .12s;
}
.random-btn:hover { transform: translateY(-1px); background: #fff; }
.random-btn:disabled { opacity: .5; cursor: default; }

/* header search */
.search { position: relative; }
.search input {
  width: 250px; height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-2);
  padding: 0 16px 0 38px;
  font: inherit; font-size: 13.5px;
  outline: none;
}
.search input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(227,74,34,.14); }
.search .mag {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--mute); pointer-events: none; display: flex;
}
.search .drop {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 380px; max-width: 84vw;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(22,19,14,.16);
  overflow: hidden;
  display: none;
}
.search .drop.open { display: block; }
.search .drop .item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.search .drop .item:last-child { border-bottom: 0; }
.search .drop .item:hover { background: #fff; }
.search .drop .item img { width: 22px; height: 17px; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.search .drop .item .n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.search .drop .item .c { font-family: var(--mono); font-size: 11px; color: var(--mute); }

/* ---------- hero ---------- */
.hero { padding: 84px 0 66px; border-bottom: 1px solid var(--line-strong); position: relative; overflow: hidden; }
.hero .kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: 3px;
  color: var(--signal); text-transform: uppercase;
  display: flex; align-items: center; gap: 10px; margin-bottom: 26px;
}
.hero .kicker::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); opacity: .25; }
.hero h1 {
  font-family: var(--serif); font-weight: 560;
  font-size: clamp(44px, 7.2vw, 96px);
  line-height: .98; letter-spacing: -1.5px;
  max-width: 15ch;
}
.hero h1 em { font-style: italic; color: var(--signal); }
.hero .lede {
  margin-top: 26px; max-width: 46ch;
  font-size: 17px; color: var(--ink-2);
}
.hero .stats { display: flex; gap: 54px; margin-top: 44px; flex-wrap: wrap; }
.hero .stat .num {
  font-family: var(--serif); font-size: 40px; font-weight: 600; letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.hero .stat .lbl { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--mute); text-transform: uppercase; margin-top: 2px; }
.hero .cta-row { display: flex; gap: 14px; margin-top: 46px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 50px; padding: 0 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: transform .12s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: var(--signal); color: #fff; box-shadow: 0 10px 26px rgba(227,74,34,.32); }
.btn.primary:hover { background: var(--signal-dark); }
.btn.ghost { border: 1px solid var(--line-strong); background: var(--paper-2); }
/* 居中的独立按钮容器（inline-flex 元素用 text-align 居中最可靠） */
.cta-solo { text-align: center; margin: 34px 0 56px; }

/* ---------- legal pages (privacy etc.) ---------- */
.legal { max-width: 780px; }
.legal h3 {
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 21px;
  margin: 40px 0 14px; padding-top: 26px; border-top: 1px solid var(--line-strong);
}
.legal h3:first-of-type { border-top: 0; margin-top: 10px; padding-top: 0; }
.legal p, .legal li { color: #3E3930; font-size: 15px; line-height: 1.8; margin-bottom: 12px; }
.legal ul { padding-left: 22px; margin: 0 0 12px; }
.legal li { margin-bottom: 7px; }
.legal a { color: var(--signal); }
.legal .upd {
  font-family: var(--mono); font-size: 12px; letter-spacing: .5px;
  color: var(--mute); text-transform: uppercase; margin-bottom: 26px;
}
.site-foot .flink { color: var(--mute); text-decoration: underline; text-underline-offset: 3px; }
.site-foot .flink:hover { color: var(--ink); }

/* frequency ruler decoration */
.ruler {
  height: 34px; margin-top: 58px;
  background: repeating-linear-gradient(90deg,
    var(--line-strong) 0 1px, transparent 1px 44px);
  opacity: .35;
  position: relative;
}
.ruler i {
  position: absolute; top: 18px;
  font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--mute);
}

/* ---------- section headers ---------- */
.sec-head { display: flex; align-items: baseline; gap: 18px; padding: 52px 0 26px; }
.sec-head h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; letter-spacing: -.5px; }
.sec-head .idx { font-family: var(--mono); font-size: 13px; color: var(--signal); }
.sec-head .tail { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--mute); }

/* ---------- country grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line-strong);
}
.cc {
  background: var(--paper);
  padding: 18px 18px 16px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  transition: background .14s ease;
  min-height: 118px;
}
.cc:hover { background: var(--paper-2); }
.cc .top { display: flex; align-items: flex-start; justify-content: space-between; }
.cc img { width: 34px; height: 25px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(22,19,14,.14); }
.cc .no { font-family: var(--mono); font-size: 10.5px; color: var(--mute); }
.cc .nm { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -.3px; line-height: 1.15; }
.cc .ct { margin-top: auto; font-family: var(--mono); font-size: 11.5px; color: var(--mute); }
.cc .ct b { color: var(--signal); font-weight: 600; }

/* A-Z anchor rail */
.az { display: flex; flex-wrap: wrap; gap: 4px; padding: 18px 0 22px; }
.az a {
  font-family: var(--mono); font-size: 12px;
  width: 28px; height: 28px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 6px;
}
.az a:hover { border-color: var(--signal); color: var(--signal); }

/* ---------- country page ---------- */
.c-hero { border-bottom: 1px solid var(--line-strong); padding: 58px 0 40px; }
.c-hero .row { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.c-hero img {
  width: 92px; height: 68px; border-radius: 6px; object-fit: cover;
  box-shadow: 0 0 0 1px rgba(22,19,14,.18), 0 14px 30px rgba(22,19,14,.14);
}
.c-hero h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(38px, 6vw, 68px); letter-spacing: -1px; line-height: 1; }
.c-hero .meta { margin-top: 16px; font-family: var(--mono); font-size: 13px; color: var(--mute); letter-spacing: .5px; }
.c-hero .meta b { color: var(--signal); }

.tools {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 0; border-bottom: 1px solid var(--line-strong);
  position: sticky; top: 64px; background: var(--paper); z-index: 40;
}
.tools input {
  flex: 1; max-width: 360px; height: 40px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--paper-2); padding: 0 18px;
  font: inherit; font-size: 14px; outline: none;
}
.tools input:focus { background: #fff; box-shadow: 0 0 0 3px rgba(227,74,34,.14); }
.tools .count { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--mute); }

/* ---------- station list ---------- */
.stations { border-left: 1px solid var(--line); border-right: 1px solid var(--line); margin: 26px 0 30px; }
.st-row {
  display: flex; align-items: center; gap: 16px;
  width: 100%; text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  transition: background .12s;
}
.st-row:hover { background: var(--paper-2); }
.st-row .no { font-family: var(--mono); font-size: 11px; color: var(--mute); width: 34px; flex-shrink: 0; }
.st-row .nm { font-weight: 600; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.st-row .sub { font-family: var(--mono); font-size: 11.5px; color: var(--mute); flex-shrink: 0; }
.st-row .play {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  transition: background .12s, color .12s, border-color .12s;
}
.st-row:hover .play { background: var(--signal); border-color: var(--signal); color: #fff; }
.st-row.on .play { background: var(--signal); border-color: var(--signal); color: #fff; }
.st-row.on { background: #fff; box-shadow: inset 3px 0 0 var(--signal); }

.load-more {
  display: block; margin: 0 auto 40px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 12px 30px; font-weight: 600; font-size: 14px;
  background: var(--paper-2);
}
.load-more:hover { background: #fff; transform: translateY(-1px); }

.empty-block { padding: 60px 0; text-align: center; color: var(--mute); font-family: var(--mono); font-size: 13px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line-strong); margin-top: 30px; }
.site-foot .wrap { display: flex; gap: 24px; align-items: center; padding: 26px 28px; flex-wrap: wrap; }
.site-foot p { font-size: 13px; color: var(--mute); }
.site-foot .mono { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; }
.site-foot .up { margin-left: auto; font-family: var(--mono); font-size: 12px; border-bottom: 1px solid var(--ink); padding-bottom: 1px; }

/* ---------- player bar ---------- */
.pbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: var(--ink); color: var(--paper);
  display: none;
  box-shadow: 0 -14px 34px rgba(22,19,14,.28);
}
.pbar.show { display: block; }
.pbar .wrap { display: flex; align-items: center; gap: 16px; height: 68px; }
.pbar .wave { display: flex; align-items: flex-end; gap: 2.5px; height: 20px; }
.pbar .wave i { width: 3px; background: var(--signal); border-radius: 2px; animation: wob 1s ease-in-out infinite; }
.pbar .wave i:nth-child(2) { animation-delay: .18s; }
.pbar .wave i:nth-child(3) { animation-delay: .36s; }
@keyframes wob { 0%,100% { height: 6px; } 50% { height: 19px; } }
.pbar.paused .wave i { animation-play-state: paused; height: 6px; }
.pbar .who { min-width: 0; flex: 1; }
.pbar .who .t { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .who .s { font-family: var(--mono); font-size: 11px; color: #B9B2A4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .ctrl {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; color: var(--paper);
  border: 1px solid #4A443A;
  transition: background .12s, border-color .12s;
}
.pbar .ctrl:hover { background: #2A261E; }
.pbar .ctrl.main { background: var(--signal); border-color: var(--signal); }
.pbar .ctrl.main:hover { background: var(--signal-dark); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(8px);
  background: var(--ink); color: var(--paper);
  padding: 11px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- favorites & history ---------- */
.st-row .heart {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--mute);
  transition: color .12s, background .12s;
}
.st-row .heart:hover { color: var(--signal); background: rgba(227,74,34,.09); }
.st-row.fav .heart { color: var(--signal); }
.st-row.fav .heart svg path { fill: currentColor; }
@media (hover: hover) {
  .st-row .heart { opacity: .25; }
  .st-row:hover .heart, .st-row.fav .heart { opacity: 1; }
}
.lib-tools { display: flex; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line-strong); }
.lib-tools .clear {
  margin-left: auto;
  font-family: var(--mono); font-size: 12px; letter-spacing: .5px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 18px; background: var(--paper-2);
}
.lib-tools .clear:hover { background: #fff; color: var(--signal); border-color: var(--signal); }
#pbFav { color: var(--mute); }
#pbFav.on { color: var(--signal); border-color: var(--signal); }
#pbFav.on svg path { fill: currentColor; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .search input { width: 170px; }
  .hero { padding: 54px 0 46px; }
  .hero .stats { gap: 34px; }
  .wrap { padding: 0 18px; }
  .c-hero img { width: 64px; height: 48px; }
  .st-row .no { display: none; }
  .tools { top: 63px; }
}
@media (max-width: 560px) {
  .search { display: none; }
  .st-row .sub { display: none; }
  .hero .stat .num { font-size: 30px; }
  .site-head .wrap { gap: 12px; }
  nav.main { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; }
  nav.main::-webkit-scrollbar { display: none; }
  nav.main a { font-size: 12.5px; white-space: nowrap; }
  .random-btn span { display: none; }
  .st-row .heart { opacity: 1; }
}
