/* report-green.css - Forest-Green Editorial Personal Blog Theme */
:root {
  --bg: #070907;
  --panel: #10130e;
  --panel2: #141a11;
  --border: #26301f;
  --text: #eaeee2;
  --body: #c6cfba;
  --muted: #95a48b;
  --accent: #4ade80;
  --accent-hover: #6ee7a0;
  --accent-bg: rgba(74, 222, 128, 0.1);
  --hero-shade: linear-gradient(180deg, rgba(7, 9, 7, 0.35) 0%, rgba(7, 9, 7, 0.88) 100%);
  --footer-bg: #040504;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  --dialog-backdrop: rgba(7, 9, 7, 0.85);
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", "STSong", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --max-width: 1240px;
  --page-pad: 30px;
}

html[data-theme="light"] {
  --bg: #f4f6f2;
  --panel: #ffffff;
  --panel2: #ebefe7;
  --border: #d2dcce;
  --text: #141a12;
  --body: #354032;
  --muted: #64725f;
  --accent: #15803d;
  --accent-hover: #166534;
  --accent-bg: rgba(21, 128, 61, 0.08);
  --hero-shade: linear-gradient(180deg, rgba(244, 246, 242, 0.3) 0%, rgba(244, 246, 242, 0.9) 100%);
  --footer-bg: #e5ece0;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --dialog-backdrop: rgba(244, 246, 242, 0.82);
}

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

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

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-width: 0;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Accessibility */
.rg-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;
}

/* Base Layout Container */
.rg-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  width: 100%;
}

/* Header */
.rg-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.25s ease;
}

.rg-header-in {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.rg-logo {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rg-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rg-nav a {
  color: var(--body);
  text-decoration: none;
  font-size: 0.92rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.rg-nav a:hover {
  color: var(--text);
}

.rg-nav a.on,
.rg-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.rg-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rg-tool-btn,
.rg-menu-btn {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.rg-tool-btn:hover,
.rg-menu-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rg-tool-btn svg,
.rg-menu-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.rg-lang-btn {
  font-weight: 600;
  min-width: 38px;
}

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

/* Theme Icons Switching */
.rg-ico-moon,
.rg-ico-sun {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

html[data-theme="dark"] .rg-ico-moon {
  display: none;
}

html[data-theme="dark"] .rg-ico-sun {
  display: inline-block;
}

html[data-theme="light"] .rg-ico-moon {
  display: inline-block;
}

html[data-theme="light"] .rg-ico-sun {
  display: none;
}

/* Hero Section */
.rg-home {
  width: 100%;
}

.rg-hero {
  position: relative;
  min-height: 380px;
  height: 50vh;
  max-height: 520px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  background-color: var(--panel);
}

.rg-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.85);
}

.rg-hero-shade {
  position: absolute;
  inset: 0;
  background: var(--hero-shade);
}

.rg-hero-in {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: var(--page-pad);
  text-align: left;
  color: var(--text);
}

.rg-hero-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px 0;
  font-weight: 600;
}

.rg-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.18;
  margin: 0 0 14px 0;
  color: var(--text);
  font-weight: 700;
}

.rg-hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--body);
  max-width: 620px;
  margin: 0 0 24px;
  line-height: 1.6;
}

.rg-hero-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 26px;
  background-color: var(--accent);
  color: #070907;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.rg-hero-btn:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(74, 222, 128, 0.35);
}

.rg-hero-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 16px 0 0 0;
}

/* Main Body Layout */
.rg-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px var(--page-pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}

/* Feed Section */
.rg-feed {
  min-width: 0;
}

.rg-feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.rg-feed-head h2 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--text);
  margin: 0;
}

.rg-feed-head span {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Horizontal Feed Post Cards */
.rg-post-card {
  display: flex;
  gap: 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 20px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.rg-post-card:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow);
  transform: translateY(-1px);
}

.pc-cover {
  flex: 0 0 176px;
  width: 176px;
  height: 124px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel2);
  display: block;
}

.pc-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rg-post-card:hover .pc-cover img {
  transform: scale(1.05);
}

.pc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pc-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.pc-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  line-height: 1.35;
  margin: 0 0 8px 0;
}

.pc-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.pc-title a:hover {
  color: var(--accent);
}

.pc-excerpt {
  font-size: 0.88rem;
  color: var(--body);
  line-height: 1.5;
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Chips & Tags */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.chip {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--panel2);
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.chip.cat {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: transparent;
  font-weight: 500;
}

.chip-n {
  font-size: 0.72em;
  opacity: 0.75;
  margin-left: 4px;
}

/* Sidebar & Cards */
.rg-side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.side-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.side-card h4 {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 14px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}

.author-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--panel2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

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

.author-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.author-role {
  font-size: 0.8rem;
  color: var(--muted);
}

.author-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: center;
  padding: 12px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}

.author-stats b {
  display: block;
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}

.author-stats .rg-counter {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 6px;
}

.author-stats .rg-counter-label {
  display: inline;
}

.rg-counter-label .bsz-cache-badge {
  display: inline-block;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 3px;
}

.author-stats span {
  font-size: 0.75rem;
  color: var(--muted);
}

.side-note {
  font-size: 0.85rem;
  color: var(--body);
  line-height: 1.6;
  margin: 0;
}

/* GA4 / Webinfo Statistics Card */
.card-webinfo .webinfo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
}

.card-webinfo .webinfo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--border);
}

.card-webinfo .item-name {
  color: var(--muted);
}

.card-webinfo .item-count {
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

[data-cache-badge] {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--panel2);
  color: var(--muted);
  border: 1px solid var(--border);
  margin-left: 6px;
  vertical-align: middle;
}

/* Article Page Layout */
.rg-post-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px var(--page-pad);
}

.rg-post-grid {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.rg-post-grid.no-toc {
  grid-template-columns: minmax(0, 1fr);
  max-width: 860px;
  margin: 0 auto;
}

.rg-post-grid.is-right {
  grid-template-columns: minmax(0, 1fr) 208px;
}

.rg-post-grid.is-right .rg-toc {
  order: 2;
}

.rg-post-grid.is-right .rg-article {
  order: 1;
}

/* Sticky TOC */
.rg-toc {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-size: 0.85rem;
}

.rg-toc-head {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  margin-bottom: 10px;
  cursor: default;
}

.rg-toc-head svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform 0.2s ease;
}

#rg-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#rg-toc-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  word-break: break-word;
}

#rg-toc-nav a:hover {
  color: var(--text);
}

#rg-toc-nav a.on {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}

#rg-toc-nav .toc-lv2 {
  padding-left: 8px;
}

#rg-toc-nav .toc-lv3 {
  padding-left: 18px;
  font-size: 0.8rem;
}

#rg-toc-nav .toc-lv4 {
  padding-left: 28px;
  font-size: 0.75rem;
}

/* Article Detail Content */
.rg-article {
  min-width: 0;
}

.p-head {
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.p-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 14px 0;
  font-weight: 700;
}

.p-meta {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

/* Top Border Card for Summary / Verdict */
.p-verdict {
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 6px;
  padding: 18px 22px;
  margin: 24px 0;
  font-size: 0.96rem;
  color: var(--body);
  line-height: 1.7;
}

.p-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--body);
  counter-reset: article-section;
}

.p-content h1,
.p-content h2,
.p-content h3,
.p-content h4,
.p-content h5,
.p-content h6 {
  font-family: var(--font-serif);
  color: var(--text);
  margin-top: 1.8em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}

.p-content h2 {
  counter-increment: article-section;
  font-size: 1.6rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.p-content h2::before {
  content: counter(article-section, decimal-leading-zero) ". ";
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85em;
  margin-right: 6px;
  opacity: 0.85;
  font-weight: 400;
}

.p-content h3 {
  font-size: 1.3rem;
}

.p-content h4 {
  font-size: 1.1rem;
}

.p-content p {
  margin: 1.25em 0;
}

.p-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.p-content a:hover {
  color: var(--accent-hover);
}

.p-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.8em auto;
  display: block;
}

.p-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 10px 20px;
  margin: 1.6em 0;
  background: var(--panel);
  color: var(--muted);
  border-radius: 0 6px 6px 0;
}

.p-content blockquote p {
  margin: 0.5em 0;
}

.p-content code:not([class]) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--panel2);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Code Highlights and Line Numbers */
figure.highlight {
  position: relative;
  margin: 1.6em 0;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.55;
}

figure.highlight table {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
  border: none;
}

figure.highlight td {
  border: none;
  padding: 12px 14px;
  vertical-align: top;
}

figure.highlight .gutter {
  width: 44px;
  text-align: right;
  color: var(--muted);
  border-right: 1px solid var(--border);
  background: var(--panel2);
  user-select: none;
  opacity: 0.7;
  padding-right: 12px;
}

figure.highlight .code {
  overflow-x: auto;
  color: var(--text);
  background: var(--panel);
}

figure.highlight .code pre {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
}

/* Tables in Content with Scroll Wrap */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.6em 0;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.p-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.92rem;
}

.p-content th,
.p-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.p-content th {
  background: var(--panel2);
  color: var(--text);
  font-weight: 600;
}

.p-content tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

html[data-theme="light"] .p-content tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.02);
}

/* Post Bottom Tags & Nav */
.p-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.p-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.p-nav-item {
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.2s ease;
}

.p-nav-item:hover {
  border-color: var(--accent);
}

.p-nav-item.nx {
  text-align: right;
  align-items: flex-end;
}

.p-nav-item span {
  font-size: 0.75rem;
  color: var(--muted);
}

.p-nav-item strong {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.35;
}

/* Taxonomy / Pages / Archives */
.rg-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px var(--page-pad);
}

.rg-page-head {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.rg-page-head h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--text);
  margin: 0 0 8px 0;
}

.rg-page-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.rg-tax-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.rg-tax-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.rg-tax-item:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rg-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}

.rg-year {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--accent);
  margin: 40px 0 16px 0;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 6px;
}

.rg-empty {
  padding: 50px 0;
  text-align: center;
  color: var(--muted);
  font-size: 1rem;
}

/* Pagination */
.rg-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 40px 0 20px 0;
}

.pg-btn {
  padding: 8px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.pg-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pg-btn.is-off {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

.pg-info {
  font-size: 0.88rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Comments */
.rg-comments {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.rg-noscript {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 20px 0;
}

/* Footer */
.rg-footer {
  background-color: var(--footer-bg);
  border-top: 1px solid var(--border);
  margin-top: 80px;
  padding: 40px 0;
  transition: background-color 0.25s ease;
}

.rg-footer-in {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--muted);
}

.rg-footer-in a {
  color: var(--body);
  text-decoration: none;
  transition: color 0.15s ease;
}

.rg-footer-in a:hover {
  color: var(--accent);
}

/* Search Modal / Dialog */
dialog.rg-search {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
  max-width: 600px;
  width: calc(100% - 32px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65);
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 1000;
}

dialog.rg-search::backdrop {
  background: var(--dialog-backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.rg-search-in {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.rg-search-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.rg-search-close:hover {
  color: var(--text);
  background: var(--panel2);
}

#rg-search-input {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 42px 12px 16px;
  font-size: 1rem;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}

#rg-search-input:focus {
  border-color: var(--accent);
}

.rg-search-results {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rg-search-results li {
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.rg-search-results li:last-child {
  border-bottom: none;
}

.rg-search-results a {
  text-decoration: none;
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.rg-search-results a:hover {
  background: var(--panel2);
}

.rg-search-item-title {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 3px;
}

.rg-search-item-snippet {
  color: var(--body);
  font-size: 0.82rem;
  line-height: 1.4;
}

.rg-search-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 24px 0;
  margin: 0;
}

/* Layout Spacing Helpers & Selectors Contract */
.m\[1\],
[class*="m[1]"] {
  margin-bottom: 1rem;
}

/* Responsive Media Queries */
@media (max-width: 960px) {
  .rg-body {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .rg-post-grid,
  .rg-post-grid.is-right {
    grid-template-columns: 1fr;
  }

  .rg-toc {
    position: relative;
    top: 0;
    max-height: none;
    margin-bottom: 24px;
  }

  .rg-toc-head {
    cursor: pointer;
    user-select: none;
  }

  .rg-toc.is-collapsed #rg-toc-nav {
    display: none;
  }

  .rg-toc.is-collapsed .rg-toc-head svg {
    transform: rotate(-90deg);
  }
}

@media (max-width: 860px) {
  .rg-menu-btn {
    display: inline-flex;
  }

  .rg-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 16px var(--page-pad);
    gap: 8px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
  }

  .rg-nav.is-open {
    display: flex;
  }

  .rg-nav a {
    padding: 10px 12px;
    border-radius: 6px;
    border-bottom: none;
  }

  .rg-nav a.on,
  .rg-nav a[aria-current="page"] {
    background: var(--panel2);
    border-bottom: none;
  }
}

@media (max-width: 640px) {
  :root {
    --page-pad: 16px;
  }

  .rg-header-in {
    gap: 8px;
  }

  .rg-logo {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
  }

  .rg-tools {
    flex: 0 0 auto;
    gap: 4px;
  }

  .rg-tool-btn,
  .rg-menu-btn {
    flex: 0 0 auto;
    min-width: 36px;
    min-height: 36px;
    padding: 8px;
  }

  .rg-menu-btn > span {
    display: none;
  }

  .rg-post-card {
    flex-direction: column;
    padding: 14px;
  }

  .pc-cover {
    flex: none;
    width: 100%;
    height: 180px;
  }

  .rg-hero {
    height: auto;
    min-height: 340px;
    padding: 40px 0;
  }

  .rg-hero-in {
    padding: 20px 16px;
  }

  .p-nav {
    grid-template-columns: 1fr;
  }

  .p-nav-item.nx {
    text-align: left;
    align-items: flex-start;
  }

  .rg-footer-in {
    flex-direction: column;
    text-align: center;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* cover-css.txt — 新增文章 figure 精确 CSS 增量（review-v2）
   仅用于文章页 .p-cover；列表卡片 CSS 一律不改，
   已认可的 176x124 桌面 / 180 高手机卡片几何保持不变。
   文章封面实际尺寸 1280x720，列表缩略图实际尺寸 480x270，模板已写清宽高。
   其它字体/颜色/布局/统计 JS/评论/正文/路由一字不改。 */

.p-cover {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.p-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}



/* body-images append (2026-11-05) — 正文图容错 CSS 增量，追加到 report-green.css 原文件末尾。
   只针对 .p-content 内增强过的正文图与失败提示；不改现有 .p-content img / .p-cover /
   .pc-cover 及其他布局、字体、颜色。无 JS 时不加任何类名，原生图片照常显示；
   只有最终失败并已显示手动提示时，才隐藏破图图标（.is-body-img-failed），正常图永不隐藏。 */

/* 正文图加载中的占位底色，避免白底闪烁；不隐藏图片 */
.p-content img[data-original-src] {
  background: var(--panel2);
}

/* 最终失败才隐藏破图图标（此时下方已有手动重试 / 查看原图） */
.p-content img.is-body-img-failed {
  display: none;
}

/* 失败手动操作条：沿用面板、边框、强调色与圆角 */
.rg-body-img-fallback {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 1em auto;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.rg-body-img-fallback .rg-body-img-retry {
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
}

.rg-body-img-fallback .rg-body-img-retry:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.rg-body-img-fallback .rg-body-img-original {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rg-body-img-fallback .rg-body-img-original:hover {
  color: var(--accent-hover);
}

