/* ==========================================
   Ora — 设计系统 & 全局样式
   ========================================== */

:root {
  /* 色彩系统 */
  --bg-base: #0d0f13;
  --bg-surface: #141720;
  --bg-elevated: #1c2030;
  --bg-overlay: #242840;
  --bg-muted: #1a1e2e;

  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);

  --text-primary: #e8eaf0;
  --text-secondary: #9aa0b4;
  --text-muted: #5c6380;
  --text-inverse: #0d0f13;

  /* 品牌色：暖紫蓝 */
  --accent: #7b68ee;
  --accent-bright: #9d8ff5;
  --accent-dim: rgba(123,104,238,0.15);
  --accent-glow: rgba(123,104,238,0.35);

  /* 功能色 */
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;

  --success-dim: rgba(74,222,128,0.12);
  --warning-dim: rgba(251,191,36,0.12);
  --danger-dim: rgba(248,113,113,0.12);

  /* 分类色 */
  --cat-1: #7b68ee;
  --cat-2: #06b6d4;
  --cat-3: #10b981;
  --cat-4: #f59e0b;
  --cat-5: #ec4899;
  --cat-6: #ef4444;

  /* 排版 */
  --font-sans: 'Inter', 'Noto Sans SC', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-xs: clamp(11px, 1.1vw, 12px);
  --text-sm: clamp(12px, 1.3vw, 13px);
  --text-base: clamp(13px, 1.5vw, 15px);
  --text-md: clamp(15px, 1.7vw, 17px);
  --text-lg: clamp(18px, 2vw, 22px);
  --text-xl: clamp(24px, 3vw, 32px);

  /* 间距 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.3);
  --shadow-accent: 0 0 20px var(--accent-glow);

  /* 过渡 */
  --transition: 150ms cubic-bezier(0.4,0,0.2,1);
  --transition-md: 250ms cubic-bezier(0.4,0,0.2,1);

  /* 布局 */
  --topbar-h: 56px;
  --sidebar-w: 224px;
  --right-panel-w: 280px;

  /* 最大布局宽度 — PC端居中约束 */
  --layout-max: 1440px;
  --layout-offset: max(0px, (100vw - var(--layout-max)) / 2);
}

/* 浅色主题 */
[data-theme="light"] {
  --bg-base: #f4f5f8;
  --bg-surface: #ffffff;
  --bg-elevated: #f8f9fc;
  --bg-overlay: #eef0f5;
  --bg-muted: #f0f2f7;

  --border-subtle: rgba(0,0,0,0.05);
  --border-default: rgba(0,0,0,0.09);
  --border-strong: rgba(0,0,0,0.15);

  --text-primary: #1a1d2e;
  --text-secondary: #5a6080;
  --text-muted: #9aa0ba;
  --text-inverse: #ffffff;

  --accent-dim: rgba(123,104,238,0.10);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.09);
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: #080a0e;
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-md), color var(--transition-md);
}

/* 浅色模式下 body 背景 */
html[data-theme="light"] body {
  background: #e4e6ed;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }

/* ==========================================
   Scrollbar
   ========================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ==========================================
   Topbar
   ========================================== */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  z-index: 100;
  backdrop-filter: blur(12px);
}

/* 顶栏居中内容区的两侧竖线，与 app-layout 对齐 */
.topbar::before,
.topbar::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-default);
  pointer-events: none;
}
.topbar::before { left: var(--layout-offset); }
.topbar::after  { right: var(--layout-offset); }

.topbar-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 100%;
  padding: 0 calc(var(--layout-offset) + var(--space-4));
  max-width: var(--layout-max);
  margin: 0 auto;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.sidebar-toggle:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}
.icon-menu::before { content: '≡'; font-size: 20px; }

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  font-size: var(--text-md);
  white-space: nowrap;
  color: var(--text-primary);
  text-decoration: none;
  transition: opacity var(--transition);
}
.logo:hover { opacity: 0.85; }
.logo-icon {
  font-size: 22px;
  color: var(--accent-bright);
  line-height: 1;
}

.topbar-search {
  flex: 1;
  max-width: 480px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 18px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 36px;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 0 40px 0 36px;
  color: var(--text-primary);
  font-size: var(--text-sm);
  outline: none;
  transition: all var(--transition);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-elevated);
}

.search-kbd {
  position: absolute;
  right: 10px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: none;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  flex-shrink: 0;
}

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

/* 背景纹理：两侧留白区域有微妙的网格点缀 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, var(--border-subtle) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}

.app-layout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  max-width: var(--layout-max);
  margin-left: auto;
  margin-right: auto;
  position: relative;
  /* 两侧细边框，分隔背景纹理与内容区域 */
  box-shadow: -1px 0 0 var(--border-default), 1px 0 0 var(--border-default);
  background: var(--bg-base);
  z-index: 1;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: var(--layout-offset);
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-md), width var(--transition-md);
  z-index: 90;
}

.sidebar.collapsed {
  width: 60px;
}
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-stats,
.sidebar.collapsed .badge { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: var(--space-2) var(--space-3); }

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-title {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--space-1) var(--space-3);
  margin-bottom: var(--space-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}
.nav-item:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent-bright);
}
.nav-item.active .nav-icon { color: var(--accent-bright); }

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge {
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  margin-left: auto;
}

.sidebar-footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.sidebar-stat-item {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.sidebar-stat-item strong { color: var(--text-secondary); }

/* ==========================================
   Main Content
   ========================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  margin-right: var(--right-panel-w);
  padding: var(--space-6);
  min-width: 0;
  transition: margin var(--transition-md);
}

.main-content.sidebar-collapsed { margin-left: 60px; }

/* ==========================================
   Right Panel
   ========================================== */
.right-panel {
  position: fixed;
  top: var(--topbar-h);
  right: var(--layout-offset);
  width: var(--right-panel-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--bg-surface);
  border-left: 1px solid var(--border-default);
  overflow-y: auto;
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 36px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-overlay);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(248,113,113,0.2);
}
.btn-danger:hover { background: rgba(248,113,113,0.2); }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-sm { height: 28px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn-lg { height: 44px; padding: 0 var(--space-6); font-size: var(--text-base); }

/* ==========================================
   Forms
   ========================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  font-size: var(--text-base);
  outline: none;
  transition: all var(--transition);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  background: var(--bg-elevated);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239aa0b4' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger);
}

/* ==========================================
   Cards
   ========================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

/* ==========================================
   帖子列表
   ========================================== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.post-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.post-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-dim);
  transform: translateY(-1px);
}
.post-item.pinned {
  border-left: 3px solid var(--accent);
}
.post-item.hot::after {
  content: '🔥';
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 14px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.post-category {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent-bright);
}

.post-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  background: var(--bg-overlay);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.post-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-title:hover { color: var(--accent-bright); }

.post-excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.post-footer {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.post-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.avatar {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 56px; height: 56px; font-size: 22px; }
.avatar-xl { width: 80px; height: 80px; font-size: 32px; }

.avatar-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  flex-shrink: 0;
  line-height: 1;
}

.post-stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-left: auto;
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.stat .stat-icon { font-size: 13px; }

/* ==========================================
   帖子详情
   ========================================== */
.post-detail-header {
  margin-bottom: var(--space-6);
}

.post-detail-title {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.post-detail-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.post-content {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--text-primary);
}

.post-content h1, .post-content h2, .post-content h3 {
  margin: var(--space-6) 0 var(--space-3);
  font-weight: 700;
}
.post-content h1 { font-size: var(--text-xl); }
.post-content h2 { font-size: var(--text-lg); }
.post-content h3 { font-size: var(--text-md); }

.post-content p { margin-bottom: var(--space-4); }

.post-content code {
  background: var(--bg-overlay);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--accent-bright);
}

.post-content pre {
  background: var(--bg-overlay);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
  margin: var(--space-4) 0;
}
.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-3) var(--space-4);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-4) 0;
  color: var(--text-secondary);
}

.post-content ul, .post-content ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}
.post-content li { margin-bottom: var(--space-1); }

.post-content img {
  border-radius: var(--radius-md);
  margin: var(--space-4) auto;
  max-height: 480px;
  object-fit: cover;
}

.post-content a { color: var(--accent-bright); text-decoration: underline; }

.post-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
  margin: var(--space-5) 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.action-btn:hover { background: var(--bg-overlay); color: var(--text-primary); }
.action-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-bright);
}
.action-btn.danger-active {
  background: var(--danger-dim);
  border-color: rgba(248,113,113,0.3);
  color: var(--danger);
}

/* ==========================================
   回复
   ========================================== */
.replies-section {
  margin-top: var(--space-8);
}

.replies-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.replies-title {
  font-size: var(--text-md);
  font-weight: 700;
}

.reply-item {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}
.reply-item:last-child { border-bottom: none; }

.reply-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.reply-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.vote-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px;
  transition: color var(--transition), transform var(--transition);
  line-height: 1;
}
.vote-btn:hover { color: var(--accent-bright); transform: scale(1.2); }
.vote-btn.up-active { color: var(--success); }
.vote-btn.down-active { color: var(--danger); }
.vote-count { font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); }

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

.reply-author-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  flex-wrap: wrap;
}

.reply-author-name {
  font-weight: 600;
  font-size: var(--text-sm);
}
.reply-author-name.op {
  color: var(--accent-bright);
}
.reply-author-name.op::after {
  content: ' OP';
  font-size: 10px;
  background: var(--accent-dim);
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 4px;
}

.reply-time {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.reply-content {
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}
.reply-content p { margin-bottom: var(--space-2); }

.reply-quote {
  background: var(--bg-muted);
  border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.reply-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.reply-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: color var(--transition);
  padding: 2px 4px;
}
.reply-action-btn:hover { color: var(--accent-bright); }

/* 楼层数 */
.floor-num {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-overlay);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: auto;
}

/* ==========================================
   编辑器
   ========================================== */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  flex-wrap: wrap;
}

.editor-tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.editor-tool-btn:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}

.editor-sep {
  width: 1px;
  height: 20px;
  background: var(--border-default);
  margin: 0 4px;
}

.editor-textarea {
  width: 100%;
  min-height: 160px;
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: var(--space-4);
  color: var(--text-primary);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  line-height: 1.7;
  outline: none;
  resize: vertical;
  transition: all var(--transition);
}
.editor-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ==========================================
   页面标题
   ========================================== */
.page-header {
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
  background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ==========================================
   筛选器
   ========================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.filter-chip {
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-default);
  background: none;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.filter-chip:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}
.filter-chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-bright);
}

/* ==========================================
   右侧面板 Widgets
   ========================================== */
.widget {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.widget-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-4);
}

.widget-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: opacity var(--transition);
}
.widget-item:last-child { border-bottom: none; }
.widget-item:hover { opacity: 0.8; }

.widget-rank {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  width: 18px;
  flex-shrink: 0;
  padding-top: 2px;
}

.widget-item-title {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.widget-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================
   模态框
   ========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease;
}

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

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-box.modal-wide { max-width: 800px; }

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 700;
}

.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  background: var(--bg-overlay);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--bg-elevated); color: var(--text-primary); }

.modal-form { display: flex; flex-direction: column; gap: var(--space-4); }
.modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  margin-top: var(--space-2);
}

/* ==========================================
   Toast
   ========================================== */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  color: var(--text-primary);
  max-width: 320px;
  pointer-events: all;
  animation: toastIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastIn {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.removing {
  animation: toastOut 0.2s ease forwards;
}
@keyframes toastOut {
  to { transform: translateX(60px); opacity: 0; }
}

.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-success .toast-icon::before { content: '✓'; color: var(--success); }
.toast-error .toast-icon::before { content: '✕'; color: var(--danger); }
.toast-info .toast-icon::before { content: 'ℹ'; color: var(--info); }
.toast-warning .toast-icon::before { content: '⚠'; color: var(--warning); }

/* ==========================================
   用户卡片
   ========================================== */
.user-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-info-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
}
.user-info-role {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ==========================================
   个人主页
   ========================================== */
/* ==========================================
   Profile Page — 重构版
   ========================================== */

.profile-page {
  padding-bottom: var(--space-8);
}

/* 封面横幅 */
.profile-cover {
  position: relative;
  height: 200px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  margin-bottom: 0;
}
.profile-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.4) 100%);
}
.btn-cover-edit {
  position: absolute;
  bottom: 12px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background var(--transition);
}
.btn-cover-edit:hover { background: rgba(0,0,0,0.7); }

/* 主信息卡 */
.profile-main-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 0 var(--space-8) var(--space-8);
  margin-bottom: var(--space-6);
  position: relative;
}

/* 头像区域 — 悬浮在封面边界 */
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  margin-top: -52px;
  margin-bottom: var(--space-4);
}
.profile-avatar-ring {
  border-radius: 50%;
  border: 4px solid var(--bg-surface);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  line-height: 0;
}
.profile-avatar-ring .avatar-placeholder {
  border-radius: 50%;
}
.btn-avatar-edit {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-surface);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}
.btn-avatar-edit:hover { transform: scale(1.1); }

/* 操作按钮行 */
.profile-actions {
  position: absolute;
  top: 16px;
  right: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* 在线/离线徽章 */
.profile-online-badge {
  font-size: var(--text-xs);
  color: var(--success);
  font-weight: 600;
}
.profile-offline-badge {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* 用户名 + UID */
.profile-identity {
  margin-bottom: var(--space-4);
}
.profile-display-name {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.profile-username-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.profile-username {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

/* 个性签名 */
.profile-signature {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-style: italic;
  margin-top: 4px;
  padding-left: 12px;
  border-left: 3px solid var(--accent);
}

/* 徽章行 */
.profile-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

/* 简介 */
.profile-bio {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--space-4);
  max-width: 600px;
}

/* 元信息行（城市/网站/时间） */
.profile-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.profile-meta-item {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.profile-meta-link {
  color: var(--accent-bright);
  text-decoration: none;
}
.profile-meta-link:hover { text-decoration: underline; }

/* 等级/积分/金币条 */
.profile-level-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  border: 1px solid var(--border-subtle);
}
.profile-level-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.profile-level-icon { font-size: 16px; }
.profile-level-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

/* 数据统计卡片网格 */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-3);
}
.profile-stat-card {
  background: var(--bg-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  transition: border-color var(--transition), transform var(--transition);
}
.profile-stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.profile-stat-num {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.profile-stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

/* 旧 profile-hero 保留为兼容 */
.profile-hero {
  display: none;
}

/* ==========================================
   编辑资料弹窗
   ========================================== */
.edit-profile-form {
  max-height: 75vh;
  overflow-y: auto;
  padding-right: 4px;
}
.form-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-3);
  margin-top: var(--space-2);
}
.form-divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-5) 0;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
}
.required { color: var(--danger); }

/* 头像编辑区 */
.avatar-edit-preview {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
}
.avatar-preview-box {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  width: 96px;
  height: 96px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.avatar-preview-box img,
.avatar-preview-box > div {
  border-radius: 50%;
}
.avatar-type-tabs {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.avatar-type-btn {
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 8px 16px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
}
.avatar-type-btn.active,
.avatar-type-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-bright);
}
.avatar-sub-panel {
  margin-bottom: var(--space-4);
}
.avatar-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.avatar-color-swatch:hover { transform: scale(1.15); }
.avatar-color-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
  transform: scale(1.1);
}
.avatar-emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-3);
}
.avatar-emoji-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-muted);
  cursor: pointer;
  font-size: 20px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-emoji-swatch:hover { background: var(--bg-overlay); transform: scale(1.1); }
.avatar-emoji-swatch.active {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* ==========================================
   role-badge（移到这里统一）
   ========================================== */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.role-admin { background: var(--danger-dim); color: var(--danger); }
.role-mod { background: var(--warning-dim); color: var(--warning); }
.role-member { background: var(--bg-overlay); color: var(--text-muted); }

/* ==========================================
   通知
   ========================================== */
.notif-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border-subtle);
}
.notif-item:hover { background: var(--bg-overlay); }
.notif-item.unread { background: var(--accent-dim); }
.notif-item.unread:hover { background: rgba(123,104,238,0.2); }

.notif-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-overlay);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: var(--text-sm); color: var(--text-primary); line-height: 1.5; }
.notif-time { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }

/* ==========================================
   管理后台
   ========================================== */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-6);
  gap: 0;
  overflow-x: auto;
}

/* 后台身份标识 */
.admin-identity-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-3);
}

/* 后台安全提示栏 */
.admin-security-notice {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--warning);
  margin-bottom: var(--space-6);
}
.admin-security-notice code {
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
}

.admin-tab {
  padding: var(--space-3) var(--space-5);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  margin-bottom: -1px;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab.active {
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.data-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tr:hover td { background: var(--bg-overlay); }

/* ==========================================
   搜索浮层
   ========================================== */
.search-dropdown {
  position: fixed;
  top: var(--topbar-h);
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  max-width: calc(100vw - 32px);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  max-height: 480px;
  overflow-y: auto;
}

.search-result-group { padding: var(--space-3) 0; }
.search-result-group-title {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 var(--space-4) var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: background var(--transition);
}
.search-result-item:hover { background: var(--bg-overlay); }
.search-result-title {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
}
.search-result-meta { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.search-highlight { color: var(--accent-bright); font-weight: 600; }

/* ==========================================
   加载骨架
   ========================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-overlay) 25%,
    var(--bg-elevated) 50%,
    var(--bg-overlay) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==========================================
   分页
   ========================================== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  margin-top: var(--space-6);
}

.page-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: none;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.page-btn:hover { background: var(--bg-overlay); color: var(--text-primary); }
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ==========================================
   空状态
   ========================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
}

.empty-title {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.empty-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.6;
}

/* ==========================================
   帖子创建页面
   ========================================== */
.create-post-wrap {
  max-width: 800px;
  margin: 0 auto;
}

.create-tags-input {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-muted);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  min-height: 40px;
  cursor: text;
  transition: all var(--transition);
}
.create-tags-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--accent-dim);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--accent-bright);
}
.tag-pill-remove {
  background: none;
  border: none;
  color: var(--accent-bright);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}
.tag-pill-remove:hover { opacity: 1; }

.tags-text-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: var(--text-sm);
  flex: 1;
  min-width: 80px;
}
.tags-text-input::placeholder { color: var(--text-muted); }

/* ==========================================
   通知下拉
   ========================================== */
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
.notif-dropdown-title { font-weight: 700; font-size: var(--text-sm); }
.notif-dropdown-body { max-height: 360px; overflow-y: auto; }

/* ==========================================
   Tabs
   ========================================== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: var(--space-5);
  gap: 0;
}
.tab-btn {
  padding: var(--space-2) var(--space-4);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--accent-bright);
  border-bottom-color: var(--accent);
}

/* ==========================================
   响应式
   ========================================== */
@media (max-width: 1200px) {
  .right-panel { display: none; }
  .main-content { margin-right: 0; }
}

@media (max-width: 900px) {
  .sidebar {
    left: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .topbar-search { max-width: 200px; }
  .search-kbd { display: none; }
}

@media (max-width: 600px) {
  .topbar-search { display: none; }
  .main-content { padding: var(--space-4); }
  .post-stats { display: none; }
  .profile-hero { flex-direction: column; text-align: center; }
  .modal-box { padding: var(--space-5); }
  /* Profile 响应式 */
  .profile-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-actions { position: static; margin-top: var(--space-3); }
  .profile-main-card { padding: 0 var(--space-4) var(--space-6); }
  .form-row { grid-template-columns: 1fr; }
  .avatar-edit-preview { flex-direction: column; align-items: flex-start; }
}

/* ==========================================
   用户下拉菜单
   ========================================== */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 150;
  overflow: hidden;
  animation: slideUp 0.15s ease;
}

.user-dropdown-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}

.user-dropdown-menu { padding: var(--space-2) 0; }
.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.user-dropdown-item:hover {
  background: var(--bg-overlay);
  color: var(--text-primary);
}
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger:hover { background: var(--danger-dim); }

/* ==========================================
   Misc utilities
   ========================================== */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-bright); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.w-full { width: 100%; }
.relative { position: relative; }

.divider {
  height: 1px;
  background: var(--border-default);
  margin: var(--space-4) 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
}
.tag-accent { background: var(--accent-dim); color: var(--accent-bright); }
.tag-success { background: var(--success-dim); color: var(--success); }
.tag-danger { background: var(--danger-dim); color: var(--danger); }
.tag-warning { background: var(--warning-dim); color: var(--warning); }

/* online dot */
.online-dot {
  width: 8px; height: 8px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
}

/* progress bar */
.progress-bar {
  height: 4px;
  background: var(--bg-overlay);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* floating action button */
.fab {
  position: fixed;
  bottom: var(--space-6);
  right: calc(var(--right-panel-w) + var(--space-5));
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-lg), var(--shadow-accent);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
}
.fab:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

@media (max-width: 1200px) {
  .fab { right: var(--space-5); }
}

/* ============================================
   UID 芯片
   ============================================ */
.uid-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--bg-overlay);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* ============================================
   徽章
   ============================================ */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
  transition: transform var(--transition);
}
.user-badge:hover { transform: translateY(-1px); }

/* ============================================
   成就墙
   ============================================ */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  padding: 4px 0 20px;
}
.achievement-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: default;
  transition: all var(--transition);
  position: relative;
  text-align: center;
}
.achievement-item.unlocked:hover {
  transform: translateY(-3px);
  border-color: currentColor;
}
.achievement-icon {
  font-size: 28px;
  line-height: 1;
}
.achievement-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.achievement-rarity {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ============================================
   签到模块
   ============================================ */
.checkin-widget {
  margin-bottom: 24px;
  padding: 20px;
}
.checkin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.checkin-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}
.checkin-stats strong { font-weight: 700; }
.checkin-calendar {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
  margin-bottom: 14px;
}
.checkin-day {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all 0.15s;
}
.checkin-day.done {
  background: var(--accent);
  color: white;
  border-color: var(--accent-dim);
}
.checkin-day.today {
  border-color: var(--accent-bright);
  box-shadow: 0 0 6px var(--accent-glow);
}
.checkin-done {
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

/* ============================================
   成就 Toast 特殊样式
   ============================================ */
.toast.toast-achievement {
  min-width: 280px;
  padding: 14px 18px;
}
