/* ============================================
   GEO Workbench - Stylesheet
   极简扁平风 · 白底 · 柔和配色
   ============================================ */

/* === Variables === */
:root {
  --white: #ffffff;
  --bg: #f8f9fb;
  --bg-hover: #f1f3f5;
  --bg-active: #e8ecf0;
  --border: #e5e7eb;
  --border-light: #f0f0f0;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --blue: #4f6ef7;
  --blue-light: #eef2ff;
  --blue-dark: #3b5de7;
  --green: #22c55e;
  --green-light: #f0fdf4;
  --red: #ef4444;
  --red-light: #fef2f2;
  --orange: #f59e0b;
  --orange-light: #fffbeb;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;
  --pink: #ec4899;
  --pink-light: #fdf2f8;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --sidebar-w: 240px;
  --transition: all 0.2s ease;
}

/* === Reset === */
* { 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-primary);
  line-height: 1.6;
  font-size: 14px;
  overflow: hidden;
  height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
button { cursor: pointer; font-family: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* === Layout === */
.app { display: flex; height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.main-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}

/* === Sidebar === */
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-header h1 span { font-size: 20px; }
.sidebar-header p {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
  letter-spacing: 1px;
  text-align: center;
}
.sidebar-logo {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}
.sidebar-nav { flex: 1; padding: 12px 12px 0; overflow-y: auto; }
.nav-section { margin-bottom: 8px; }
.nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 8px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--blue-light); color: var(--blue); font-weight: 600; }
.nav-item .nav-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
}

/* === Main Header === */
.main-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title .icon { font-size: 22px; }
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.header-actions { display: flex; gap: 8px; align-items: center; }

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text-primary);
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: #d1d5db; }
.btn-primary {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn-success {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.btn-danger {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn-warning {
  background: #f59e0b;
  color: var(--white);
  border-color: #f59e0b;
}
.btn-warning:hover { background: #d97706; border-color: #d97706; }
.btn-ghost { border: none; background: transparent; }
.btn-ghost:hover { background: var(--bg-hover); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
}
.btn-group { display: flex; gap: 8px; }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* === Stats Cards === */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  transition: var(--transition);
}
.stat-card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-card.blue .stat-value { color: var(--blue); }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.orange .stat-value { color: var(--orange); }
.stat-card.purple .stat-value { color: var(--purple); }
.stat-card.red .stat-value { color: var(--red); }

/* === Filter Bar === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar .search-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}
.search-input {
  position: relative;
}
.search-input input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.search-input input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79,110,247,0.1); }
.search-input .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
}
.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  min-width: 120px;
}
.filter-select:focus { border-color: var(--blue); }

/* === Table === */
.table-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-wrapper {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead { background: var(--bg); }
th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
}
td {
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
tr:hover { background: var(--bg-hover); }
tr:last-child td { border-bottom: none; }
.table-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
}

/* === Tags/Badges === */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}
.tag-high { background: var(--red-light); color: var(--red); }
.tag-medium { background: var(--orange-light); color: var(--orange); }
.tag-low { background: var(--bg-hover); color: var(--text-muted); }
.tag-blue { background: var(--blue-light); color: var(--blue); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-purple { background: var(--purple-light); color: var(--purple); }
.tag-pending { background: var(--bg-hover); color: var(--text-muted); }
.tag-progress { background: var(--blue-light); color: var(--blue); }
.tag-done { background: var(--green-light); color: var(--green); }
.tag-complete { background: var(--green-light); color: var(--green); }
.tag-purple { background: #f3e8ff; color: #7c3aed; }

/* === Cards Grid === */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.card:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-category {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 8px;
  border-radius: 4px;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
}
.card-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.card-meta {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-actions {
  display: flex;
  gap: 4px;
}
.warn-highlight {
  color: var(--red);
  font-weight: 600;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
}
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* === Forms === */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--white);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.1);
}
.form-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* === Content Workspace === */
.workspace-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  height: calc(100vh - 180px);
}
.workspace-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.workspace-sidebar-header {
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom: none;
}
.workspace-question-list {
  flex: 1;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}
.workspace-question-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  border-left: 3px solid transparent;
}
.workspace-question-item:hover { background: var(--bg-hover); }
.workspace-question-item.selected {
  background: #e8f0fe;
  border-left: 4px solid var(--blue);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(66, 133, 244, 0.2);
}
.workspace-q-check {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background: var(--blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.workspace-q-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 6px;
}
.workspace-q-meta {
  display: flex;
  gap: 6px;
  align-items: center;
}
.question-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}
.question-item:hover { background: var(--bg-hover); }
.question-item.selected { background: var(--blue-light); border-left: 3px solid var(--blue); }
.question-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 4px;
}
.question-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
}
.workspace-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}
.generation-controls {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.control-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.article-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.article-editor-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.article-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}
.article-content textarea {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: none;
  resize: none;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  outline: none;
}
.article-content .streaming-text {
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.article-content .streaming-cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background: var(--blue);
  animation: blink 0.8s infinite;
  vertical-align: middle;
  margin-left: 2px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.article-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  text-align: center;
  padding: 40px;
}
.article-placeholder .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.article-placeholder p { font-size: 14px; }

/* === Distribution Matrix === */
.matrix-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.matrix-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.matrix-platform-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.matrix-platform-name {
  font-size: 15px;
  font-weight: 600;
}
.matrix-rules {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
}
.matrix-content {
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* === Batch Generation === */
.batch-progress {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.progress-bar-container {
  height: 8px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}
.batch-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.batch-item-status { font-size: 18px; width: 28px; text-align: center; }
.batch-item-title { flex: 1; font-size: 13px; }
.batch-item-tag { font-size: 11px; }

/* === Analytics === */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.analytics-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.analytics-card h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.analytics-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.analytics-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 80px;
  text-align: right;
}
.analytics-bar-track {
  flex: 1;
  height: 20px;
  background: var(--bg);
  border-radius: 4px;
  overflow: hidden;
}
.analytics-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  min-width: fit-content;
}
.analytics-bar-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 30px;
}

/* === Settings === */
.settings-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.settings-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.api-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}
.api-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.api-status .dot.connected { background: var(--green); }
.api-status .dot.disconnected { background: var(--red); }

/* === Model Tags === */
.model-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.model-tag-text { background: var(--blue-light); color: var(--blue); }
.model-tag-vision { background: var(--purple-light); color: var(--purple); }
.model-tag-tts { background: var(--green-light); color: var(--green); }

/* === Generating Indicator === */
.generating-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 14px;
}
.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Toast === */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 14px; margin-bottom: 16px; }

/* === Page visibility === */
.page { display: none; }
.page.active { display: block; }
.page-workspace.active { display: flex; flex-direction: column; height: calc(100vh - 116px); }

/* === Responsive === */
@media (max-width: 1024px) {
  .workspace-layout { grid-template-columns: 1fr; height: auto; }
  .workspace-sidebar { max-height: 300px; }
}

/* === Data Management === */
.data-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.data-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  flex: 1;
  min-width: 200px;
  text-align: center;
}
.data-card .icon { font-size: 32px; margin-bottom: 8px; }
.data-card h4 { font-size: 14px; margin-bottom: 4px; }
.data-card p { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* === Article List === */
.article-list-item {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}
.article-list-item:hover { background: var(--bg-hover); }
.article-list-item.selected { background: var(--blue-light); border-left: 3px solid var(--blue); }
.article-list-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-list-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
}

/* === Tabs === */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* === Helper Classes === */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }

/* === Kanban Board === */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: calc(100vh - 220px);
}
.kanban-column {
  flex: 1;
  min-width: 300px;
  max-width: 380px;
  background: var(--bg);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.kanban-column-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.kanban-column-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.kanban-column-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 100px;
}
.kanban-column-body {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kanban-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
}
.kanban-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 10px;
}
.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.kanban-card-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.kanban-column[data-status="未开始"] .kanban-column-title { color: var(--text-muted); }
.kanban-column[data-status="进行中"] .kanban-column-title { color: var(--blue); }
.kanban-column[data-status="已发布"] .kanban-column-title { color: var(--green); }
.kanban-column[data-status="未开始"] { border-top: 3px solid var(--text-muted); border-radius: var(--radius); }
.kanban-column[data-status="进行中"] { border-top: 3px solid var(--blue); border-radius: var(--radius); }
.kanban-column[data-status="已发布"] { border-top: 3px solid var(--green); border-radius: var(--radius); }

/* Drag & Drop */
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card[draggable="true"]:active { cursor: grabbing; }
.kanban-card.dragging {
  opacity: 0.4;
  transform: rotate(2deg);
  box-shadow: var(--shadow-lg);
}
.kanban-column.drag-over {
  background: var(--blue-light);
  border: 2px dashed var(--blue);
}
.kanban-column.drag-over .kanban-column-body {
  background: transparent;
}
.kanban-drop-placeholder {
  height: 4px;
  background: var(--blue);
  border-radius: 2px;
  margin: 4px 0;
  transition: all 0.2s;
}

/* Kanban Pending Panel */
.kanban-pending-panel {
  border: 1px solid var(--border);
  background: var(--bg);
}
.kb-pending-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  background: var(--white);
}
.kb-pending-toolbar .form-input {
  flex: 1;
  min-width: 0;
}
.kb-select-all {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.kb-pending-list {
  max-height: calc(100vh - 320px);
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kb-pending-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.kb-pending-item:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.kb-pending-item .kb-check {
  margin-top: 2px;
  flex-shrink: 0;
  cursor: pointer;
}
.kb-pending-content {
  flex: 1;
  min-width: 0;
}
.kb-pending-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--white);
}
.kb-selected-count {
  font-size: 13px;
  color: var(--text-muted);
}
.kb-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-muted);
  font-size: 13px;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* === Dashboard Page === */
#page-dashboard {
  padding: 0;
}
.dashboard-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dash-stat {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 20px 12px;
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}
.dash-stat:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.dash-stat-value {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
}
.dash-stat-value.blue { color: var(--blue); }
.dash-stat-value.green { color: var(--green); }
.dash-stat-value.orange { color: var(--orange); }
.dash-stat-value.purple { color: var(--purple); }
.dash-stat-value.red { color: var(--red); }
.dash-stat-value.gray { color: var(--text-muted); }
.dash-stat-value.cyan { color: #06b6d4; }
.dash-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}
.dashboard-charts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 1200px) {
  .dashboard-charts { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dashboard-charts { grid-template-columns: 1fr; }
}
.dash-chart-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  transition: var(--transition);
}
.dash-chart-card:hover {
  box-shadow: var(--shadow);
}
.dash-chart-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

/* Progress Ring */
.dash-progress-ring {
  width: 120px;
  height: 120px;
  margin: 0 auto 12px;
  position: relative;
}
.dash-progress-ring svg {
  width: 100%;
  height: 100%;
}
.dash-progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.dash-progress-labels {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
  color: var(--text-muted);
}
.dash-progress-labels .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.dash-progress-labels .dot.green { background: var(--green); }
.dash-progress-labels .dot.gray { background: #d1d5db; }

/* Metrics Grid */
.dash-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.dash-metric-item {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: 8px;
}
.dash-metric-num {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.dash-metric-num.blue { color: var(--blue); }
.dash-metric-num.green { color: var(--green); }
.dash-metric-num.purple { color: var(--purple); }
.dash-metric-num.orange { color: var(--orange); }
.dash-metric-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Matrix Card */
.dash-matrix-card {
  grid-column: span 2;
}
@media (max-width: 768px) {
  .dash-matrix-card { grid-column: span 1; }
}
.dash-matrix-wrapper {
  overflow-x: auto;
}
.dash-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-matrix th, .dash-matrix td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
}
.dash-matrix th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text);
  position: sticky;
  top: 0;
}
.dash-matrix td:first-child {
  text-align: left;
  font-weight: 500;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bar Chart */
.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.bar-label {
  min-width: 60px;
  font-size: 13px;
  color: var(--text);
  text-align: right;
}
.bar-track {
  flex: 1;
  height: 20px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.bar-fill.bar-blue { background: var(--blue); }
.bar-fill.bar-green { background: var(--green); }
.bar-fill.bar-red { background: var(--red); }
.bar-fill.bar-orange { background: var(--orange); }
.bar-fill.bar-purple { background: var(--purple); }
.bar-fill.bar-gray { background: #d1d5db; }
.bar-fill.bar-cyan { background: #06b6d4; }
.bar-value {
  min-width: 30px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

/* === Changelog Page === */
.changelog-header {
  text-align: center;
  margin-bottom: 32px;
}
.changelog-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.changelog-header .text-muted {
  font-size: 14px;
  color: var(--text-muted);
}
.changelog-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.changelog-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--bg);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* Timeline */
.changelog-timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 32px;
}
.changelog-timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

/* Release */
.changelog-release {
  position: relative;
  margin-bottom: 24px;
}
.changelog-dot {
  position: absolute;
  left: -32px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--white);
  z-index: 1;
}
.changelog-latest .changelog-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.2);
}

/* Card */
.changelog-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px 24px;
  transition: var(--transition);
}
.changelog-card:hover {
  box-shadow: var(--shadow);
}
.changelog-latest .changelog-card {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.1);
}

/* Card Header */
.changelog-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.changelog-version {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 2px 10px;
  border-radius: 6px;
}
.changelog-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  background: var(--blue);
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.changelog-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Title */
.changelog-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

/* Change List */
.changelog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.changelog-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
}
.change-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* 文稿管理 - 文章数量徽章 */
.article-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-light);
  padding: 4px 14px;
  border-radius: 20px;
  line-height: 1;
  white-space: nowrap;
}

/* ========== 数据看板新增样式 ========== */

/* 空状态提示 */
.dash-empty-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 40px 20px;
  line-height: 1.6;
}

/* AI提及率趋势图 */
.dash-trend-chart {
  display: flex;
  gap: 8px;
  height: 180px;
  padding: 8px 0;
}
.dash-trend-y {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  width: 36px;
  text-align: right;
  padding: 4px 0;
}
.dash-trend-bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border-left: 1px solid var(--border-light);
  padding-left: 8px;
}
.dash-trend-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}
.dash-trend-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dash-trend-bar {
  width: 80%;
  max-width: 48px;
  background: linear-gradient(180deg, var(--blue) 0%, #60a5fa 100%);
  border-radius: 6px 6px 0 0;
  position: relative;
  min-height: 4px;
  transition: height 0.3s ease;
}
.dash-trend-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--blue);
  white-space: nowrap;
}
.dash-trend-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  white-space: nowrap;
}
.dash-trend-footer {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

/* 待复测列表 */
.dash-retest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-retest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary, #f9fafb);
  border-radius: 8px;
  font-size: 13px;
}
.dash-retest-date {
  font-weight: 600;
  color: var(--orange, #f59e0b);
  font-size: 12px;
  min-width: 48px;
}
.dash-retest-q {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.dash-retest-status {
  flex-shrink: 0;
}
.dash-retest-more {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px;
}

/* 拖拽样式 */
.dash-chart-card[draggable="true"] {
  cursor: grab;
  user-select: none;
}
.dash-chart-card[draggable="true"]:active {
  cursor: grabbing;
}
.dash-card-dragging {
  opacity: 0.5;
  transform: scale(0.98);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
}
.dash-card-dragover {
  border: 2px dashed var(--blue) !important;
  background: rgba(59, 130, 246, 0.05) !important;
}

/* 校验报告样式 */
.validation-pass {
  text-align: center;
  color: var(--green, #10b981);
  font-size: 14px;
  padding: 16px;
  background: rgba(16, 185, 129, 0.05);
  border-radius: 8px;
}
.validation-report {
  font-size: 13px;
}
.validation-header {
  font-weight: 600;
  color: var(--orange, #f59e0b);
  margin-bottom: 12px;
  font-size: 14px;
}
.validation-section {
  margin-bottom: 12px;
}
.validation-section-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 13px;
}
.validation-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.validation-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
}
.validation-error {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
}
.validation-warn {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid #f59e0b;
}
.validation-word {
  font-weight: 600;
  color: var(--text);
  min-width: 60px;
  flex-shrink: 0;
}
.validation-context {
  color: var(--text-muted);
  word-break: break-all;
}

/* GEO 评分报告样式 */
.score-report {
  margin-top: 16px;
  padding: 20px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 12px;
}
.score-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.score-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
.score-label {
  font-size: 11px;
  color: var(--text-muted, #999);
  margin-top: 2px;
}
.score-level {
  font-size: 16px;
  font-weight: 600;
}
.score-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.score-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}
.check-pass {
  background: rgba(16, 185, 129, 0.06);
}
.check-fail {
  background: rgba(239, 68, 68, 0.06);
}
.check-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.check-name {
  font-weight: 600;
  min-width: 90px;
  flex-shrink: 0;
}
.check-detail {
  color: var(--text-muted, #666);
  flex: 1;
}

/* 表单行布局 */
.form-row {
  display: flex;
  gap: 16px;
}
.form-row .form-group {
  flex: 1;
}
