/*
Theme Name: Haomao Blog
Theme URI: https://blog.newmao.cn
Author: 好猫API
Description: 好猫API 博客专用主题 —— 杂志式排版、渐变主视觉、阅读进度、自动目录、代码高亮容器。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: haomao
*/

/* ============ tokens ============ */
:root {
  --ink: #15171c;
  --ink-2: #2b303b;
  --muted: #6a7280;
  --muted-2: #9aa1ac;
  --line: #efe7e2;
  --line-2: #f6efeb;
  --bg: #fffdfc;
  --soft: #fff6f1;
  --brand: #ff6b2c;
  --brand-2: #e8390f;
  --grad: linear-gradient(135deg, #ff8a3d 0%, #e8390f 100%);
  --grad-soft: linear-gradient(135deg, #fff1e8 0%, #ffe3d6 100%);
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(21, 23, 28, 0.05);
  --shadow-md: 0 18px 40px -22px rgba(232, 57, 15, 0.35);
  --wrap: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC",
    sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono",
    monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: none; color: var(--brand); }

/* WP 6 会在全局样式里给 a 加下划线，这里清零（正文内的下划线单独恢复） */
:where(a:not(.wp-element-button)) { text-decoration: none; }
.nav a, .brand, .toc a, .card a, .post-nav a, .footer-col a, .crumb a, .post-tags a, .section-head .more, .topic, .topic * { text-decoration: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ============ reading progress ============ */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--grad);
  z-index: 200;
  transition: width 0.12s linear;
}

/* ============ header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 253, 252, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-2);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 68px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-size: 16px;
  color: var(--ink);
  letter-spacing: 0.2px;
}
.brand-text em {
  font-style: normal;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: 14px; flex: 1 1 auto; }
.nav a {
  color: var(--ink-2);
  font-size: 14.5px;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 500;
}
.nav a:hover { background: var(--soft); color: var(--brand-2); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  padding: 10px 20px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  white-space: nowrap;
}
.btn-grad {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(232, 57, 15, 0.8);
}
.btn-grad:hover { transform: translateY(-1px); color: #fff; box-shadow: 0 16px 30px -14px rgba(232, 57, 15, 0.9); }
.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.btn-line {
  border: 1px solid var(--line);
  color: var(--ink-2);
  background: #fff;
}
.btn-line:hover { border-color: #ffd2bd; color: var(--brand-2); }

.header-cta { flex: 0 0 auto; }

/* ============ hero ============ */
.hero {
  position: relative;
  overflow: hidden;
  background: #14161b;
  color: #fff;
  padding: 76px 0 84px;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}
.hero::before {
  width: 620px;
  height: 620px;
  right: -160px;
  top: -280px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 122, 46, 0.55), rgba(255, 122, 46, 0) 68%);
}
.hero::after {
  width: 520px;
  height: 520px;
  left: -180px;
  bottom: -300px;
  background: radial-gradient(circle at 50% 50%, rgba(232, 57, 15, 0.42), rgba(232, 57, 15, 0) 70%);
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 48px;
  align-items: center;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  letter-spacing: 0.6px;
  color: #ffd9c6;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero-badge i {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.18);
  display: inline-block;
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1.22;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.hero h1 span {
  background: linear-gradient(120deg, #ffb37a, #ff6b2c 55%, #ff9a5c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p.lead {
  margin: 0 0 30px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16.5px;
  line-height: 1.85;
  max-width: 33em;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-card {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  padding: 22px;
  backdrop-filter: blur(8px);
}
.hero-card h3 {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.hero-list { list-style: none; margin: 0; padding: 0; }
.hero-list li {
  display: flex;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.86);
}
.hero-list li:first-child { border-top: 0; padding-top: 0; }
.hero-list b {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--grad);
  color: #fff;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-top: 3px;
}

/* ============ section ============ */
.section { padding: 66px 0; }
.section-soft { background: linear-gradient(180deg, #fff7f2 0%, #fffdfc 100%); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.section-head h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.3px;
  font-weight: 800;
}
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.section-head .more { font-size: 14px; font-weight: 600; color: var(--brand-2); }

/* ============ post cards ============ */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #ffd6c3;
}
.card-cover {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--grad-soft);
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .card-cover img { transform: scale(1.045); }
.cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad);
  color: #fff;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 2px;
}
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-2);
  background: var(--soft);
  border: 1px solid #ffe0d0;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--brand-2); }
.card .excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
  font-size: 12.5px;
  margin-top: auto;
  padding-top: 6px;
}
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }

/* featured */
.featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 50px -34px rgba(21, 23, 28, 0.4);
}
.featured-cover { position: relative; min-height: 340px; background: var(--grad-soft); }
.featured-cover img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.featured-body { padding: 40px 42px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.featured-body h2 {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.4;
  letter-spacing: -0.4px;
  font-weight: 800;
}
.featured-body h2 a { color: var(--ink); }
.featured-body h2 a:hover { color: var(--brand-2); }
.featured-body p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.featured-body .btn { align-self: flex-start; margin-top: 6px; }

/* ============ single ============ */
.post-hero {
  background: #14161b;
  color: #fff;
  padding: 54px 0 120px;
  position: relative;
  overflow: hidden;
}
.post-hero::after {
  content: "";
  position: absolute;
  width: 640px; height: 640px;
  right: -220px; top: -320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 46, 0.42), rgba(255, 122, 46, 0) 68%);
}
.post-hero .wrap { position: relative; z-index: 2; }
.post-hero.has-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, rgba(20, 22, 27, 0.91) 0%, rgba(20, 22, 27, 0.96) 100%), var(--cover);
  background-size: cover, cover;
  background-position: center 35%, center 35%;
  opacity: 1;
  z-index: 0;
}
.crumb { font-size: 13px; color: rgba(255, 255, 255, 0.5); margin-bottom: 16px; }
.crumb a { color: rgba(255, 255, 255, 0.7); }
.crumb a:hover { color: #fff; }
.crumb span { margin: 0 8px; opacity: 0.5; }
.post-hero .chip { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.16); color: #ffcaae; }
.post-hero h1 {
  margin: 16px 0 18px;
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.32;
  letter-spacing: -0.6px;
  font-weight: 800;
  max-width: 20em;
}
.post-hero .meta { color: rgba(255, 255, 255, 0.55); padding-top: 0; }
.post-hero .meta .dot { background: rgba(255, 255, 255, 0.4); }

.post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 274px;
  gap: 48px;
  align-items: start;
  margin-top: -82px;
  padding-bottom: 80px;
  position: relative;
}

.article-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 60px -40px rgba(21, 23, 28, 0.45);
  overflow: hidden;
}
.post-cover { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-body { padding: 44px 52px 52px; }

/* content typography */
.entry { font-size: 16.5px; line-height: 1.92; color: #23262e; }
.entry > *:first-child { margin-top: 0; }
.entry p { margin: 0 0 20px; }
.entry h2 {
  position: relative;
  margin: 46px 0 18px;
  padding-left: 15px;
  font-size: 25px;
  line-height: 1.45;
  letter-spacing: -0.4px;
  font-weight: 800;
  color: var(--ink);
  scroll-margin-top: 92px;
}
.entry h2::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 4px;
  border-radius: 4px;
  background: var(--grad);
}
.entry h3 {
  margin: 34px 0 14px;
  font-size: 19.5px;
  font-weight: 700;
  color: var(--ink);
  scroll-margin-top: 92px;
}
.entry h4 { margin: 26px 0 12px; font-size: 17px; font-weight: 700; }
.entry ul, .entry ol { margin: 0 0 22px; padding-left: 22px; }
.entry li { margin: 8px 0; }
.entry li::marker { color: var(--brand); }
.entry strong { color: var(--ink); font-weight: 700; }
.entry hr { border: 0; border-top: 1px solid var(--line); margin: 38px 0; }

.entry a { color: var(--brand-2); text-decoration: underline; text-decoration-color: #ffc9b1; text-underline-offset: 3px; }
.entry a:hover { text-decoration-color: var(--brand); }

.entry blockquote {
  margin: 26px 0;
  padding: 18px 22px;
  background: var(--soft);
  border-left: 4px solid var(--brand);
  border-radius: 0 14px 14px 0;
  color: #4a4f5a;
}
.entry blockquote p:last-child { margin-bottom: 0; }

.entry :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: #fff1e9;
  color: #d1460f;
  border: 1px solid #ffe0d0;
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-word;
}

.entry pre {
  position: relative;
  margin: 24px 0;
  padding: 20px 22px;
  background: #1a1d24;
  border-radius: 14px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.75;
  color: #e6e8ec;
  box-shadow: 0 16px 34px -24px rgba(21, 23, 28, 0.9);
}
.entry pre code {
  font-family: var(--mono);
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}
.copy-code {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #cfd4dc;
  font-size: 11.5px;
  font-family: var(--font);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
}
.entry pre:hover .copy-code { opacity: 1; }
.copy-code:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.entry table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 26px 0;
  font-size: 14.5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: table;
}
.entry thead th {
  background: linear-gradient(180deg, #fff4ed, #ffeadf);
  color: #8a3c14;
  font-weight: 700;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #ffe0d0;
  white-space: nowrap;
}
.entry tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: top;
}
.entry tbody tr:last-child td { border-bottom: 0; }
.entry tbody tr:nth-child(even) { background: #fffbf8; }

.entry img { border-radius: 14px; margin: 26px auto; box-shadow: 0 18px 40px -30px rgba(21, 23, 28, 0.6); }

/* toc */
.toc {
  position: sticky;
  top: 92px;
  align-self: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 20px 16px;
  box-shadow: var(--shadow-sm);
}
.toc-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 12px;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line-2); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 5px 0 5px 11px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.toc a:hover { color: var(--brand-2); }
.toc a.active { color: var(--brand-2); border-left-color: var(--brand); font-weight: 600; background: linear-gradient(90deg, #fff4ee, transparent); }

.toc-mobile { display: none; }

/* post footer */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; padding-top: 24px; border-top: 1px dashed var(--line); }
.post-tags a {
  font-size: 12.5px;
  color: var(--muted);
  background: #faf7f5;
  border: 1px solid var(--line);
  padding: 4px 11px;
  border-radius: 999px;
}
.post-tags a:hover { color: var(--brand-2); border-color: #ffd6c3; background: var(--soft); }

.author-box {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 28px;
  padding: 20px 22px;
  background: #fbf9f8;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.author-box img { width: 52px; height: 52px; border-radius: 14px; }
.author-box strong { display: block; font-size: 15px; color: var(--ink); }
.author-box span { font-size: 13.5px; color: var(--muted); line-height: 1.7; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 22px;
}
.post-nav a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.6;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.post-nav a:hover { border-color: #ffd6c3; transform: translateY(-2px); }
.post-nav small { display: block; font-size: 11.5px; color: var(--muted-2); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.post-nav .next { text-align: right; }

/* cta band */
.cta-band {
  position: relative;
  overflow: hidden;
  margin: 56px 0 0;
  padding: 44px 46px;
  border-radius: 22px;
  background: #14161b;
  color: #fff;
}
.cta-band::after {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  right: -140px; bottom: -240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 122, 46, 0.5), rgba(255, 122, 46, 0) 70%);
}
.cta-band h3 { position: relative; margin: 0 0 10px; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; }
.cta-band p { position: relative; margin: 0 0 22px; color: rgba(255, 255, 255, 0.68); font-size: 14.5px; max-width: 34em; }
.cta-band .btn { position: relative; }

/* ============ topics ============ */
.topics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.topic {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 24px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.topic:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #ffd6c3; }
.topic .ico {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
}
.topic h3 { margin: 0 0 6px; font-size: 16.5px; color: var(--ink); letter-spacing: -0.2px; }
.topic p { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.topic .arrow { font-size: 13.5px; font-weight: 600; color: var(--brand-2); }
@media (max-width: 900px) { .topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .topics { grid-template-columns: minmax(0, 1fr); } }

/* ============ rich blocks（正文彩色区块） ============ */
.entry .callout {
  position: relative;
  margin: 26px 0;
  padding: 18px 22px 18px 54px;
  border-radius: 14px;
  font-size: 15.5px;
  line-height: 1.8;
  border: 1px solid transparent;
}
.entry .callout::before {
  position: absolute;
  left: 18px;
  top: 17px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.entry .callout p:last-child { margin-bottom: 0; }
.entry .callout strong { color: inherit; }

.entry .callout-tip { background: #eefaf3; border-color: #c6ecd7; color: #14532d; }
.entry .callout-tip::before { content: "✓"; background: #16a34a; }
.entry .callout-warn { background: #fff7ed; border-color: #fed7aa; color: #7c2d12; }
.entry .callout-warn::before { content: "!"; background: #ea580c; }
.entry .callout-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.entry .callout-info::before { content: "i"; background: #2563eb; }
.entry .callout-danger { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.entry .callout-danger::before { content: "×"; background: #dc2626; }
.entry .callout-note { background: #faf5ff; border-color: #e9d5ff; color: #4c1d95; }
.entry .callout-note::before { content: "★"; background: #7c3aed; font-size: 10px; }

.entry .keypoint {
  margin: 30px 0;
  padding: 22px 26px;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff4ed 0%, #ffe9dd 100%);
  border: 1px solid #ffd8c4;
  font-size: 17px;
  line-height: 1.75;
  color: #7a2e0c;
  font-weight: 600;
}
.entry .keypoint::before {
  content: "结论";
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #e8390f;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.entry .steps { margin: 26px 0; padding: 0; list-style: none; counter-reset: step; }
.entry .steps li {
  position: relative;
  counter-increment: step;
  padding: 0 0 22px 46px;
  margin: 0;
  border-left: 2px dashed #ffe0d0;
  margin-left: 15px;
}
.entry .steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.entry .steps li::before {
  content: counter(step);
  position: absolute;
  left: -16px;
  top: -2px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff8a3d, #e8390f);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px -8px rgba(232, 57, 15, 0.9);
}
.entry .steps li strong { display: block; margin-bottom: 3px; font-size: 15.5px; }

.entry .compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 28px 0;
}
.entry .compare > div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  background: #fff;
  font-size: 14.5px;
  line-height: 1.8;
}
.entry .compare > div:first-child { border-color: #c6ecd7; background: #f4fbf7; }
.entry .compare > div:last-child { border-color: #fed7aa; background: #fffaf4; }
.entry .compare h4 { margin: 0 0 8px; font-size: 14px; letter-spacing: 0.5px; }
.entry .compare ul { margin: 0; padding-left: 18px; }
.entry .compare li { margin: 4px 0; }

.entry .hl {
  background: linear-gradient(180deg, transparent 62%, #ffd9c6 62%);
  padding: 0 2px;
  font-weight: 600;
  color: #b5300c;
}

.entry .pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.entry .pill {
  font-size: 12.5px;
  color: #8a3c14;
  background: #fff1e8;
  border: 1px solid #ffd9c6;
  padding: 3px 12px;
  border-radius: 999px;
}

@media (max-width: 720px) {
  .entry .compare { grid-template-columns: minmax(0, 1fr); }
  .entry .callout { padding: 16px 18px 16px 48px; }
}

/* ============ footer ============ */
.site-footer {
  margin-top: 0;
  background: #101216;
  color: rgba(255, 255, 255, 0.62);
  padding: 58px 0 34px;
  font-size: 14px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.footer-brand img { width: 38px; height: 38px; border-radius: 11px; }
.footer-brand strong { color: #fff; font-size: 16px; display: block; line-height: 1.3; }
.footer-brand em { font-style: normal; font-size: 11.5px; letter-spacing: 2px; color: rgba(255, 255, 255, 0.4); text-transform: uppercase; }
.site-footer p { margin: 0; line-height: 1.85; max-width: 30em; }
.footer-col h4 { margin: 0 0 14px; font-size: 13px; color: #fff; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 600; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 9px 0; }
.footer-col a { color: rgba(255, 255, 255, 0.62); font-size: 14px; }
.footer-col a:hover { color: #ffb08a; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 22px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.36);
  flex-wrap: wrap;
}

/* ============ misc ============ */
.empty-state {
  padding: 70px 24px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: #fff;
}

.to-top {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 26px -16px rgba(21, 23, 28, 0.5);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 120;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: #ffd6c3; color: var(--brand-2); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ============ responsive ============ */
@media (max-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: -60px; }
  .toc { display: none; }
  .toc-mobile {
    display: block;
    margin: 0 0 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fffaf7;
    padding: 14px 18px;
  }
  .toc-mobile summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-2);
    list-style: none;
  }
  .toc-mobile summary::-webkit-details-marker { display: none; }
  .toc-mobile ul { margin: 12px 0 0; padding-left: 18px; }
  .toc-mobile a { font-size: 13.5px; color: var(--muted); }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .hero { padding: 56px 0 60px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured { grid-template-columns: minmax(0, 1fr); }
  .featured-cover { min-height: 220px; }
  .featured-body { padding: 28px; }
  .post-body { padding: 30px 24px 36px; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav { display: none; }
  .header-inner { height: 62px; justify-content: space-between; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav .next { text-align: left; }
  .entry { font-size: 16px; }
  .entry h2 { font-size: 21.5px; }
  .entry thead th, .entry tbody td { padding: 10px 12px; font-size: 13.5px; }
  .cta-band { padding: 30px 24px; }
  .footer-top { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .brand-text strong { font-size: 15px; }
}

@media print {
  .site-header, .toc, .to-top, .cta-band, .site-footer, .post-nav, #progress { display: none; }
  .post-layout { margin-top: 0; }
  .article-card { box-shadow: none; border: 0; }
}
