/* ============================================================
   Baoli Technical Blog — standalone draft stylesheet
   Design tokens mirror baoli-website-v3/assets/css/style.css
   ============================================================ */
:root {
  --navy-900: #07182e;
  --navy-800: #0a2440;
  --navy-700: #0f3d6b;
  --blue-600: #1565c0;
  --blue-500: #1e88e5;
  --cyan-500: #00a8cc;
  --cyan-300: #5cc6ec;
  --gold-500: #d9a13b;
  --sky: #e8f1f8;
  --bg: #f4f8fb;
  --bg-soft: #eef4f9;
  --card: #ffffff;
  --ink: #0a1e33;
  --ink-soft: #24333f;
  --ink-mute: #5b6c7c;
  --line: #d8e5ee;
  --radius: 16px;
  --radius-s: 12px;
  --shadow: 0 18px 44px -26px rgba(10, 36, 64, .5);
  --shadow-s: 0 8px 22px -20px rgba(10, 36, 64, .45);
  --maxw: 1240px;
  --header-h: 96px;
  --topbar-h: 32px;
  --green-wa: #1d8f56;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--ink);
  line-height: 1.65; font-size: 16px;
  padding-top: calc(var(--topbar-h) + var(--header-h));
}
img { max-width: 100%; display: block; -webkit-user-drag: none; -webkit-touch-callout: none; }
a { color: var(--blue-600); text-decoration: none; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Topbar ---------- */
.topbar { background: var(--navy-900); color: #c6dcea; font-size: 12.5px; height: var(--topbar-h); position: fixed; top: 0; left: 0; right: 0; z-index: 60; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 100%; gap: 18px; }
.topbar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar b { color: #fff; font-weight: 600; }
.topbar a { color: #fff; }
.topbar a:hover { color: var(--cyan-300); }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: fixed; top: var(--topbar-h); left: 0; right: 0; z-index: 50; box-shadow: 0 4px 18px -14px rgba(10,36,64,.4); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 24px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 70px; height: 70px; object-fit: contain; }
.brand-text .en { font-size: 25px; font-weight: 800; letter-spacing: .06em; color: var(--navy-800); line-height: 1.05; }
.brand-text .legal { font-size: 12px; color: var(--ink-mute); letter-spacing: .02em; }
.brand-text .cn { font-size: 11.2px; color: var(--blue-600); font-weight: 600; letter-spacing: .08em; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { font-size: 15px; font-weight: 600; color: var(--ink-soft); padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--blue-600); }
.main-nav a.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.main-nav a.nav-cta { background: var(--blue-600); color: #fff; padding: 10px 20px; border-radius: 999px; border: 0; }
.main-nav a.nav-cta:hover { background: var(--navy-800); }
/* 汉堡按钮：桌面隐藏，<=980px 显示（博客 header 为白底，故用深色图标） */
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; cursor: pointer; padding: 8px; color: var(--navy-800); }
.nav-toggle svg { width: 26px; height: 26px; }

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: 13.5px; color: var(--ink-mute); padding: 22px 0 0; }
.crumbs a { color: var(--ink-mute); }
.crumbs a:hover { color: var(--blue-600); }
.crumbs .sep { margin: 0 7px; color: var(--cyan-500); }

/* ---------- Post hero ---------- */
.post-hero { position: relative; min-height: 420px; display: flex; align-items: flex-end; color: #fff; overflow: hidden; }
.post-hero .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-hero .veil { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7,24,46,.25) 0%, rgba(7,24,46,.78) 78%, rgba(7,24,46,.92) 100%); }
.post-hero .container { position: relative; padding-top: 70px; padding-bottom: 44px; max-width: 980px; }
.post-tags { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
/* 对比度：蓝底白字原为 4.46:1（12px 需 4.5），底色提到 .95 后 6.02:1；
   金底白字仅 2.70:1，改为深色字后 6.58:1 */
.post-tag { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; background: rgba(21,101,192,.95); padding: 5px 14px; border-radius: 999px; }
.post-tag.gold { color: var(--navy-900); background: rgba(217,161,59,.9); }
.post-hero h1 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.14; font-weight: 800; text-wrap: balance; }
.post-hero .dek { margin-top: 14px; font-size: 18px; color: #d7e6f2; max-width: 44em; }
.post-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 22px; font-size: 13.5px; color: #b9cddd; }
.post-meta b { color: #fff; font-weight: 600; }

/* ---------- Prose ---------- */
.prose { max-width: 860px; margin: 0 auto; padding: 46px 24px 10px; }
.prose > p, .prose > ul, .prose > ol { margin-bottom: 18px; color: var(--ink-soft); font-size: 17px; }
.prose p.lead { font-size: 19px; color: var(--ink); font-weight: 500; }
.prose h2 { font-size: 27px; color: var(--navy-800); margin: 44px 0 16px; line-height: 1.25; scroll-margin-top: 150px; }
.prose h2::after { content: ""; display: block; width: 56px; height: 3px; background: linear-gradient(90deg, var(--blue-600), var(--cyan-500)); border-radius: 2px; margin-top: 10px; }
.prose h3 { font-size: 20px; color: var(--navy-700); margin: 30px 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 8px; color: var(--ink-soft); }
.prose li::marker { color: var(--blue-600); }
.prose strong { color: var(--navy-800); }
.prose a { text-decoration: none; }

/* ---------- Figures ---------- */
figure { margin: 30px 0; }
/* height:auto 不可省：img 的 HTML height 属性会被当成固定高度，
   width:100% 在窄屏压缩宽度后图片会被压扁（实测 500px 下比例 0.67 vs 原图 1.33） */
figure img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow-s); }
figcaption { font-size: 13.5px; color: var(--ink-mute); margin-top: 10px; padding-left: 12px; border-left: 3px solid var(--cyan-300); }
.fig-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.fig-2 img { aspect-ratio: 4 / 3; height: auto; object-fit: cover; }
@media (max-width: 700px) { .fig-2 { grid-template-columns: 1fr; } }
/* 竖版/中等分辨率配图：限宽居中，避免浏览器拉伸发糊 */
figure.fig-narrow { max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- Spec tables ---------- */
.tbl-wrap { overflow-x: auto; margin: 26px 0; border-radius: var(--radius-s); box-shadow: var(--shadow-s); background: #fff; }
table.spec { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
table.spec caption { text-align: left; font-size: 13px; color: var(--ink-mute); padding: 12px 16px 0; }
table.spec th { background: var(--navy-800); color: #fff; text-align: left; padding: 12px 14px; font-size: 13px; letter-spacing: .03em; white-space: nowrap; }
table.spec td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
table.spec tbody tr:nth-child(even) { background: var(--bg-soft); }
table.spec tbody tr:last-child td { border-bottom: 0; }
table.spec td.num, table.spec th.num { font-variant-numeric: tabular-nums; }
table.spec td.hl { background: #e3f0fa; font-weight: 700; color: var(--navy-800); }

/* ---------- Callout / compare cards ---------- */
.callout { border-radius: var(--radius-s); padding: 22px 24px; margin: 28px 0; background: var(--sky); border: 1px solid var(--line); }
.callout h3, .callout h4 { color: var(--navy-800); font-size: 16.5px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.callout p { font-size: 15.5px; color: var(--ink-soft); margin-bottom: 8px; }
.callout p:last-child { margin-bottom: 0; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 28px 0; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }
.duo .callout { margin: 0; }
.duo .win { background: #e9f7ef; border-color: #bfe3cd; }
.duo .win h3, .duo .win h4 { color: #14683c; }
.duo .win li::marker { color: #1d8f56; }
.duo .lose { background: #fdf6e7; border-color: #f0dfb6; }
.duo .lose h3, .duo .lose h4 { color: #8a6114; }
.duo .lose li::marker { color: #b07d1e; }
.duo ul { padding-left: 20px; font-size: 15px; color: var(--ink-soft); }
.duo li { margin-bottom: 6px; }
.prose .duo li { font-size: 15px; }

.note { font-size: 14px; color: var(--ink-mute); background: var(--bg-soft); border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.note b { color: var(--navy-800); }

/* ---------- Key facts strip ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 30px 0; }
.fact { background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-s); padding: 18px 20px; border-top: 3px solid var(--cyan-500); }
.fact b { display: block; font-size: 26px; color: var(--navy-800); line-height: 1.1; }
.fact span { font-size: 13.5px; color: var(--ink-mute); }

/* ---------- SVG charts ---------- */
.chart-card { background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-s); padding: 20px; margin: 26px 0; }
.chart-card h3, .chart-card h4 { color: var(--navy-800); font-size: 16px; margin-bottom: 12px; }
svg.chart { width: 100%; height: auto; }

/* ---------- In-article CTA ---------- */
.post-cta { background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); border-radius: var(--radius); padding: 34px 36px; margin: 44px 0 20px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.post-cta h3 { font-size: 22px; margin-bottom: 6px; color: #fff; }
.post-cta p { color: #c6dcea; font-size: 15px; max-width: 40em; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 12px 26px; border-radius: 999px; font-weight: 700; font-size: 15px; transition: .2s; cursor: pointer; }
.btn-white { background: #fff; color: var(--navy-800); }
.btn-white:hover { background: var(--cyan-300); }
.btn-outline { border: 1.5px solid rgba(255,255,255,.55); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-wa { border: 1.5px solid var(--green-wa); color: var(--green-wa); }
.btn-wa:hover { background: var(--green-wa); color: #fff; }

/* ---------- Author / footer of article ---------- */
.post-foot { max-width: 860px; margin: 10px auto 0; padding: 0 24px; }
.about-box { background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-s); padding: 24px 26px; display: flex; gap: 20px; align-items: center; margin: 30px 0 46px; }
.about-box img { width: 64px; height: 64px; object-fit: contain; flex: 0 0 auto; }
.about-box p { font-size: 14px; color: var(--ink-mute); }
.about-box b { color: var(--navy-800); font-size: 15px; }
.next-read { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 46px; }
@media (max-width: 700px) { .next-read { grid-template-columns: 1fr; } }
.next-read a { background: #fff; border-radius: var(--radius-s); box-shadow: var(--shadow-s); padding: 18px 20px; display: block; }
.next-read .dir { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan-500); font-weight: 700; }
.next-read .t { color: var(--navy-800); font-weight: 700; font-size: 15.5px; margin-top: 6px; }
.next-read a:hover { outline: 2px solid var(--cyan-300); }
.hub-link { margin: -24px 0 26px; font-size: 14.5px; color: var(--ink-mute); }
.hub-link a { color: var(--cyan-500); font-weight: 600; }
.hub-link a:hover { color: var(--navy-800); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #b9cddd; margin-top: 40px; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 34px; padding: 52px 24px 34px; }
@media (max-width: 980px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .foot-grid { grid-template-columns: 1fr; } }
.site-footer h3, .site-footer h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #b9cddd; }
.site-footer a:hover { color: var(--cyan-300); }
.social-row { display: flex; gap: 10px; }
.social-row a { width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,.09); display: inline-flex; align-items: center; justify-content: center; }
.social-row a:hover { background: var(--blue-600); }
.social-row svg { width: 16px; height: 16px; fill: #fff; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: 13px; color: #7d94a9; text-align: center; }

/* ---------- Blog index ---------- */
.blog-hero { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 74px 0 60px; }
.blog-hero .container { max-width: 980px; }
.blog-hero h1 { font-size: clamp(32px, 4.6vw, 48px); font-weight: 800; }
.blog-hero p { color: #c6dcea; font-size: 18px; margin-top: 14px; max-width: 46em; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 26px; padding: 50px 0 70px; }
.blog-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s); display: flex; flex-direction: column; transition: .22s; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.blog-card img { height: 190px; width: 100%; object-fit: cover; }
.blog-card .body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.blog-card .cat { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--blue-600); }
.blog-card h2 { font-size: 19.5px; line-height: 1.3; color: var(--navy-800); }
.blog-card h2 a { color: inherit; }
.blog-card p { font-size: 14.5px; color: var(--ink-mute); flex: 1; }
.blog-card .meta { font-size: 12.5px; color: var(--ink-mute); border-top: 1px solid var(--line); padding-top: 12px; }
.blog-card .read { color: var(--blue-600); font-weight: 700; font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .brand-mark { width: 56px; height: 56px; }
  .brand-text .en { font-size: 21px; }
  .main-nav { gap: 15px; }
  .main-nav a { font-size: 13.5px; }
}
@media (max-width: 980px) {
  :root { --header-h: 76px; }
  .topbar .container span:nth-child(3) { display: none; }
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; top: calc(var(--topbar-h) + var(--header-h)); left: 0; right: 0;
    background: var(--navy-800); flex-direction: column; align-items: stretch;
    padding: 12px 20px 20px; display: none;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .6);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 8px; font-size: 15.5px; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
  .main-nav a.nav-cta { border-bottom: 0; text-align: center; margin-top: 8px; }
}

/* ---------- Floating WhatsApp (quiet, same as main site) ---------- */
#waFloat{position:fixed;right:25px;bottom:86px;width:44px;height:44px;border-radius:50%;background:#25d366;color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 16px -8px rgba(0,0,0,.55);opacity:0;transform:translateY(20px);pointer-events:none;transition:.3s;z-index:100}
#waFloat.show{opacity:1;transform:none;pointer-events:auto}
#waFloat:hover{background:#1fb457}
#waFloat svg{display:block}

/* 整卡可点击：card-link 的伪元素铺满卡片（点图片/正文/Read article 都跳同一篇文章） */
.blog-card { position: relative; }
.blog-card .card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.blog-card:hover .card-link { text-decoration: underline; }

/* article key points + list stats */
.blog-stat { grid-column: 1 / -1; margin: 0; padding: 13px 18px; background: #eef4f9; border-left: 3px solid #1565c0; border-radius: 8px; font-size: 13.5px; color: #40607d; }
.blog-card .pts { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #4a6480; line-height: 1.6; }
.blog-card .pts li { margin-bottom: 3px; }
