:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --ink: #1c2330;
  --muted: #6b7382;
  --line: #e6e8ed;
  --accent: #f0483e;
  --accent-soft: #fdecea;
  --green: #18a058;
  --shadow: 0 1px 3px rgba(20, 30, 50, .06), 0 6px 18px rgba(20, 30, 50, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }

.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; background: var(--accent);
  color: #fff; font-weight: 700; font-size: 22px; display: grid; place-items: center;
}
.brand h1 { margin: 0; font-size: 20px; letter-spacing: .5px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 16px; }
.sync { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.sync.error .dot { background: var(--accent); }
.sync.running .dot { background: #e0a020; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
.refresh-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  border: 1px solid var(--accent); border-radius: 9px; background: var(--accent);
  color: #fff; font-size: 13px; cursor: pointer; transition: .15s; white-space: nowrap;
}
.refresh-btn:hover:not(:disabled) { background: #d93a31; }
.refresh-btn:disabled { opacity: .6; cursor: wait; }
.refresh-icon { font-size: 17px; line-height: 1; }
.refresh-btn.busy .refresh-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.toast {
  margin-top: 16px; padding: 12px 16px; border-radius: 10px; font-size: 13px;
  background: #eaf5ee; color: #1a7a45; border: 1px solid #bfe3cd;
}
.toast.error { background: var(--accent-soft); color: #b03028; border-color: #f4c4bf; }
.toast.running { background: #fdf5e3; color: #96690d; border-color: #f0dfa8; }

.toolbar { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.searchbox { position: relative; }
.searchbox svg {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
}
.searchbox input {
  width: 100%; padding: 12px 16px 12px 44px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); color: var(--ink); font-size: 14px; outline: none;
}
.searchbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 13px; cursor: pointer; transition: .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.stats { margin-top: 18px; display: flex; gap: 24px; flex-wrap: wrap; color: var(--muted); font-size: 12px; }
.stats b { color: var(--ink); font-size: 15px; }

.news-list { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.news-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: block;
}
.news-item:hover { transform: translateY(-2px); border-color: #d5d9e0; box-shadow: 0 8px 24px rgba(20,30,50,.09); }
.news-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.tag { background: var(--accent-soft); color: var(--accent); padding: 2px 9px; border-radius: 6px; font-weight: 600; }
.news-title { font-size: 16px; font-weight: 600; margin: 0 0 6px; line-height: 1.45; }
.news-desc { font-size: 13px; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-time { margin-left: auto; white-space: nowrap; }

.loading, .empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.more-wrap { text-align: center; margin: 26px 0 10px; }
.more-btn {
  padding: 10px 28px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink); cursor: pointer; font-size: 14px;
}
.more-btn:hover { border-color: var(--accent); color: var(--accent); }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; padding-top: 20px; padding-bottom: 40px; border-top: 1px solid var(--line); margin-top: 30px; }

@media (max-width: 600px) {
  .brand p { display: none; }
  .topbar-inner { padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; gap: 12px; }
  .header-actions { width: 100%; justify-content: space-between; }
  .news-item { padding: 15px 16px; }
}
