/* ========== 全局重置与变量 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #f5f5f7;
  --card-bg: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
  --radius: 14px;
  --max-width: 640px;
  --header-bg: rgba(245,245,247,0.72);
  --header-border: rgba(0,0,0,0.06);
  --modal-bg: rgba(255,255,255,0.95);
  --input-bg: rgba(0,0,0,0.03);
  --hover-bg: rgba(0,0,0,0.03);
  --like-bg: rgba(239,68,68,0.08);
  --reply-bg: rgba(0,0,0,0.02);
  --scrollbar-thumb: rgba(0,0,0,0.15);
}

:root[data-theme="dark"] {
  --bg: #050505;
  --card-bg: rgba(255,255,255,0.04);
  --text: #f5f5f7;
  --text-secondary: #86868b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --border: rgba(255,255,255,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
  --radius: 14px;
  --max-width: 640px;
  --header-bg: rgba(5,5,5,0.72);
  --header-border: rgba(255,255,255,0.06);
  --modal-bg: rgba(30,30,30,0.95);
  --input-bg: rgba(255,255,255,0.05);
  --hover-bg: rgba(255,255,255,0.04);
  --like-bg: rgba(239,68,68,0.12);
  --reply-bg: rgba(255,255,255,0.03);
  --scrollbar-thumb: rgba(255,255,255,0.1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #050505;
    --card-bg: rgba(255,255,255,0.04);
    --text: #f5f5f7;
    --text-secondary: #86868b;
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);
    --radius: 14px;
    --max-width: 640px;
    --header-bg: rgba(5,5,5,0.72);
    --header-border: rgba(255,255,255,0.06);
    --modal-bg: rgba(30,30,30,0.95);
    --input-bg: rgba(255,255,255,0.05);
    --hover-bg: rgba(255,255,255,0.04);
    --like-bg: rgba(239,68,68,0.12);
    --reply-bg: rgba(255,255,255,0.03);
    --scrollbar-thumb: rgba(255,255,255,0.1);
  }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========== 顶部导航 ========== */
.header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color 0.2s;
}

.header-avatar:hover {
  border-color: var(--primary);
}

.header-nickname {
  font-size: 0.85rem;
  color: var(--text);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== 通用按钮 ========== */
.btn {
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: var(--hover-bg); }
.btn-sm { padding: 5px 14px; font-size: 0.8rem; }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #22c55e; color: white; }
.btn-success:hover { background: #16a34a; }

.btn-icon {
  color: var(--text);
  background: none;
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover {
  border-color: var(--primary);
  background: var(--hover-bg);
}
.btn-icon[data-theme-toggle][data-theme-current="dark"] {
  border-color: var(--primary);
  color: var(--primary);
}

/* ========== 弹窗 ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--modal-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 360px;
  box-shadow: var(--shadow-hover);
  animation: modalIn 0.2s ease;
}

.modal-wide { max-width: 480px; }

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

.modal h3 { margin-bottom: 16px; font-size: 1.1rem; }

.modal input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.2s;
  background: var(--input-bg);
  color: var(--text);
}

.modal input:focus { border-color: var(--primary); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.auth-switch {
  text-align: center;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
}

/* ========== 个人资料 ========== */
.profile-avatar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.upload-btn-small {
  cursor: pointer;
  color: var(--primary);
  font-size: 0.85rem;
}

/* ========== 用户管理 ========== */
.user-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 12px;
}

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

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

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-info img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.user-info .name { font-size: 0.9rem; font-weight: 500; }
.user-info .role {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--border);
  color: var(--text-secondary);
}

.user-info .role.admin { background: rgba(59,130,246,0.15); color: #60a5fa; }
.user-info .role.superadmin { background: rgba(245,158,11,0.15); color: #fbbf24; }

/* ========== 搜索抽屉 ========== */
.search-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 0 solid var(--border);
}

.search-drawer.open {
  max-height: 120px;
  border-top: 1px solid var(--border);
}

.search-drawer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-drawer-inner label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-drawer-inner input[type="date"] {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
}

.search-drawer-inner input[type="date"]:focus { border-color: var(--primary); }

/* ========== 卡片 ========== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: box-shadow 0.2s;
}

.card:hover { box-shadow: var(--shadow-hover); }

/* ========== 发布区域 ========== */
.publish-area {
  max-width: var(--max-width);
  margin: 16px auto 0;
  padding: 0 16px;
}

.publish-card textarea {
  width: 100%;
  border: none;
  resize: vertical;
  font-size: 0.95rem;
  line-height: 1.6;
  outline: none;
  font-family: inherit;
  min-height: 60px;
  background: transparent;
  color: var(--text);
}

.publish-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.upload-btn {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.upload-btn:hover { background: var(--hover-bg); }

.image-preview {
  position: relative;
  margin-top: 12px;
  display: inline-block;
}

.image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  object-fit: cover;
}

.remove-img {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== 动态列表 ========== */
.feed {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: pageIn 0.35s ease-out;
}

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

.post-card {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: fadeIn 0.3s ease;
}

.post-card:active { transform: scale(0.98); }

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

/* 发布者信息 */
.post-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

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

.post-author .author-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.post-author .author-role {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--border);
  color: var(--text-secondary);
  margin-left: 4px;
}

.post-content {
  font-size: 0.95rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-image { margin-top: 12px; }

.post-image img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.post-image img:hover { transform: scale(1.01); }

.post-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.post-footer .spacer { flex: 1; }

/* 点赞按钮 */
.btn-like {
  background: none;
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text-secondary);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-like:hover { border-color: #ef4444; color: #ef4444; }
.btn-like.liked { border-color: #ef4444; color: #ef4444; background: var(--like-bg); }
.btn-like.liked svg { fill: #ef4444; stroke: #ef4444; }

.btn-delete {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-delete:hover { opacity: 1; background: var(--like-bg); }

/* ========== 加载更多 ========== */
.load-more {
  text-align: center;
  padding: 16px;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 60px 16px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========== 提示消息 ========== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.875rem;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== 响应式 ========== */
/* ========== 移动端适配 ========== */
@media (max-width: 480px) {
  .header-inner { padding: 10px 12px; }
  .logo { font-size: 1rem; }
  .logo svg { width: 16px; height: 16px; }
  .card { padding: 14px; border-radius: 8px; }
  .feed { padding: 10px; gap: 10px; }
  .header-nickname { display: none; }

  /* 导航按钮紧凑 */
  .header-actions { gap: 4px; }
  .header-actions .btn { padding: 5px 10px; font-size: 0.75rem; }
  .btn-icon {
  color: var(--text); padding: 6px; }

  /* 搜索栏竖排 */
  .search-drawer-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .search-drawer-inner label {
    width: 100%;
    justify-content: space-between;
  }
  .search-drawer-inner input[type="date"] {
    flex: 1;
  }
  .search-drawer.open { max-height: 200px; }

  /* 发布区域 */
  .publish-area { padding: 0 10px; margin-top: 10px; }
  .publish-card textarea { font-size: 0.9rem; min-height: 50px; }
  .publish-footer { flex-wrap: wrap; gap: 8px; }
  .image-preview img { max-width: 150px; max-height: 150px; }

  /* 帖子卡片 */
  .post-content { font-size: 0.9rem; line-height: 1.7; }
  .post-image img { max-height: 300px; border-radius: 6px; }
  .post-author img { width: 30px; height: 30px; }
  .post-author .author-name { font-size: 0.82rem; }
  .post-footer { gap: 8px; font-size: 0.75rem; flex-wrap: wrap; }
  .btn-like { padding: 3px 8px; font-size: 0.75rem; }
  .btn-delete { font-size: 0.75rem; padding: 3px 6px; }

  /* 弹窗 */
  .modal { padding: 20px; width: 94%; max-width: none; }
  .modal h3 { font-size: 1rem; margin-bottom: 12px; }
  .modal input { padding: 9px 10px; font-size: 13px; }
  .modal-actions button { padding: 9px; font-size: 13px; }
  .auth-switch { font-size: 12px; }

  /* 管理面板表格 */
  .admin-table { font-size: 0.78rem; }
  .admin-table th, .admin-table td { padding: 8px 4px; }
  .admin-table th:first-child,
  .admin-table td:first-child { display: none; } /* 隐藏头像列 */
  .admin-avatar { width: 28px !important; height: 28px !important; }
  .role-badge { font-size: 0.65rem; padding: 1px 6px; }
  .admin-table .btn { font-size: 0.7rem; padding: 3px 6px; white-space: nowrap; }

  /* 详情页 */
  .detail-card { padding: 14px; }
  .detail-content { font-size: 0.9rem; }

  /* 个人资料弹窗 */
  .profile-avatar { width: 60px !important; height: 60px !important; }

  /* 分页 */
  .pagination { gap: 4px; flex-wrap: wrap; justify-content: center; }
  .pagination button { padding: 5px 10px; font-size: 0.8rem; }

  /* FAB */
  .fab { width: 48px; height: 48px; bottom: 16px; right: 16px; }

  /* Toast */
  .toast { font-size: 13px; padding: 8px 16px; max-width: 90vw; }

  /* 图片灯箱 */
  .lightbox img { max-width: 95vw; max-height: 85vh; }
}

/* 超小屏幕 */
@media (max-width: 360px) {
  .header-inner { padding: 8px 10px; }
  .logo { font-size: 0.9rem; }
  .card { padding: 12px; }
  .feed { padding: 8px; gap: 8px; }
  .post-footer { gap: 6px; }
  .modal { padding: 16px; }
  .admin-table th:nth-child(3),
  .admin-table td:nth-child(3) { display: none; } /* 隐藏用户名列 */
}

/* 用户管理头像尺寸限制 */
.user-item img,
.user-info img {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  max-width: 36px;
  border-radius: 50%;
  object-fit: cover;
}

/* 管理面板表格 */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.admin-avatar {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.role-badge {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--border);
  color: var(--text-secondary);
}

.role-badge.role-admin { background: rgba(59,130,246,0.15); color: #60a5fa; }
.role-badge.role-superadmin { background: rgba(245,158,11,0.15); color: #fbbf24; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  transition: background 0.2s;
}

.back-link:hover { background: var(--border); }

/* ========== Lucide Icons ========== */
.icon-inline {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}

.logo .icon-inline {
  width: 1.1em;
  height: 1.1em;
}

.btn-icon .icon-inline {
  width: 1.2em;
  height: 1.2em;
}


/* ========== 评论区 ========== */
.comment-section {
  margin-top: 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.comment-section h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-input {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: center;
}

.comment-input input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9em;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.comment-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.comment-input input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.comment-input .btn {
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.85em;
  white-space: nowrap;
}

/* comment-item replaced by comment-card */

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

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

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

.comment-author {
  font-weight: 600;
  font-size: 0.88em;
  color: var(--text);
}

.comment-time {
  font-size: 0.78em;
  color: var(--text-secondary);
}

.comment-delete {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.78em;
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
  padding: 2px 6px;
  border-radius: 4px;
}

.comment-item:hover .comment-delete {
  opacity: 0.7;
}

.comment-delete:hover {
  opacity: 1 !important;
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.comment-text {
  font-size: 0.93em;
  color: var(--text);
  line-height: 1.6;
  word-break: break-word;
}

.comment-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 30px 20px;
  font-size: 0.9em;
}

/* ========== 通知弹窗 ========== */
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
}

.notif-item:hover {
  background: var(--hover-bg);
}

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

.notif-item.read {
  opacity: 0.55;
}

.notif-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

.notif-body {
  flex: 1;
}

.notif-text {
  font-size: 0.93em;
  color: var(--text);
  line-height: 1.5;
}

.notif-text strong {
  font-weight: 600;
}

.notif-time {
  font-size: 0.78em;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 通知铃铛 */
.notif-bell {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  color: var(--text);
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
}

.notif-bell:hover {
  background: var(--hover-bg);
}

.notif-badge {
  position: absolute;
  top: 0;
  right: -2px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65em;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  text-align: center;
  line-height: 16px;
  font-weight: 700;
  border: 2px solid var(--card-bg);
}


/* ========== 用户管理卡片 ========== */
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-user-card {
  background: var(--hover-bg);
  border-radius: 10px;
  padding: 14px;
  transition: box-shadow 0.2s;
}

.admin-user-card:hover {
  box-shadow: var(--shadow-hover);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.admin-user-detail {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-username {
  font-size: 0.82em;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  align-items: center;
}

.admin-user-actions .btn-sm {
  font-size: 0.8em;
  padding: 5px 12px;
  border-radius: 6px;
}

.btn-danger {
  background: #ef4444 !important;
  color: #fff !important;
}

.btn-danger:hover {
  background: #dc2626 !important;
}

.btn-warn {
  background: #f59e0b !important;
  color: #fff !important;
}

.btn-warn:hover {
  background: #d97706 !important;
}

.reset-code-display {
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 1.5px;
  font-size: 0.95em;
}

.role-badge {
  font-size: 0.75em;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.role-superadmin {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
}

.role-admin {
  background: rgba(59,130,246,0.15);
  color: #60a5fa;
}

.role-guest {
  background: rgba(255,255,255,0.06);
  color: #86868b;
}

/* 手机端适配 */
@media (max-width: 480px) {
  .admin-user-info {
    gap: 10px;
  }

  .admin-avatar {
    width: 38px;
    height: 38px;
  }

  .admin-user-name {
    font-size: 0.9em;
  }

  .admin-user-actions {
    gap: 5px;
  }

  .admin-user-actions .btn-sm {
    font-size: 0.75em;
    padding: 4px 10px;
  }
}





/* ===== Douyin-style Comment Cards ===== */
.comment-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.comment-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.comment-main {
  display: flex;
  gap: 12px;
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
}

/* Reply list: flat, one-level indent */
.reply-list {
  margin-top: 10px;
  margin-left: 48px;
  padding: 8px 12px;
  background: var(--hover-bg);
  border-radius: 10px;
}
.reply-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(128,128,128,0.1);
}
.reply-item:last-child {
  border-bottom: none;
}
.reply-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.reply-body {
  flex: 1;
  min-width: 0;
}
.reply-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.reply-author {
  font-weight: 600;
  font-size: 0.82em;
  color: var(--text);
}
.reply-time {
  font-size: 0.74em;
  color: var(--text-secondary);
}
.reply-text {
  font-size: 0.88em;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}
.comment-reply-tag {
  font-size: 0.78em;
  color: var(--primary);
}
.comment-reply-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78em;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.comment-card:hover .comment-reply-btn,
.reply-item:hover .comment-reply-btn {
  opacity: 1;
}
.comment-reply-btn:hover {
  color: var(--primary);
}
.comment-delete {
  opacity: 0;
}
.comment-card:hover .comment-delete,
.reply-item:hover .comment-delete {
  opacity: 0.7;
}
.comment-reply-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--hover-bg);
  border-radius: 10px 10px 0 0;
  font-size: 0.85rem;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  margin-bottom: -1px;
}
.comment-reply-cancel {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 0 4px;
  line-height: 1;
}
.comment-reply-cancel:hover {
  color: var(--text-primary);
}


/* ===== Announcement Styles ===== */
.announcement-view {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px;
}
.announce-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.announce-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
}
.announce-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.announce-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.announce-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  transform: translateY(-1px);
}
.announce-pinned {
  border-left: 3px solid var(--primary);
  background: linear-gradient(135deg, rgba(59,130,246,0.04), var(--card-bg));
}
.announce-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.announce-pin {
  font-size: 0.75em;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}
.announce-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.announce-preview {
  font-size: 0.88em;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}
.announce-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78em;
  color: var(--text-secondary);
}
.announce-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.btn-text {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.82em;
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s;
}
.btn-text:hover {
  background: rgba(79,70,229,0.08);
}
.btn-text.btn-danger {
  color: #ef4444;
}
.btn-text.btn-danger:hover {
  background: rgba(239,68,68,0.08);
}
.announce-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 40px 20px;
  font-size: 0.95em;
}

/* Detail */
.announce-detail-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.announce-detail-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 8px 0 12px;
  color: var(--text);
}
.announce-detail-meta {
  display: flex;
  gap: 12px;
  font-size: 0.82em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.announce-detail-content {
  font-size: 0.95em;
  line-height: 1.8;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Form */
.announce-form {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.announce-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95em;
  outline: none;
  transition: border-color 0.2s;
}
.announce-input:focus {
  border-color: var(--primary);
}
.announce-textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.93em;
  outline: none;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  line-height: 1.6;
  transition: border-color 0.2s;
}
.announce-textarea:focus {
  border-color: var(--primary);
}
.announce-pin-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88em;
  color: var(--text-secondary);
  cursor: pointer;
}


/* ===== Multi-Image Grid ===== */
.img-grid {
  display: grid;
  gap: 4px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}
.img-grid-1 { grid-template-columns: 1fr; }
.img-grid-3 { grid-template-columns: repeat(3, 1fr); }
.img-grid-4 { grid-template-columns: repeat(3, 1fr); }
.img-grid-item {
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--border);
}
.img-grid-1 .img-grid-item { aspect-ratio: auto; max-height: 400px; }
.img-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.img-grid-item:hover img { transform: scale(1.03); }

/* Image Viewer Overlay */
.img-viewer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.92);
  z-index: 1000; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.img-viewer-img {
  max-width: 90vw; max-height: 85vh; object-fit: contain;
  border-radius: 4px; cursor: default;
}
.img-viewer-close {
  position: absolute; top: 16px; right: 20px;
  color: #fff; font-size: 28px; cursor: pointer; z-index: 1001;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.1);
  transition: background 0.2s;
}
.img-viewer-close:hover { background: rgba(255,255,255,0.2); }
.img-viewer-counter {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.7); font-size: 14px;
}
.img-viewer-prev, .img-viewer-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: #fff; font-size: 40px; cursor: pointer; z-index: 1001;
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.1);
  transition: background 0.2s; user-select: none;
}
.img-viewer-prev { left: 16px; }
.img-viewer-next { right: 16px; }
.img-viewer-prev:hover, .img-viewer-next:hover { background: rgba(255,255,255,0.25); }

/* Multi-image preview in publish */
.images-preview {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.img-preview-item {
  position: relative; width: 72px; height: 72px;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
}
.img-preview-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.img-preview-item .remove-img {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  font-size: 12px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; line-height: 1;
}


/* ===== PC Drawer Detail Panel ===== */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
  backdrop-filter: blur(2px);
}
.drawer-overlay.show { display: block; }

#detailView.drawer-mode {
  position: fixed;
  top: 0; right: 0;
  width: 520px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg);
  z-index: 501;
  overflow-y: auto;
  padding: 20px 24px;
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
#detailView.drawer-mode.drawer-open {
  transform: translateX(0);
}
#detailView.drawer-mode .back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}
#detailView.drawer-mode .card.post-card {
  box-shadow: none;
  border: 1px solid var(--border);
}
#detailView.drawer-mode .comment-section {
  margin-top: 16px;
}
#detailView.drawer-mode .comment-section h4 {
  font-size: 0.95rem;
}

/* Scrollbar styling for drawer */
#detailView.drawer-mode::-webkit-scrollbar {
  width: 6px;
}
#detailView.drawer-mode::-webkit-scrollbar-track {
  background: transparent;
}
#detailView.drawer-mode::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
#detailView.drawer-mode::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}


/* ===== Visitor Panel ===== */
.visitor-panel {
  margin-bottom: 16px;
  padding: 16px;
}
.visitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.visitor-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
}
.visitor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.visitor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.visitor-item:last-child { border-bottom: none; }
.visitor-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.visitor-ip-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.visitor-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.visitor-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visitor-name.visitor-ip {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.visitor-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.visitor-list::-webkit-scrollbar { width: 4px; }
.visitor-list::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 2px; }


/* ========== 文章页样式 ========== */
.nav-link { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--primary); }

.article-list { max-width: 720px; margin: 0 auto; padding: 16px; }

.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.article-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}
.article-card-summary {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}
.article-card-cover {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}

/* 文章详情 */
.article-detail {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}
.article-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.4;
}
.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.article-detail-content {
  font-size: 1rem;
  line-height: 2;
  color: var(--text-primary);
  word-break: break-word;
}

/* 发布文章表单 */
.article-form {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}
.article-form input[type="text"],
.article-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 12px;
  font-family: inherit;
}
.article-form textarea {
  min-height: 300px;
  resize: vertical;
  line-height: 1.8;
}
.article-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.article-editor-form { max-width: 880px; }
.editor-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.editor-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.editor-status-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.editor-pill,
.editor-dirty {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: rgba(127,127,127,0.1);
}
.editor-pill[data-state="typing"] {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(59,130,246,0.12);
}
.editor-pill[data-state="saved"] {
  color: #16a34a;
  border-color: rgba(22,163,74,0.45);
  background: rgba(22,163,74,0.12);
}
.editor-pill[data-state="dirty"] {
  color: #ea580c;
  border-color: rgba(234,88,12,0.45);
  background: rgba(234,88,12,0.12);
}
.editor-dirty[data-state="dirty"] {
  color: #ea580c;
  border-color: rgba(234,88,12,0.45);
  background: rgba(234,88,12,0.12);
}
.editor-dirty[data-state="clean"] {
  color: #16a34a;
  border-color: rgba(22,163,74,0.45);
  background: rgba(22,163,74,0.12);
}
.editor-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}
.editor-shortcut {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--text-secondary);
}
.draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px dashed var(--primary);
  border-radius: 10px;
  background: rgba(59,130,246,0.08);
  color: var(--text-secondary);
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.draft-banner-actions {
  display: inline-flex;
  gap: 8px;
}
.article-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.article-editor-form .article-form-grid input[type="text"] {
  margin-bottom: 4px;
}
.cover-upload-box {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: rgba(127,127,127,0.04);
}
.cover-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--primary);
  font-size: 0.9rem;
}
.cover-preview-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.cover-preview-image {
  max-width: min(100%, 260px);
  max-height: 150px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.article-editor-form .vditor {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-editor-form .toastui-editor-defaultUI {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.article-editor-form .toastui-editor-defaultUI-toolbar {
  background: var(--card-bg);
  border-bottom-color: var(--border);
}
.article-editor-form .toastui-editor-main {
  background: var(--card-bg);
}
.article-editor-form .toastui-editor-contents {
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.8;
}
.blog-fallback-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 380px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.96rem;
  line-height: 1.8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.article-editor-form .vditor-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--card-bg);
}
.article-editor-form .article-form-actions {
  position: sticky;
  bottom: 8px;
  z-index: 6;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .editor-panel {
    background: rgba(16,18,22,0.88);
    border-color: rgba(255,255,255,0.12);
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-defaultUI {
    border-color: rgba(255,255,255,0.14);
    background: #0f1115;
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-defaultUI-toolbar,
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-toolbar {
    background: #131722;
    border-bottom-color: rgba(255,255,255,0.12);
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-toolbar button {
    color: #d1d5db;
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-toolbar button:hover {
    background: rgba(255,255,255,0.08);
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-main,
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-md-container,
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-ww-container,
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-md-preview {
    background: #0f1115;
    color: #e5e7eb;
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-contents,
  :root:not([data-theme="light"]) .article-detail-content .toastui-editor-contents {
    color: #e5e7eb;
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-contents code,
  :root:not([data-theme="light"]) .article-detail-content .toastui-editor-contents code {
    background: #1a2030;
    color: #93c5fd;
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-contents pre,
  :root:not([data-theme="light"]) .article-detail-content .toastui-editor-contents pre {
    background: #111827;
    border: 1px solid rgba(255,255,255,0.12);
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-popup,
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-context-menu,
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-dropdown-toolbar {
    background: #121826;
    border-color: rgba(255,255,255,0.14);
    color: #e5e7eb;
  }
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-popup input,
  :root:not([data-theme="light"]) .article-editor-form .toastui-editor-popup label {
    color: #e5e7eb;
    background: transparent;
  }
  :root:not([data-theme="light"]) .article-editor-form .article-form-actions {
    background: rgba(10,12,16,0.92);
  }
}

@media (max-width: 768px) {
  .article-editor-form { max-width: 100%; }
  .article-form-grid { grid-template-columns: 1fr; }
  .editor-panel { padding: 12px; border-radius: 10px; }
  .editor-topbar { gap: 8px; }
  .editor-stats { width: 100%; font-size: 0.76rem; }
  .editor-shortcut { display: none; }
  .article-editor-form .article-form-actions {
    bottom: 6px;
    padding: 6px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .article-editor-form .article-form-actions .btn {
    flex: 1;
    min-width: 0;
  }
  .blog-fallback-textarea {
    min-height: 300px;
  }
}

.article-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.article-header {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}


/* ========== 杂谈专属样式 ========== */
.chitchat-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.85rem;
}
.chitchat-author { color: var(--text-primary); font-weight: 500; }
.chitchat-time { color: var(--muted); }
.chitchat-content {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.7;
  word-break: break-word;
}
.chitchat-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.7;
}
.chitchat-form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 10px;
  font-family: inherit;
}
