/* ===================== 基础重置 ===================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f4f6f8;
  color: #2c3338;
  line-height: 1.6;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===================== 顶部导航 ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #eceef1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.brand-logo {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e88e5, #1565c0);
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  border-radius: 8px;
}
.brand-name { font-size: 18px; font-weight: 700; color: #1a1a1a; }
.brand-sub { font-size: 11px; color: #aaa; letter-spacing: .5px; }

.nav-tabs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tab {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  color: #5a6268;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.nav-tab:hover { background: #f0f4f8; color: #1e88e5; }
.nav-tab.active {
  color: #1e88e5;
  background: #e8f1fb;
  font-weight: 600;
}
.nav-tab.disabled {
  color: #c0c4cc;
  cursor: not-allowed;
}
.nav-tab.disabled:hover { background: transparent; color: #c0c4cc; }
.nav-tab .coming {
  font-size: 10px;
  color: #bbb;
  margin-left: 4px;
  vertical-align: super;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f4f6f8;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 6px 14px;
  width: 200px;
  transition: all .15s ease;
}
.search-box:focus-within {
  background: #fff;
  border-color: #1e88e5;
  box-shadow: 0 0 0 3px rgba(30, 136, 229, .1);
}
.search-box svg { color: #999; flex-shrink: 0; }
.search-box input {
  border: none; outline: none; background: transparent;
  width: 100%; font-size: 13px; color: #2c3338;
}
.topbar-date {
  font-size: 12px; color: #999; white-space: nowrap;
}

/* ===================== 主体容器 ===================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.board-header { margin-bottom: 24px; }
.board-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #1a1a1a;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.board-header h1::before {
  content: "";
  display: inline-block;
  width: 4px; height: 22px;
  background: linear-gradient(180deg, #1e88e5, #1565c0);
  border-radius: 2px;
}
.board-desc { margin-top: 8px; color: #888; font-size: 13px; margin-left: 14px; }

/* ===================== 卡片网格 ===================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ===================== 单个卡片 ===================== */
.card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #eef0f3;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease, transform .2s ease;
}
.card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f2f4f6;
}
.card-head-left {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.source-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: #fff;
  flex-shrink: 0;
  background: #1e88e5;
}
.source-name {
  font-size: 15px; font-weight: 600; color: #1a1a1a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.source-more {
  font-size: 12px; color: #aaa;
  display: inline-flex; align-items: center; gap: 2px;
  flex-shrink: 0;
  transition: color .15s ease;
}
.source-more:hover { color: #1e88e5; }

.card-list { padding: 6px 0; }
.card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  transition: background .12s ease;
}
.card-item:hover { background: #f7f9fb; }
.card-item:hover .item-title { color: #1e88e5; }

.item-rank {
  width: 22px; height: 20px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: "DIN Alternate", "Helvetica Neue", Arial, sans-serif;
  color: #c0c4cc;
}
.item-rank.top1 { color: #ff5a5f; }
.item-rank.top2 { color: #ff8a3d; }
.item-rank.top3 { color: #ffc03d; }

.item-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: #3a3a3a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .12s ease;
}
.item-new {
  flex-shrink: 0;
  padding: 1px 5px;
  border-radius: 4px;
  background: #ff5a5f;
  color: #fff;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
}
.item-meta {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #b0b4b8;
}
.item-hot {
  display: inline-flex; align-items: center; gap: 2px;
  color: #ff7a45;
}
.item-date { color: #b0b4b8; }

/* ===================== 搜索结果页（SERP） ===================== */
.search-results { max-width: 800px; }
.source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.source-filter {
  border: 1px solid #e3e7ec;
  background: #fff;
  color: #4a535b;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  transition: all .15s ease;
}
.source-filter:hover {
  border-color: #b7d3ef;
  color: #1e88e5;
}
.source-filter.active {
  border-color: #1e88e5;
  background: #e8f1fb;
  color: #1e88e5;
  font-weight: 600;
}
.source-filter em {
  font-style: normal;
  color: #9aa3aa;
  font-size: 12px;
}
.source-filter.active em { color: #1e88e5; }
.source-filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.search-info {
  font-size: 13px; color: #999; margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid #eef0f3;
}
.result-item {
  padding: 16px 0;
  border-bottom: 1px solid #f2f4f6;
}
.result-item:last-child { border-bottom: none; }
.result-meta-top {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #999; margin-bottom: 4px;
}
.result-meta-top .source-icon {
  width: 20px; height: 20px; font-size: 11px; border-radius: 4px;
}
.result-source { color: #888; }
.result-date { color: #bbb; }
.result-title {
  font-size: 17px; font-weight: 500; color: #1a0dab;
  cursor: pointer; line-height: 1.4; margin-bottom: 4px;
  display: block;
}
.result-title:hover { text-decoration: underline; }
.result-title:visited { color: #660099; }
.result-snippet {
  font-size: 13px; color: #545454; line-height: 1.6;
  word-break: break-all;
}
.result-snippet .hl {
  color: #cc0000; font-weight: 600;
}
.result-link {
  margin-top: 6px;
  font-size: 12px;
}
.result-link a {
  color: #006621; text-decoration: none;
}
.result-link a:hover { text-decoration: underline; }
.result-actions {
  margin-top: 8px;
  display: flex; gap: 16px;
}
.result-actions a {
  font-size: 12px; color: #1e88e5; cursor: pointer;
}
.result-actions a:hover { text-decoration: underline; }
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 22px;
}
.page-btn,
.page-num {
  min-width: 32px;
  height: 32px;
  border: 1px solid #e3e7ec;
  background: #fff;
  color: #4a535b;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}
.page-btn:hover,
.page-num:hover {
  border-color: #b7d3ef;
  color: #1e88e5;
}
.page-num.active {
  border-color: #1e88e5;
  background: #1e88e5;
  color: #fff;
}
.page-btn:disabled {
  cursor: not-allowed;
  color: #c0c4cc;
  background: #f7f9fb;
  border-color: #eef0f3;
}
.page-ellipsis {
  color: #a8b0b8;
  padding: 0 4px;
}

/* ===================== 正文查看页 ===================== */
.article-viewer { max-width: 820px; }
.article-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: #1e88e5; cursor: pointer; margin-bottom: 16px;
}
.article-back:hover { text-decoration: underline; }
.article-back-link {
  font-size: 13px; color: #1e88e5; white-space: nowrap;
}
.article-back-link:hover { text-decoration: underline; }
.article-source-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 0 16px; margin-bottom: 0;
}
.article-source-bar .source-icon {
  width: 24px; height: 24px; font-size: 13px; border-radius: 5px;
}
.article-source-name { font-size: 14px; font-weight: 600; color: #444; }
.article-source-date { font-size: 12px; color: #aaa; }
.article-body {
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eef0f3;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  padding: 32px 40px;
  line-height: 1.8;
  font-size: 15px;
  color: #333;
}
.article-body h1 { font-size: 24px; font-weight: 700; margin: 0 0 16px; color: #1a1a1a; line-height: 1.4; }
.article-body h2 { font-size: 20px; font-weight: 600; margin: 28px 0 12px; color: #222; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.article-body h3 { font-size: 17px; font-weight: 600; margin: 24px 0 10px; color: #333; }
.article-body h4 { font-size: 15px; font-weight: 600; margin: 20px 0 8px; color: #444; }
.article-body p { margin: 10px 0; }
.article-body strong { font-weight: 600; color: #1a1a1a; }
.article-body em { font-style: italic; }
.article-body a { color: #1e88e5; text-decoration: none; }
.article-body a:hover { text-decoration: underline; }
.article-body ul, .article-body ol { margin: 10px 0; padding-left: 28px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin: 4px 0; }
.article-body blockquote {
  border-left: 3px solid #1e88e5;
  background: #f7f9fb;
  padding: 8px 16px; margin: 12px 0;
  color: #666; font-size: 13px;
}
.article-body img { max-width: 100%; border-radius: 6px; margin: 8px 0; }
.article-body table {
  border-collapse: collapse; width: 100%; margin: 12px 0; font-size: 13px;
}
.article-body th, .article-body td {
  border: 1px solid #ddd; padding: 8px 12px; text-align: left;
}
.article-body th { background: #f7f9fb; font-weight: 600; }
.article-body code {
  background: #f4f6f8; padding: 2px 6px; border-radius: 3px;
  font-size: 13px; font-family: "SFMono-Regular", Consolas, monospace;
}
.article-body hr { border: none; border-top: 1px solid #eee; margin: 20px 0; }
.article-source-link {
  margin-top: 24px; padding-top: 16px; border-top: 1px solid #eee;
  font-size: 13px; color: #888;
}
.article-source-link a { color: #1e88e5; }

/* ===================== 空状态 ===================== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #999;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 16px; color: #666; margin-bottom: 6px; }
.empty-state span { font-size: 13px; color: #aaa; }

/* ===================== 页脚 ===================== */
.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #eef0f3;
  text-align: center;
  color: #aaa;
  font-size: 12px;
}
.footer-sub { margin-top: 4px; color: #c0c4cc; }

/* ===================== 响应式 ===================== */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .search-box { width: 160px; }
}
@media (max-width: 720px) {
  .topbar-inner { gap: 14px; padding: 0 14px; }
  .brand-sub { display: none; }
  .topbar-right { gap: 8px; }
  .search-box { width: 120px; }
  .topbar-date { display: none; }
  .container { padding: 20px 14px 40px; }
  .cards-grid { grid-template-columns: 1fr; gap: 14px; }
  .board-header h1 { font-size: 22px; }
}
