/* ============================================
   暗黑模式 - 漫画风暴 Dark Theme
   ============================================ */

/* 切换动画 */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* 暗黑模式变量覆盖 */
html.dark {
  --primary: #FF8F5E;
  --primary-light: #FFB088;
  --primary-dark: #FF6B35;
  --secondary: #00D4B4;
  --accent: #FF5C9A;
  --accent-light: #FF8AB5;
  --bg: #1A1A2E;
  --bg-card: #16213E;
  --bg-hover: #1F2B47;
  --text: #E8E8E8;
  --text-secondary: #A0AEC0;
  --text-light: #718096;
  --border: #4A5568;
  --shadow: 4px 4px 0px #0D1117;
  --shadow-lg: 6px 6px 0px #0D1117;
  --shadow-hover: 8px 8px 0px #0D1117;
  --shadow-active: 2px 2px 0px #0D1117;
  --gradient: linear-gradient(135deg, #FF8F5E 0%, #FF5C9A 100%);
  --gradient-light: linear-gradient(135deg, #FF8F5E 0%, #00D4B4 100%);
  --gradient-hero: linear-gradient(135deg, #FF5C9A 0%, #FF8F5E 50%, #FFD93D 100%);
  --bg: #1A1A2E;
  --color-pop-yellow: #FFD93D;
  --color-pop-blue: #4ECDC4;
  --color-pop-pink: #FF5C9A;
  --color-pop-purple: #A855F7;
  --color-pop-green: #00D4B4;
}

/* 暗黑模式下的半色调纹理 */
html.dark body::before {
  background: radial-gradient(circle, rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.15;
}

/* 暗黑模式下的导航栏 */
html.dark .navbar {
  background: rgba(22, 33, 62, 0.95);
  border-bottom-color: #4A5568;
  box-shadow: 0 4px 0 rgba(0,0,0,0.2);
}

/* 暗黑模式下的卡片 */
html.dark .card,
html.dark .post-card,
html.dark .task-card,
html.dark .sidebar-card {
  background: #16213E;
  border-color: #4A5568;
  box-shadow: 4px 4px 0 #0D1117;
}
html.dark .card:hover {
  box-shadow: 8px 8px 0 #0D1117;
}

/* 暗黑模式下的输入框 */
html.dark .form-control,
html.dark .form-select {
  background: #1A1A2E;
  border-color: #4A5568;
  color: #E8E8E8;
}
html.dark .form-control:focus,
html.dark .form-select:focus {
  border-color: #FF8F5E;
  box-shadow: 4px 4px 0 rgba(255,143,94,0.2);
}
html.dark .form-control::placeholder {
  color: #718096;
}

/* 暗黑模式下的弹窗 */
html.dark .modal-content {
  background: #16213E;
  border-color: #4A5568;
  box-shadow: 6px 6px 0 #0D1117;
}
html.dark .modal-header {
  background: #1F2B47;
  border-bottom-color: #4A5568;
}
html.dark .modal-footer {
  background: #1A1A2E;
  border-top-color: #4A5568;
}

/* 暗黑模式下的底部导航 */
html.dark .bottom-nav {
  background: rgba(22, 33, 62, 0.98);
  border-top-color: #4A5568;
  box-shadow: 0 -4px 0 rgba(0,0,0,0.2);
}

/* 暗黑模式下的通知弹窗 */
html.dark #notifPopup {
  background: #16213E;
  border: 3px solid #4A5568;
  box-shadow: 6px 6px 0 #0D1117;
}

/* 暗黑模式下的Toast */
html.dark .toast-msg {
  background: #16213E;
  border-color: #4A5568;
  color: #E8E8E8;
  box-shadow: 4px 4px 0 #0D1117;
}

/* 暗黑模式下的筛选栏 */
html.dark .filter-bar .filter-btn {
  background: #16213E;
  border-color: #4A5568;
  color: #A0AEC0;
}
html.dark .filter-bar .filter-btn.active {
  background: #FF8F5E;
  border-color: #4A5568;
  color: #1A1A2E;
}

/* 暗黑模式下的公告栏 */
html.dark .announcement {
  background: #2D2D2D;
  border-color: #4A5568;
  color: #FFD93D;
}

/* 暗黑模式下的用户中心 */
html.dark .profile-header {
  box-shadow: 6px 6px 0 #0D1117;
}

/* 暗黑模式下的评论区 */
html.dark .comment-item {
  border-bottom-color: #2D3748;
}
html.dark .comment-item:hover {
  background: #1F2B47;
}

/* 暗黑模式下的通知列表 */
html.dark .notification-item {
  border-bottom-color: #2D3748;
}
html.dark .notification-item:hover {
  background: #1F2B47;
}
html.dark .notification-item.unread {
  background: rgba(255,143,94,0.08);
}

/* 暗黑模式下的侧边栏 */
html.dark .admin-sidebar {
  background: #16213E;
  border-right-color: #4A5568;
}

/* 暗黑模式下的滚动条 */
html.dark ::-webkit-scrollbar-thumb {
  background: #FF8F5E;
  border-color: #4A5568;
}
html.dark ::-webkit-scrollbar-track {
  background: #1A1A2E;
}

/* 暗黑模式下的badge */
html.dark .badge-status {
  border-color: #4A5568;
}
html.dark .badge-category {
  border-color: #FF8F5E;
  color: #FF8F5E;
  background: rgba(255,143,94,0.1);
}

/* 暗黑模式下的下拉菜单 */
html.dark .dropdown-menu {
  background: #16213E;
  border-color: #4A5568;
  box-shadow: 4px 4px 0 #0D1117;
}
html.dark .dropdown-item {
  color: #E8E8E8;
}
html.dark .dropdown-item:hover {
  background: #1F2B47;
  color: #FF8F5E;
}
html.dark .dropdown-divider {
  border-top-color: #4A5568;
}

/* 暗黑模式下的图片 */
html.dark .post-card .post-images {
  border-color: #4A5568;
}

/* 暗黑模式下的空状态 */
html.dark .empty-state {
  color: #718096;
}

/* 暗黑模式下的骨架屏 */
html.dark .skeleton {
  background: linear-gradient(90deg, #1F2B47 25%, #2D3748 50%, #1F2B47 75%);
  background-size: 200% 100%;
  border-color: #4A5568;
}

/* 暗黑模式下的footer */
html.dark footer {
  color: #718096;
}

/* 暗黑模式切换按钮 */
.dark-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 1.2rem;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}
.dark-toggle:hover {
  transform: scale(1.15) rotate(15deg);
  box-shadow: var(--shadow);
}
.dark-toggle:active {
  transform: scale(0.9);
}
.dark-toggle .icon-sun,
.dark-toggle .icon-moon {
  position: absolute;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.dark-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.dark-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}
html.dark .dark-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}
html.dark .dark-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* 暗黑过渡遮罩 */
.dark-transition-overlay {
  position: fixed;
  inset: 0;
  background: #1A1A2E;
  z-index: 99999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.dark-transition-overlay.active {
  opacity: 0.3;
}

/* ===== @提及 + #话题标签 样式 ===== */
.content-tag {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 107, 53, 0.08);
  transition: all 0.2s;
  cursor: pointer;
  display: inline-block;
}
.content-tag:hover {
  background: rgba(255, 107, 53, 0.18);
  color: var(--primary-dark);
  transform: scale(1.05);
  text-decoration: none;
}
.content-mention {
  color: #00BFA6;
  font-weight: 700;
  text-decoration: none;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 191, 166, 0.08);
  transition: all 0.2s;
  cursor: pointer;
  display: inline-block;
}
.content-mention:hover {
  background: rgba(0, 191, 166, 0.18);
  color: #009988;
  transform: scale(1.05);
  text-decoration: none;
}
html.dark .content-tag {
  background: rgba(255, 143, 94, 0.15);
  color: #FFB088;
}
html.dark .content-tag:hover {
  background: rgba(255, 143, 94, 0.25);
}
html.dark .content-mention {
  background: rgba(0, 212, 180, 0.15);
  color: #00D4B4;
}
html.dark .content-mention:hover {
  background: rgba(0, 212, 180, 0.25);
}

/* ===== 双击点赞提示 ===== */
.post-card .post-images img,
.post-card .post-images video {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.post-card .post-images img:active,
.post-card .post-images video:active {
  transform: scale(0.97);
}

/* ===== 积分进度卡片暗黑适配（主页+个人主页） ===== */
html.dark #homePointsBar,
html.dark #profilePointsCard {
  background: #1e1e2e;
}
html.dark #profilePointsCard .text-muted {
  color: #8b8ba0 !important;
}
