/* ==============================================
   Minirum — Warm Editorial Design
   A forum that reads like a beautifully crafted
   indie magazine. Warm earth tones, refined
   typography, tactile surfaces, subtle motion.
   ============================================== */

/* ==============================================
   Grain Texture Overlay (applied to body)
   ============================================== */

html::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ==============================================
   Theme System — 5 Warm Color Schemes
   ============================================== */

/* Warm Light — Terracotta & Stone (default) */
:root, .theme-light, [data-theme="light"] {
  --primary: #c73a2e;
  --primary-hover: #a82d22;
  --primary-subtle: #fdf0ee;
  --primary-dark: #a82d22;
  --primary-ring: rgba(199, 58, 46, 0.2);
  --accent: #d4724a;
  --accent-subtle: #fdf3ee;

  --bg: #fcf9f7;
  --bg-card: #ffffff;
  --bg-elevated: #f5f1ed;
  --bg-subtle: #f8f4f0;
  --bg-input: #fcf9f7;

  --text: #241f1c;
  --text-secondary: #7d6e64;
  --text-muted: #b09f93;
  --text-on-primary: #ffffff;

  --border: #e5ddd6;
  --border-light: #efe9e3;
  --border-focus: #c73a2e;

  --highlight: #b9863a;
  --highlight-bg: #fdf6ed;
  --highlight-border: #e8c88a;

  --danger: #c73a2e;
  --danger-subtle: #fdf0ee;
  --success: #3a8c5e;
  --success-subtle: #edf7f1;
  --warning: #b9863a;
  --warning-subtle: #fdf6ed;

  --shadow-sm: 0 1px 3px rgba(36, 31, 28, 0.04), 0 1px 2px rgba(36, 31, 28, 0.04);
  --shadow-md: 0 4px 12px rgba(36, 31, 28, 0.05), 0 2px 4px rgba(36, 31, 28, 0.04);
  --shadow-lg: 0 12px 32px rgba(36, 31, 28, 0.06), 0 4px 12px rgba(36, 31, 28, 0.04);
  --shadow-xl: 0 24px 48px rgba(36, 31, 28, 0.08);
  --shadow-focus: 0 0 0 3px var(--primary-ring);

  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-sans: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', Consolas, monospace;

  --transition: 250ms cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 150ms cubic-bezier(0.22, 1, 0.36, 1);
  --bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Warm Dark — Charcoal & Ember */
.theme-dark {
  --primary: #e8835a;
  --primary-hover: #f09a75;
  --primary-subtle: #2d1e1a;
  --primary-ring: rgba(232, 131, 90, 0.25);
  --accent: #d4724a;
  --accent-subtle: #2d1e1a;

  --bg: #181614;
  --bg-card: #211e1b;
  --bg-elevated: #2a2622;
  --bg-subtle: #211e1b;
  --bg-input: #181614;

  --text: #e6e0da;
  --text-secondary: #9c8d81;
  --text-muted: #6b5f56;
  --text-on-primary: #ffffff;

  --border: #332e29;
  --border-light: #282421;
  --border-focus: #e8835a;

  --highlight: #e8c88a;
  --highlight-bg: #2d261a;
  --highlight-border: #8a6e3a;

  --danger: #e8835a;
  --danger-subtle: #2d1e1a;
  --success: #5ab883;
  --success-subtle: #1a2d22;
  --warning: #e8c88a;
  --warning-subtle: #2d261a;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.35);
  --shadow-focus: 0 0 0 3px var(--primary-ring);
}

/* Sakura — Rose & Powder */
.theme-sakura {
  --primary: #c4627a;
  --primary-hover: #b04e66;
  --primary-subtle: #fdf0f3;
  --primary-ring: rgba(196, 98, 122, 0.2);
  --accent: #d4879a;
  --accent-subtle: #fdf0f3;

  --bg: #fdf8f7;
  --bg-card: #ffffff;
  --bg-elevated: #f8f0f0;
  --bg-subtle: #faf4f3;
  --bg-input: #fdf8f7;

  --text: #2d2426;
  --text-secondary: #8a7378;
  --text-muted: #b8a3a8;
  --text-on-primary: #ffffff;

  --border: #ecdbe0;
  --border-light: #f3e8eb;
  --border-focus: #c4627a;

  --highlight: #c49a3a;
  --highlight-bg: #fdf8ed;
  --highlight-border: #e8d48a;

  --danger: #c44a5a;
  --danger-subtle: #fdf0f2;
  --success: #5a8c72;
  --success-subtle: #edf7f1;
  --warning: #c49a3a;
  --warning-subtle: #fdf8ed;

  --shadow-sm: 0 1px 3px rgba(45, 36, 38, 0.04), 0 1px 2px rgba(45, 36, 38, 0.04);
  --shadow-md: 0 4px 12px rgba(45, 36, 38, 0.05), 0 2px 4px rgba(45, 36, 38, 0.04);
  --shadow-lg: 0 12px 32px rgba(45, 36, 38, 0.06), 0 4px 12px rgba(45, 36, 38, 0.04);
  --shadow-xl: 0 24px 48px rgba(45, 36, 38, 0.08);
  --shadow-focus: 0 0 0 3px var(--primary-ring);
}

/* Forest — Sage & Earth */
.theme-forest {
  --primary: #3a7a5a;
  --primary-hover: #2e6648;
  --primary-subtle: #eef6f1;
  --primary-ring: rgba(58, 122, 90, 0.2);
  --accent: #5a9a72;
  --accent-subtle: #eef6f1;

  --bg: #f8faf7;
  --bg-card: #ffffff;
  --bg-elevated: #f0f5f0;
  --bg-subtle: #f4f8f4;
  --bg-input: #f8faf7;

  --text: #1c2820;
  --text-secondary: #5a7864;
  --text-muted: #8aa894;
  --text-on-primary: #ffffff;

  --border: #dce8de;
  --border-light: #e8f0e8;
  --border-focus: #3a7a5a;

  --highlight: #a08a3a;
  --highlight-bg: #f8f8ed;
  --highlight-border: #d4c87a;

  --danger: #c44a3a;
  --danger-subtle: #fdf0ee;
  --success: #3a7a5a;
  --success-subtle: #eef6f1;
  --warning: #a08a3a;
  --warning-subtle: #f8f8ed;

  --shadow-sm: 0 1px 3px rgba(28, 40, 32, 0.04), 0 1px 2px rgba(28, 40, 32, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 40, 32, 0.05), 0 2px 4px rgba(28, 40, 32, 0.04);
  --shadow-lg: 0 12px 32px rgba(28, 40, 32, 0.06), 0 4px 12px rgba(28, 40, 32, 0.04);
  --shadow-xl: 0 24px 48px rgba(28, 40, 32, 0.08);
  --shadow-focus: 0 0 0 3px var(--primary-ring);
}

/* Ocean — Teal & Sand */
.theme-ocean {
  --primary: #2a7a82;
  --primary-hover: #1e646a;
  --primary-subtle: #edf6f7;
  --primary-ring: rgba(42, 122, 130, 0.2);
  --accent: #4a9aa2;
  --accent-subtle: #edf6f7;

  --bg: #f7fafa;
  --bg-card: #ffffff;
  --bg-elevated: #eef5f5;
  --bg-subtle: #f4f8f8;
  --bg-input: #f7fafa;

  --text: #1c2828;
  --text-secondary: #548284;
  --text-muted: #82aaac;
  --text-on-primary: #ffffff;

  --border: #d0e2e2;
  --border-light: #e4f0f0;
  --border-focus: #2a7a82;

  --highlight: #a08a3a;
  --highlight-bg: #f8f8ed;
  --highlight-border: #d4c87a;

  --danger: #c44a4a;
  --danger-subtle: #fdf0ee;
  --success: #3a8a7a;
  --success-subtle: #edf7f4;
  --warning: #a08a3a;
  --warning-subtle: #f8f8ed;

  --shadow-sm: 0 1px 3px rgba(28, 40, 40, 0.04), 0 1px 2px rgba(28, 40, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 40, 40, 0.05), 0 2px 4px rgba(28, 40, 40, 0.04);
  --shadow-lg: 0 12px 32px rgba(28, 40, 40, 0.06), 0 4px 12px rgba(28, 40, 40, 0.04);
  --shadow-xl: 0 24px 48px rgba(28, 40, 40, 0.08);
  --shadow-focus: 0 0 0 3px var(--primary-ring);
}

/* ==============================================
   Base Reset
   ============================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

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

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

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

::selection {
  background: var(--primary);
  color: var(--text-on-primary);
}

/* ==============================================
   Scrollbar
   ============================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==============================================
   Layout
   ============================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  padding: 2rem 0;
  animation: fade-up 600ms var(--bounce) both;
}

.content {
  min-width: 0;
}

.main {
  min-height: calc(100vh - 200px);
}

/* ==============================================
   Header
   ============================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-card) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition), border-color var(--transition);
}

.header-content {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 1rem;
}

.logo {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
  position: relative;
  transition: color var(--transition-fast);
}

.logo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 400ms var(--bounce);
}

.logo:hover {
  color: var(--primary-hover);
}

.logo:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-desktop {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  position: relative;
  color: var(--text-secondary);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  opacity: 0;
  transform: scale(0.92);
  transition: all var(--transition-fast);
  z-index: -1;
}

.nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-link:hover::before {
  opacity: 1;
  transform: scale(1);
}

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

/* ==============================================
   Buttons
   ============================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.125rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.4;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-on-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--text-on-primary);
  text-decoration: none;
  box-shadow: var(--shadow-focus), 0 2px 6px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-focus);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-elevated);
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-outline:active {
  transform: translateY(0);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.btn-sm:hover {
  background: var(--border);
  color: var(--text);
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-sm.danger { color: var(--danger); }
.btn-sm.danger:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

.btn-sm.success { color: var(--success); }
.btn-sm.success:hover {
  background: var(--success-subtle);
  color: var(--success);
}

.btn-sm.warning { color: var(--warning); }
.btn-sm.warning:hover {
  background: var(--warning-subtle);
  color: var(--warning);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-warning:hover {
  background: #8a6e2a;
  color: #fff;
  transform: translateY(-1px);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  background: none;
  border: none;
  cursor: pointer;
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

.btn-icon:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}

.btn-icon.danger:hover {
  background: var(--danger-subtle);
  color: var(--danger);
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.btn-action:hover {
  background: var(--bg-elevated);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-action svg {
  width: 15px;
  height: 15px;
}

/* OAuth Buttons */
.btn-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  transition: all var(--transition-fast);
}

.btn-oauth:hover {
  background: var(--bg-elevated);
  border-color: var(--border-focus);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-oauth svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-oauth:active {
  transform: translateY(0);
}

.btn-github:hover {
  border-color: #24292e;
  background: #24292e;
  color: #fff;
}

.btn-github:hover svg {
  fill: #fff;
}

.btn-google:hover {
  border-color: #4285F4;
  background: #4285F4;
  color: #fff;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  transition: background var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: var(--bg-elevated);
}

/* ==============================================
   Navigation / Dropdown
   ============================================== */

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 0.5rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  animation: slide-down 300ms var(--bounce) both;
}

.nav-mobile .nav-link {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.nav-mobile.active {
  display: flex;
}

.user-menu {
  position: relative;
}

.user-menu::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}

.btn-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  border-radius: 99px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text);
  transition: all var(--transition-fast);
}

.btn-user:hover {
  border-color: var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem;
  z-index: 200;
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(0.95);
  transition: opacity 200ms var(--bounce), transform 200ms var(--bounce), visibility 200ms;
}

.user-menu:hover .dropdown,
.user-menu:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
}

.dropdown a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-xs);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition-fast);
}

.dropdown a:hover {
  background: var(--bg-elevated);
  text-decoration: none;
}

.dropdown hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 0.25rem 0;
}

/* ==============================================
   Sidebar
   ============================================== */

.sidebar {
  position: sticky;
  top: 88px;
  height: fit-content;
}

/* Profile Sidebar Card */
.profile-sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.profile-sidebar-avatar {
  margin-bottom: 1rem;
}

.profile-sidebar-avatar .avatar-large {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  margin: 0 auto;
}

.profile-sidebar-username {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.profile-sidebar-bio {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.profile-sidebar-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.ps-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.ps-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.ps-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-sidebar-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.profile-sidebar-meta svg {
  opacity: 0.5;
  flex-shrink: 0;
}

/* Content Header */
.content-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-light);
}

.content-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.content-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Dashboard Sidebar Navigation */
.dashboard-sidebar-nav {
  list-style: none;
}

.dashboard-sidebar-nav li {
  margin-bottom: 0.15rem;
}

.dashboard-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.dashboard-nav-link:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}

.dashboard-nav-link.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.dashboard-nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.dashboard-nav-link .badge {
  margin-left: auto;
}

.sidebar-section {
  margin-bottom: 1.75rem;
}

.sidebar-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
  font-weight: 700;
  padding-left: 0.75rem;
}

.category-list {
  list-style: none;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-item a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  flex: 1;
}

.category-item a:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}

.category-item.active a {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.category-item .category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.category-item a:hover .category-icon {
  color: var(--text);
}

.category-item.active .category-icon {
  color: var(--primary);
}

.category-item .category-icon svg {
  width: 100%;
  height: 100%;
}

.category-info h4 .category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-right: 0.35rem;
  vertical-align: middle;
  color: var(--primary);
}

.category-info h4 .category-icon svg {
  width: 100%;
  height: 100%;
}

.category-edit {
  width: 100%;
  padding: 1rem 0;
}

.category-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 1rem;
  width: 100%;
}

.category-edit .form-group {
  margin-bottom: 0.6rem;
}

.category-edit .form-label {
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}

.category-edit .icon-picker {
  grid-template-columns: repeat(auto-fill, minmax(1.8rem, 1fr));
  gap: 0.25rem;
  padding: 0.5rem;
}

.category-edit .icon-preview {
  width: 1.8rem;
  height: 1.8rem;
}

.category-edit .icon-preview svg {
  width: 0.9rem;
  height: 0.9rem;
}

.tip-list {
  list-style: none;
  padding: 0;
}

.tip-list li {
  padding: 0.35rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  position: relative;
  padding-left: 1.25rem;
  line-height: 1.5;
}

.tip-list li::before {
  content: '';
  position: absolute;
  left: 0.4rem;
  top: 0.65rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
}

/* ==============================================
   Post Cards
   ============================================== */

.pinned-posts {
  margin-bottom: 2rem;
}

.post-list {
  display: flex;
  flex-direction: column;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.625rem;
  transition: all var(--transition);
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}

.post-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.post-card.pinned {
  border-color: var(--highlight-border);
  background: var(--highlight-bg);
}

.post-header {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-category {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.post-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.post-title a {
  color: var(--text);
  transition: color var(--transition-fast);
}

.post-title a:hover {
  color: var(--primary);
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.post-author:hover {
  color: var(--primary);
  text-decoration: none;
}

.post-time {
  color: var(--text-muted);
}

.post-stats {
  display: flex;
  gap: 0.75rem;
  color: var(--text-muted);
  margin-left: auto;
}

.post-stats span {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.post-stats span svg {
  width: 0.85rem;
  height: 0.85rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title svg {
  width: 16px;
  height: 16px;
  color: var(--highlight);
}

.pinned-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--highlight);
  background: var(--highlight-bg);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

.post-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==============================================
   Post Detail
   ============================================== */

.post-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
  animation: fade-up 500ms var(--bounce) both;
}

.post-content {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.post-detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.post-detail-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0.75rem 0;
  color: var(--text);
  letter-spacing: -0.02em;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-body {
  line-height: 1.85;
  font-size: 1rem;
  color: var(--text);
}

.post-body p {
  margin-bottom: 1rem;
}

.post-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

/* Markdown Content */
.markdown-body {
  line-height: 1.85;
  color: var(--text);
  font-size: 1rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5, .markdown-body h6 {
  font-family: var(--font-serif);
  color: var(--text);
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.markdown-body h1 { font-size: 1.75rem; }
.markdown-body h2 { font-size: 1.4rem; }
.markdown-body h3 { font-size: 1.15rem; }

.markdown-body p {
  margin-bottom: 1rem;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-elevated);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  color: var(--primary);
}

.markdown-body pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.markdown-body blockquote {
  border-left: 3px solid var(--primary);
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.markdown-body ul, .markdown-body ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.35rem;
}

.markdown-body img {
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 2rem 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.markdown-body th, .markdown-body td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-light);
  text-align: left;
}

.markdown-body th {
  background: var(--bg-elevated);
  font-weight: 600;
}

/* ==============================================
   Replies
   ============================================== */

.replies-section {
  margin-top: 2.5rem;
}

.replies-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.replies-title span {
  color: var(--text-muted);
  font-weight: 400;
}

.reply-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.reply-form textarea {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-input);
  resize: vertical;
  transition: border-color var(--transition-fast);
  margin-bottom: 0.75rem;
}

.reply-form textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.reply-form textarea::placeholder {
  color: var(--text-muted);
}

.locked-notice {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.login-prompt {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.reply-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.625rem;
  transition: all var(--transition-fast);
}

.reply-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.reply-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.reply-author a {
  color: var(--text);
}

.reply-author a:hover {
  color: var(--primary);
}

.reply-time {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.8rem;
  margin-left: auto;
}

.reply-body {
  font-size: 0.925rem;
  line-height: 1.75;
  color: var(--text);
}

.reply-body p {
  margin-bottom: 0.5rem;
}

.reply-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.empty-replies {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-muted);
}

/* ==============================================
   User Profile
   ============================================== */

.user-profile {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
  animation: fade-up 500ms var(--bounce) both;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.profile-info {
  flex: 1;
}

.profile-username {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.profile-bio {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.profile-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat {
  position: relative;
}

.stat + .stat {
  padding-left: 1.5rem;
}

.stat + .stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.4;
}

.profile-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  margin-bottom: -2px;
}

.tab:hover {
  color: var(--text);
  text-decoration: none;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.user-posts .post-card {
  margin-bottom: 0.5rem;
}

/* ==============================================
   Item List (Dashboard / User)
   ============================================== */

.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.item-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

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

.item-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.item-title a {
  color: var(--text);
  transition: color var(--transition-fast);
}

.item-title a:hover {
  color: var(--primary);
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.item-meta svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 0.2rem;
}

.item-actions {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

/* ==============================================
   Empty State
   ============================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.empty-state .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==============================================
   Pagination
   ============================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.pagination .current {
  background: var(--primary);
  color: var(--text-on-primary);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.page-info {
  padding: 0 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==============================================
   Alerts
   ============================================== */

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin: 0.75rem 0;
  animation: slide-down 300ms var(--bounce) both;
}

.alert-success {
  background: var(--success-subtle);
  color: #2a6a4a;
}

.alert-error, .alert-danger {
  background: var(--danger-subtle);
  color: #9a2a1a;
}

.alert-warning {
  background: var(--warning-subtle);
  color: #8a6a2a;
}

.alert-info {
  background: var(--primary-subtle);
  color: #7a2a1e;
}

/* ==============================================
   Footer
   ============================================== */

.footer {
  border-top: 1px solid var(--border-light);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  margin-top: 5rem;
  font-size: 0.85rem;
  transition: border-color var(--transition);
}

/* ==============================================
   Forms
   ============================================== */

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-input);
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.form-group input:disabled {
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: not-allowed;
}

.hint, .form-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.form-hint svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

.form-hint span {
  flex: 1;
}

.form-hint .char-counter {
  flex: 0 0 auto;
  margin-left: auto;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.label-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.required {
  color: var(--danger);
  font-weight: 700;
}

.form-section {
  margin-bottom: 1.5rem;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.form-actions-left {
  margin-right: auto;
}

.form-actions-right {
  display: flex;
  gap: 0.75rem;
}

.form-input {
  width: 100%;
  padding: 0.6rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg-input);
  transition: all var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.icon-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.25rem, 1fr));
  gap: 0.4rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}

.icon-option {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.icon-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.icon-preview svg {
  width: 1.1rem;
  height: 1.1rem;
}

.icon-option input:checked + .icon-preview {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
}

.icon-option:hover .icon-preview {
  background: var(--bg-elevated);
  color: var(--text);
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-card h2, .form-card h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* ==============================================
   Login / Register
   ============================================== */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* ==============================================
   Auth Pages (Login / Register)
   ============================================== */

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  padding: 3rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-md);
  animation: fade-up 500ms var(--bounce) both;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.auth-form {
  margin-bottom: 1rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-footer {
  text-align: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.email-login-form .form-group,
.email-register-form .form-group {
  margin-bottom: 1rem;
}

.email-input-group {
  display: flex;
  gap: 0.5rem;
}

.email-input-group input {
  flex: 1;
}

.btn-send-code {
  flex-shrink: 0;
  white-space: nowrap;
}

.login-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==============================================
   Error Page
   ============================================== */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 250px);
  text-align: center;
  padding: 2rem;
  animation: fade-up 500ms var(--bounce) both;
}

.error-code {
  font-family: var(--font-serif);
  font-size: 7rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.04em;
}

.error-message {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* ==============================================
   New Post / Editor
   ============================================== */

.new-post-header {
  margin-bottom: 1.5rem;
  animation: fade-up 500ms var(--bounce) both;
}

.new-post-header h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.new-post-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.post-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.category-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}

.category-option {
  position: relative;
}

.category-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.category-option label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.category-option label:hover {
  border-color: var(--border);
  background: var(--bg-elevated);
}

.category-option input[type="radio"]:checked + label {
  border-color: var(--primary);
  background: var(--primary-subtle);
  color: var(--primary);
}

.title-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-input);
  transition: all var(--transition-fast);
}

.title-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.title-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.content-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.content-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.content-toolbar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  background: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.toolbar-btn:hover {
  background: var(--bg-card);
  color: var(--text);
}

.toolbar-btn svg {
  width: 18px;
  height: 18px;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 0.35rem;
}

.content-textarea {
  width: 100%;
  min-height: 280px;
  padding: 1rem;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg-input);
  resize: vertical;
}

.content-textarea:focus {
  outline: none;
}

.content-textarea::placeholder {
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.char-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.char-counter.warning { color: var(--warning); }
.char-counter.danger { color: var(--danger); }

/* ==============================================
   Settings Page
   ============================================== */

.settings-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 0;
  animation: fade-up 500ms var(--bounce) both;
}

.settings-page h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.settings-form {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.settings-section h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.avatar-preview {
  margin-bottom: 1rem;
}

/* ==============================================
   Dashboard
   ============================================== */

.dashboard-content {
  animation: fade-up 500ms var(--bounce) both;
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-muted);
}

.badge-admin {
  background: var(--danger-subtle);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.badge-pinned {
  background: var(--highlight-bg);
  color: var(--highlight);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.badge-locked {
  background: var(--danger-subtle);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.badge-active {
  background: var(--success-subtle);
  color: var(--success);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

.badge-banned {
  background: var(--danger-subtle);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--border);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 0.75rem;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon.blue {
  background: var(--primary-subtle);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--success-subtle);
  color: var(--success);
}

.stat-icon.purple {
  background: #ede9fe;
  color: #7c3aed;
}

.stat-icon.orange {
  background: var(--warning-subtle);
  color: var(--warning);
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
  letter-spacing: -0.03em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Activity Section */
.activity-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.activity-section h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: opacity var(--transition-fast);
}

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

.activity-item:hover .activity-content .title a {
  color: var(--primary);
}

.activity-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.activity-icon svg {
  width: 18px;
  height: 18px;
}

.activity-icon.post {
  background: var(--primary-subtle);
  color: var(--primary);
}

.activity-icon.reply {
  background: var(--success-subtle);
  color: var(--success);
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-content .title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.activity-content .title a {
  color: var(--text);
  transition: color var(--transition-fast);
}

.activity-content .meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==============================================
   Theme Selector
   ============================================== */

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.theme-option {
  position: relative;
}

.theme-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-option input[type="radio"]:checked + .theme-label {
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.theme-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 0.5rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-label:hover {
  border-color: var(--border);
  background: var(--bg-elevated);
}

.theme-preview {
  width: 100%;
  height: 48px;
  border-radius: var(--radius-xs);
}

.preview-light {
  background: linear-gradient(135deg, #fcf9f7 50%, #c73a2e 50%);
}

.preview-dark {
  background: linear-gradient(135deg, #181614 50%, #e8835a 50%);
}

.preview-sakura {
  background: linear-gradient(135deg, #fdf8f7 50%, #c4627a 50%);
}

.preview-forest {
  background: linear-gradient(135deg, #f8faf7 50%, #3a7a5a 50%);
}

.preview-ocean {
  background: linear-gradient(135deg, #f7fafa 50%, #2a7a82 50%);
}

.theme-name {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ==============================================
   Danger Zone
   ============================================== */

.danger-zone {
  border-color: #e8c8c0;
}

.danger-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-light);
}

.danger-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.danger-item-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.danger-item-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Form Switch */
.form-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.form-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border);
  border-radius: 99px;
  transition: var(--transition);
}

.switch-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  bottom: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-switch input:checked + .switch-slider {
  background: var(--primary);
}

.form-switch input:checked + .switch-slider::before {
  transform: translateX(22px);
}

/* ==============================================
   Notifications Page
   ============================================== */

.notifications-page {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 0;
  animation: fade-up 500ms var(--bounce) both;
}

.notifications-page .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.notifications-page .page-header h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.notification-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.notification-item.unread {
  background: var(--primary-subtle);
  border-color: rgba(199, 58, 46, 0.15);
}

.notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  flex-shrink: 0;
}

.notification-item.unread .notification-icon {
  background: var(--primary-subtle);
  color: var(--primary);
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.notification-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.notification-link {
  position: absolute;
  inset: 0;
}

/* ==============================================
   Admin Panel
   ============================================== */

.admin {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  animation: fade-up 500ms var(--bounce) both;
}

.admin-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: var(--danger-subtle);
  color: var(--danger);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-badge svg {
  width: 14px;
  height: 14px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.admin-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.admin-tab:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}

.admin-tab.active {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 600;
}

.admin-tab svg {
  width: 16px;
  height: 16px;
}

.admin-content {
  min-width: 0;
}

.admin-section {
  margin-bottom: 2rem;
}

.admin-section h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.admin-search {
  margin-bottom: 1rem;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: 0 0 0.3rem;
  max-width: 280px;
  transition: border-color var(--transition-fast);
}

.search-input-wrap:focus-within {
  border-color: var(--text-muted);
}

.search-input-wrap svg {
  width: 0.85rem;
  height: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.5;
}

.search-input {
  flex: 1;
  border: none;
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  outline: none;
  font-family: var(--font-sans);
}

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

.search-clear {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.6;
}

.search-clear:hover {
  opacity: 1;
  color: var(--text-secondary);
  text-decoration: none;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-card .category-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-card .category-item:last-child {
  border-bottom: none;
}

.category-info {
  flex: 1;
}

.category-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.category-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.category-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.category-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Admin Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
}

.admin-table td {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--bg-subtle);
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-info .username {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.user-info .user-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.actions-cell {
  display: flex;
  gap: 0.35rem;
}

.inline-form {
  display: inline;
}

/* ==============================================
   Avatars
   ============================================== */

.avatar-tiny {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-small {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.avatar-default {
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==============================================
   Utility / Misc
   ============================================== */

.likes-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.likes-section {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.likes-section h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.likes-section h3 svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  font-size: 0.6rem;
  font-weight: 800;
  background: var(--danger);
  color: var(--text-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--bg-card);
}

.category-header {
  margin-bottom: 1.5rem;
}

.category-header h1 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

.page-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  line-height: 1.6;
}

/* ==============================================
   Keyframe Animations
   ============================================== */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==============================================
   Responsive — Tablet
   ============================================== */

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  .nav-desktop {
    display: none;
  }

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

  .nav-mobile.active {
    display: flex;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .header-actions .btn {
    display: none;
  }

  .post-detail {
    padding: 1rem 0;
  }

  .post-content {
    padding: 1.25rem;
  }

  .post-detail-title {
    font-size: 1.5rem;
  }

  .post-detail-meta {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }

  .profile-stats {
    justify-content: center;
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0;
  }

  .admin-table {
    font-size: 0.8rem;
  }

  .category-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions-right {
    width: 100%;
  }

  .form-actions-right .btn {
    flex: 1;
  }

  .theme-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .post-card {
    padding: 1rem 1.25rem;
  }

  .post-meta {
    gap: 0.5rem;
  }

  .item-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .item-actions {
    align-self: flex-end;
  }

  .post-stats {
    margin-left: 0;
  }
}

/* ==============================================
   Responsive — Mobile
   ============================================== */

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .theme-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-selector {
    grid-template-columns: 1fr;
  }

  .post-detail-title {
    font-size: 1.25rem;
  }

  .auth-card {
    padding: 1.25rem;
  }

  .logo {
    font-size: 1.25rem;
  }
}

/* ==============================================
   Index Page — Homepage
   ============================================== */

.index-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
  animation: fadeIn 500ms ease-out both;
}

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

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.index-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Sidebar */
.index-sidebar {
  position: sticky;
  top: 2rem;
  animation: slideIn 600ms ease-out 100ms both;
}

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.index-sidebar .sidebar-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  letter-spacing: -0.01em;
}

.category-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-nav li {
  margin-bottom: 0.25rem;
}

.category-nav a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
}

.category-nav a:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.category-nav li.active a {
  background: var(--primary-subtle);
  color: var(--primary);
  font-weight: 500;
}

.category-nav .cat-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.category-nav .cat-icon svg {
  width: 16px;
  height: 16px;
}

.new-post-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
}

.new-post-btn:hover {
  color: white;
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.new-post-btn svg {
  width: 16px;
  height: 16px;
}

/* Main Content */
.index-content {
  min-width: 0;
}

/* Pinned Posts */
.pinned-section {
  margin-bottom: 2rem;
  animation: slideUp 600ms ease-out 200ms both;
}

.pinned-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary);
}

.pinned-header svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
}

.pinned-header h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pinned-grid {
  display: grid;
  gap: 0.75rem;
}

.pinned-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  transition: all var(--transition);
}

.pinned-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.pinned-card .card-category {
  display: inline-block;
  font-family: Tahoma, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.pinned-card .card-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 400;
  margin: 0 0 0.625rem;
  line-height: 1.3;
}

.pinned-card .card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

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

.pinned-card .card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pinned-card .card-author {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.pinned-card .card-author:hover {
  color: var(--primary);
}

.pinned-card .avatar-tiny {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.pinned-card .card-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.pinned-card .card-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pinned-card .card-stats svg {
  width: 13px;
  height: 13px;
  opacity: 0.5;
}

/* Post List */
.posts-section {
  animation: slideUp 600ms ease-out 300ms both;
}

.posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.posts-header h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
}

.index-content .post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  transition: all var(--transition);
  position: relative;
}

.index-content .post-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  border-radius: 0 2px 2px 0;
  transition: background var(--transition);
}

.index-content .post-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.index-content .post-card:hover::before {
  background: var(--accent);
}

.index-content .post-card .card-category {
  display: inline-block;
  font-family: Tahoma, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
  text-decoration: none;
  transition: all var(--transition);
}

.index-content .post-card .card-category:hover {
  background: var(--primary-subtle);
  color: var(--primary);
}

.index-content .post-card .card-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 400;
  margin: 0 0 0.625rem;
  line-height: 1.3;
}

.index-content .post-card .card-title a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.index-content .post-card .card-title a:hover {
  color: var(--primary);
}

.index-content .post-card .card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.index-content .post-card .card-author {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.index-content .post-card .card-author:hover {
  color: var(--primary);
}

.index-content .post-card .avatar-tiny {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.index-content .post-card .card-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.index-content .post-card .card-stats span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.index-content .post-card .card-stats svg {
  width: 13px;
  height: 13px;
  opacity: 0.5;
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.pagination-bar a {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: all var(--transition);
}

.pagination-bar a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination-bar .page-indicator {
  font-family: Tahoma, monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Empty State Card */
.empty-state-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state-card p {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

/* Index Responsive */
@media (max-width: 1024px) {
  .index-layout {
    grid-template-columns: 220px 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .index-layout {
    grid-template-columns: 1fr;
  }
  
  .index-sidebar {
    position: static;
  }
  
  .pinned-card .card-stats {
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .post-card .card-stats {
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .post-card .card-meta {
    flex-wrap: wrap;
  }
}

/* ==============================================
   Post Detail Page
   ============================================== */

.post-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
  animation: fadeIn 500ms ease-out both;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
}

/* Article */
.post-article {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  animation: slideUp 600ms ease-out 100ms both;
}

.post-article .post-header {
  padding: 2.5rem 2.5rem 1.75rem;
  border-bottom: 1px solid var(--border-light);
  display: block;
}

.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  font-family: Tahoma, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.post-breadcrumb a:hover {
  color: var(--primary);
}

.post-breadcrumb .separator {
  opacity: 0.4;
}

.post-article .post-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.post-article .post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: Tahoma, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 0.25rem 0.625rem;
  border-radius: 3px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.category-badge svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}

.category-badge:hover {
  background: var(--primary);
  color: white;
}

.post-author-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  transition: color var(--transition-fast);
}

.post-author-link:hover {
  color: var(--primary);
}

.post-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.post-date {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-stats-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.875rem 2.5rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: Tahoma, monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.stat-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

/* Post Content */
.post-article .post-body {
  padding: 2rem 2.5rem;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text);
}

.post-article .post-body p {
  margin-bottom: 1.25rem;
}

.post-article .post-body p:last-child {
  margin-bottom: 0;
}

.post-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 2.5rem;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.btn-action-post {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-sm);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.btn-action-post:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

.btn-action-post svg {
  width: 16px;
  height: 16px;
}

.btn-action-post.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-action-post.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-action-post.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-action-post.danger:hover {
  background: var(--danger-subtle);
}

/* 点赞状态样式 - 使用更高优先级 */
.btn-action-post.liked,
.btn-action-post.primary.liked {
  background: var(--primary-dark, #c53d3d) !important;
  border-color: var(--primary-dark, #c53d3d) !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.btn-action-post.liked .like-icon-outline,
.btn-action-post.primary.liked .like-icon-outline {
  display: none !important;
}

.btn-action-post.liked .like-icon-filled,
.btn-action-post.primary.liked .like-icon-filled {
  display: inline-block !important;
}

.btn-action-post.liked:hover,
.btn-action-post.primary.liked:hover {
  background: var(--primary-dark, #c53d3d) !important;
  border-color: var(--primary-dark, #c53d3d) !important;
}

/* Sidebar */
.post-sidebar {
  position: sticky;
  top: 2rem;
  animation: slideIn 600ms ease-out 200ms both;
}

.author-card {
  text-align: center;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  object-fit: cover;
  border: 2px solid var(--border-light);
}

.author-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 0.375rem;
}

.author-name a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.author-name a:hover {
  color: var(--primary);
}

.author-bio {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.author-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
}

.author-stat {
  text-align: center;
}

.author-stat .stat-value {
  font-family: Tahoma, monospace;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.author-stat .stat-label {
  font-family: Tahoma, monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.author-joined {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}

.author-joined svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* Replies Section */
.post-page .replies-section {
  margin-top: 2rem;
  animation: slideUp 600ms ease-out 300ms both;
}

.replies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary);
}

.replies-header h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--text);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.reply-count {
  font-family: Tahoma, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 0.25rem 0.625rem;
  border-radius: 3px;
}

.reply-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.reply-form-card textarea {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-input);
  resize: vertical;
  transition: all var(--transition-fast);
  margin-bottom: 1rem;
}

.reply-form-card textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.reply-form-card textarea::placeholder {
  color: var(--text-muted);
}

.login-prompt-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-prompt-card p {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0;
}

.login-prompt-card a {
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.login-prompt-card a:hover {
  text-decoration: underline;
}

.replies-list {
  display: grid;
  gap: 1rem;
}

.reply-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--transition-fast);
}

.reply-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.reply-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.post-page .reply-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.post-page .reply-author:hover {
  color: var(--primary);
}

.post-page .reply-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.post-page .reply-author-name {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  font-weight: 500;
}

.post-page .reply-time {
  font-family: Tahoma, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-page .reply-content {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1rem;
}

.post-page .reply-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-xs);
  font-family: Tahoma, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-like:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-subtle);
}

/* 评论点赞状态样式 - 使用更高优先级 */
.btn-like.liked {
  border-color: var(--primary-dark, #c53d3d) !important;
  color: var(--primary-dark, #c53d3d) !important;
  background: rgba(220, 38, 38, 0.1) !important;
}

.btn-like.liked .like-icon-outline {
  display: none !important;
}

.btn-like.liked .like-icon-filled {
  display: inline-block !important;
}

.btn-like svg {
  width: 14px;
  height: 14px;
}

/* Post Detail Responsive */
@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  
  .post-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .post-page {
    padding: 1.5rem 0 3rem;
  }
  
  .post-header {
    padding: 1.5rem;
  }
  
  .post-title {
    font-size: 1.5rem;
  }
  
  .post-body {
    padding: 1.5rem;
  }
  
  .post-stats-bar {
    padding: 0.75rem 1.5rem;
  }
  
  .post-actions-bar {
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
  }
  
  .post-sidebar {
    grid-template-columns: 1fr;
  }
}
