/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px; color: #1a1a2e; background: #f5f6fa;
}

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #1a1a2e 0%, #16213e 50%, #1a3a5c 100%);
}
.login-box {
  width: 380px; background: #fff; border-radius: 16px; padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.login-brand { text-align: center; margin-bottom: 36px; }
.login-logo {
  width: 64px; height: 64px; border-radius: 14px;
  background: linear-gradient(135deg, #1a73e8, #0d5bba);
  color: #fff; font-size: 28px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; letter-spacing: 2px;
}
.login-brand h1 { font-size: 24px; font-weight: 700; color: #1a1a2e; }
.login-brand p { font-size: 13px; color: #999; margin-top: 6px; }
.login-error { color: #e53935; font-size: 13px; text-align: center; margin-top: 12px; min-height: 20px; }

/* ===== 主布局 ===== */
.main-page { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: 220px; background: #1a1a2e; color: #fff; display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 10;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #1a73e8, #0d5bba);
  font-size: 18px; font-weight: 800; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.sidebar-title h2 { font-size: 16px; font-weight: 700; }
.sidebar-title span { font-size: 11px; color: rgba(255,255,255,0.45); }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  color: rgba(255,255,255,0.6); font-size: 14px; cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; background: rgba(26,115,232,0.3); border-right: 3px solid #1a73e8; }
.nav-icon { font-size: 12px; }
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; align-items: center; font-size: 13px;
}
.sidebar-footer a { color: #e53935; cursor: pointer; }
.sidebar-footer a:hover { text-decoration: underline; }

/* 内容区 */
.content {
  margin-left: 220px; flex: 1; padding: 28px 32px; min-height: 100vh;
}
.page-content { display: none; }
.page-content.active { display: block; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 24px; color: #1a1a2e; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  text-align: center;
}
.stat-value { font-size: 32px; font-weight: 800; color: #1a73e8; }
.stat-label { font-size: 13px; color: #999; margin-top: 6px; }

/* 最近发布 */
.recent-section { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.recent-half { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 12px rgba(0,0,0,0.04); }
.recent-half h3 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.mini-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f5f5f5; font-size: 13px;
}
.mini-item:last-child { border-bottom: none; }
.mini-route { font-weight: 500; }
.mini-meta { color: #999; }

/* ===== 表格工具栏 ===== */
.table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.toolbar-left { display: flex; gap: 10px; align-items: center; }
.toolbar-left select, .toolbar-left input {
  padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 8px; font-size: 13px;
  background: #fff; outline: none;
}
.toolbar-left input { width: 200px; }
.toolbar-left select:focus, .toolbar-left input:focus { border-color: #1a73e8; }
.toolbar-count { font-size: 13px; color: #999; }

/* 表格 */
.table-wrap {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
table { width: 100%; border-collapse: collapse; }
thead { background: #f8f9fb; }
th { padding: 14px 16px; text-align: left; font-size: 13px; font-weight: 600; color: #666; }
td { padding: 14px 16px; font-size: 13px; border-bottom: 1px solid #f5f5f5; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfc; }

/* 状态标签 */
.status-tag {
  display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 600;
}
.status-active { background: #e8f5e9; color: #2e7d32; }
.status-expired { background: #f5f5f5; color: #999; }

/* 分页 */
.pagination {
  display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 20px;
}
.pagination button {
  padding: 6px 14px; border: 1px solid #e0e0e0; border-radius: 6px;
  background: #fff; font-size: 13px; cursor: pointer; color: #333;
}
.pagination button:hover { border-color: #1a73e8; color: #1a73e8; }
.pagination button:disabled { color: #ccc; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: #666; }

/* ===== 按钮 ===== */
.btn-primary {
  background: linear-gradient(135deg, #1a73e8, #0d5bba); color: #fff;
  border: none; border-radius: 8px; padding: 10px 20px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; border-radius: 8px; }
.btn-cancel {
  background: #f5f5f5; color: #666; border: none; border-radius: 8px;
  padding: 10px 20px; font-size: 14px; cursor: pointer;
}
.btn-search {
  background: #f0f2f5; color: #333; border: 1px solid #e0e0e0;
  border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer;
}
.btn-search:hover { background: #e8eaf0; }
.btn-danger {
  background: none; color: #e53935; border: 1px solid #e53935;
  border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer;
}
.btn-danger:hover { background: #e53935; color: #fff; }
.btn-edit {
  background: none; color: #1a73e8; border: 1px solid #1a73e8;
  border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; margin-right: 6px;
}
.btn-edit:hover { background: #1a73e8; color: #fff; }

/* v2.0 任务 11：调整次数按钮 */
.btn-adjust {
  background: none; color: #FF6B35; border: 1px solid #FF6B35;
  border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; margin-right: 6px;
}
.btn-adjust:hover { background: #FF6B35; color: #fff; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #333; margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 12px; border: 1px solid #e0e0e0; border-radius: 8px;
  font-size: 14px; outline: none; transition: border-color 0.15s;
}
.form-group input:focus { border-color: #1a73e8; }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45); z-index: 100; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff; border-radius: 14px; padding: 32px; width: 420px;
  max-width: 90vw; box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 10px 24px; border-radius: 8px;
  font-size: 14px; z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.toast.show { opacity: 1; }

/* ===== 系统设置 ===== */
.settings-card {
  background: #fff; border-radius: 12px; padding: 28px; max-width: 560px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.settings-card h3 {
  font-size: 15px; font-weight: 600; margin: 18px 0 12px; color: #333;
}
.settings-card h3:first-child { margin-top: 0; }
.settings-card textarea, .settings-card input {
  width: 100%; padding: 10px 12px; border: 1px solid #e0e3e8; border-radius: 8px;
  font-size: 14px; font-family: inherit; margin-bottom: 8px;
}
.settings-card textarea:focus, .settings-card input:focus { outline: none; border-color: #1a73e8; }
.settings-card .form-group { margin-bottom: 8px; }
.settings-card label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .recent-section { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-brand .sidebar-title, .nav-item { justify-content: center; }
  .sidebar-brand { padding: 20px 10px; }
  .nav-item { padding: 14px 10px; }
  .content { margin-left: 60px; padding: 20px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .table-wrap { overflow-x: auto; }
}