/* ============================================
   每日资讯 · 静态站点样式
   浅色主题 · 移动端优先 · 无任何框架依赖
   ============================================ */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1f2329;
  --text-2: #646a73;
  --text-3: #8f959e;
  --border: #e5e6eb;
  --accent: #3370ff;

  /* 分类色：生活 / 运动 / 减肥 / 热点 / 冷知识 */
  --c-life: #2ea467;
  --c-life-bg: #e8f6ef;
  --c-sport: #3370ff;
  --c-sport-bg: #eaf0ff;
  --c-weight-loss: #d97e00;
  --c-weight-loss-bg: #fdf3e3;
  --c-hotspot: #d83931;
  --c-hotspot-bg: #fdeeee;
  --c-trivia: #7a5af8;
  --c-trivia-bg: #f0ecfe;
}

* { 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", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

main { flex: 1; padding-bottom: 40px; }

/* ---------- 顶部 ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent); color: #fff;
  font-size: 20px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 17px; }
.brand-text small { color: var(--text-3); font-size: 12px; }

.updated { color: var(--text-3); font-size: 12px; }

/* ---------- 分类导航 ---------- */
.cat-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.cat-nav .wrap { display: flex; gap: 6px; overflow-x: auto; }
.cat-tab {
  border: none; background: none; cursor: pointer;
  padding: 12px 14px; font-size: 14px; color: var(--text-2);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.cat-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- 文章列表 ---------- */
.article-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.article-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.article-card:hover { border-color: #c9cdd4; box-shadow: 0 2px 10px rgba(31,35,41,.06); }

.card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cat-tag {
  font-size: 12px; padding: 1px 8px; border-radius: 4px; font-weight: 500;
}
.cat-tag[data-cat="life"]        { color: var(--c-life);         background: var(--c-life-bg); }
.cat-tag[data-cat="sport"]       { color: var(--c-sport);        background: var(--c-sport-bg); }
.cat-tag[data-cat="weight-loss"] { color: var(--c-weight-loss);  background: var(--c-weight-loss-bg); }
.cat-tag[data-cat="hotspot"]     { color: var(--c-hotspot);      background: var(--c-hotspot-bg); }
.cat-tag[data-cat="trivia"]      { color: var(--c-trivia);       background: var(--c-trivia-bg); }

.card-date { font-size: 12px; color: var(--text-3); }

.article-card h2 { font-size: 17px; line-height: 1.5; margin-bottom: 6px; }
.article-card p {
  font-size: 14px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.empty-tip { text-align: center; color: var(--text-3); padding: 40px 0; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  color: var(--text-3); font-size: 13px;
}
.site-footer p + p { margin-top: 4px; }

/* ============================================
   文章页（detail）
   ============================================ */

.detail-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.back-link { color: var(--text-2); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--accent); }

.detail { background: var(--card); border: 1px solid var(--border); border-radius: 12px; margin-top: 16px; }
.detail-body { padding: 24px 20px; }

.detail-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.detail-date { font-size: 12px; color: var(--text-3); }

.detail h1 { font-size: 22px; line-height: 1.5; margin-bottom: 16px; }

.detail-meta { font-size: 13px; color: var(--text-3); padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }

/* 正文排版 */
.article-content { font-size: 15.5px; color: var(--text); }
.article-content h2 { font-size: 18px; margin: 26px 0 10px; }
.article-content h3 { font-size: 16px; margin: 20px 0 8px; }
.article-content p { margin-bottom: 14px; }
.article-content ul, .article-content ol { padding-left: 22px; margin-bottom: 14px; }
.article-content li { margin-bottom: 6px; }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  background: #f2f6ff;
  padding: 10px 14px; border-radius: 0 8px 8px 0;
  color: var(--text-2); margin: 14px 0;
}
.article-content strong { color: var(--text); }
.article-content img { max-width: 100%; border-radius: 8px; margin: 8px 0; }

.article-tips {
  margin-top: 20px; padding: 12px 14px;
  background: #f7f8fa; border-radius: 8px;
  font-size: 13px; color: var(--text-3);
}

.detail-footer { padding: 0 20px 20px; display: flex; justify-content: space-between; }
.btn {
  display: inline-block; padding: 8px 16px; border-radius: 8px;
  font-size: 14px; text-decoration: none;
  border: 1px solid var(--border); color: var(--text-2); background: var(--card);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { opacity: .9; color: #fff; }

@media (max-width: 480px) {
  .brand-text small { display: none; }
  .article-card { padding: 14px; }
  .article-card h2 { font-size: 16px; }
  .detail-body { padding: 20px 16px; }
  .detail h1 { font-size: 20px; }
}

/* ============================================
   半动态扩展：精选 / 标签云 / 月份导航 / 搜索
   ============================================ */

/* 顶部主导航 */
.site-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 0;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: var(--text); font-weight: 600;
  flex-shrink: 0;
}
.nav-brand .brand-mark { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
.nav-search { flex: 1; min-width: 0; position: relative; }
.nav-search input {
  width: 100%; height: 34px; padding: 0 12px 0 32px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); font-size: 13px; color: var(--text);
  outline: none; transition: border-color .15s;
}
.nav-search input:focus { border-color: var(--accent); background: var(--card); }
.nav-search::before {
  content: ""; position: absolute; left: 10px; top: 50%;
  width: 14px; height: 14px; transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f959e' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='M21 21l-4.35-4.35'/></svg>") no-repeat center / contain;
}
.nav-links { display: flex; gap: 4px; flex-shrink: 0; }
.nav-link {
  padding: 6px 10px; border-radius: 6px;
  font-size: 13px; color: var(--text-2); text-decoration: none;
}
.nav-link:hover { background: var(--bg); color: var(--text); }
.nav-link.active { color: var(--accent); background: var(--c-sport-bg); }

/* 精选模块 */
.featured-section { margin-top: 16px; }
.section-title {
  font-size: 16px; font-weight: 600; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ""; width: 4px; height: 16px;
  background: var(--accent); border-radius: 2px;
}
.section-count {
  margin-left: auto;
  font-size: 12px; font-weight: 400;
  color: var(--text-3);
}
.featured-list { display: flex; flex-direction: column; gap: 12px; }

/* 卡片标签 */
.card-tags {
  margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap;
}
.card-tag {
  font-size: 12px; padding: 2px 8px; border-radius: 4px;
  background: var(--bg); color: var(--text-2);
  text-decoration: none; transition: background .15s;
}
.card-tag:hover { background: var(--c-sport-bg); color: var(--accent); }

/* 标签云 */
.tag-cloud {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 0 16px;
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 20px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-2); text-decoration: none; font-size: 13px;
  transition: all .15s;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); }
.tag-pill.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.tag-count {
  font-size: 11px; padding: 0 5px;
  background: var(--bg); border-radius: 10px; color: var(--text-3);
}
.tag-pill.active .tag-count { background: rgba(255,255,255,.25); color: #fff; }
.tag-size-1 { font-size: 13px; }
.tag-size-2 { font-size: 15px; padding: 7px 14px; }
.tag-size-3 { font-size: 17px; padding: 8px 16px; font-weight: 500; }

/* 月份导航 */
.month-list {
  list-style: none; display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 0 16px;
}
.month-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 14px;
}
.month-link:hover { border-color: var(--accent); }
.month-link.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.month-link.active .month-count { background: rgba(255,255,255,.25); color: #fff; }
.month-count {
  font-size: 12px; padding: 0 6px; border-radius: 10px;
  background: var(--bg); color: var(--text-3);
}

/* 搜索 */
.search-page-input-wrap { margin: 16px 0; }
.search-page-input-wrap input {
  width: 100%; height: 44px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 15px; color: var(--text); outline: none;
  background: var(--card);
}
.search-page-input-wrap input:focus { border-color: var(--accent); }
.search-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.search-meta .count { color: var(--text-3); font-size: 13px; }

/* 错误提示 */
.err-tip {
  padding: 20px; text-align: center; color: var(--text-3);
  background: var(--card); border-radius: 10px; font-size: 14px;
}
