/* ============================================================
   Ruyi Theme - Main Stylesheet
   Author: 牛大圣 & 小圣二号
   ============================================================ */

/* ------------ Variables ------------ */
:root {
  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --bg-code: #f6f8fa;
  --text: #0a0a0a;
  --text-muted: #4b5563;
  --text-subtle: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #ea580c;
  --accent-hover: #c2410c;
  --accent-bg: rgba(234,88,12,0.08);
  --tag-bg: #f4f4f5;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
}
[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-elevated: #111113;
  --bg-code: #161618;
  --text: #ededed;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --border: #27272a;
  --border-strong: #3f3f46;
  --accent: #fb923c;
  --accent-hover: #fdba74;
  --accent-bg: rgba(251,146,60,0.1);
  --tag-bg: #1f1f22;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ------------ Reset & Base ------------ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Text",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI",
               "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* ------------ Nav ------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .site-header { background: rgba(10,10,10,0.72); }
.site-header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.site-logo img { width: 28px; height: 28px; border-radius: 6px; }
.site-logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.site-logo-text .main { font-size: 15px; font-weight: 700; color: var(--text); }
.site-logo-text .sub {
  font-size: 10px; font-weight: 500; color: var(--text-subtle);
  letter-spacing: 0.02em; margin-top: 2px;
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; }
.site-nav a {
  padding: 6px 12px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s;
}
.site-nav a:hover,
.site-nav .current-menu-item > a { color: var(--text); background: var(--bg-elevated); }
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: all 0.15s;
  margin-left: 8px;
}
.theme-toggle:hover { background: var(--bg-elevated); border-color: var(--text-subtle); }

/* ------------ Layout ------------ */
.banner-strip {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0;
}
.layout {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  align-items: start;
}
.layout.single-column { grid-template-columns: 1fr; }
main.site-main { min-width: 0; }
aside.sidebar {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px 0;
}

/* ------------ Hero ------------ */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.hero h1 {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ------------ Banner ------------ */
.banner {
  margin: 0 0 8px;
  position: relative;
  border-radius: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 45%, #fb923c 100%);
  color: white;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 28px 32px;
  box-shadow: 0 10px 30px rgba(234,88,12,0.18);
  text-decoration: none;
  isolation: isolate;
}
.banner::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(255,255,255,0.35) 0%, transparent 40%),
    radial-gradient(circle at 15% 120%, rgba(255,255,255,0.18) 0%, transparent 45%),
    repeating-linear-gradient(45deg, transparent 0 24px, rgba(255,255,255,0.04) 24px 48px);
  z-index: -1;
}
.banner-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(255,255,255,0.22);
  padding: 4px 10px; border-radius: 100px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  margin-bottom: 10px;
}
.banner-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.9);
  animation: ruyi-pulse 1.6s ease-in-out infinite;
}
@keyframes ruyi-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.banner-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; margin-bottom: 6px; color: white; }
.banner-desc { font-size: 14px; color: rgba(255,255,255,0.92); line-height: 1.5; max-width: 480px; }
.banner-cta {
  display: flex; align-items: center; gap: 6px;
  background: white; color: var(--accent);
  padding: 10px 20px; border-radius: 100px;
  font-size: 14px; font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.banner-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.18); }
.banner-cta .arrow { transition: transform 0.2s; }
.banner-cta:hover .arrow { transform: translateX(3px); }
[data-theme="dark"] .banner {
  background: linear-gradient(135deg, #7c2d12 0%, #c2410c 50%, #ea580c 100%);
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* Image-background banner variant */
.banner.banner-image {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  min-height: 200px;
}

/* Pure image mode (no text/CTA overlaid) */
.banner.banner-image-only {
  display: block;
  padding: 0;
  min-height: 220px;
  aspect-ratio: auto;
}
.banner.banner-image-only::before { content: none; }

/* Image mode with text overlaid (kept for future use) */
.banner.banner-image:not(.banner-image-only)::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0.6) 100%);
  z-index: -1;
}
[data-theme="dark"] .banner.banner-image:not(.banner-image-only)::before {
  background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.8) 100%);
}

/* ------------ Sections ------------ */
.site-main > section { padding: 48px 0; border-bottom: 1px solid var(--border); }
.site-main > section:last-child { border-bottom: none; }
.section-title {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 24px;
}

/* ------------ Post list (minimal) ------------ */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { padding-left: 8px; }
.post-item:hover .post-title { color: var(--accent); }
.post-date {
  font-size: 13px; color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}
.post-title { font-size: 16px; font-weight: 500; transition: color 0.15s; }
.post-tag {
  font-size: 11px; color: var(--text-subtle);
  padding: 2px 8px; background: var(--tag-bg);
  border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ------------ Featured cards ------------ */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card {
  padding: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
  display: block;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(234,88,12,0.08);
}
.card-tag {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  padding: 2px 8px;
  background: var(--accent-bg);
  border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.card h3 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; line-height: 1.3; color: var(--text); }
.card p { font-size: 14.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 12px; }
.card-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-subtle); }
.card-meta .dot { width: 3px; height: 3px; background: var(--text-subtle); border-radius: 50%; }

/* ------------ Sidebar widgets ------------ */
.widget {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.widget-title, .widgettitle {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-subtle);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 6px;
}

.widget-profile { text-align: center; padding: 24px 20px; }
.widget-profile img.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 0 auto 14px;
  border: 2px solid var(--border);
  padding: 2px;
  background: var(--bg);
}
.widget-profile .profile-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.widget-profile .profile-tag { font-size: 12.5px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.widget-profile .profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.widget-profile .stat-num { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.widget-profile .stat-label { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }

.widget ul { list-style: none; padding: 0; margin: 0; }
.widget ul li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  flex: 1;
  transition: color 0.15s;
}
.widget ul li a:hover { color: var(--accent); }
.widget ul li .post-count,
.widget ul li .count {
  font-size: 11px; color: var(--text-subtle);
  background: var(--bg);
  padding: 2px 8px; border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

/* Popular posts widget */
.widget-popular ul li {
  display: flex; gap: 12px;
  border-bottom: 1px dashed var(--border);
  padding: 10px 0;
}
.widget-popular ul li a { display: block; }
.widget-popular .popular-num {
  font-size: 20px; font-weight: 800;
  color: var(--text-subtle);
  line-height: 1; min-width: 22px;
  font-variant-numeric: tabular-nums;
}
.widget-popular ul li:nth-child(1) .popular-num { color: var(--accent); }
.widget-popular .popular-title { font-size: 13.5px; line-height: 1.4; font-weight: 500; }
.widget-popular .popular-meta { font-size: 11px; color: var(--text-subtle); margin-top: 3px; }

/* Tag cloud widget */
.tagcloud, .widget .tag-cloud {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.tagcloud a, .widget .tag-cloud a {
  font-size: 12px !important;
  padding: 4px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.4;
}
.tagcloud a:hover, .widget .tag-cloud a:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Newsletter widget */
.widget-newsletter { text-align: center; padding: 22px 20px; }
.widget-newsletter .nl-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.widget-newsletter .nl-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; margin-bottom: 12px; }
.widget-newsletter input {
  width: 100%; padding: 8px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text);
  font-size: 13px; margin-bottom: 8px; font-family: inherit;
}
.widget-newsletter input:focus { outline: none; border-color: var(--accent); }
.widget-newsletter button {
  width: 100%; padding: 8px 12px;
  background: var(--accent); color: white;
  border: none; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
  font-family: inherit;
}
.widget-newsletter button:hover { background: var(--accent-hover); }

/* ------------ Friends strip ------------ */
.friends-strip {
  max-width: 1140px;
  margin: 40px auto 0;
  padding: 24px 32px;
  border-top: 1px solid var(--border);
}
.friends-strip-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.friends-strip-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-subtle);
}
.friends-strip-more { font-size: 12px; color: var(--text-subtle); text-decoration: none; }
.friends-strip-more:hover { color: var(--accent); }
.friends-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}
.friend-cell {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px; font-weight: 500;
  text-align: center;
  transition: all 0.15s;
  min-width: 0;
}
.friend-cell:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234,88,12,0.1);
}
.friend-cell-icon { font-size: 20px; line-height: 1; }
.friend-cell-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* WP nav menu fallback for friends grid */
.friends-grid-menu { list-style: none; padding: 0; margin: 0; display: contents; }
.friends-grid-menu > li { display: contents; }
.friends-grid-menu > li > a {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 12px; font-weight: 500;
  text-align: center;
  transition: all 0.15s;
  min-width: 0;
}
.friends-grid-menu > li > a:hover {
  border-color: var(--accent); color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(234,88,12,0.1);
}

/* ------------ Single post ------------ */
.single-layout {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 64px;
}
.single-main { min-width: 0; padding: 40px 0 80px; }
.breadcrumb { font-size: 12.5px; color: var(--text-subtle); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-subtle); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { margin: 0 6px; }

.entry-title {
  font-size: 40px; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.15;
  margin-bottom: 16px;
}
.entry-meta {
  display: flex; gap: 16px;
  font-size: 13px; color: var(--text-subtle);
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  flex-wrap: wrap;
}
.entry-meta .dot { width: 3px; height: 3px; background: var(--text-subtle); border-radius: 50%; }
.entry-meta .badge {
  display: flex; align-items: center; gap: 4px;
  padding: 2px 8px; background: var(--accent-bg); color: var(--accent);
  border-radius: 4px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.entry-meta a { color: var(--text-subtle); text-decoration: none; }
.entry-meta a:hover { color: var(--accent); }

/* Content card */
.entry-content {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  padding: 40px 48px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
}
[data-theme="dark"] .entry-content {
  box-shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 12px rgba(0,0,0,0.2);
}

.entry-content h2 {
  font-size: 26px; font-weight: 700;
  letter-spacing: -0.01em;
  margin: 40px 0 16px;
  scroll-margin-top: 72px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}
.entry-content h2:first-child { margin-top: 0; }
.entry-content h3 { font-size: 20px; font-weight: 700; margin: 32px 0 12px; scroll-margin-top: 72px; }
.entry-content h4 { font-size: 16px; font-weight: 700; margin: 24px 0 8px; scroll-margin-top: 72px; }
.entry-content p { margin: 12px 0; line-height: 1.75; }
.entry-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(234,88,12,0.3);
  transition: border-color 0.15s;
}
.entry-content a:hover { border-bottom-color: var(--accent); }
.entry-content strong { font-weight: 700; color: var(--text); }
.entry-content ul, .entry-content ol { padding-left: 24px; margin: 12px 0; }
.entry-content li { margin: 6px 0; line-height: 1.7; }
.entry-content code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
}
.entry-content pre {
  margin: 16px 0;
  padding: 16px 20px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.6;
  position: relative;
}
.entry-content pre code {
  background: none; border: none; padding: 0;
  color: var(--text); font-size: inherit;
}
.entry-content blockquote {
  margin: 16px 0;
  padding: 12px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
  font-style: italic;
}
.entry-content blockquote p { margin: 4px 0; }
.entry-content img { border-radius: 8px; margin: 16px 0; }
.entry-content table {
  width: 100%; border-collapse: collapse;
  margin: 16px 0; font-size: 14px;
}
.entry-content th, .entry-content td {
  border: 1px solid var(--border);
  padding: 10px 14px; text-align: left;
}
.entry-content th { background: var(--bg-elevated); font-weight: 700; }

.entry-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.entry-footer-nav a {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.entry-footer-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.entry-footer-nav .nav-next { text-align: right; }
.entry-footer-nav .nav-label { font-size: 12px; color: var(--text-subtle); margin-bottom: 4px; }
.entry-footer-nav .nav-title { font-weight: 600; font-size: 14.5px; }

/* TOC */
.entry-toc {
  position: sticky;
  top: 78px;
  height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 40px 0;
  font-size: 13px;
}
.toc-title {
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 12px;
  padding-left: 12px;
}
.entry-toc ul { list-style: none; padding: 0; margin: 0; }
.entry-toc li a {
  display: block;
  padding: 4px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid var(--border);
  line-height: 1.5;
  transition: all 0.15s;
}
.entry-toc li a:hover { color: var(--text); border-left-color: var(--text-subtle); }
.entry-toc li a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.entry-toc li.toc-h3 a { padding-left: 24px; font-size: 12.5px; }
.entry-toc li.toc-h4 a { padding-left: 36px; font-size: 12px; }

/* ------------ Comments ------------ */
.comments-area {
  margin-top: 40px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg-elevated);
}
.comments-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.comment-list { list-style: none; padding: 0; }
.comment {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-meta { font-size: 13px; color: var(--text-subtle); margin-bottom: 8px; }
.comment-meta a { color: var(--text); text-decoration: none; font-weight: 600; }
.comment-body { font-size: 14.5px; }
.comment-respond textarea,
.comment-respond input {
  width: 100%; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: inherit; font-size: 14px;
  margin-bottom: 10px;
}
.comment-respond textarea { min-height: 100px; resize: vertical; }
.comment-respond .submit,
.comment-respond input[type="submit"] {
  width: auto;
  padding: 8px 20px;
  background: var(--accent); color: white;
  border: none; border-radius: 8px;
  font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.comment-respond .submit:hover,
.comment-respond input[type="submit"]:hover { background: var(--accent-hover); }

/* ------------ Pagination ------------ */
.pagination, .nav-links {
  display: flex; justify-content: center;
  gap: 6px; margin-top: 32px;
}
.pagination a, .pagination span,
.nav-links a, .nav-links span {
  display: flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: all 0.15s;
}
.pagination a:hover, .nav-links a:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pagination .current, .nav-links .current {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ------------ Search / 404 ------------ */
.page-header {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-title { font-size: 36px; font-weight: 800; letter-spacing: -0.02em; }
.page-description { font-size: 15px; color: var(--text-muted); margin-top: 8px; }

.error-404 {
  text-align: center;
  padding: 80px 24px;
}
.error-404 h1 {
  font-size: 96px;
  font-weight: 900;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--accent), #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}
.error-404 p { font-size: 17px; color: var(--text-muted); margin-bottom: 24px; }
.error-404 a.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--accent);
  color: white;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.15s;
}
.error-404 a.btn:hover { background: var(--accent-hover); transform: translateY(-2px); }

/* ------------ Footer ------------ */
.site-footer {
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 32px 60px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-subtle);
  flex-wrap: wrap;
  gap: 12px;
}
.site-footer a { color: var(--text-subtle); text-decoration: none; transition: color 0.15s; }
.site-footer a:hover { color: var(--accent); }
.site-footer-links { display: flex; gap: 20px; }

/* ------------ Responsive ------------ */
@media (max-width: 1024px) {
  .single-layout { grid-template-columns: 1fr; gap: 0; }
  .entry-toc { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  aside.sidebar { position: static; padding: 0 0 40px; order: 2; }
  main.site-main { order: 1; }
  .friends-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .site-header-inner, .layout, .single-layout, .friends-strip, .site-footer, .banner-strip {
    padding-left: 20px; padding-right: 20px;
  }
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .entry-title { font-size: 30px; }
  .entry-content { padding: 24px 20px; border-radius: 10px; }
  .post-item { grid-template-columns: 1fr; gap: 4px; }
  .post-date { font-size: 12px; }
  .site-nav ul { display: none; }
  .site-logo-text .main { font-size: 14px; }
  .banner { grid-template-columns: 1fr; padding: 22px 20px; gap: 16px; }
  .banner-title { font-size: 18px; }
  .banner-cta { justify-self: start; }
  .friends-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .site-main > section { padding: 32px 0; }
}

/* ------------ Promo grid (4 square tiles) ------------ */
.site-main > section.featured-section {
  padding: 24px 0 16px;
}
.site-main > section.promo-section {
  padding: 8px 0 16px;
  margin: 0;
  border-bottom: none;
}
.promo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.promo-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
a.promo-item:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
.promo-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--bg-elevated, #f6f7f7);
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
}
.promo-img.promo-img-empty {
  background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
}
[data-theme="dark"] .promo-img.promo-img-empty {
  background: linear-gradient(135deg, #431407 0%, #7c2d12 100%);
}
.promo-title {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary, #4b5563);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0 2px;
  min-width: 0;
  word-break: break-word;
}
a.promo-item:hover .promo-title { color: var(--brand, #ea580c); }
@media (max-width: 720px) {
  .promo-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ------------ WordPress core alignment ------------ */
.alignleft { float: left; margin: 0 20px 20px 0; }
.alignright { float: right; margin: 0 0 20px 20px; }
.aligncenter { display: block; margin: 20px auto; }
.wp-caption {
  max-width: 100%;
  margin: 20px 0;
  text-align: center;
}
.wp-caption img { border-radius: 8px; }
.wp-caption-text { font-size: 13px; color: var(--text-subtle); margin-top: 8px; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px; width: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  position: absolute !important;
  word-wrap: normal !important;
}
.sticky { }
.gallery-caption { }
.bypostauthor { }

/* ========== Ruyi Analytics 在线人数（footer 内嵌） ========== */
.site-footer-online {
  width: fit-content;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted, #94a3b8);
  opacity: .75;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}
.site-footer-online .ruyi-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 4px rgba(16,185,129,0.5);
  display: inline-block;
}
.site-footer-online b {
  color: inherit;
  font-weight: 600;
  margin: 0 1px;
}
@media (prefers-color-scheme: dark) {
  .site-footer-online { color: #64748b; }
}
html[data-theme="dark"] .site-footer-online { color: #64748b; }
