﻿* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --bg: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #22223a;
  --border: #2d2d4a;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --pink: #ec4899;
  --blue: #3b82f6;
  --radius: 12px;
  --radius-sm: 8px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}
.app { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 220px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 32px;
  padding: 0 8px;
}
.logo-icon { font-size: 24px; }
.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: all .2s;
  cursor: pointer;
}
.nav-item:hover { background: var(--bg-card-hover); color: var(--text); }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 8px 0; color: var(--text-muted); border-top: 1px solid var(--border); margin-top: auto; }

/* 主内容 */
.main { flex: 1; padding: 32px; max-width: 1200px; }
.page { display: none; }
.page.active { display: block; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.page-header h1 { font-size: 24px; font-weight: 700; }
.date-display { color: var(--text-muted); font-size: 14px; }

/* 卡片 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 16px;
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.card-body { padding: 20px; }
.full-width { grid-column: 1 / -1; }

/* 数据网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}
.stat-card .stat-icon { font-size: 24px; margin-bottom: 8px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-card-hover); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-close { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; }

/* 表单 */
.generate-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-group input, .form-group select {
  padding: 8px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
}
.form-group select { cursor: pointer; }

/* 内容卡片 */
.content-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  background: rgba(255,255,255,.02);
}
.content-item .headline { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.content-item .meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.content-item .body-text {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 120px;
  overflow: hidden;
}
.content-item .body-text.expanded { max-height: none; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.badge-xhs { background: rgba(236,72,153,0.2); color: var(--pink); }
.badge-dy { background: rgba(59,130,246,0.2); color: var(--blue); }
.badge-draft { background: rgba(245,158,11,0.2); color: var(--warning); }
.badge-published { background: rgba(34,197,94,0.2); color: var(--success); }

/* 加载 */
.loading, .loading-sm {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}
.loading-sm { padding: 12px; }

/* 表格 */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.data-table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: none; }

/* 弹窗 */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 20px; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(99,102,241,0.15);
  color: var(--primary-light);
  margin: 2px;
}

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { width: 60px; padding: 16px 8px; }
  .sidebar .logo-text, .sidebar .nav-item span:not(.nav-icon), .sidebar-footer { display: none; }
  .main { padding: 16px; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* 文字颜色 */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

/* 洞察列表 */
.insight-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.insight-item:last-child { border-bottom: none; }
.insight-score {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* 排期日历风格 */
.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.schedule-item:last-child { border-bottom: none; }
.schedule-day {
  width: 40px;
  font-weight: 600;
  font-size: 13px;
}
.schedule-time {
  font-size: 13px;
  color: var(--primary-light);
}
.schedule-label {
  font-size: 12px;
  color: var(--text-muted);
}
.schedule-score {
  margin-left: auto;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(99,102,241,0.15);
}
