/* ==========================================================================
   云深资源网 - Modern Design System (Zero Layui / Zero Bootstrap)
   ========================================================================== */

:root {
  --bg-body: #f6f8fb;
  --bg-surface: #ffffff;
  --bg-surface-2: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.82);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --border-subtle: #f1f5f9;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-text: #1d4ed8;

  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.16);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --nav-height: 64px;
  --container-max: 1200px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-body: #0b1120;
  --bg-surface: #111827;
  --bg-surface-2: #1e293b;
  --bg-glass: rgba(17, 24, 39, 0.82);
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: #1e293b;
  --border-subtle: #172033;

  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-text: #93c5fd;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

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

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

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

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  color: var(--text-primary);
}

.brand-logo img {
  height: 32px;
  width: 32px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.brand-logo:hover img {
  transform: scale(1.06);
}

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

.nav-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-surface-2);
}

.nav-links a.active {
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 600;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-pill {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 0 12px;
  height: 38px;
  width: 240px;
  transition: all var(--transition);
}

.search-pill:focus-within {
  background: var(--bg-surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  width: 280px;
}

.search-pill input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
  width: 100%;
  font-size: 13.5px;
  padding: 0 8px 0 4px;
}

.search-pill input::placeholder {
  color: var(--text-muted);
}

.search-kbd {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 1px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}

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

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
  background: var(--bg-surface-2);
}

.mobile-only {
  display: none;
}

/* Mobile Drawer & Search Sheet */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(300px, 82vw);
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  z-index: 201;
  padding: 20px;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--text-secondary);
}

.mobile-nav-list a.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

.mobile-search-sheet {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 20px;
  z-index: 99;
  box-shadow: var(--shadow-md);
  display: none;
}

.mobile-search-sheet.open {
  display: block;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Main Layout Grid
   ========================================================================== */
.main-content {
  flex: 1;
  padding: 24px 0 48px;
}

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

.layout-grid > * {
  min-width: 0;
}

.layout-single {
  max-width: 960px;
  margin: 0 auto;
}

/* Cards & Surfaces */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 20px;
}

/* Section Header */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 2px 2px 12px;
  border-bottom: 1px solid var(--border-color);
}

.section-bar h1, .section-bar h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.section-bar .dot {
  width: 4px;
  height: 18px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--accent), #4f46e5);
  flex-shrink: 0;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.section-link:hover {
  color: var(--accent-text);
  background: var(--accent-soft);
}

.section-link .arrow {
  transition: transform var(--transition);
}

.section-link:hover .arrow {
  transform: translateX(3px);
}

/* ==========================================================================
   Post List Cards
   ========================================================================== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.35);
}

.post-cover {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface-2);
  aspect-ratio: 16 / 10;
}

.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.3s ease;
}

.post-card:hover .post-cover img {
  transform: scale(1.04);
}

.post-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 2px 4px 2px 0;
}

.post-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card:hover .post-title {
  color: var(--accent);
}

.post-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: auto;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-new {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--danger-soft);
  color: var(--danger);
  margin-left: 4px;
}

.cate-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 500;
  font-size: 12px;
}

.cate-pill:hover {
  background: var(--accent);
  color: #fff;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: calc(var(--nav-height) + 20px);
}

.hot-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hot-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
}

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

.hot-item:nth-child(1) .hot-rank { background: #fef3c7; color: #d97706; }
.hot-item:nth-child(2) .hot-rank { background: #e2e8f0; color: #475569; }
.hot-item:nth-child(3) .hot-rank { background: #ffedd5; color: #c2410c; }

[data-theme="dark"] .hot-item:nth-child(1) .hot-rank { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
[data-theme="dark"] .hot-item:nth-child(2) .hot-rank { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
[data-theme="dark"] .hot-item:nth-child(3) .hot-rank { background: rgba(249, 115, 22, 0.2); color: #fb923c; }

.hot-item-info {
  min-width: 0;
  flex: 1;
}

.hot-item-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hot-item-title:hover {
  color: var(--accent);
}

.hot-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  gap: 8px;
}

.pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.cate-grid .pill-link {
  justify-content: center;
  text-align: center;
  padding: 7px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.pill-link:hover, .pill-link.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: rgba(37, 99, 235, 0.25);
}

/* ==========================================================================
   Buttons & Inputs
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.2;
}

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: var(--radius-md); }
.btn-pill { border-radius: var(--radius-full); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background: var(--bg-surface-2);
  border-color: var(--text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-surface-2);
  color: var(--text-primary);
}

.input, .textarea, .select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.textarea {
  resize: vertical;
  min-height: 96px;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition);
}

.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.page-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-ellipsis {
  padding: 0 6px;
  color: var(--text-muted);
}

/* ==========================================================================
   Article Detail & Prose
   ========================================================================== */
.breadcrumbs {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  min-width: 0;
  overflow: hidden;
}

.breadcrumbs a,
.breadcrumbs span:not(.breadcrumb-current) {
  flex-shrink: 0;
}

.breadcrumbs .breadcrumb-current {
  color: var(--text-secondary);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.article-header {
  padding: 20px 26px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.article-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.38;
  margin: 0 0 12px;
  letter-spacing: -0.015em;
}

.article-footer {
  padding: 14px 26px 18px;
  border-top: 1px solid var(--border-subtle);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

.prose {
  padding: 16px 26px 24px;
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-primary);
  word-break: break-word;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

.prose > *:first-child,
.prose > p:first-child:has(> br:only-child) + * {
  margin-top: 0 !important;
}

.prose p:empty,
.prose p:has(> br:only-child) {
  display: none;
}

.prose h1, .prose h2, .prose h3, .prose h4 {
  line-height: 1.38;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.prose h1 {
  font-size: 1.32em;
  margin: 1.3em 0 0.55em;
}

.prose h2 {
  font-size: 1.16em;
  margin: 1.25em 0 0.55em;
  padding-left: 11px;
  border-left: 3.5px solid var(--accent);
}

.prose h3 {
  font-size: 1.05em;
  margin: 1.1em 0 0.45em;
}

.prose h4 {
  font-size: 1em;
  margin: 0.95em 0 0.4em;
}

.prose p {
  margin: 0 0 0.78em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose strong, .prose b {
  font-weight: 650;
  color: var(--text-primary);
}

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, 0.35);
  transition: border-color var(--transition), color var(--transition);
}

.prose a:hover {
  border-bottom-color: var(--accent);
}

.prose ul, .prose ol {
  margin: 0.45em 0 0.85em;
  padding-left: 1.45em;
}

.prose li {
  margin: 0.28em 0;
}

.prose li::marker {
  color: var(--accent);
  font-weight: 600;
}

.prose img {
  border-radius: 10px;
  border: 1px solid var(--border-color);
  margin: 14px auto;
  height: auto;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.prose img:hover {
  box-shadow: var(--shadow-md);
}

.prose hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 18px 0;
}

.prose blockquote {
  margin: 12px 0;
  padding: 10px 15px;
  border-left: 3px solid var(--accent);
  background: var(--bg-surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: 14.5px;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 14px 16px;
  margin: 12px 0;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}

.prose code {
  background: var(--bg-surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
  color: var(--accent-text);
}

.prose pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13.5px;
}

.prose th, .prose td {
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  text-align: left;
}

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

.prose tr:nth-child(even) td {
  background: var(--border-subtle);
}

/* ==========================================================================
   Comments
   ========================================================================== */
.comment-section {
  margin-top: 24px;
}

.reply-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13.5px;
}

.reply-banner.active {
  display: flex;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.comment-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.comment-item:last-child { border-bottom: none; }

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface-2);
}

.comment-body { flex: 1; min-width: 0; }

.comment-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-author { font-weight: 600; font-size: 14px; }
.comment-time { font-size: 12px; color: var(--text-muted); }

.comment-text {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 8px;
  word-break: break-word;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.comment-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-secondary);
}
.comment-reply-btn:hover { color: var(--accent); }

.comment-children {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-child {
  display: flex;
  gap: 10px;
}

.comment-child .comment-avatar {
  width: 30px;
  height: 30px;
}

/* ==========================================================================
   Wish Pool & Status Badges
   ========================================================================== */
.wish-hero {
  background: linear-gradient(135deg, var(--accent-soft), rgba(16, 185, 129, 0.08));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

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

.wish-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
}

.wish-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(37, 99, 235, 0.35);
}

.wish-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}

.status-0 { background: var(--bg-surface-2); color: var(--text-muted); }
.status-1 { background: var(--accent-soft); color: var(--accent-text); }
.status-2 { background: var(--warning-soft); color: #d97706; }
.status-3 { background: var(--success-soft); color: #059669; }
.status-4 { background: var(--danger-soft); color: var(--danger); }

[data-theme="dark"] .status-2 { color: #fbbf24; }
[data-theme="dark"] .status-3 { color: #34d399; }

.wish-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wish-card-desc {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.55;
  height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.wish-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-muted);
}

.vote-count {
  color: #f97316;
  font-weight: 700;
}

/* Segmented Radio Pills */
.radio-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill input {
  display: none;
}

.radio-pill span {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.radio-pill input:checked + span {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ==========================================================================
   Modal, Lightbox, Toast
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-dialog-lg {
  max-width: 900px;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.modal-body {
  padding: 22px;
}

.form-field {
  margin-bottom: 16px;
}

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

/* Image Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
  color: var(--bg-surface);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { background: #059669; color: #fff; }
.toast-error { background: #dc2626; color: #fff; }
.toast-warning { background: #d97706; color: #fff; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Empty & Error States */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-state img {
  width: 180px;
  margin: 0 auto 18px;
  opacity: 0.9;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--text-muted);
  font-size: 14px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 22px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

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

/* Back to Top */
.back-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  box-shadow: var(--shadow-md);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  transition: all var(--transition);
}

.back-top-btn.visible {
  display: inline-flex;
}

.back-top-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 992px) {
  .layout-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: static;
  }
  .wish-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: inline-flex !important; }
  .container { padding: 0 14px; }

  .post-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .wish-hero {
    flex-direction: column;
    align-items: stretch;
    padding: 18px 20px;
  }
  .wish-hero .btn {
    width: 100%;
  }
  .wish-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .form-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .article-header, .prose, .article-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .article-header {
    padding-top: 16px;
    padding-bottom: 12px;
  }
  .prose {
    padding-top: 14px;
    padding-bottom: 20px;
    font-size: 14.5px;
    line-height: 1.7;
  }
  .main-content {
    padding-top: 14px;
  }
  .article-title {
    font-size: 19px;
  }
}
