/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* —— Dark / Night —— */
  --bg: #0a0a14;
  --surface: rgba(26, 26, 38, 0.55);
  --surface-strong: rgba(30, 30, 48, 0.78);
  --surface-solid: #1a1a26;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ececf2;
  --text2: #a8a8b8;
  --text3: #6a6a82;
  --accent: #6b9aff;
  --accent2: #4fd6cc;
  --politics: #ff8b8b;
  --economics: #6b9aff;
  --mixed: #c890ff;
  --fashion: #ff79b8;
  --rank-gold: #ffcd3c;
  --rank-silver: #c0c6d6;
  --rank-bronze: #d49567;
  --overlay-rgba: rgba(6, 6, 16, 0.78);
  --specular: rgba(255, 255, 255, 0.18);
  --specular-soft: rgba(255, 255, 255, 0.06);
  --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
  --shadow-card-hover: 0 18px 60px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

/* —— Light / Day —— */
body.theme-light {
  --bg: #eef2f8;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --border: rgba(20, 24, 40, 0.10);
  --border-strong: rgba(20, 24, 40, 0.18);
  --text: #1a1d2b;
  --text2: #545970;
  --text3: #8a8fa6;
  --accent: #3666e6;
  --accent2: #1aa8a0;
  --politics: #d04848;
  --economics: #3666e6;
  --mixed: #8b3fd9;
  --fashion: #d63384;
  --rank-gold: #d99e00;
  --rank-silver: #707a90;
  --rank-bronze: #a05a23;
  --overlay-rgba: rgba(255, 255, 255, 0.55);
  --specular: rgba(255, 255, 255, 0.85);
  --specular-soft: rgba(255, 255, 255, 0.35);
  --shadow-card: 0 10px 40px rgba(40, 60, 110, 0.12), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --shadow-card-hover: 0 18px 50px rgba(40, 60, 110, 0.22), 0 1px 0 rgba(255, 255, 255, 1) inset;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.8s ease, color 0.8s ease;
}

/* ===== Background Layer ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -3;
  background: linear-gradient(145deg, #07111f 0%, #111422 48%, #151018 100%);
}

.bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.8s ease-in-out;
  filter: saturate(1.05);
}

.bg-image.active { opacity: 1; }

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--overlay-rgba);
  backdrop-filter: blur(2px);
  transition: background 0.8s ease;
}

/* ===== Container ===== */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  position: relative;
}

/* ===== Header ===== */
.header {
  text-align: center;
  padding: 44px 0 24px;
  position: relative;
}

.header h1 {
  font-family: inherit;
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent) 10%, var(--accent2) 90%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 60px rgba(107, 154, 255, 0.25);
}

.subtitle {
  margin-top: 10px;
  color: var(--text2);
  font-size: 0.95rem;
  font-weight: 500;
}

/* —— 主题切换按钮 —— */
.theme-toggle {
  position: absolute;
  top: 44px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-card);
}

.theme-toggle:hover {
  transform: scale(1.08) rotate(-12deg);
  border-color: var(--accent);
}

.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
body.theme-light .theme-toggle .icon-sun { display: block; }
body.theme-light .theme-toggle .icon-moon { display: none; }

/* ===== Liquid Glass 通用 ===== */
.glass {
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.glass::before {
  /* 顶部镜面高光 */
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 50%;
  background: linear-gradient(180deg, var(--specular) 0%, transparent 100%);
  opacity: 0.35;
  pointer-events: none;
  border-radius: 18px 18px 0 0;
}

/* ===== Page Nav (全球 / 时尚) ===== */
.page-nav {
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  margin: 0 auto 18px;
  width: fit-content;
  position: relative;
  overflow: hidden;
}

.page-nav::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 50%;
  background: linear-gradient(180deg, var(--specular) 0%, transparent 100%);
  opacity: 0.35;
  pointer-events: none;
}

.page-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 1;
}

.page-tab-icon { font-size: 1.05rem; }

.page-tab:hover { color: var(--text); }

.page-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  box-shadow: 0 6px 20px rgba(107, 154, 255, 0.4), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
  transform: translateY(-1px);
}

/* ===== Setup Bar ===== */
.setup-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-card);
  position: relative;
}

.setup-bar::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 50%;
  background: linear-gradient(180deg, var(--specular-soft) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 14px 14px 0 0;
}

.setup-hint {
  font-size: 0.85rem;
  color: var(--text2);
  white-space: nowrap;
}

.setup-inputs {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.api-select, .api-input {
  padding: 7px 12px;
  background: var(--surface-strong);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.api-select { cursor: pointer; }
.api-input { flex: 1; min-width: 140px; }
.api-input:focus, .api-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(107, 154, 255, 0.15); }

.guide-link {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}

.guide-link:hover { text-decoration: underline; }

/* ===== Guide Panel ===== */
.guide-panel {
  display: none;
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.guide-panel.show { display: block; animation: slide-down 0.4s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.guide-content h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 700;
}

.guide-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.guide-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

.guide-card strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--text);
}

.guide-card p {
  font-size: 0.8rem;
  color: var(--text2);
  margin-bottom: 10px;
}

.guide-note {
  font-size: 0.8rem;
  color: var(--text3);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(107, 154, 255, 0.35), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(107, 154, 255, 0.5), 0 1px 0 rgba(255, 255, 255, 0.25) inset; }
.btn:active { transform: translateY(0); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 5px 12px;
  font-size: 0.78rem;
  box-shadow: none;
}

.btn-outline:hover { background: rgba(107, 154, 255, 0.12); transform: none; box-shadow: none; }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 18px;
  background: var(--surface);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--text2);
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 1px 0 var(--specular-soft) inset;
}

.filter-tab:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }

.filter-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(107, 154, 255, 0.4), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.fashion-filter .filter-tab.active {
  background: linear-gradient(135deg, var(--fashion), #c890ff);
  box-shadow: 0 6px 18px rgba(255, 121, 184, 0.4), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.event-count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text3);
  padding: 5px 12px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ===== Loading & Error ===== */
.loading {
  text-align: center;
  padding: 80px 0;
  color: var(--text2);
}

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error {
  text-align: center;
  padding: 48px 0;
  color: var(--politics);
}

.error .btn { margin-top: 12px; }

/* ============================================================
   News Card — Liquid Glass (iOS 26)
   ============================================================ */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.news-card {
  display: flex;
  gap: 18px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 22px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.45s ease,
    border-color 0.45s ease;
  animation: card-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.news-card:nth-child(1)  { animation-delay: 0.02s; }
.news-card:nth-child(2)  { animation-delay: 0.05s; }
.news-card:nth-child(3)  { animation-delay: 0.08s; }
.news-card:nth-child(4)  { animation-delay: 0.11s; }
.news-card:nth-child(5)  { animation-delay: 0.14s; }
.news-card:nth-child(6)  { animation-delay: 0.17s; }
.news-card:nth-child(7)  { animation-delay: 0.20s; }
.news-card:nth-child(8)  { animation-delay: 0.23s; }
.news-card:nth-child(9)  { animation-delay: 0.26s; }
.news-card:nth-child(10) { animation-delay: 0.29s; }
.news-card:nth-child(n+11) { animation-delay: 0.32s; }

@keyframes card-enter {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* —— 顶部镜面高光 (specular highlight) ——
   仅覆盖卡片顶部 22% 区域 (标题之上),并控制在低 z-index,确保文字始终浮于其上 */
.news-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 22%;
  background: linear-gradient(
    180deg,
    var(--specular) 0%,
    var(--specular-soft) 50%,
    transparent 100%
  );
  opacity: 0.55;
  pointer-events: none;
  border-radius: 20px 20px 0 0;
  transition: opacity 0.45s ease;
  z-index: 0;
}

/* —— 折射边缘光 + 排名色条 —— */
.news-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 12%;
  bottom: 12%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 0;
}

.news-card:hover::after { opacity: 1; }

.news-card.rank-1::after { background: linear-gradient(180deg, transparent, var(--rank-gold), transparent); opacity: 1; }
.news-card.rank-2::after { background: linear-gradient(180deg, transparent, var(--rank-silver), transparent); opacity: 1; }
.news-card.rank-3::after { background: linear-gradient(180deg, transparent, var(--rank-bronze), transparent); opacity: 1; }

/* hover 只做纯 translate (不缩放),避免文字子像素重绘导致的模糊 */
.news-card:hover {
  transform: translate3d(0, -4px, 0);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
  background: var(--surface-strong);
}

/* hover 时高光略减弱,让文字对比度更清晰 */
.news-card:hover::before { opacity: 0.42; }

.news-card:active {
  transform: translate3d(0, -1px, 0);
  transition-duration: 0.12s;
}

/* —— 排名徽章 (玻璃质感) —— */
.rank-badge {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  color: var(--text2);
  margin-top: 2px;
  position: relative;
  z-index: 1;
  box-shadow: 0 1px 0 var(--specular-soft) inset, 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rank-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--specular) 0%, transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}

/* hover 时徽章只做位移 + 轻微旋转,不缩放,保数字清晰 */
.news-card:hover .rank-badge { transform: translate3d(0, -1px, 0) rotate(-4deg); }

.rank-1 .rank-badge {
  background: linear-gradient(135deg, rgba(255, 205, 60, 0.35), rgba(255, 205, 60, 0.15));
  border-color: rgba(255, 205, 60, 0.5);
  color: var(--rank-gold);
  font-size: 1.3rem;
  box-shadow: 0 1px 0 var(--specular) inset, 0 4px 16px rgba(255, 205, 60, 0.35);
}
.rank-2 .rank-badge {
  background: linear-gradient(135deg, rgba(192, 198, 214, 0.35), rgba(192, 198, 214, 0.15));
  border-color: rgba(192, 198, 214, 0.45);
  color: var(--rank-silver);
  font-size: 1.2rem;
}
.rank-3 .rank-badge {
  background: linear-gradient(135deg, rgba(212, 149, 103, 0.3), rgba(212, 149, 103, 0.12));
  border-color: rgba(212, 149, 103, 0.45);
  color: var(--rank-bronze);
  font-size: 1.15rem;
}

.card-media {
  flex: 0 0 156px;
  width: 156px;
  aspect-ratio: 16 / 10;
  align-self: stretch;
  min-height: 108px;
  max-height: 136px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
  box-shadow: 0 1px 0 var(--specular-soft) inset, 0 8px 22px rgba(0, 0, 0, 0.16);
}

.card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card-body { flex: 1; min-width: 0; position: relative; z-index: 1; }

.card-title {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: 0.005em;
}

.card-desc {
  font-size: 0.86rem;
  color: var(--text2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.card-category {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
}

.cat-politics  { background: rgba(255, 139, 139, 0.18);  color: var(--politics); }
.cat-economics { background: rgba(107, 154, 255, 0.18);  color: var(--economics); }
.cat-mixed     { background: rgba(200, 144, 255, 0.18);  color: var(--mixed); }
.cat-runway    { background: rgba(255, 121, 184, 0.20);  color: var(--fashion); }
.cat-brand     { background: rgba(200, 144, 255, 0.18);  color: var(--mixed); }
.cat-trend     { background: rgba(79, 214, 204, 0.18);   color: var(--accent2); }

/* —— 地区标识 —— */
.card-region {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--surface-strong);
  color: var(--text2);
  border: 1px solid var(--border);
}

.card-source { font-size: 0.78rem; color: var(--text3); }
.card-time   { font-size: 0.78rem; color: var(--text3); margin-left: auto; }

.card-tag,
.card-confirmed {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  background: rgba(79, 214, 204, 0.14);
  color: var(--accent2);
  border: 1px solid rgba(79, 214, 204, 0.22);
}

.card-confirmed {
  background: rgba(107, 154, 255, 0.12);
  color: var(--accent);
  border-color: rgba(107, 154, 255, 0.22);
}

/* —— Impact Meter —— */
.card-impact {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 52px;
  padding: 4px 8px;
  border-radius: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

.impact-score {
  font-size: 1.18rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.impact-label {
  font-size: 0.62rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* —— 外链指示 —— */
.card-external-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--accent);
  opacity: 1;
  transform: translateX(0);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.news-card:hover .card-external-link { opacity: 1; transform: translateX(0); }
.card-external-link svg { width: 13px; height: 13px; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 40px 0 20px;
  color: var(--text3);
  font-size: 0.8rem;
}

.footer-note { margin-top: 4px; font-size: 0.72rem; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--surface-strong);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 999;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25), 0 1px 0 var(--specular-soft) inset;
}

.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .header h1 { font-size: 1.55rem; }
  .header { padding: 28px 0 18px; }
  .theme-toggle { top: 28px; right: 12px; width: 38px; height: 38px; }
  .theme-toggle svg { width: 17px; height: 17px; }

  .page-tab { padding: 8px 14px; font-size: 0.85rem; }

  .setup-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .setup-inputs { flex-wrap: wrap; }
  .api-input { min-width: 100%; }

  .guide-cards { grid-template-columns: 1fr; }

  .news-card { padding: 16px; gap: 12px; border-radius: 18px; }
  .card-media { flex-basis: 112px; width: 112px; min-height: 82px; max-height: 104px; border-radius: 12px; }
  .card-title { font-size: 0.95rem; }
  .card-desc { -webkit-line-clamp: 3; font-size: 0.82rem; }
  .card-impact { display: none; }
  .rank-badge { width: 38px; height: 38px; font-size: 1rem; }

  .filter-bar { gap: 6px; }
  .filter-tab { padding: 6px 12px; font-size: 0.78rem; }
}

@media (max-width: 520px) {
  .news-card { flex-wrap: wrap; align-items: flex-start; }
  .card-media {
    order: 2;
    flex: 1 1 calc(100% - 50px);
    width: auto;
    min-height: 130px;
    max-height: none;
  }
  .card-body { order: 3; flex-basis: 100%; }
  .card-impact { order: 4; }
}

/* ===== Prefers reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .news-card, .theme-toggle, .filter-tab, .page-tab, .btn { animation: none !important; transition-duration: 0.1s !important; }
}
