:root {
  --bg: #12141a; --card: #1c1f28; --card2: #242835; --line: #2e3344;
  --tx: #e8eaf2; --tx2: #9aa1b5; --tx3: #6b7288;
  --accent: #f59e0b; --accent2: #f97316;
  --grad: linear-gradient(135deg, #f59e0b, #f97316);
  --fs: 1; /* 字體縮放：小（目前版型）= 1；中 1.13；大 1.42（仿 albo） */
}
body.f-m { --fs: 1.13; }
body.f-l { --fs: 1.42; }
body.f-xxl { --fs: 2.13; } /* 超大 = 大再大 50% */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--tx);
  font-family: -apple-system, "PingFang TC", "Noto Sans TC", sans-serif;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
#app { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* 頂欄 */
.topbar { display: flex; align-items: center; padding: calc(14px + env(safe-area-inset-top)) 0 10px; }
h1 { font-size: calc(26px * var(--fs)); font-weight: 800; letter-spacing: 1px; }
h1 .pre { color: var(--tx2); font-size: 14px; font-weight: 600; margin-right: 6px; }
h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--tx2); font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.top-btn.on { background: var(--grad); color: #fff; border-color: transparent; }
.fs-opt.on { background: var(--card2); color: var(--accent); border-color: var(--accent); }

/* tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tab {
  flex: 1; padding: 10px 0; text-align: center; border-radius: 12px;
  background: var(--card); color: var(--tx2); font-size: calc(15px * var(--fs)); font-weight: 600; border: none;
}
.tab.active { background: var(--grad); color: #fff; }

/* 搜尋列 */
.searchrow { display: flex; gap: 8px; margin-bottom: 10px; }
#search {
  flex: 1; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--tx); font-size: calc(16px * var(--fs)); outline: none;
}
#search:focus { border-color: var(--accent); }
#btnSearchClear { padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--tx2); font-size: 15px; }

/* 標籤 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  padding: 6px 13px; border-radius: 999px; background: var(--card); color: var(--tx2);
  font-size: calc(13px * var(--fs)); border: 1px solid var(--line);
}
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }

/* 電台列表 */
.station {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 14px; padding: 12px; margin-bottom: 10px;
}
.st-favicon {
  width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
  background: var(--card2); object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: #fff; overflow: hidden;
}
.st-main { flex: 1; min-width: 0; }
.st-name { font-size: calc(15px * var(--fs)); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-meta { font-size: calc(12px * var(--fs)); color: var(--tx2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-blocked { font-size: calc(11px * var(--fs)); color: var(--tx3); margin-top: 3px; }
.station.blocked { opacity: 0.62; }
.station.playing { border: 2px solid var(--accent); }
.st-acts { display: flex; gap: 6px; flex-shrink: 0; }
.st-btn {
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: var(--card2); color: var(--tx); font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.st-btn.play { background: var(--grad); color: #fff; font-size: 16px; }
.st-btn:disabled { opacity: 0.35; }
.st-btn.fav-on { color: var(--accent); }

/* 播放條（固定底部） */
#playerBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: rgba(20, 22, 28, 0.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
#playerBar.hidden { display: none; }
.pb-inner { max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.pb-info { flex: 1; min-width: 0; }
.pb-name { font-size: calc(14px * var(--fs)); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-status { font-size: calc(11px * var(--fs)); color: var(--tx2); margin-top: 2px; }
.pb-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--grad); color: #fff; font-size: 17px; flex-shrink: 0; }
.pb-btn.stop { background: var(--card2); color: var(--tx2); }
.pb-btn.sleep { background: var(--card2); color: var(--tx); font-size: 14px; }
.pb-btn.sleep-on { color: var(--accent); }

/* sheet */
.overlay { position: fixed; inset: 0; z-index: 160; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end; justify-content: center; }
.overlay.hidden { display: none; }
.sheet {
  background: var(--card); width: 100%; max-width: 640px;
  border-radius: 22px 22px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 80vh; overflow-y: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h2 { font-size: 18px; font-weight: 800; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--card2); color: var(--tx2); font-size: 16px; }
.sleep-opt { width: 100%; padding: 13px 0; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card2); color: var(--tx); font-size: 15px; font-weight: 600; }
.sleep-opt.active { background: var(--grad); color: #fff; border-color: transparent; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--card2); color: var(--tx); padding: 10px 18px; border-radius: 999px;
  font-size: calc(13px * var(--fs)); z-index: 200; max-width: 86%; text-align: center;
  box-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
#toast.hidden { display: none; }

.muted { color: var(--tx2); font-size: calc(13px * var(--fs)); padding: 10px 4px; }
.sec-label { font-size: calc(13px * var(--fs)); color: var(--accent); font-weight: 700; padding: 4px 4px 8px; }
.empty { text-align: center; padding: 60px 20px; color: var(--tx2); font-size: calc(15px * var(--fs)); line-height: 1.8; }
.lbl { font-size: 13px; color: var(--tx2); font-weight: 600; display: block; margin-bottom: 8px; }