:root {
  /* 现代高级配色系统：清晰高对比度、质感雅致、通透自然 */
  --bg: #f8fafc;
  --bg2: #f1f5f9;
  --card: #ffffff;
  --card-hover: #ffffff;
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-light: #f1f5f9;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.03);
  --radius: 14px;
  --radius-sm: 8px;
  --gap: 18px;
}

[data-theme="dark"],
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090d16;
    --bg2: #0f172a;
    --card: #131b2e;
    --card-hover: #19243b;
    --text: #f8fafc;
    --text-secondary: #cbd5e1;
    --muted: #94a3b8;
    --muted-light: #64748b;
    --line: #1e293b;
    --line-light: #0f172a;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-light: rgba(59, 130, 246, 0.15);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 16px 32px -4px rgba(0, 0, 0, 0.5);
  }
}

[data-theme="dark"] {
  --bg: #090d16;
  --bg2: #0f172a;
  --card: #131b2e;
  --card-hover: #19243b;
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --muted: #94a3b8;
  --muted-light: #64748b;
  --line: #1e293b;
  --line-light: #0f172a;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-light: rgba(59, 130, 246, 0.15);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.4);
  --shadow-hover: 0 16px 32px -4px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(124, 58, 237, 0.04) 0px, transparent 50%),
    radial-gradient(at 50% 100%, rgba(16, 185, 129, 0.03) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.3));
}

.topbar h1 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.3px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.topbar h1 [data-brand="main"] {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar h1 [data-brand="sub"] {
  margin-left: 0;
  flex: none;
}

.topbar h1 small {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.tagline {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clock {
  display: none;
}

.lang {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  outline: none;
}

.lang:hover {
  border-color: #cbd5e1;
  background: var(--bg-subtle, #f1f5f9);
}

.btn {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn:hover {
  background: var(--bg2);
  border-color: #cbd5e1;
}

.btn.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.github-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.github-btn:hover {
  background: var(--bg2);
  border-color: #cbd5e1;
  color: var(--text);
  transform: translateY(-1px);
}

/* ---------------- 顶部 Tab ---------------- */
.tabs {
  position: sticky;
  top: 59px;
  z-index: 40;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 24px;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.tabs[hidden] {
  display: none;
}

.tab {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 999px;
  transition: all 0.15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab:hover {
  color: var(--text);
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.tab.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
}

/* ---------------- 主站入口卡片（portal 模式） ---------------- */
.entries {
  padding: 8px 16px 0;
}

.entries[hidden] {
  display: none;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 0 8px;
}

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.entry-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: #93c5fd;
  box-shadow: 0 10px 25px -4px rgba(37, 99, 235, 0.1);
}

.entry-card:hover::before {
  opacity: 1;
}

.entry-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.entry-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
}

.entry-go {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

/* ---------------- 区块标题 ---------------- */
.section-title {
  margin: 20px 24px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* ---------------- 固定看板（天气/游戏/AI） ---------------- */
.widgets-wrap {
  padding: 0 16px;
}

.widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 0 8px;
}

.widget {
  --accent: #2563eb;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.widget-title {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-input {
  width: 90px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  outline: none;
}

.mini-btn {
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.mini-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.widget-body {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.w-item {
  font-size: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-light);
}

.w-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.w-item a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.w-item a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.w-item .w-meta {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 3px;
}

.w-item .w-desc {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 3px;
  line-height: 1.45;
}

.w-loading {
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  padding: 16px 0;
}

/* ---------------- 瀑布流/网格 ---------------- */
main {
  padding: 14px 24px 60px;
  max-width: 1440px;
  margin: 0 auto;
}

.feed {
  column-width: 320px;
  column-gap: var(--gap);
}

.card {
  --accent: #2563eb;
  break-inside: avoid;
  margin: 0 0 var(--gap);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  animation: cardFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
}

.card .bar {
  height: 3px;
  background: var(--accent);
}

.card .body {
  padding: 14px 16px 16px;
}

.card .thumb {
  height: 140px;
  background-size: cover;
  background-position: center;
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--line);
  transition: transform 0.3s ease;
}

.card:hover .thumb {
  transform: scale(1.02);
}

.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.title {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  line-height: 1.45;
  transition: color 0.15s ease;
}

.title:hover {
  color: var(--accent);
}

.desc {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.meta span:first-child {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--text-secondary);
}

.meta span:last-child {
  text-align: right;
  min-width: 0;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 垂类站个性化元素 (Game, Hot, AI) */
.badge-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  margin-right: 6px;
  flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35); }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; }
.rank-3 { background: linear-gradient(135deg, #b45309, #78350f); color: #fff; }
.rank-other { background: #f1f5f9; color: #64748b; }

.badge-heat {
  font-size: 11.5px;
  font-weight: 600;
  color: #ef4444;
  background: #fef2f2;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #fee2e2;
}

.game-claim-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  background: #10b981;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.game-claim-btn:hover {
  background: #059669;
  transform: translateY(-1px);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- 规范化信息流广告卡片 ---------------- */
.card-ad {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ad-label-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 4px;
}

.ad-badge {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}

.ad-container {
  padding: 12px 16px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------- 加载哨兵与无限流 ---------------- */
.sentinel {
  text-align: center;
  padding: 32px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.sentinel .loader {
  display: none;
}

.loader.is-on {
  display: inline-flex;
  gap: 6px;
}

.loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .4;
  animation: blink 1s infinite ease-in-out both;
}

.loader span:nth-child(2) { animation-delay: .2s; }
.loader span:nth-child(3) { animation-delay: .4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: .25; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1.15); }
}

#status {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.load-more-btn {
  cursor: pointer;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.load-more-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

/* ---------------- 提示条 ---------------- */
.banner {
  position: sticky;
  top: 108px;
  z-index: 45;
  margin: 10px 24px 0;
  padding: 8px 16px;
  font-size: 12.5px;
  color: #1e3a8a;
  font-weight: 500;
  background: #dbeafe;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
}

.banner.warn {
  color: #854d0e;
  background: #fef9c3;
  border-color: #fef08a;
}

/* ---------------- 页脚 ---------------- */
.foot {
  margin-top: 40px;
  padding: 32px 24px 48px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 12.5px;
  color: var(--muted);
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

.foot-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.foot-links a.policy-trigger,
.foot-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  transition: color 0.15s ease;
}

.foot-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.foot-links .sep {
  color: var(--line);
  user-select: none;
}

.foot-copy {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------------- Cookie 提示条 ---------------- */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  width: min(920px, calc(100% - 32px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  padding: 16px 24px;
  animation: slideUpFade 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.cookie-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-text {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1 1 500px;
}

.cookie-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.cookie-text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

.cookie-btn-accept {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.15s ease;
}

.cookie-btn-accept:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* ---------------- 模态窗 ---------------- */
.policy-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.policy-modal[hidden] {
  display: none;
}

.policy-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.policy-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 800px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.policy-box {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 85vh;
}

.policy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  padding: 10px 20px;
  gap: 12px;
}

.policy-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.policy-tab {
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.policy-tab.is-active {
  color: var(--text);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.policy-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.policy-close:hover {
  color: #ef4444;
  background: #fef2f2;
}

.policy-content {
  padding: 28px 32px;
  overflow-y: auto;
  font-size: 14.5px;
  line-height: 1.7;
  color: #334155;
}

.policy-pane h3 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--text);
  font-weight: 800;
}

.policy-date {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 18px;
}

.policy-pane h4 {
  margin: 22px 0 10px;
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
}

.policy-callout {
  background: #f8fafc;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 14px 0;
}

/* 响应式 */
@media (max-width: 1024px) {
  .entry-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

@media (max-width: 640px) {
  .feed {
    column-width: 100%;
  }
  .entry-grid {
    grid-template-columns: 1fr;
  }
  .tagline {
    display: none;
  }
  .topbar {
    padding: 10px 16px;
  }
  .tabs {
    padding: 8px 16px;
  }
  main {
    padding: 10px 16px 40px;
  }
  .stream-toolbar {
    flex-direction: column;
    align-items: stretch;
    margin: 8px 0 16px;
  }
  .search-box {
    max-width: 100%;
  }
}

/* ---------------- 交互工具栏与即时检索 (Usability Toolbar) ---------------- */
.stream-toolbar {
  max-width: 900px;
  margin: 12px auto 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 36px 9px 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.clear-search-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
}
.clear-search-btn:hover {
  color: var(--text);
}

.stream-stats {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ---------------- 回到顶部 (Back to Top) ---------------- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 28px;
  z-index: 90;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
  color: var(--accent);
}

/* 深色模式特定组件细节适配 */
[data-theme="dark"] .topbar,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .topbar {
    background: rgba(15, 23, 42, 0.88);
  }
}

[data-theme="dark"] .policy-box,
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .policy-box {
    background: #0f172a;
    border-color: #1e293b;
  }
  :root:not([data-theme="light"]) .policy-head,
  :root:not([data-theme="light"]) .policy-callout {
    background: #1e293b;
  }
}