/* 春泥博客 - 现代 Web 工程与 Google 技术社区样式表（纯本地零外部依赖） */

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --brand: #1a73e8;
  --brand-hover: #1557b0;
  --brand-soft: #e8f0fe;
  --emerald: #0f766e;
  --emerald-soft: #e6f4ea;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --indigo: #4338ca;
  --indigo-soft: #e0e7ff;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --surface: #111827;
  --surface-alt: #1e293b;
  --border: #1f2937;
  --border-strong: #334155;
  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --brand: #60a5fa;
  --brand-hover: #93c5fd;
  --brand-soft: rgba(59, 130, 246, 0.16);
  --emerald: #34d399;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --amber: #fbbf24;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --indigo: #a5b4fc;
  --indigo-soft: rgba(99, 102, 241, 0.18);
  --code-bg: #020617;
  --code-text: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

a:hover {
  color: var(--brand-hover);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 999;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-header {
  background: rgba(17, 24, 39, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

[data-theme="dark"] .brand-link,
[data-theme="dark"] .footer-logo-wrap {
  background: rgba(255, 255, 255, 0.94);
  padding: 4px 10px;
  border-radius: 10px;
}

.brand-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.nav-item {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 7px 11px;
  border-radius: 8px;
  white-space: nowrap;
}

.nav-item:hover,
.nav-item.active {
  color: var(--brand);
  background: var(--brand-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-search {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 6px 2px 12px;
  width: 210px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.header-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.header-search input {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.85rem;
  width: 100%;
  outline: none;
  padding: 5px 4px;
  min-width: 0;
}

.header-search button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.header-search button:hover {
  color: var(--brand);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.mobile-menu-btn {
  display: none;
}

.mobile-drawer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 0 18px;
}

.mobile-search {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mobile-search input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9375rem;
}

.mobile-search button {
  padding: 0 16px;
  border-radius: 8px;
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.mobile-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mobile-links a {
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}

/* Announcement Banner (Required right below header navigation on homepage) */
.announce-bar {
  background: linear-gradient(90deg, #eff6ff 0%, #ecfdf5 100%);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

[data-theme="dark"] .announce-bar {
  background: linear-gradient(90deg, rgba(30, 58, 138, 0.35) 0%, rgba(6, 78, 59, 0.32) 100%);
}

.announce-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.announce-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.announce-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
}

/* Badges & Buttons */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
}

.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-green { background: var(--emerald-soft); color: var(--emerald); }
.badge-indigo { background: var(--indigo-soft); color: var(--indigo); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }

[data-theme="dark"] .badge-teal { background: rgba(20, 184, 166, 0.16); color: #5eead4; }

.btn-primary,
.btn-outline,
.btn-sm,
.btn-sm-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  border: 1px solid var(--brand);
  padding: 9px 18px;
  font-size: 0.92rem;
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 9px 18px;
  font-size: 0.92rem;
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-sm {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 4px 11px;
  font-size: 0.78rem;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.btn-sm-primary {
  background: var(--brand);
  color: #ffffff;
  border: 0;
  padding: 7px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-sm-primary:hover {
  background: var(--brand-hover);
  color: #ffffff;
}

/* Hero Section */
.hero-section {
  padding: 28px 0 8px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}

.hero-lead {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.hero-cover-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 7.6;
  background: var(--surface-alt);
}

.hero-cover-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.hero-lead:hover .hero-cover-link img {
  transform: scale(1.02);
}

.hero-lead-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: 1.55rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

.hero-title a {
  color: var(--text);
}

.hero-title a:hover {
  color: var(--brand);
}

.hero-summary {
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.96rem;
}

.hero-cta-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-side-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-sub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.hero-sub-card h2 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.42;
}

.hero-sub-card h2 a {
  color: var(--text);
}

.hero-sub-card h2 a:hover {
  color: var(--brand);
}

.hero-sub-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-toolbox-promo {
  margin-top: auto;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 60%, #0f766e 100%);
  color: #f8fafc;
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.hero-toolbox-promo strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.hero-toolbox-promo p {
  margin: 0;
  font-size: 0.82rem;
  color: #cbd5e1;
  line-height: 1.45;
}

/* Main Content & Category Strip */
.content-section {
  padding: 24px 0 48px;
}

.cat-strip,
.tool-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
}

.cat-chip:hover,
.cat-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.chip-cnt {
  font-size: 0.76rem;
  opacity: 0.8;
}

.layout-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
}

.section-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Article Feed Cards */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.article-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
}

.card-thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 5 / 3;
  background: var(--surface-alt);
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.card-title a {
  color: var(--text);
}

.card-title a:hover {
  color: var(--brand);
}

.card-summary {
  margin: 0;
  font-size: 0.91rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar Widgets */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.widget-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.widget-head .widget-title {
  margin-bottom: 0;
}

.widget-more {
  font-size: 0.82rem;
  font-weight: 600;
}

.toc-widget {
  position: sticky;
  top: 84px;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-link {
  font-size: 0.86rem;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-left: 2px solid var(--border);
  line-height: 1.45;
}

.toc-link:hover,
.toc-link.active {
  color: var(--brand);
  border-left-color: var(--brand);
  background: var(--brand-soft);
  border-radius: 0 6px 6px 0;
}

.toc-l3 {
  padding-left: 18px;
  font-size: 0.82rem;
}

.tool-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-mini-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 500;
}

.tool-mini-list a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.tool-mini-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.metric-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 6px;
  text-align: center;
}

.metric-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.metric-val {
  display: block;
  font-size: 0.92rem;
  color: var(--emerald);
  margin-top: 2px;
}

.widget-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.hot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hot-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hot-rank {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.hot-body a {
  display: block;
  font-size: 0.89rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  margin-bottom: 3px;
}

.hot-body a:hover {
  color: var(--brand);
}

.hot-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.tag-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* Page Banner & Breadcrumbs */
.page-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 26px 0;
}

.page-banner h1 {
  margin: 8px 0 8px;
  font-size: 1.7rem;
  line-height: 1.3;
}

.page-banner p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 780px;
}

.breadcrumbs {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Article Detail */
.article-shell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.article-header {
  margin: 14px 0 20px;
}

.article-title {
  margin: 8px 0 12px;
  font-size: 1.85rem;
  line-height: 1.32;
  letter-spacing: -0.015em;
}

.article-lead {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text-secondary);
  padding: 14px 16px;
  background: var(--surface-alt);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
}

.article-banner-fig {
  margin: 0 0 24px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-banner-fig img {
  width: 100%;
  aspect-ratio: 16 / 6.5;
  object-fit: cover;
}

/* Prose Typography */
.prose {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.82;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.prose h2 {
  margin: 28px 0 12px;
  font-size: 1.35rem;
  line-height: 1.38;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 84px;
}

.prose h3 {
  margin: 22px 0 10px;
  font-size: 1.12rem;
  line-height: 1.4;
  scroll-margin-top: 84px;
}

.prose p {
  margin: 0 0 16px;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin-bottom: 7px;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: var(--surface-alt);
  color: var(--brand);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.prose pre {
  position: relative;
  margin: 18px 0 22px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  max-width: 100%;
  line-height: 1.6;
  border: 1px solid #1e293b;
}

.prose pre code {
  background: transparent;
  color: inherit;
  border: 0;
  padding: 0;
  font-size: 0.86rem;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.74rem;
  cursor: pointer;
}

.code-copy-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.prose blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  background: var(--brand-soft);
  border-left: 4px solid var(--brand);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 22px;
  display: block;
  overflow-x: auto;
  font-size: 0.9rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
}

.prose th {
  background: var(--surface-alt);
  font-weight: 600;
}

.article-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.tags-label {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 600;
}

.editorial-note {
  margin-top: 22px;
  padding: 16px 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.editorial-note strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.editorial-note p {
  margin: 0;
}

.related-section {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.related-section h2 {
  margin: 0 0 14px;
  font-size: 1.15rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.related-card:hover {
  border-color: var(--brand);
}

.related-card h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.45;
}

.rel-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* Tools Workspace */
.tools-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tool-hub-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.tool-hub-card h2 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.4;
}

.tool-hub-card h2 a {
  color: var(--text);
}

.tool-hub-card p {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex: 1;
}

.tool-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 22px;
}

.form-row {
  margin-bottom: 14px;
}

.form-row label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-row.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.input-ctrl {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.input-ctrl:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.mono-area {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chk {
  display: flex !important;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
  cursor: pointer;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tool-msg {
  font-size: 0.84rem;
  color: var(--emerald);
  font-weight: 500;
}

.tool-msg.error {
  color: #dc2626;
}

.tool-output {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.output-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #1e293b;
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: 10px 10px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
}

.code-out {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px;
  border-radius: 0 0 10px 10px;
  overflow-x: auto;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.58;
}

.diag-panel {
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  padding: 16px;
  background: var(--bg);
}

.diag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.status-good { color: #059669; font-weight: 600; }
.status-warn { color: #d97706; font-weight: 600; }
.status-bad { color: #dc2626; font-weight: 600; }

.pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.pill-green { background: #10b981; color: #fff; }
.pill-amber { background: #f59e0b; color: #111827; }
.pill-red { background: #ef4444; color: #fff; }

.diag-advice {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.tool-guide {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
}

/* Radar Page */
.radar-ring {
  margin-bottom: 30px;
}

.radar-ring-head {
  margin-bottom: 14px;
  padding-left: 14px;
  border-left: 4px solid var(--brand);
}

.radar-adopt .radar-ring-head { border-left-color: #10b981; }
.radar-trial .radar-ring-head { border-left-color: #1a73e8; }
.radar-assess .radar-ring-head { border-left-color: #f59e0b; }

.radar-ring-head h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
}

.radar-ring-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.radar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.radar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.radar-card h3 {
  margin: 0 0 8px;
  font-size: 1.04rem;
  line-height: 1.4;
}

.radar-card h3 a { color: var(--text); }
.radar-card h3 a:hover { color: var(--brand); }

.radar-card p {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex: 1;
}

.radar-more {
  font-size: 0.84rem;
  font-weight: 600;
}

/* Search & Pagination & 404 */
.big-search-form {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  max-width: 680px;
}

.big-search-form input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.96rem;
}

.search-count {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.empty-box,
.not-found-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
}

.nf-code {
  display: inline-block;
  font-size: 3rem;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}

.nf-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
}

.page-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.page-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.page-info {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
  padding: 38px 20px 28px;
}

.footer-logo-wrap {
  display: inline-flex;
  margin-bottom: 10px;
}

.footer-desc {
  margin: 0 0 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-motto {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-col h4 {
  margin: 0 0 12px;
  font-size: 0.94rem;
  color: var(--text);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  font-size: 0.87rem;
  color: var(--text-secondary);
}

.footer-col a:hover {
  color: var(--brand);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.footer-bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.footer-bottom p {
  margin: 0;
}

.beian-wrap a {
  color: var(--text-secondary);
  font-weight: 500;
}

.beian-wrap a:hover {
  color: var(--brand);
}

/* Responsive Breakpoints (Mobile-first safe down to 375px with zero horizontal overflow) */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .header-search { display: none; }
  .mobile-menu-btn { display: inline-flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .layout-two-col { grid-template-columns: 1fr; }
  .toc-widget { position: static; }
  .tools-hub-grid,
  .radar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tool-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .container { padding: 0 14px; }
  .header-inner { min-height: 60px; }
  .brand-logo { height: 38px; }
  .announce-inner { gap: 6px; }
  .announce-text { font-size: 0.84rem; }
  .hero-lead-body { padding: 16px; }
  .hero-title { font-size: 1.28rem; }
  .hero-toolbox-promo { flex-direction: column; align-items: flex-start; }
  .article-card { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .card-thumb { aspect-ratio: 16 / 8.5; }
  .article-shell { padding: 18px 16px; }
  .article-title { font-size: 1.4rem; }
  .related-grid,
  .tools-hub-grid,
  .radar-grid,
  .footer-grid,
  .form-row.two-col { grid-template-columns: 1fr; }
  .big-search-form { flex-direction: column; }
  .footer-grid { padding: 28px 14px 20px; }
}
