/* ============================================
   康寿云·一键发布 v2.1 — 主样式
   设计：现代化 SaaS 风格 / 双主题 / 响应式
   ============================================ */

/* ----- CSS 变量：浅色主题 ----- */
:root {
  --color-primary: #0891b2;
  --color-primary-dark: #0e7490;
  --color-primary-light: #06b6d4;
  --color-accent: #f59e0b;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  --bg-base: #f7f9fc;
  --bg-card: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #f1f5f9;
  --bg-active: #ecfeff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.10), 0 8px 10px -6px rgba(0,0,0,0.05);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --sidebar-width: 240px;
  --topbar-height: 64px;

  --gradient-primary: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
  --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-info: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
}

/* ----- CSS 变量：深色主题 ----- */
[data-theme="dark"] {
  --bg-base: #0f172a;
  --bg-card: #1e293b;
  --bg-sidebar: #1e293b;
  --bg-hover: #334155;
  --bg-active: #164e63;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #64748b;

  --border-color: #334155;
  --border-light: #1e293b;

  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4);
}

/* ----- 基础重置 ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s, color 0.3s;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: inherit; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ----- 应用启动屏 ----- */
.app-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
}
.loader-content { text-align: center; }
.loader-logo { display: inline-block; animation: pulse 1.5s ease-in-out infinite; }
.loader-content h2 { margin: 16px 0 24px; color: var(--text-primary); font-size: 20px; }
.loader-bar {
  width: 240px; height: 4px; background: var(--border-color);
  border-radius: 4px; overflow: hidden; margin: 0 auto 12px;
}
.loader-bar-fill {
  height: 100%; width: 0; background: var(--gradient-primary);
  border-radius: 4px;
  animation: loadBar 1.5s ease-in-out forwards;
}
.loader-content p { color: var(--text-tertiary); font-size: 13px; margin: 0; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes loadBar { from { width: 0; } to { width: 100%; } }

/* ----- App 布局 ----- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* ----- 侧边栏 ----- */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { flex-shrink: 0; }
.brand-name { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.brand-sub { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: all 0.2s;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--bg-active);
  color: var(--color-primary);
  font-weight: 600;
}
.nav-item.active .nav-icon { color: var(--color-primary); }
.nav-icon { flex-shrink: 0; color: var(--text-tertiary); }
.nav-item.active .nav-icon { color: var(--color-primary); }
.nav-badge {
  margin-left: auto;
  background: var(--color-accent);
  color: white; font-size: 11px;
  padding: 2px 7px; border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-md);
  cursor: pointer; transition: background 0.2s;
}
.user-card:hover { background: var(--bg-hover); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gradient-primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-role { font-size: 11px; color: var(--text-tertiary); }

.sidebar-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 99;
}

/* ----- 主内容区 ----- */
.main { display: flex; flex-direction: column; min-height: 100vh; min-width: 0; }

/* ----- 顶部栏 ----- */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 18px; font-weight: 600; color: var(--text-primary); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-stats { display: flex; gap: 12px; }
.stat-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--bg-base);
  border-radius: 20px; font-size: 12px;
  color: var(--text-secondary);
}
.stat-pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-tertiary);
}
.stat-pill-dot.ok { background: var(--color-success); }
.stat-pill-dot.info { background: var(--color-info); }
.stat-pill-dot.warn { background: var(--color-warning); }
.stat-pill-dot.err { background: var(--color-danger); }

.icon-btn {
  width: 36px; height: 36px;
  border: none; background: transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.mobile-only { display: none; }

/* ----- 页面内容 ----- */
.page-content { flex: 1; padding: 24px; max-width: 100%; }
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; flex-wrap: wrap; gap: 16px;
}
.page-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 0 0 4px; }
.page-subtitle { font-size: 13px; color: var(--text-tertiary); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ----- 卡片 ----- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.2s;
}
.card-hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
/* 创作库卡片 */
.library-card { display: flex; flex-direction: column; min-height: 158px; }
.library-card:hover { border-color: var(--color-primary); }
.library-card .badge { font-size: 11px; padding: 2px 8px; }
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.card-title { font-size: 15px; font-weight: 600; color: var(--text-primary); margin: 0; }
.card-subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }

/* ----- 统计卡片 ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 80px; height: 80px;
  background: var(--gradient-primary);
  border-radius: 50%;
  opacity: 0.08;
  transform: translate(30%, -30%);
}
.stat-card.success::before { background: var(--gradient-success); }
.stat-card.warning::before { background: var(--gradient-accent); }
.stat-card.info::before { background: var(--gradient-info); }
.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-active);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.stat-card.success .stat-icon { background: #d1fae5; color: var(--color-success); }
.stat-card.warning .stat-icon { background: #fef3c7; color: var(--color-accent); }
.stat-card.info .stat-icon { background: #dbeafe; color: var(--color-info); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--text-tertiary); margin-top: 4px; }
.stat-trend { font-size: 12px; margin-top: 8px; color: var(--color-success); }
.stat-trend.down { color: var(--color-danger); }

/* ----- 按钮 ----- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-primary);
  border-radius: var(--radius-md);
  font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }
.btn-primary {
  background: var(--gradient-primary);
  color: white; border-color: transparent;
}
.btn-primary:hover { opacity: 0.9; }
.btn-success { background: var(--color-success); color: white; border-color: transparent; }
.btn-danger { background: var(--color-danger); color: white; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { display: flex; width: 100%; justify-content: center; }

/* ----- 表单 ----- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-primary); margin-bottom: 6px;
}
.form-label .required { color: var(--color-danger); }
.form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.form-control {
  display: block; width: 100%;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(8,145,178,0.1);
}
textarea.form-control { min-height: 100px; resize: vertical; font-family: inherit; }
select.form-control { cursor: pointer; }

/* ----- 网格布局 ----- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ----- 平台卡片 ----- */
.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column;
  transition: all 0.2s;
}
.platform-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.platform-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.platform-logo {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px; color: white;
  flex-shrink: 0;
}
.platform-info { flex: 1; min-width: 0; }
.platform-name { font-size: 15px; font-weight: 600; color: var(--text-primary); }
.platform-desc { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.platform-status {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 500;
}
.platform-status.connected { background: #d1fae5; color: var(--color-success); }
.platform-status.disconnected { background: var(--bg-hover); color: var(--text-tertiary); }

/* ----- 标签/Tab ----- */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 10px 16px;
  border: none; background: transparent;
  color: var(--text-secondary);
  font-size: 14px; font-weight: 500;
  cursor: pointer; position: relative;
  white-space: nowrap;
  transition: color 0.2s;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--color-primary); }
.tab.active::after {
  content: ''; position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 2px; background: var(--color-primary);
}

/* ----- 徽章 ----- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 500;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-default { background: var(--bg-hover); color: var(--text-secondary); }

/* ----- 表格 ----- */
.table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  padding: 12px; text-align: left;
  border-bottom: 1px solid var(--border-light);
}
.table th {
  font-weight: 600; color: var(--text-secondary);
  background: var(--bg-base);
  font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.table tr:hover { background: var(--bg-hover); }
.table-responsive { overflow-x: auto; }

/* ----- 通知 Toast ----- */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 280px; max-width: 400px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px;
  animation: slideIn 0.3s ease;
}
.toast.success { border-left-color: var(--color-success); }
.toast.warning { border-left-color: var(--color-warning); }
.toast.error { border-left-color: var(--color-danger); }
.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: var(--color-success); }
.toast.warning .toast-icon { color: var(--color-warning); }
.toast.error .toast-icon { color: var(--color-danger); }
.toast.info .toast-icon { color: var(--color-info); }
.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.toast-message { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.toast-close {
  background: none; border: none; padding: 0;
  color: var(--text-tertiary); cursor: pointer;
}
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ----- 模态框 ----- */
.modal-container {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
  animation: fadeIn 0.2s;
}
.modal-container.show { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 600px; width: calc(100% - 40px);
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease;
}
.modal-large { max-width: 900px; }
.modal-header {
  padding: 20px; border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 20px; border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 8px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ----- 编辑器 ----- */
.editor-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 400px;
}
.editor-pane {
  display: flex; flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}
.editor-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-base);
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  display: flex; justify-content: space-between; align-items: center;
}
.editor-textarea {
  flex: 1; border: none; padding: 14px;
  background: transparent; color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 13px; line-height: 1.6;
  resize: none;
}
.editor-textarea:focus { outline: none; }
.editor-preview {
  flex: 1; padding: 14px;
  overflow-y: auto;
  font-size: 14px; line-height: 1.7;
  color: var(--text-primary);
}
.editor-preview h1, .editor-preview h2, .editor-preview h3 { margin-top: 1em; }
.editor-preview h1 { font-size: 22px; }
.editor-preview h2 { font-size: 18px; }
.editor-preview h3 { font-size: 16px; }
.editor-preview p { margin: 0.5em 0; }
.editor-preview code {
  background: var(--bg-hover); padding: 2px 6px;
  border-radius: 4px; font-size: 0.9em;
}
.editor-preview pre {
  background: var(--bg-base); padding: 12px;
  border-radius: var(--radius-md); overflow-x: auto;
}
.editor-preview pre code { background: transparent; padding: 0; }
.editor-preview blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 12px; margin: 1em 0;
  color: var(--text-secondary);
}

/* ----- 复选框 ----- */
.checkbox-wrapper {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer; user-select: none;
}
.checkbox-wrapper input { display: none; }
.checkbox-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-color);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  transition: all 0.2s;
}
.checkbox-wrapper input:checked + .checkbox-box {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.checkbox-wrapper input:checked + .checkbox-box::after {
  content: ''; width: 10px; height: 6px;
  border-left: 2px solid white; border-bottom: 2px solid white;
  transform: rotate(-45deg) translateY(-1px);
}
.switch {
  position: relative; display: inline-block;
  width: 40px; height: 22px;
}
.switch input { display: none; }
.switch-slider {
  position: absolute; cursor: pointer;
  inset: 0; background: var(--border-color);
  border-radius: 22px; transition: 0.3s;
}
.switch-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 2px; top: 2px;
  background: white; border-radius: 50%;
  transition: 0.3s;
}
.switch input:checked + .switch-slider { background: var(--color-primary); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }

/* ----- 进度条 ----- */
.progress {
  height: 6px; background: var(--bg-hover);
  border-radius: 3px; overflow: hidden;
}
.progress-bar {
  height: 100%; background: var(--gradient-primary);
  border-radius: 3px; transition: width 0.3s;
}
.progress-bar.success { background: var(--gradient-success); }
.progress-bar.warning { background: var(--gradient-accent); }

/* ----- 空状态 ----- */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-tertiary);
}
.empty-icon {
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  color: var(--text-tertiary);
  opacity: 0.4;
}
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.empty-desc { font-size: 13px; max-width: 400px; margin: 0 auto 16px; }

/* ----- 工具类 ----- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-primary-color { color: var(--color-primary); }
.font-bold { font-weight: 600; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; } .gap-3 { gap: 24px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ----- 响应式 ----- */
@media (max-width: 1024px) {
  .editor-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 280px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    width: var(--sidebar-width);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask.show { display: block; }
  .mobile-only { display: flex; }
  .topbar { padding: 0 16px; }
  .topbar-stats { display: none; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .page-title { font-size: 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ============================================
   v2.1 新增组件样式
   ============================================ */

/* AI 助手 */
.ai-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.ai-feature-card { padding: 20px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); transition: all .2s; cursor: pointer; position: relative; overflow: hidden; }
.ai-feature-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.ai-feature-card .ai-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--gradient-primary); color: white; margin-bottom: 12px; }
.ai-feature-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.ai-feature-card p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.ai-feature-card .ai-hot { position: absolute; top: 12px; right: 12px; font-size: 10px; padding: 2px 8px; background: var(--color-accent); color: white; border-radius: 10px; }

.ai-result-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; margin-top: 16px; }
.ai-result-list { display: flex; flex-direction: column; gap: 10px; }
.ai-result-item { padding: 12px 16px; background: var(--bg-base); border-radius: var(--radius-md); border: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; gap: 12px; transition: all .15s; }
.ai-result-item:hover { background: var(--bg-hover); border-color: var(--border-color); }
.ai-result-item .ai-text { flex: 1; font-size: 14px; color: var(--text-primary); line-height: 1.6; }

/* SEO 优化 */
.seo-score-circle { width: 140px; height: 140px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-direction: column; margin: 0 auto; position: relative; }
.seo-score-circle svg { transform: rotate(-90deg); }
.seo-score-circle .score-num { position: absolute; font-size: 36px; font-weight: 700; color: var(--text-primary); }
.seo-score-circle .score-label { position: absolute; bottom: 28px; font-size: 12px; color: var(--text-secondary); }

.seo-suggestion { padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-base); border-left: 3px solid var(--color-info); margin-bottom: 10px; font-size: 13px; line-height: 1.7; }
.seo-suggestion.warning { border-left-color: var(--color-warning); }
.seo-suggestion.danger { border-left-color: var(--color-danger); }
.seo-suggestion.success { border-left-color: var(--color-success); }
.seo-suggestion .sug-title { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.seo-suggestion .sug-content { color: var(--text-secondary); }

.seo-keyword { display: inline-block; padding: 4px 12px; background: var(--bg-active); color: var(--color-primary); border-radius: 12px; font-size: 12px; margin: 2px 4px 2px 0; font-weight: 500; }
.seo-keyword .kw-density { font-size: 10px; color: var(--text-tertiary); margin-left: 4px; }

/* 内容日历 */
.cal-container { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; }
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.cal-title { font-size: 20px; font-weight: 600; color: var(--text-primary); }
.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-weekday { text-align: center; font-size: 12px; color: var(--text-tertiary); font-weight: 500; padding: 8px 0; }
.cal-day { aspect-ratio: 1; padding: 6px; border: 1px solid var(--border-light); border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; background: var(--bg-card); display: flex; flex-direction: column; gap: 2px; overflow: hidden; min-height: 70px; }
.cal-day:hover { border-color: var(--color-primary); }
.cal-day.outside { background: var(--bg-base); color: var(--text-tertiary); }
.cal-day.today { background: var(--bg-active); border-color: var(--color-primary); }
.cal-day .day-num { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.cal-day .day-events { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden; }
.cal-event { font-size: 10px; padding: 1px 4px; background: var(--color-primary); color: white; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.platform-wechat { background: #07c160; }
.cal-event.platform-baijia { background: #4e6ef2; }
.cal-event.platform-qiehao { background: #ff6633; }
.cal-event.platform-bilibili { background: #fb7299; }

/* 封面图库 */
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cover-item { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); overflow: hidden; transition: all .2s; cursor: pointer; }
.cover-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cover-item .cover-thumb { width: 100%; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; color: white; text-align: center; padding: 12px; line-height: 1.2; }
.cover-item .cover-info { padding: 12px 14px; }
.cover-item .cover-name { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.cover-item .cover-meta { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-tertiary); }

.cover-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.cover-filter-chip { padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all .15s; }
.cover-filter-chip:hover { border-color: var(--color-primary); color: var(--color-primary); }
.cover-filter-chip.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* 模板卡片 (扩展) */
.tpl-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 16px; transition: all .2s; }
.tpl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-primary); }
.tpl-card .tpl-cat { display: inline-block; font-size: 11px; padding: 2px 8px; background: var(--bg-active); color: var(--color-primary); border-radius: 8px; margin-bottom: 8px; }
.tpl-card .tpl-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; line-height: 1.4; }
.tpl-card .tpl-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.5; margin-bottom: 10px; }

/* 仪表盘 v2.1 入口 */
.dashboard-shortcut { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.shortcut-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); cursor: pointer; transition: all .15s; }
.shortcut-card:hover { border-color: var(--color-primary); background: var(--bg-hover); }
.shortcut-card .sc-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--bg-active); color: var(--color-primary); flex-shrink: 0; }
.shortcut-card .sc-text { flex: 1; }
.shortcut-card .sc-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.shortcut-card .sc-desc { font-size: 11px; color: var(--text-tertiary); }

/* 进度条 */
.progress-bar { width: 100%; height: 8px; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient-primary); transition: width .3s; }

/* 加载状态 */
.skeleton { background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-base) 50%, var(--bg-hover) 75%); background-size: 200% 100%; animation: skeleton 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
