:root {
  --xhs-red: #ff2442;
  --xhs-red-dark: #e01e3a;
  --bg: #f7f7f8;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-soft: #6b6b6b;
  --text-faint: #9a9a9a;
  --border: #ededed;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 6px 22px rgba(255, 36, 66, 0.14);
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--xhs-red);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
  flex: none;
}
.brand-name { font-weight: 700; font-size: 17px; }
.brand-sub { color: var(--text-faint); font-size: 12px; }
.topbar .back {
  margin-left: auto;
  color: var(--xhs-red);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- 容器 ---------- */
.container { max-width: 960px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---------- 首页 hero ---------- */
.hero { margin-bottom: 22px; }
.hero h1 { font-size: 26px; letter-spacing: .5px; }
.hero p { color: var(--text-soft); margin-top: 6px; font-size: 14px; }

/* ---------- 文章卡片列表 ---------- */
.feed { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 680px) { .feed { grid-template-columns: 1fr; } }

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card h3 { font-size: 17px; line-height: 1.45; margin-bottom: 8px; }
.card .summary {
  color: var(--text-soft);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card .meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-faint);
}
.card .author {
  color: var(--xhs-red);
  font-weight: 600;
}
.card .date { margin-left: auto; }

.empty { text-align: center; color: var(--text-faint); padding: 60px 0; }

/* ---------- 详情页 ---------- */
.detail-header { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 22px; }
.detail-header h1 { font-size: 24px; line-height: 1.4; }
.detail-meta {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-faint);
  flex-wrap: wrap;
}
.detail-meta .author { color: var(--xhs-red); font-weight: 600; }

.article-body { font-size: 15.5px; color: #2a2a2a; }
.article-body h2 {
  font-size: 19px;
  margin: 28px 0 12px;
  padding-left: 11px;
  border-left: 4px solid var(--xhs-red);
}
.article-body h3 { font-size: 16px; margin: 20px 0 8px; color: #333; }
.article-body p { margin: 12px 0; }
.article-body ul, .article-body ol { margin: 12px 0 12px 22px; }
.article-body li { margin: 6px 0; }
.article-body .lead { font-size: 16px; color: #333; background: #fff5f6; border-radius: 10px; padding: 14px 16px; }
.article-body .note { color: var(--text-soft); font-style: italic; border-top: 1px dashed var(--border); padding-top: 14px; margin-top: 26px; }
.article-body strong { color: var(--xhs-red-dark); }
.article-body .data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14px;
}
.article-body .data-table th, .article-body .data-table td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
}
.article-body .data-table th { background: #fff0f2; color: var(--xhs-red-dark); font-weight: 600; }
.article-body .data-table tr:nth-child(even) td { background: #fafafa; }

/* ---------- 互动数据条 ---------- */
.stats {
  position: sticky;
  bottom: 0;
  margin-top: 34px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-around;
  padding: 14px 10px;
}
.stat { text-align: center; cursor: pointer; user-select: none; border: none; background: none; font: inherit; color: var(--text); }
.stat .num { display: block; font-size: 20px; font-weight: 700; }
.stat .label { font-size: 12px; color: var(--text-faint); }
.stat.like.active { color: var(--xhs-red); }
.stat.like.active .num { color: var(--xhs-red); }

/* ---------- 独立文章页 ---------- */
.article-standalone { background: var(--bg); }
.article-standalone .article-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 22px 80px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 30px;
}
