/* ============================================
   翰林校园论坛 - Warm Gradient Theme
   锈红 → 暖棕 → 香槟金 → 暖沙  渐变主题
   设计灵感: 翰林实验学校品牌色 + Apple HIG
   ============================================ */

/* --- Design Tokens --- */
:root {
  /* 品牌色 */
  --c-burgundy: #8B3A2A;
  --c-burgundy-deep: #6B2A1A;
  --c-burgundy-dark: #4A1A1A;
  --c-gold: #C9A227;
  --c-gold-light: #D4AF37;
  --c-gold-bright: #E8C547;
  --c-cream: #F5E6C8;
  --c-rust: #8B3A2A;
  --c-warm-sand: #E8D4A8;
  --c-champagne: #D4B896;
  --c-warm-brown: #A65D3D;

  /* 辅助色 */
  --c-teal: #C9A227;
  --c-amber: #D4AF37;
  --c-pink: #CD853F;
  --c-emerald: #8B6914;
  --c-blue: #6B4C3B;

  /* 背景 - 暖色渐变 */
  --bg-base: #F5E6C8;
  --bg-surface: rgba(255, 255, 255, 0.5);
  --bg-elevated: rgba(255, 255, 255, 0.65);
  --bg-hover: rgba(255, 255, 255, 0.8);
  --bg-surface-transparent: rgba(139, 58, 42, 0.04);
  --bg-elevated-transparent: rgba(139, 58, 42, 0.08);
  --bg-hover-transparent: rgba(139, 58, 42, 0.12);

  /* 玻璃 - 暖白半透明 */
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(139, 58, 42, 0.1);
  --glass-blur: 16px;

  /* 文字 - 深棕系（在浅色背景上） */
  --text-primary: #2D1810;
  --text-secondary: #6B4C3B;
  --text-tertiary: #9B8070;
  --text-on-dark: #FFF8E7;
  --text-on-dark-secondary: #E8D4A8;

  /* 渐变 */
  --grad-primary: linear-gradient(135deg, #8B3A2A 0%, #C9A227 100%);
  --grad-bg: linear-gradient(165deg, #8B3A2A 0%, #A65D3D 25%, #C98B5D 55%, #E8D4A8 100%);
  --grad-gold: linear-gradient(135deg, #D4AF37 0%, #C9A227 100%);
  --grad-burgundy: linear-gradient(135deg, #6B2A1A 0%, #8B3A2A 100%);

  /* 阴影 - 暖色调 */
  --shadow-sm: 0 1px 3px rgba(74, 26, 26, 0.08);
  --shadow-md: 0 4px 12px rgba(74, 26, 26, 0.1);
  --shadow-lg: 0 8px 24px rgba(74, 26, 26, 0.14);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 980px;

  /* 布局 */
  --header-h: 56px;
  --sidebar-w: 240px;
  --max-w: 1200px;

  /* 过渡 */
  --transition: 0.2s ease;
  --transition-fast: 0.15s ease;
}

/* --- 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: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background: var(--grad-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.47;
  letter-spacing: -0.01em;
}

/* 背景光晕 - 暖色径向渐变 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 900px 700px at 15% 10%, rgba(201, 162, 39, 0.15), transparent 60%),
    radial-gradient(ellipse 700px 900px at 85% 90%, rgba(212, 184, 150, 0.12), transparent 60%),
    radial-gradient(ellipse 500px 500px at 50% 50%, rgba(255, 248, 231, 0.1), transparent 70%);
  pointer-events: none;
}

/* 微噪纹理 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
}

/* --- Typography --- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; color: var(--text-primary); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
a { color: var(--c-burgundy); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--c-burgundy-deep); }
.gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 高级页面标题 - 实色 + 金色装饰线 */
.page-title {
  color: var(--text-primary);
  font-weight: 800;
  font-family: 'Noto Serif SC', serif;
  position: relative;
  padding-left: 16px;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(255, 248, 231, 0.5);
}
.page-title::before {
  content: '';
  position: absolute;
  left: 0; top: 8%;
  width: 4px; height: 84%;
  background: linear-gradient(180deg, #C9A227 0%, #8B3A2A 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(201, 162, 39, 0.3);
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 58, 42, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 58, 42, 0.25); }

/* --- Glass Card --- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.4), var(--shadow-sm);
}

/* --- Header --- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  background: rgba(139, 58, 42, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid rgba(201, 162, 39, 0.15);
}
.app-header .logo,
.app-header .logo span,
.app-header .icon-btn,
.app-header .header-search input,
.app-header .header-search .search-icon,
.app-header .user-avatar-btn span {
  color: var(--text-on-dark) !important;
}
.app-header .gradient-text {
  -webkit-text-fill-color: #E8C547 !important;
  background: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: -0.02em;
}
.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--grad-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.3);
}

.header-search {
  flex: 1;
  max-width: 360px;
  margin: 0 20px;
  position: relative;
}
.header-search input {
  width: 100%;
  height: 36px;
  padding: 0 14px 0 36px;
  background: rgba(255, 255, 255, 0.15);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  color: var(--text-on-dark);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
}
.header-search input:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.5);
  background: rgba(255, 255, 255, 0.25);
}
.header-search input::placeholder { color: rgba(255, 248, 231, 0.6); }
.header-search .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 248, 231, 0.6);
  font-size: 0.875rem;
}

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

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-on-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  position: relative;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.15); color: var(--text-on-dark); }
.icon-btn .badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  border-radius: var(--radius-pill);
  background: var(--c-gold-bright);
  font-size: 0.65rem;
  color: var(--c-burgundy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 3px;
  border-radius: var(--radius-pill);
  border: 0.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.user-avatar-btn:hover { background: rgba(255, 255, 255, 0.2); }

.guest-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(201, 162, 39, 0.2);
  color: #E8C547;
  font-size: 0.78rem;
  font-weight: 600;
  border: 0.5px solid rgba(201, 162, 39, 0.3);
}

/* --- Avatar --- */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-sm { width: 26px; height: 26px; font-size: 0.65rem; }

/* --- Layout --- */
.app-layout {
  display: flex;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 16px;
  gap: 20px;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + 20px);
  height: fit-content;
}

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

/* --- Sidebar Nav --- */
.sidebar .nav-section {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 10px;
  box-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.4), var(--shadow-sm);
}
.nav-section { margin-bottom: 16px; }
.nav-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  padding: 0 12px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(139, 58, 42, 0.1); color: var(--c-burgundy); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(139, 58, 42, 0.15), rgba(201, 162, 39, 0.1));
  color: var(--c-burgundy);
  font-weight: 700;
  box-shadow: inset 0 0.0px 0 rgba(139, 58, 42, 0.05);
}
.nav-item .nav-icon { font-size: 1rem; width: 18px; text-align: center; }
.nav-item .nav-count {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  background: rgba(139, 58, 42, 0.06);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.btn-primary {
  background: var(--grad-burgundy);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 58, 42, 0.25);
}
.btn-primary:hover { background: var(--c-burgundy-deep); box-shadow: 0 4px 12px rgba(139, 58, 42, 0.35); }
.btn-gold {
  background: var(--grad-gold);
  color: white;
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.25);
}
.btn-gold:hover { background: #b08d20; box-shadow: 0 4px 12px rgba(201, 162, 39, 0.35); }
.btn-ghost {
  background: rgba(139, 58, 42, 0.06);
  color: var(--text-secondary);
  border: 0.5px solid var(--glass-border);
}
.btn-ghost:hover { background: rgba(139, 58, 42, 0.12); color: var(--text-primary); }
.btn-danger {
  background: #c0392b;
  color: white;
}
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: 5px 14px; font-size: 0.8rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Post Card --- */
.post-card {
  padding: 18px;
  margin-bottom: 12px;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.post-card:hover {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(201, 162, 39, 0.25);
  transform: translateY(-1px);
}
.post-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 100%;
  background: var(--cat-color, var(--c-gold));
  opacity: 0;
  transition: opacity var(--transition);
}
.post-card:hover::before { opacity: 0.8; }

.post-pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: rgba(201, 162, 39, 0.15);
  color: var(--c-gold);
  margin-right: 6px;
  font-weight: 600;
}

.post-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  margin-bottom: 8px;
}

.post-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.02em;
}
.post-card:hover .post-title { color: var(--c-burgundy); }

.post-excerpt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
  line-height: 1.5;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}
.post-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.post-meta-item.liked { color: var(--c-pink); }
.post-meta-item.voted-up { color: var(--c-gold); }

.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.post-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(139, 58, 42, 0.06);
  color: var(--text-secondary);
}

/* --- Post Detail --- */
.post-detail {
  padding: 24px;
  margin-bottom: 12px;
}
.post-detail-title {
  font-size: 1.4rem;
  font-weight: 900;
  font-family: 'Noto Serif SC', serif;
  margin-bottom: 12px;
  line-height: 1.35;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}
.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 0.5px solid var(--glass-border);
}
.post-detail-content {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
}
.post-detail-actions {
  display: flex;
  gap: 8px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 0.5px solid var(--glass-border);
  flex-wrap: wrap;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--glass-border);
  background: rgba(139, 58, 42, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.action-btn:hover { background: rgba(139, 58, 42, 0.1); color: var(--text-primary); }
.action-btn.active.like { color: var(--c-pink); border-color: rgba(205, 133, 63, 0.3); background: rgba(205, 133, 63, 0.1); }
.action-btn.active.upvote { color: var(--c-gold); border-color: rgba(201, 162, 39, 0.3); background: rgba(201, 162, 39, 0.1); }
.action-btn.active.downvote { color: var(--c-burgundy); border-color: rgba(139, 58, 42, 0.3); background: rgba(139, 58, 42, 0.1); }
.action-btn.active.fav { color: var(--c-gold); border-color: rgba(212, 175, 55, 0.3); background: rgba(212, 175, 55, 0.1); }

/* Vote group */
.vote-group {
  display: flex;
  align-items: center;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--glass-border);
  overflow: hidden;
  background: rgba(139, 58, 42, 0.04);
}
.vote-btn {
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all var(--transition-fast);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 4px;
}
.vote-btn:hover { background: rgba(139, 58, 42, 0.08); }
.vote-btn.active.up { color: var(--c-gold); background: rgba(201, 162, 39, 0.1); }
.vote-btn.active.down { color: var(--c-burgundy); background: rgba(139, 58, 42, 0.1); }
.vote-score {
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.82rem;
  border-left: 0.5px solid var(--glass-border);
  border-right: 0.5px solid var(--glass-border);
  min-width: 46px;
  text-align: center;
  color: var(--text-primary);
}

/* --- Poll Component --- */
.poll-card {
  padding: 22px;
  margin: 18px 0;
  border-left: 3px solid var(--c-gold);
  background: rgba(201, 162, 39, 0.06);
}
.poll-question {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.poll-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.poll-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--glass-border);
  background: rgba(139, 58, 42, 0.04);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.poll-btn.agree { background: rgba(201, 162, 39, 0.08); border-color: rgba(201, 162, 39, 0.25); }
.poll-btn.agree:hover { background: rgba(201, 162, 39, 0.15); border-color: rgba(201, 162, 39, 0.45); color: var(--c-gold); }
.poll-btn.disagree { background: rgba(139, 58, 42, 0.08); border-color: rgba(139, 58, 42, 0.25); }
.poll-btn.disagree:hover { background: rgba(139, 58, 42, 0.15); border-color: rgba(139, 58, 42, 0.45); color: var(--c-burgundy); }

.poll-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.poll-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.poll-label {
  font-size: 0.82rem;
  font-weight: 600;
  min-width: 44px;
  color: var(--text-secondary);
}
.poll-bar {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(139, 58, 42, 0.08);
  overflow: hidden;
}
.poll-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.poll-bar-fill.agree { background: var(--grad-gold); }
.poll-bar-fill.disagree { background: var(--c-burgundy); }
.poll-pct {
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 40px;
  text-align: right;
  color: var(--text-primary);
}
.poll-count {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  min-width: 44px;
}
.poll-total {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  padding-top: 4px;
}
.poll-login-hint {
  text-align: center;
  padding: 12px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

/* --- Comments --- */
.comments-section { padding: 20px; }
.comment-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 0.5px solid rgba(139, 58, 42, 0.06);
}
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.comment-author { font-weight: 600; font-size: 0.82rem; color: var(--text-primary); }
.comment-role-tag {
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.comment-role-tag.teacher { background: rgba(201, 162, 39, 0.15); color: var(--c-gold); }
.comment-role-tag.student { background: rgba(139, 58, 42, 0.06); color: var(--text-tertiary); }
.comment-role-tag.admin { background: rgba(139, 58, 42, 0.15); color: var(--c-burgundy); }
.comment-time { font-size: 0.72rem; color: var(--text-tertiary); }
.comment-content { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; }
.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}
.comment-action {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-family: inherit;
}
.comment-action:hover { color: var(--text-primary); }
.comment-action.active { color: var(--c-pink); }

.comment-reply { padding-left: 44px; }

.comment-input-area {
  display: flex;
  gap: 10px;
  padding: 14px 0;
}
.comment-input-area textarea {
  flex: 1;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
  min-height: 40px;
  transition: all var(--transition);
}
.comment-input-area textarea:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.5);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.08);
}

.guest-comment-hint {
  padding: 14px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: rgba(139, 58, 42, 0.04);
}
.guest-comment-hint a {
  color: var(--c-burgundy);
  cursor: pointer;
  font-weight: 600;
}

/* --- Announcement Banner --- */
.announcement-banner {
  padding: 14px 18px;
  margin-bottom: 12px;
  border-left: 3px solid var(--c-gold);
  background: rgba(201, 162, 39, 0.08);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.announcement-banner .ann-icon {
  color: var(--c-gold);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.announcement-banner .ann-content {
  flex: 1;
}
.announcement-banner .ann-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.announcement-banner .ann-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.announcement-banner .ann-time {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

/* --- Login Page --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}
.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 50% 30%, rgba(139, 58, 42, 0.2), transparent 70%),
    radial-gradient(ellipse 400px 600px at 50% 70%, rgba(201, 162, 39, 0.12), transparent 70%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 40px 36px;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(74, 26, 26, 0.2);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  font-size: 1.8rem;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(139, 58, 42, 0.3);
}
.auth-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 900;
  font-family: 'Noto Serif SC', serif;
  margin-bottom: 10px;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  position: relative;
  display: block;
  width: 100%;
}
.auth-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #C9A227, transparent);
  border-radius: 1px;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 28px;
}

/* --- Form --- */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.form-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.5);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: rgba(201, 162, 39, 0.5);
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.08);
}
.form-input::placeholder { color: var(--text-tertiary); }
textarea.form-input {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}
select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239B8070' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.form-error {
  color: #c0392b;
  font-size: 0.78rem;
  margin-top: 4px;
  padding: 8px 12px;
  background: rgba(192, 57, 43, 0.08);
  border-radius: var(--radius-sm);
  border: 0.5px solid rgba(192, 57, 43, 0.15);
}

.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: rgba(139, 58, 42, 0.06);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: none;
  background: none;
  font-family: inherit;
}
.auth-tab.active {
  background: var(--grad-burgundy);
  color: white;
}

/* --- Role Selector --- */
.role-selector {
  display: flex;
  gap: 8px;
}
.role-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  font-family: inherit;
  text-align: center;
}
.role-btn:hover { background: rgba(255, 255, 255, 0.6); }
.role-btn.active {
  background: rgba(139, 58, 42, 0.12);
  border-color: rgba(139, 58, 42, 0.4);
  color: var(--c-burgundy);
}

/* --- Right Sidebar / Stats --- */
.stats-card { padding: 18px; margin-bottom: 12px; }
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.stat-item {
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(139, 58, 42, 0.04);
}
.stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--c-burgundy);
}
.stat-label { font-size: 0.68rem; color: var(--text-tertiary); margin-top: 2px; }

/* --- Trending --- */
.trending-card { padding: 18px; }
.trending-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 0.5px solid rgba(139, 58, 42, 0.06);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.trending-item:hover { padding-left: 4px; }
.trending-item:last-child { border-bottom: none; }
.trending-rank {
  font-size: 1.1rem;
  font-weight: 800;
  width: 22px;
  flex-shrink: 0;
}
.trending-item:nth-child(1) .trending-rank { color: var(--c-gold); }
.trending-item:nth-child(2) .trending-rank { color: var(--text-secondary); }
.trending-item:nth-child(3) .trending-rank { color: var(--c-burgundy); }
.trending-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}
.trending-item:hover .trending-title { color: var(--text-primary); }

/* --- Suggestions --- */
.suggestion-card {
  padding: 18px;
  margin-bottom: 12px;
  transition: background var(--transition);
}
.suggestion-card:hover { background: rgba(255, 255, 255, 0.7); }
.suggestion-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.status-pending { background: rgba(201, 162, 39, 0.15); color: var(--c-gold); }
.status-accepted { background: rgba(139, 105, 20, 0.15); color: var(--c-emerald); }
.status-reviewing { background: rgba(107, 76, 59, 0.15); color: var(--c-blue); }
.status-done { background: rgba(201, 162, 39, 0.15); color: var(--c-gold); }

.suggestion-support {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 0.5px solid var(--glass-border);
  background: rgba(139, 58, 42, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.suggestion-support:hover { background: rgba(139, 58, 42, 0.1); }
.suggestion-support.active {
  background: rgba(201, 162, 39, 0.1);
  border-color: rgba(201, 162, 39, 0.3);
  color: var(--c-gold);
}

/* --- Profile --- */
.profile-header {
  padding: 28px;
  text-align: center;
  margin-bottom: 12px;
}
.profile-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 18px;
}
.profile-stat { text-align: center; }
.profile-stat-value { font-size: 1.2rem; font-weight: 800; color: var(--c-burgundy); }
.profile-stat-label { font-size: 0.72rem; color: var(--text-tertiary); }

/* --- Create Post --- */
.create-post-card { padding: 24px; }
.tag-input-area {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px;
  min-height: 42px;
  background: rgba(255, 255, 255, 0.5);
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-md);
  align-items: center;
}
.tag-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: rgba(201, 162, 39, 0.12);
  color: var(--c-gold);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
}
.tag-chip .remove {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}
.tag-chip .remove:hover { opacity: 1; }
.tag-input {
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  flex: 1;
  min-width: 100px;
  font-family: inherit;
}

/* --- Admin Panel --- */
.admin-panel { padding: 24px; }
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: rgba(139, 58, 42, 0.06);
  border-radius: var(--radius-pill);
  padding: 3px;
  flex-wrap: wrap;
}
.admin-tab {
  padding: 8px 16px;
  text-align: center;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  border: none;
  background: none;
  font-family: inherit;
}
.admin-tab.active {
  background: var(--grad-burgundy);
  color: white;
}
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.admin-stat-card {
  padding: 18px;
  text-align: center;
}
.admin-stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--c-burgundy);
  font-family: 'Noto Serif SC', serif;
}
.admin-stat-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}
.admin-user-row:hover { background: rgba(139, 58, 42, 0.04); }
.admin-user-info { flex: 1; }
.admin-user-name { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.admin-user-meta { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 2px; }
.admin-user-actions { display: flex; gap: 6px; }
.admin-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}
.admin-badge.admin { background: rgba(139, 58, 42, 0.15); color: var(--c-burgundy); }
.admin-badge.teacher { background: rgba(201, 162, 39, 0.15); color: var(--c-gold); }
.admin-badge.student { background: rgba(139, 58, 42, 0.06); color: var(--text-tertiary); }
.admin-badge.banned { background: rgba(192, 57, 43, 0.15); color: #c0392b; }
.admin-delete-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 0.5px solid rgba(192, 57, 43, 0.2);
  background: rgba(192, 57, 43, 0.06);
  color: #c0392b;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.admin-delete-btn:hover { background: rgba(192, 57, 43, 0.15); }
.admin-ban-btn {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--glass-border);
  background: rgba(139, 58, 42, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.admin-ban-btn:hover { background: rgba(139, 58, 42, 0.1); }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 11px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 0.5px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toast-in 0.2s ease forwards;
  box-shadow: var(--shadow-md);
  max-width: 320px;
}
.toast.success { border-left: 3px solid var(--c-gold); }
.toast.error { border-left: 3px solid #c0392b; }
.toast.info { border-left: 3px solid var(--c-burgundy); }
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.fade-out { animation: toast-out 0.2s ease forwards; }
@keyframes toast-out {
  to { transform: translateX(100%); opacity: 0; }
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(74, 26, 26, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.2s ease;
}
.modal-content {
  max-width: 500px;
  width: 100%;
  padding: 24px;
  animation: modal-in 0.25s ease;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in {
  from { transform: scale(0.96); opacity: 0; }
}

/* --- Share Modal --- */
.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 18px 0;
}
.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.share-option:hover { background: rgba(139, 58, 42, 0.06); }
.share-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: white;
}
.share-wechat { background: #07c160; }
.share-weibo { background: #e6162d; }
.share-qq { background: #12b7f5; }
.share-link { background: var(--c-burgundy); }
.share-label { font-size: 0.72rem; color: var(--text-secondary); }

/* --- Loading --- */
.loading-spinner {
  width: 32px; height: 32px;
  border: 2.5px solid rgba(139, 58, 42, 0.1);
  border-top-color: var(--c-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Page Entrance Animation --- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.main-content { animation: fade-in-up 0.3s ease; }
.auth-card { animation: fade-in-up 0.4s ease; }

.skeleton {
  background: rgba(139, 58, 42, 0.06);
  border-radius: var(--radius-md);
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 14px; opacity: 0.4; }

/* --- Mobile Bottom Nav --- */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  height: 56px;
  background: rgba(139, 58, 42, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid rgba(201, 162, 39, 0.15);
  justify-content: space-around;
  align-items: center;
}
.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(255, 248, 231, 0.6);
  cursor: pointer;
  font-size: 0.62rem;
  padding: 8px 12px;
  border: none;
  background: none;
  font-family: inherit;
  transition: color var(--transition-fast);
}
.mobile-nav-item.active { color: var(--c-gold-bright); }
.mobile-nav-item .nav-icon { font-size: 1.2rem; }

.fab {
  display: none;
  position: fixed;
  bottom: 72px; right: 18px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--grad-burgundy);
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 99;
  transition: background var(--transition);
}
.fab:hover { background: var(--c-burgundy-deep); }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { display: none; }
  .right-sidebar { display: none; }
}

@media (max-width: 768px) {
  :root {
    --header-h: 52px;
  }

  .app-header { padding: 0 12px; }
  .header-search { margin: 0 12px; }
  .logo span { display: none; }
  .header-actions .icon-btn:not(.mobile-search) { display: none; }

  .app-layout { padding: 12px 12px 72px; }
  .post-card { padding: 14px; }
  .post-detail { padding: 18px; }

  .mobile-nav { display: flex; }
  .fab { display: flex; align-items: center; justify-content: center; }

  .auth-card { padding: 28px 20px; }

  .post-detail-actions { gap: 6px; }
  .action-btn { padding: 6px 12px; font-size: 0.78rem; }

  .profile-stats { gap: 16px; }
  .share-grid { grid-template-columns: repeat(2, 1fr); }

  h1 { font-size: 1.3rem; }
  .post-detail-title { font-size: 1.15rem; }
  .admin-stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .header-search { display: none; }
  .post-meta { gap: 8px; font-size: 0.72rem; }
  .comment-reply { padding-left: 24px; }
  .poll-result-row { flex-wrap: wrap; }
  .admin-tabs { flex-wrap: wrap; }
  .admin-tab { font-size: 0.75rem; padding: 6px 12px; }
}

/* --- Utility --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-tertiary { color: var(--text-tertiary); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.cursor-pointer { cursor: pointer; }
.position-relative { position: relative; }
