:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #0f172a;
  --subtext: #334155;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --border: #e2e8f0;
  --dark-card: #0f172a;
}

html, body, div, header, nav, main, section, article, aside, footer, h1, h2, h3, p, ul, li, span, a {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* 顶部导航栏：严格左右对称、永不遮挡正文 */
.topbar, header:not(.topbar) {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.brand span {
  color: var(--accent);
}
.brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  color: var(--subtext);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.nav-links a:hover {
  background: #f1f5f9;
  color: var(--text);
}
.nav-links a.btn-shop {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.nav-links a.btn-shop:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

/* 兼容无 .topbar 类名的首页与商品页顶栏 */
header:not(.topbar) {
  padding: 16px 24px;
}
header:not(.topbar) nav, header:not(.topbar) h1 {
  max-width: 960px;
  margin: 0 auto;
}
header:not(.topbar) nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 14px;
}
header:not(.topbar) nav a {
  color: var(--subtext);
  font-weight: 500;
}
header:not(.topbar) h1 {
  font-size: 22px;
  font-weight: 800;
  margin-top: 10px;
}

/* 主体容器 */
.container, main {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 24px;
}

/* 主文章卡片 */
.article-card, section, article:not(.article-card) {
  background: var(--card);
  border-radius: 20px;
  padding: 40px 44px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06);
}

/* 顶部徽章标签 */
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid #dbeafe;
  margin-bottom: 16px;
}

/* 文章主标题 */
.article-card h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* 内容摘要高亮框 */
.summary-box {
  background: #f8fafc;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin-bottom: 30px;
  color: var(--subtext);
  font-size: 15px;
  line-height: 1.7;
}
.summary-box strong {
  color: var(--text);
}

/* 二级标题 */
h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 20px;
  border-radius: 3px;
  background: var(--accent);
}
.related-card h2:first-child, section > h2:first-child {
  margin-top: 0;
}

p {
  font-size: 15.5px;
  color: var(--subtext);
  margin-bottom: 16px;
}

code {
  background: #f1f5f9;
  color: #be123c;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
}

/* 正文要点卡片列表 */
article ul, section ul {
  list-style: none;
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
article ul li, section ul li {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 15px;
  color: var(--subtext);
  line-height: 1.7;
}
article ul li strong, section ul li strong {
  color: var(--text);
}

/* 清爽淡雅浅蓝商品推荐卡片 (.promo-card) */
.promo-card {
  margin-top: 36px;
  background: linear-gradient(135deg, #f4f9ff 0%, #e6f2ff 100%);
  border-radius: 16px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #bfdbfe;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06);
}

.promo-info {
  flex: 1;
}
.promo-tag {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.promo-title {
  font-size: 17.5px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.45;
}
.promo-sub {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.5;
}

.promo-action {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  padding-left: 20px;
  border-left: 1px dashed #bfdbfe;
}
.promo-price {
  font-size: 26px;
  font-weight: 800;
  color: #ef4444;
  letter-spacing: -0.02em;
  line-height: 1;
}
.btn-buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563eb;
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 10px;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
  white-space: nowrap;
}
.btn-buy::after {
  content: " →";
  margin-left: 4px;
}
.btn-buy:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

/* 底部相关推荐白卡 (.related-card) */
.related-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 44px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px -6px rgba(15, 23, 42, 0.04);
}
.related-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-list li {
  border-bottom: 1px solid #f1f5f9;
}
.related-list li:last-child {
  border-bottom: none;
}
.related-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 12px;
  color: var(--subtext);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  transition: all 0.15s ease;
}
.related-list a::after {
  content: "→";
  color: #94a3b8;
  font-weight: 700;
  transition: transform 0.15s ease, color 0.15s ease;
}
.related-list a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.related-list a:hover::after {
  color: var(--accent);
  transform: translateX(4px);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

footer {
  max-width: 960px;
  margin: 36px auto 56px;
  padding: 0 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 12px 16px;
  }
  .container, main {
    padding: 0 16px;
    margin: 20px auto;
  }
  .article-card, .related-card, section {
    padding: 24px 20px;
    border-radius: 16px;
  }
  .article-card h1 {
    font-size: 22px;
  }
  .promo-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 20px;
  }
  .promo-action {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px dashed #bfdbfe; border-left: none; padding-left: 0;
  }
}
