/* 热点资讯 · 响应式样式（移动端优先，PC 端增强） */
:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #6b7280;
  --line: #eceff3;
  --accent: #1677ff;
  --accent-bg: rgba(22, 119, 255, 0.08);
  --hot: #ff4d2e;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.05), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo { font-size: 19px; font-weight: 800; letter-spacing: 0.5px; }
.logo-small { font-size: 17px; }

.btn-refresh {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-refresh:hover { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.btn-refresh.loading { opacity: 0.6; pointer-events: none; }

.btn-back {
  border: none;
  background: none;
  font-size: 15px;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px 10px;
  margin-left: -10px;
  border-radius: 8px;
}
.btn-back:hover { background: var(--line); color: var(--text); }
.topbar-space { width: 24px; }

/* ---------- 平台 Tab ---------- */
.tabs {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  padding: 12px 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab:hover { color: var(--accent); border-color: var(--accent); }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ---------- 容器 & 列表 ---------- */
.container { max-width: 820px; margin: 0 auto; padding: 12px 16px 40px; }
.feed { list-style: none; display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
}
.rank {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  background: #f1f2f4;
  margin-top: 2px;
}
.rank-top { color: #fff; }
.rank-1 { background: linear-gradient(135deg, #ff512f, #f09819); }
.rank-2 { background: linear-gradient(135deg, #bdc3c7, #8e9aaf); }
.rank-3 { background: linear-gradient(135deg, #e08a4b, #b8622a); }

.card-body { flex: 1 1 auto; min-width: 0; }
.card-title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.card:hover .card-title { color: var(--accent); }
.card-meta { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.pill {
  flex: 0 0 auto;
  font-size: 11.5px;
  padding: 1px 8px;
  border-radius: 5px;
  background: var(--accent-bg);
  color: var(--accent);
}
.meta-time { font-size: 12px; color: var(--text-2); }
.card-hot {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--hot);
  margin-top: 4px;
  white-space: nowrap;
}
.card-thumb {
  flex: 0 0 88px;
  width: 88px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 2px;
  background: #eef0f3;
}

/* ---------- 加载 / 状态 ---------- */
.status {
  text-align: center;
  color: var(--text-2);
  padding: 48px 16px;
  font-size: 14px;
}
.status .spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  margin-bottom: 12px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
  padding: 24px 16px 8px;
}

/* ---------- 详情页 ---------- */
.article-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px;
  margin-top: 8px;
}
.article-title { font-size: 21px; font-weight: 800; line-height: 1.45; word-break: break-word; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.article-content { margin-top: 18px; }
.article-hero { margin-bottom: 18px; }
.article-hero img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef0f3;
}
.article-img { margin-top: 16px; }
.article-img img {
  width: 100%;
  border-radius: 10px;
  background: #eef0f3;
}
.article-text {
  font-size: 16px;
  line-height: 1.9;
  color: #2b2f36;
  white-space: pre-wrap;
  word-break: break-word;
}
.article-desc {
  font-size: 15px;
  color: var(--text-2);
  background: #f8f9fb;
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.article-fallback { text-align: center; padding: 40px 0; color: var(--text-2); }
.article-fallback .emoji { font-size: 40px; display: block; margin-bottom: 12px; }
.article-fallback .err-text { font-size: 13px; margin-top: 8px; }
.article-fallback .btn-origin {
  display: inline-block;
  margin-top: 18px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 999px;
}

/* ---------- PC 端增强 ---------- */
@media (min-width: 768px) {
  .topbar-inner { padding: 16px 24px; }
  .tabs { padding: 14px 24px 6px; }
  .container { padding: 16px 24px 60px; }
  .logo { font-size: 21px; }
  .card-link { padding: 16px 18px; }
  .card-title { font-size: 16.5px; }
  .article-card { padding: 32px 36px; }
  .article-title { font-size: 26px; }
  .article-text { font-size: 17px; }
}
