/* ========== 全局变量 ========== */
:root {
  --primary: #07c160;
  --primary-dark: #06ad56;
  --primary-light: #e8f9f0;
  --secondary: #576b95;
  --danger: #fa5151;
  --danger-dark: #e04848;
  --warning: #fa9d3b;
  --success: #07c160;
  --info: #10aeff;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --border-light: #f0f0f0;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #a0aec0;
  --sidebar-active: #2d3748;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar-width: 240px;
}

/* ========== 重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}
input, textarea, select, button { font-family: inherit; font-size: inherit; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* ========== 侧边栏 ========== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}
.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-header .logo {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}
.sidebar-header h1 {
  font-size: 16px;
  color: white;
  font-weight: 600;
  white-space: nowrap;
}
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  color: var(--sidebar-text);
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: white; }
.nav-item.active {
  background: var(--primary);
  color: white;
}
.nav-item svg { flex-shrink: 0; }
.nav-item span { font-weight: 500; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.config-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--danger);
  flex-shrink: 0;
}
.config-status.configured .status-dot { background: var(--success); }

/* ========== 主内容区 ========== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* ========== 页面切换 ========== */
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-header h2 { font-size: 24px; font-weight: 700; }
.page-subtitle { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }

/* ========== 统计卡片 ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon-blue { background: #e3f2fd; color: #1976d2; }
.stat-icon-yellow { background: #fff8e1; color: #f57f17; }
.stat-icon-purple { background: #f3e5f5; color: #7b1fa2; }
.stat-icon-green { background: #e8f5e9; color: #2e7d32; }
.stat-icon-red { background: #ffebee; color: #c62828; }
.stat-icon-cyan { background: #e0f7fa; color: #00838f; }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { color: var(--text-secondary); font-size: 13px; }

/* ========== 仪表盘分区 ========== */
.dashboard-section { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.section-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.section-card h3 { font-size: 16px; margin-bottom: 16px; font-weight: 600; }
.upcoming-list, .recent-list { display: flex; flex-direction: column; gap: 8px; max-height: 400px; overflow-y: auto; }

.upcoming-item, .recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  gap: 12px;
}
.upcoming-item-info { flex: 1; min-width: 0; }
.upcoming-item-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-item-time { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.recent-item .recent-status { font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 4px; white-space: nowrap; }
.recent-status.success { background: var(--primary-light); color: var(--success); }
.recent-status.failed { background: #ffebee; color: var(--danger); }
.recent-status.status_check { background: #e3f2fd; color: var(--info); }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #d1d5db; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-success { background: var(--success); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

/* ========== 文章列表 ========== */
.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.2s;
}
.article-card:hover { box-shadow: var(--shadow); }
.article-thumb {
  width: 80px; height: 60px;
  border-radius: var(--radius);
  background: var(--border-light);
  object-fit: cover;
  flex-shrink: 0;
}
.article-thumb-placeholder {
  width: 80px; height: 60px;
  border-radius: var(--radius);
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
}
.article-info { flex: 1; min-width: 0; }
.article-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.article-card-title { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); }
.article-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ========== 状态标签 ========== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-draft { background: #f0f0f0; color: #666; }
.tag-scheduled { background: #fff3e0; color: #e65100; }
.tag-published { background: var(--primary-light); color: var(--success); }
.tag-failed { background: #ffebee; color: var(--danger); }
.tag-publishing { background: #e3f2fd; color: #1976d2; }
.tag-pending { background: #fff3e0; color: #e65100; }
.tag-completed { background: var(--primary-light); color: var(--success); }
.tag-cancelled { background: #f0f0f0; color: #999; }
.tag-running { background: #e3f2fd; color: #1976d2; }

/* ========== 编辑器 ========== */
.editor-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.editor-main { display: flex; flex-direction: column; gap: 20px; }
.editor-actions { display: flex; gap: 8px; }

/* 类型选择器 */
.type-selector {
  display: flex;
  gap: 12px;
}
.type-option {
  flex: 1;
  cursor: pointer;
}
.type-option input { display: none; }
.type-option-content {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
  font-weight: 500;
  color: var(--text-secondary);
}
.type-option input:checked + .type-option-content {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.type-option:hover .type-option-content {
  border-color: var(--primary);
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.required { color: var(--danger); }
.hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"], textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  transition: border-color 0.2s;
  color: var(--text);
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(7,193,96,0.1); }
textarea { resize: vertical; }

/* 富文本编辑器 */
.rich-editor-wrapper { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.rich-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.rich-toolbar button {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 14px;
  transition: background 0.2s;
}
.rich-toolbar button:hover { background: var(--border-light); }
.toolbar-divider { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.rich-editor {
  min-height: 400px;
  padding: 16px;
  outline: none;
  overflow-y: auto;
  max-height: 600px;
  line-height: 1.8;
}
.rich-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
  pointer-events: none;
}
.rich-editor h2 { font-size: 20px; margin: 12px 0 8px; }
.rich-editor h3 { font-size: 17px; margin: 10px 0 6px; }
.rich-editor p { margin: 8px 0; }
.rich-editor img { max-width: 100%; border-radius: 4px; margin: 8px 0; }
.rich-editor ul, .rich-editor ol { margin: 8px 0; padding-left: 24px; }
.rich-editor li { margin: 4px 0; }
.rich-editor a { color: var(--secondary); text-decoration: underline; }

/* 表情包选择器 */
.emoji-picker {
  position: relative;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.emoji-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
}
.emoji-tab {
  width: 36px; height: 32px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
}
.emoji-tab:hover { background: var(--border-light); }
.emoji-tab.active { background: var(--border-light); }
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  padding: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.emoji-grid button {
  width: 100%;
  aspect-ratio: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.emoji-grid button:hover { background: var(--border-light); transform: scale(1.2); }

/* 编辑器侧边栏 */
.editor-sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.sidebar-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.thumb-preview {
  width: 100%;
  aspect-ratio: 2.35 / 1;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: border-color 0.2s;
}
.thumb-preview:hover { border-color: var(--primary); }
.thumb-preview img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { color: var(--text-tertiary); font-size: 13px; }
.thumb-info { margin-top: 8px; font-size: 12px; }
.thumb-info.success { color: var(--success); }
.thumb-info.error { color: var(--danger); }

.checkbox-group { margin-bottom: 8px; }
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
}
.checkbox-group input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }

/* ========== 定时任务列表 ========== */
.schedule-list, .history-list { display: flex; flex-direction: column; gap: 12px; }
.schedule-card, .history-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.schedule-info { flex: 1; min-width: 0; }
.schedule-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.schedule-meta { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }

/* 定时任务账号状态 */
.schedule-accounts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.account-result { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.account-result-success { background: #e8f5e9; color: #2e7d32; }
.account-result-fail { background: #ffebee; color: #c62828; }
.account-result-pending { background: #f5f5f5; color: #757575; }
.account-result .result-error { font-size: 11px; color: #c62828; margin-left: 4px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.history-info { flex: 1; min-width: 0; }
.history-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.history-message { font-size: 13px; color: var(--text-secondary); word-break: break-all; }
.history-time { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* ========== 设置 ========== */
.settings-container { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 900px; }
.settings-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.settings-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.settings-actions { display: flex; gap: 12px; margin-top: 8px; }
.settings-help ol { padding-left: 20px; }
.settings-help li { margin-bottom: 8px; color: var(--text-secondary); line-height: 1.8; }
.help-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fff3e0;
  border-radius: var(--radius);
  font-size: 13px;
  color: #5d4037;
}
.help-note-info { background: #e3f2fd; color: #0d47a1; }

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

/* ========== Toast 通知 ========== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
  border-left: 4px solid var(--info);
  font-size: 14px;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.fade-out { animation: slideOut 0.3s ease forwards; }
@keyframes slideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { to { transform: translateX(400px); opacity: 0; } }

/* ========== 模态框 ========== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.modal-overlay.show,
.modal-overlay.active { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { padding: 20px 24px 0; flex-shrink: 0; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-body { padding: 16px 24px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-body p { color: var(--text-secondary); }
.modal-footer { padding: 0 24px 20px; display: flex; justify-content: flex-end; gap: 8px; flex-shrink: 0; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-tertiary);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.modal-close:hover { color: var(--text); }
.loading-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 账号管理 ========== */
.account-list { display: flex; flex-direction: column; gap: 12px; }
.account-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow 0.2s;
}
.account-card:hover { box-shadow: var(--shadow); }
.account-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.account-info { flex: 1; min-width: 0; }
.account-name { font-weight: 600; font-size: 16px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-detail { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.account-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* 公众号分类标签 */
.account-category-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}

/* 分类管理区 */
.category-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.category-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.category-section-header h3 { margin: 0; font-size: 16px; }
.category-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.category-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.category-card:hover { border-color: var(--primary); }
.category-card.category-uncategorized { opacity: 0.7; }
.category-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.category-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.category-name { font-weight: 600; font-size: 14px; }
.category-count { font-size: 12px; color: var(--text-secondary); }
.category-followers { font-size: 12px; color: var(--primary); font-weight: 600; }
.category-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* 分类颜色选择器 */
.color-picker-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-option {
  cursor: pointer;
  display: inline-flex;
}
.color-option input[type="radio"] {
  display: none;
}
.color-option span {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}
.color-option input[type="radio"]:checked + span {
  border-color: var(--text);
  transform: scale(1.1);
}

/* 公众号列表区标题 */
.account-section-header h3 { margin: 0; font-size: 16px; }

/* 账号标签（在列表/历史中显示） */
.account-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  white-space: nowrap;
}
.account-badge-none {
  background: #f0f0f0;
  color: #999;
}

/* 公众号多选器 */
.account-selector {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.account-selector-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}
.account-selector-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
}
.account-checkbox-list {
  max-height: 160px;
  overflow-y: auto;
  padding: 4px 0;
}
.account-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.account-checkbox-item:hover {
  background: var(--bg-secondary);
}
.account-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.account-checkbox-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}
.account-checkbox-id {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-left: auto;
}
.btn-xs {
  padding: 3px 8px;
  font-size: 10px;
  border-radius: 4px;
}

/* select 下拉框样式 */
select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  transition: border-color 0.2s;
  color: var(--text);
  cursor: pointer;
  appearance: auto;
}
select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(7,193,96,0.1); }

/* ========== 自定义菜单编辑器 ========== */
.menu-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}
.menu-editor {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.menu-col {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}
.menu-col-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.menu-col-header input {
  flex: 1;
  min-width: 80px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
}
.menu-col-header .btn { flex-shrink: 0; }
.menu-col-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.menu-col-actions .btn {
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.menu-col-type {
  display: flex;
  gap: 8px;
  align-items: center;
}
.menu-col-type select { width: 100%; }
.menu-col-type input { flex: 1; }
.menu-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.menu-field-group input { width: 100%; padding: 6px 10px; font-size: 11px; border: 1px solid var(--border); border-radius: var(--radius); }
.menu-field-group input:focus { outline: none; border-color: var(--primary); }
.menu-reply-textarea {
  width: 100%;
  min-height: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  line-height: 1.6;
  resize: vertical;
  font-family: inherit;
}
.menu-reply-textarea:focus { outline: none; border-color: var(--primary); }

/* ========== 表情选择器 ========== */
.menu-reply-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.emoji-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 10px;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.emoji-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.emoji-picker {
  position: absolute;
  z-index: 9999;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 340px;
  display: none;
  overflow: hidden;
}
.emoji-picker-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.emoji-tab {
  padding: 8px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.emoji-tab:hover { color: var(--text); }
.emoji-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.emoji-item {
  font-size: 20px;
  text-align: center;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.1s;
  user-select: none;
}
.emoji-item:hover {
  background: var(--primary-light);
  transform: scale(1.2);
}
.emoji-picker-footer {
  padding: 8px 12px;
  text-align: right;
  border-top: 1px solid var(--border);
}
.emoji-close-btn {
  padding: 4px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.emoji-close-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ========== 插入链接对话框 ========== */
.link-dialog {
  position: absolute;
  z-index: 9999;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 300px;
  display: none;
  padding: 16px;
}
.link-dialog-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.link-dialog-field {
  margin-bottom: 10px;
}
.link-dialog-field label {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 600;
}
.link-dialog-field input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  font-family: inherit;
}
.link-dialog-field input:focus {
  outline: none;
  border-color: var(--primary);
}
.link-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.link-dialog-cancel {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
}
.link-dialog-cancel:hover {
  border-color: var(--text-secondary);
}
.link-dialog-confirm {
  padding: 6px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.link-dialog-confirm:hover {
  background: var(--primary-dark);
}
.menu-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}
.menu-type-badge.badge-blue { background: #e3f2fd; color: #1565c0; }
.menu-type-badge.badge-green { background: #e8f5e9; color: #2e7d32; }
.menu-type-badge.badge-purple { background: #f3e5f5; color: #7b1fa2; }
.menu-type-badge.badge-orange { background: #fff3e0; color: #e65100; }
.menu-sub-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.menu-sub-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border-light);
}
.menu-sub-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.menu-sub-item-row input { flex: 1; padding: 6px 10px; font-size: 11px; }
.menu-sub-item-row select { width: 100%; padding: 6px 10px; font-size: 11px; }
.menu-sub-item-row .btn-sm { flex-shrink: 0; }
.menu-add-sub {
  text-align: center;
  padding: 8px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 11px;
  transition: all 0.2s;
}
.menu-add-sub:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.menu-add-col {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 12px;
  transition: all 0.2s;
  min-height: 200px;
}
.menu-add-col:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.menu-hint { font-size: 10px; color: var(--text-tertiary); }
.menu-label { font-size: 10px; font-weight: 600; color: var(--text-secondary); }

/* ========== 手机预览面板 ========== */
.menu-preview-panel {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.menu-preview-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-left: 4px;
}
.phone-preview {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  background: #1a1a1a;
  border-radius: 44px;
  padding: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 2px #2a2a2a inset;
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 24px;
  background: #1a1a1a;
  border-radius: 14px;
  z-index: 20;
}
.phone-screen {
  background: #f5f5f5;
  border-radius: 34px;
  overflow: hidden;
  position: relative;
}
.phone-header {
  background: #ededed;
  padding: 28px 12px 8px;
  text-align: center;
  border-bottom: 1px solid #d9d9d9;
}
.phone-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px 4px;
  font-size: 9px;
  font-weight: 600;
  color: #333;
}
.phone-title {
  font-size: 11px;
  font-weight: 600;
  color: #333;
}
.phone-body {
  padding: 20px 12px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}
.phone-chat-bubble {
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 10px;
  color: #333;
  max-width: 80%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  word-break: break-word;
  line-height: 1.6;
}
.phone-chat-reply {
  border-top-left-radius: 0;
  align-self: flex-start;
}
.phone-chat-info {
  background: #fff;
  color: #888;
  border-top-left-radius: 0;
  align-self: flex-start;
}
.phone-chat-user {
  display: flex;
  justify-content: flex-end;
}
.phone-chat-user .phone-chat-bubble {
  background: #07c160;
  color: white;
  border-top-left-radius: 8px;
  border-top-right-radius: 0;
}
.phone-link {
  color: #1a73e8;
  text-decoration: underline;
  word-break: break-all;
}
.phone-link:hover { color: #1557b0; }
.phone-link-mini {
  color: #07c160;
  font-weight: 500;
}
.phone-link-mini:hover { color: #06ad56; }
.phone-menu-bar {
  display: flex;
  background: #f7f7f7;
  border-top: 1px solid #d9d9d9;
  min-height: 48px;
}
.phone-menu-item {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: #333;
  padding: 12px 4px;
  cursor: pointer;
  position: relative;
  border-right: 1px solid #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-menu-item:last-child { border-right: none; }
.phone-menu-item:hover { background: #eaeaea; }
.phone-menu-item .phone-sub-arrow {
  font-size: 6px;
  color: #999;
  margin-left: 2px;
}
.phone-sub-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.15);
  z-index: 10;
}
.phone-sub-menu-item {
  padding: 10px 8px;
  font-size: 10px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-sub-menu-item:last-child { border-bottom: none; }
.phone-sub-menu-item:hover { background: #f5f5f5; }
.phone-menu-placeholder {
  flex: 1;
  text-align: center;
  font-size: 10px;
  color: #999;
  padding: 16px 4px;
}

/* 菜单类型说明 */
.menu-type-guide {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.menu-type-guide-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.menu-type-guide-item {
  font-size: 10px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-blue { background: #1565c0; }
.dot-green { background: #2e7d32; }
.dot-purple { background: #7b1fa2; }

/* ========== 复制目标列表 ========== */
.copy-target-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.copy-target-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}
.copy-target-item:hover { border-color: var(--primary); background: var(--primary-light); }
.copy-target-item.selected { border-color: var(--primary); background: var(--primary-light); }
.copy-target-item input[type="checkbox"] { width: 16px; height: 16px; }
.copy-target-item .copy-target-name { font-size: 14px; font-weight: 500; }
.copy-target-item .copy-target-id { font-size: 11px; color: var(--text-tertiary); }

/* ========== 模板列表 ========== */
.template-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
}
.template-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.2s;
}
.template-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.template-card-info { flex: 1; }
.template-card-name { font-size: 14px; font-weight: 600; }
.template-card-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.template-card-preview { font-size: 12px; color: var(--text-secondary); margin-top: 4px; padding: 4px 8px; background: var(--bg-secondary); border-radius: 4px; }
.template-card-actions { display: flex; gap: 6px; }

/* ========== 模板网格卡片 ========== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  max-height: 450px;
  overflow-y: auto;
  padding: 4px;
}
.template-grid-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s;
  position: relative;
}
.template-grid-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.template-grid-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.template-grid-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.template-grid-card-index {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 10px;
}
.template-grid-card-preview {
  min-height: 32px;
  line-height: 1.8;
}
.template-grid-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.template-grid-card-time {
  font-size: 11px;
  color: var(--text-tertiary);
}
.template-grid-card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

/* ========== 单列菜单模板卡片 ========== */
.column-template-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s;
}
.column-template-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  background: var(--primary-light);
}
.column-template-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.column-template-card-name {
  font-size: 13px;
  font-weight: 700;
}
.column-template-card-type {
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-secondary);
}
.column-template-card-info {
  display: flex;
  gap: 12px;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.column-template-card-time {
  font-size: 9px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}
.column-template-card-actions {
  display: flex;
  gap: 6px;
}

/* ========== 测试发送弹窗 ========== */
.follower-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
}
.follower-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.follower-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-light);
}
.follower-item:last-child { border-bottom: none; }
.follower-item:hover { background: var(--primary-light); }
.follower-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  object-fit: cover;
  margin-top: 2px;
}

/* ========== IP 白名单配置卡片 ========== */
.ip-whitelist-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.ip-whitelist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.ip-whitelist-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.ip-whitelist-body { font-size: 14px; }
.ip-whitelist-hint {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}
.ip-whitelist-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ip-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.6;
}
.ip-step.done {
  background: var(--primary-light);
  color: var(--success);
  font-weight: 500;
}
.ip-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.ip-step.done .ip-step-num {
  background: var(--success);
  color: white;
}
.ip-whitelist-link {
  color: var(--info);
  text-decoration: underline;
}
.ip-whitelist-link:hover {
  opacity: 0.8;
}
.ip-result {
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.ip-result-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.ip-result-value {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ip-code {
  font-family: 'Courier New', monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  background: white;
  padding: 6px 16px;
  border-radius: var(--radius);
  border: 2px solid var(--primary);
}
.ip-whitelist-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: #fff8e1;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.ip-whitelist-note strong {
  color: var(--warning);
}
.ip-manual-input {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ip-manual-input-field {
  flex: 1;
  min-width: 200px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Courier New', monospace;
  outline: none;
  transition: border-color 0.2s;
}
.ip-manual-input-field:focus {
  border-color: var(--primary);
}
.callback-config-hint {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 8px;
  font-size: 13px;
  line-height: 2;
  color: var(--text-secondary);
}
.callback-config-hint code {
  background: white;
  padding: 2px 8px;
  border-radius: 4px;
  color: var(--primary);
  font-family: 'Courier New', monospace;
  font-size: 12px;
}
.callback-config-hint strong {
  color: var(--text);
}
.follower-avatar-placeholder {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.follower-info { flex: 1; min-width: 0; }
.follower-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.follower-name { font-weight: 600; font-size: 14px; }
.follower-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.tag-male { background: #e6f7ff; color: #1890ff; }
.tag-female { background: #fff0f0; color: #f5222d; }
.tag-unknown { background: #f5f5f5; color: #757575; }
.tag-region { background: #f6ffed; color: #52c41a; }
.follower-id-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.follower-id-label {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.follower-id-value {
  font-size: 11px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.follower-sub-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* ========== 第三方平台配置 ========== */
.component-config-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.component-config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.component-config-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.component-config-body { font-size: 14px; }
.component-config-hint {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}
.component-config-view, .component-config-edit {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.config-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius);
}
.config-label {
  min-width: 160px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
}
.config-value {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
  font-family: 'Courier New', monospace;
}
.config-url {
  color: var(--primary);
}
.config-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.btn-copy-sm {
  padding: 4px 12px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-copy-sm:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.component-config-edit .form-group {
  margin-bottom: 12px;
}
.component-config-edit label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.component-config-edit input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Courier New', monospace;
}

/* ========== 用户管理页面 ========== */
.user-stats-summary {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.user-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}
.user-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.user-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.user-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.user-card:hover { box-shadow: var(--shadow); }
.user-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  object-fit: cover;
  margin-top: 2px;
}
.user-avatar-placeholder {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.user-info { flex: 1; min-width: 0; }
.tag-account {
  background: #e3f2fd;
  color: #1565c0;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .editor-layout { grid-template-columns: 1fr; }
  .dashboard-section { grid-template-columns: 1fr; }
  .settings-container { grid-template-columns: 1fr; }
  .menu-layout { grid-template-columns: 1fr; }
  .menu-preview-panel { position: static; max-width: 400px; }
}
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header h1, .nav-item span, .config-status .status-text { display: none; }
  .sidebar-header { justify-content: center; }
  .nav-item { justify-content: center; padding: 12px; }
  .main-content { margin-left: 60px; padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .menu-editor { grid-template-columns: 1fr; }
}

/* ========== 前端版本更新 ========== */
/* 侧边栏底部的版本号与「版本更新」按钮 */
.version-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255,255,255,0.10);
}
.version-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 8px;
}
.version-label { color: var(--sidebar-text); }
.version-value { color: #ffffff; font-weight: 600; }
.version-btn {
  width: 100%;
  padding: 7px 12px;
  font-size: 13px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.06);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s;
}
.version-btn:hover { background: var(--primary); border-color: var(--primary); }
.version-btn:active { transform: scale(0.98); }

/* 版本更新弹窗内的版本信息行 */
.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}
.version-row span { color: var(--text-secondary); }
.version-row strong { color: var(--text); }

/* 更新状态提示：默认隐藏，按检查结果切换颜色 */
.version-status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  display: none;
}
.version-status.has-update { display: block; background: #fff7e6; color: #b45309; }
.version-status.up-to-date { display: block; background: var(--primary-light); color: var(--primary-dark); }
.version-status.failed { display: block; background: #fdecec; color: var(--danger-dark); }

/* 更新日志列表 */
.version-log-title {
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.version-log { max-height: 260px; overflow-y: auto; }
.version-log-item {
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.version-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}
.version-log-head span { color: var(--text-tertiary); font-size: 12px; }
.version-log-item ul { padding-left: 18px; list-style: disc; }
.version-log-item li { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.version-log-empty { font-size: 13px; color: var(--text-tertiary); }

/* 窄屏下侧边栏收起，隐藏版本区块避免挤压 */
@media (max-width: 768px) {
  .version-box { display: none; }
}
