/* ===========================================================
   杨树-札记 · 科技风 / 淡蓝 / 卡片式
   =========================================================== */
:root {
  --bg: #eef4fb;
  --bg-2: #e3eefb;
  --card: #ffffff;
  --primary: #4a90e2;
  --primary-soft: #e8f1fb;
  --primary-deep: #2f6fb3;
  --accent: #7ec8ff;
  --text: #243447;
  --text-soft: #6b7c93;
  --border: #d8e6f6;
  --shadow: 0 8px 28px rgba(74, 144, 226, 0.12);
  --shadow-hover: 0 14px 40px rgba(74, 144, 226, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1080px;
  --mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(126, 200, 255, 0.18), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(74, 144, 226, 0.12), transparent 38%),
    linear-gradient(var(--bg-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-2) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 26px 26px, 26px 26px;
  background-attachment: fixed;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 22px;
}

a { color: var(--primary-deep); text-decoration: none; }
a:hover { color: var(--primary); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  background: rgba(238, 244, 251, 0.78);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  letter-spacing: 0.5px;
}
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(74, 144, 226, 0.4);
}
.brand-text { background: linear-gradient(120deg, var(--primary-deep), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 6px; }
.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 15px;
  transition: all 0.2s ease;
}
.nav-link:hover { background: var(--primary-soft); color: var(--primary-deep); }

/* ---------- Hero ---------- */
.hero {
  padding: 54px 0 30px;
  text-align: center;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 38px;
  letter-spacing: 1px;
  background: linear-gradient(120deg, #2f6fb3, #4a90e2 60%, #7ec8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--text-soft);
  font-size: 16px;
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 26px;
  flex-wrap: wrap;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 360px;
}
.search-box input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.15);
}
.search-box::before {
  content: "⌕";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  font-size: 18px;
}
.active-tag {
  font-size: 14px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  padding: 7px 14px;
  border-radius: 999px;
}
.active-tag a { margin-left: 8px; color: var(--text-soft); font-size: 13px; }

/* ---------- Card grid ---------- */
.card-grid {
  display: grid;
  /* min(100%, 300px) 保证在窄屏不被内容撑破；auto-fill 自适应列数 */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: stretch; /* 同一行卡片等高，避免错位 */
  gap: 20px;
  padding-bottom: 50px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
  min-width: 0; /* 关键：允许网格项收缩，防止长内容把列撑破导致布局错乱 */
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2; /* 置于封面图之上，保证 hover 高亮条可见 */
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.22s ease;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.card:hover::before { opacity: 1; }

/* ---------- 卡片封面图（16:9 顶部出血） ----------
   规范：源图 1200×675（最小 800×450），JPG / WebP，单张 ≤ 200KB
   显示：卡片宽 300–360px 时封面高 169–203px；高 DPI 屏按 2 倍取图，故源图宽用 1200
   无封面时：.card-cover--fallback 用「标题哈希取色 + 首字」渐变占位，保证列表等高整齐 */
.card-cover {
  position: relative;
  display: block;
  /* 出血：抵消 .card 的 22px 左右内边距，让封面贴到卡片边缘 */
  width: calc(100% + 44px);
  margin: -22px -22px 16px;
  aspect-ratio: 16 / 9;
  flex: none;
  overflow: hidden;
  background: var(--primary-soft);
  border-bottom: 1px solid var(--border);
}
.card-cover img {
  display: block;
  width: 100%;
  /* 必须显式写 height：img 标签上的 width/height 属性会生成 presentation hint（height:675px），
     不覆盖会导致封面被拉成近似正方形 */
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
/* 兜底：不支持 aspect-ratio 的浏览器用 padding 撑出 16:9
   （56.25% 相对卡片内容宽，+ 24.75px 补偿左右各 22px 出血带来的宽度增量） */
@supports not (aspect-ratio: 16 / 9) {
  .card-cover { height: 0; padding-bottom: calc(56.25% + 24.75px); }
  .card-cover img { position: absolute; top: 0; left: 0; }
}
.card:hover .card-cover img { transform: scale(1.04); }
.card-cover--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-cover--fallback span {
  font-size: 42px;
  font-weight: 600;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  user-select: none;
}
.tone-0 { background-image: linear-gradient(135deg, #4a90e2, #7ec8ff); }
.tone-1 { background-image: linear-gradient(135deg, #2f6fb3, #6fb1f0); }
.tone-2 { background-image: linear-gradient(135deg, #3aa8a0, #7ed8c8); }
.tone-3 { background-image: linear-gradient(135deg, #7b6fe8, #a99bf5); }
.tone-4 { background-image: linear-gradient(135deg, #e8854a, #f5b884); }
.tone-5 { background-image: linear-gradient(135deg, #5b7ea8, #9bb8d6); }
.card-meta { font-family: var(--mono); font-size: 12px; color: var(--text-soft); letter-spacing: 0.5px; }
.card-title {
  margin: 10px 0 8px;
  font-size: 19px;
  line-height: 1.4;
  color: var(--text);
  overflow-wrap: break-word;
  word-break: break-word; /* 长英文/URL 可断行，不撑破卡片 */
}
.card-excerpt {
  margin: 0 0 16px;
  color: var(--text-soft);
  font-size: 14px;
  flex: 1;
  overflow-wrap: break-word;
  word-break: break-word;
  /* 摘要统一截断 3 行，让卡片高度一致、视觉更整齐 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-family: var(--mono);
  transition: background 0.2s;
  cursor: pointer;
}
.tag:hover { background: #d6e8fb; }
.empty { color: var(--text-soft); text-align: center; padding: 60px 0; }

/* ---------- Post detail ---------- */
.post {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 38px 42px;
  box-shadow: var(--shadow);
  margin-bottom: 50px;
}
.back {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--text-soft);
}
.back:hover { color: var(--primary); }
.post-title {
  margin: 0 0 14px;
  font-size: 32px;
  line-height: 1.35;
  background: linear-gradient(120deg, #2f6fb3, #4a90e2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border);
}
.post-content { font-size: 16px; overflow-wrap: break-word; }
.post-content h2 { margin-top: 34px; font-size: 23px; }
.post-content h3 { margin-top: 26px; font-size: 19px; }
.post-content p { margin: 14px 0; }
.post-content ul, .post-content ol { padding-left: 22px; }
.post-content li { margin: 7px 0; }
.post-content blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-soft);
}
.post-content code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--primary-soft);
  color: var(--primary-deep);
  padding: 2px 6px;
  border-radius: 6px;
}
.post-content pre {
  background: #f4f5f8;
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  overflow: auto;
  margin: 20px 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
}
.post-content pre code {
  background: transparent;
  color: #24292e;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14.5px;
}
.post-content th, .post-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th {
  background: var(--primary-soft);
  font-weight: 600;
}
.post-content tr:nth-child(even) td {
  background: rgba(0,0,0,0.02);
}

/* ---------- 文章页封面 & 正文配图 ---------- */
.post-cover {
  max-width: 760px;
  margin: 0 auto 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.post-cover img {
  display: block;
  width: 100%;
  /* 关键：img 标签的 width/height 属性会生成 presentation hint（height:675px），
     不显式写 height:auto 会被固定成 675px 高，宽 100%(760px) → 封面变成近似正方形 */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* 正文内配图：居中、圆角、不溢出；超大图自动缩放到容器宽度 */
.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 22px auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.post-content figure { margin: 24px 0; text-align: center; }
.post-content figure img { margin: 0 auto; }
.post-content figcaption {
  margin-top: 9px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
}

/* ---------- Tags page ---------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 0 60px;
}
.tag-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tag-lg:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow-hover); }
.tag-lg .count {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  padding: 1px 8px;
  border-radius: 999px;
}

/* ---------- About page ---------- */
.about {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow);
  margin-bottom: 50px;
}
.about h3 { margin-top: 28px; }
.about .muted { color: var(--text-soft); font-size: 14px; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.4);
}
.beian { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--text-soft); }
.beian a { color: inherit; text-decoration: none; transition: color 0.2s; }
.beian a:hover { color: var(--primary-deep); }
.beian img { vertical-align: middle; margin-right: 3px; }

/* ===========================================================
   服务页
   =========================================================== */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  align-items: stretch;
  gap: 20px;
  padding-bottom: 40px;
}
.service-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px 22px;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.service-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.22s ease;
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
.service-card:hover::before { opacity: 1; }
.service-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 14px;
}
.service-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 14px; }
.service-detail-link {
  display: block;
  font-size: 13px;
  color: var(--accent);
  opacity: 0.6;
  margin-top: 8px;
  transition: opacity 0.2s ease;
}
.service-card:hover .service-detail-link { opacity: 1; }

/* ---------- 价目表（视觉改版 2026-09-02）---------- */
.pricing { margin-bottom: 56px; }
.pricing > h2 {
  font-size: 23px;
  color: var(--text);
  margin: 0 0 10px;
  text-align: center;
  letter-spacing: 0.5px;
}
.pricing-note {
  color: var(--text-soft);
  font-size: 14px;
  text-align: center;
  margin: 0 auto 32px;
  max-width: 640px;
  line-height: 1.7;
}
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}
.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 24px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  min-width: 0;
}
.price-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}
/* 推荐档：渐变描边 + 顶部「推荐」徽章 + 轻微抬升 */
.price-card.featured {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    linear-gradient(135deg, var(--primary), var(--accent)) border-box;
  box-shadow: 0 12px 30px -14px color-mix(in srgb, var(--primary) 50%, transparent);
  transform: translateY(-2px);
}
.price-card.featured:hover { transform: translateY(-6px); }
.price-card.featured::after {
  content: "推荐";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--primary) 55%, transparent);
}
.price-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-soft);
  margin: 0 0 8px;
}
.price-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary-deep);
  margin: 0 0 18px;
  line-height: 1.15;
  letter-spacing: -0.5px;
}
.price-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
  margin-left: 3px;
}
.price-items {
  list-style: none;
  padding: 14px 0 0;
  margin: auto 0 0;          /* 列表沉底，多卡等高对齐 */
  font-size: 13.5px;
  color: var(--text-soft);
  line-height: 1.6;
  border-top: 1px solid var(--border);
}
.price-items li { position: relative; padding-left: 20px; margin-bottom: 6px; }
.price-items li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
.pricing-sub {
  font-size: 16px;
  color: var(--text);
  margin: 30px 0 16px;
  text-align: center;
  font-weight: 600;
}
.pricing-cta {
  text-align: center;
  font-size: 14px;
  color: var(--text-soft);
  margin: 24px auto 0;
  max-width: 560px;
  line-height: 1.9;
  background: color-mix(in srgb, var(--primary) 6%, var(--card));
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px 18px;
}
.pricing-cta a { color: var(--primary-deep); text-decoration: underline; font-weight: 600; }
@media (max-width: 640px) {
  .price-value { font-size: 24px; }
}

/* ---------- 联系区 ---------- */
.service-contact {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 40px;
  box-shadow: var(--shadow);
  margin-bottom: 50px;
  text-align: center;
}
.service-contact h2 {
  font-size: 22px;
  color: var(--text);
  margin: 0 0 8px;
}
.service-contact > p {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0 0 28px;
}
.contact-cards {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.ccard, .ccard-static {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  transition: transform 0.2s, border-color 0.2s;
}
.ccard:hover { transform: translateY(-3px); border-color: var(--accent); }
.ccard-static { cursor: default; }
.ccard-static:hover { transform: none; border-color: var(--border); }
#wechat-trigger { cursor: pointer; }
#wechat-trigger:hover { transform: translateY(-3px); border-color: var(--accent); }
.ccard-icon { font-size: 20px; line-height: 1; }
.ccard-label { font-size: 12px; color: var(--text-soft); }
.ccard-value { font-size: 14px; color: var(--primary-deep); word-break: break-all; }

/* ---------- 微信扫码弹窗 ---------- */
.wechat-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.wechat-modal-inner {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  max-width: 280px;
  width: calc(100% - 32px);
}

.wechat-modal-inner img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 12px;
}

.wechat-modal-inner p {
  font-size: 14px;
  color: var(--text-soft);
  margin: 0;
}

.wechat-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-soft);
  cursor: pointer;
  line-height: 1;
}

.wechat-modal-close:hover { color: var(--primary-deep); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .hero h1 { font-size: 30px; }
  .post { padding: 26px 22px; }
  .about { padding: 28px 22px; }
  .post-title { font-size: 26px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
}

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.theme-toggle:hover {
  color: var(--primary);
  border-color: var(--accent);
  transform: rotate(18deg);
}

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 6px 0 54px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  min-width: 38px;
  height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-soft);
  font-size: 14px;
  transition: all 0.2s ease;
}
.pagination a:hover { color: var(--primary-deep); border-color: var(--accent); }
.pagination .current {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-color: transparent;
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ===========================================================
   暗色模式
   =========================================================== */
[data-theme="dark"] {
  --bg: #0d1626;
  --bg-2: #16233a;
  --card: #15233b;
  --primary: #6db3f2;
  --primary-soft: #1c2e4d;
  --primary-deep: #a8d4ff;
  --accent: #4a90e2;
  --text: #e6eefb;
  --text-soft: #9fb2cc;
  --border: #26406a;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-hover: 0 14px 40px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(109, 179, 242, 0.12), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(74, 144, 226, 0.10), transparent 38%),
    linear-gradient(var(--bg-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-2) 1px, transparent 1px);
}
[data-theme="dark"] .site-header { background: rgba(13, 22, 38, 0.72); }
[data-theme="dark"] .site-footer { background: rgba(13, 22, 38, 0.5); }
[data-theme="dark"] .search-box input { background: #0f1c30; color: var(--text); }
[data-theme="dark"] .tag:hover { background: #244067; }
[data-theme="dark"] .nav-link:hover { background: var(--primary-soft); }
[data-theme="dark"] .post-content pre {
  background: #1a2744;
  box-shadow: inset 0 0 0 1px rgba(126, 200, 255, 0.1);
}
[data-theme="dark"] .hljs,
[data-theme="dark"] .post-content pre code.hljs {
  background: transparent !important;
  color: #cfe3ff !important;
}

/* ---------- 微信扫码弹窗暗色适配 ---------- */
[data-theme="dark"] .wechat-modal-inner {
  background: #1a2744;
}

/* ---------- 关于页 / 简历（模板 B：横幅 + 双卡） ---------- */
.resume-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 20px;
}
.avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 500;
}
.avatar-img { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; object-fit: cover; }
.resume-name { font-size: 22px; font-weight: 500; color: var(--text); margin: 0; }
.resume-title { font-size: 15px; color: var(--primary-deep); margin: 4px 0 0; }
.resume-summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.7;
}
.resume-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
  padding-bottom: 40px;
}
.resume-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.resume-card-h {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 12px;
}
.resume-card-h.contact-h { margin-top: 18px; }
.contact-line { font-size: 13px; color: var(--text-soft); margin: 0 0 6px; line-height: 1.6; }
.contact-line a { color: var(--primary-deep); }
.exp-item { margin-bottom: 16px; }
.exp-item:last-child { margin-bottom: 0; }
.exp-period { font-size: 12px; color: var(--primary); font-family: var(--mono); margin: 0 0 3px; }
.exp-role { font-size: 14px; color: var(--text); margin: 0 0 4px; font-weight: 500; }
.exp-desc { font-size: 13px; color: var(--text-soft); line-height: 1.6; margin: 0; }
@media (max-width: 640px) {
  .resume-banner { padding: 18px 20px; }
  .resume-name { font-size: 19px; }
  .resume-grid { grid-template-columns: 1fr; }
}

/* ===========================================================
   AI 助理浮动球（FAB）- 右上方固定，图片 + 文字标签
   =========================================================== */
.fab {
  position: fixed;
  right: 20px;
  top: 74px; /* header (62px) + 12px gap */
  z-index: 1000;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.fab:hover {
  transform: scale(1.08);
}
.fab-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fab-avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* 防止拖拽图片 */
}
.fab-label {
  font-size: 11px;
  color: var(--primary-deep);
  background: var(--card);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  pointer-events: none; /* 点击穿透到外层 */
}

/* ---------- AI 助理弹窗 ---------- */
.fab-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.35);
}
.fab-overlay.active { display: block; }

.fab-panel {
  position: fixed;
  right: 16px;
  top: 12px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: calc(100vh - 24px);
  border-radius: 14px;
  box-shadow: 0 16px 56px rgba(0,0,0,0.3);
  z-index: 9999;
  overflow: hidden;
  display: none;
  flex-direction: column;
  border: 1px solid var(--border);
}
.fab-panel.active { display: flex; }

.fab-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.fab-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.fab-panel-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-soft);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  line-height: 1;
}
.fab-panel-close:hover { color: var(--primary-deep); background: var(--primary-soft); }

.fab-panel iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  overflow: hidden;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  /* 顶部导航（2026-09-10 修）：
     现象——手机上 logo 折成三行、导航项竖排，客服球要向左滑屏才看得到。
     根因——.nav 内的链接不可压缩，而 flex 项默认 min-width:auto 使容器无法收缩，
     整个页面被顶宽到 487px（实测 390 视口下 docSW=487，溢出 97px）。
     页面一旦横向溢出，position:fixed; right:14px 的 .fab 就跟着落到视口右侧之外。
     修法——.brand 不允许收缩 + 文字禁止折行；.nav 允许收缩(min-width:0)并自带横向
     滚动兜底；导航项禁止折行。这样页面宽度恒等于视口，客服球自然回到屏幕内。 */
  .header-inner { height: auto; min-height: 62px; gap: 10px; }
  .brand { flex: 0 0 auto; font-size: 15px; gap: 6px; letter-spacing: 0; }
  .brand-logo { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }
  .brand-text { white-space: nowrap; }
  .nav {
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;              /* 极窄屏（≤360px）时导航可横向滑动，不再撑破页面 */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link { flex: 0 0 auto; padding: 5px 7px; font-size: 13px; white-space: nowrap; }

  /* 表格在移动端允许横向滚动，避免被英文/长数字撑破页面 */
  .post-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

  .fab { right: 14px; top: 70px; }
  .fab-avatar, .fab-avatar img { width: 50px; height: 50px; }

  .fab-panel {
    right: 8px;
    left: 8px;
    width: auto;
    top: auto;
    bottom: 8px;
    height: calc(100vh - 64px);
    max-height: none;
    border-radius: 12px 12px 0 0;
  }
