:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --text-primary: #1a1a2e;
  --text-secondary: #6c757d;
  --text-tertiary: #adb5bd;
  --border-color: #e9ecef;
  --border-hover: #ced4da;
  --accent: #4263eb;
  --accent-light: #e7f5ff;
  --success: #2f9e44;
  --success-light: #ebfbee;
  --warning: #f08c00;
  --warning-light: #fff9db;
  --danger: #e03131;
  --danger-light: #fff5f5;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  padding: 24px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-logo {
  padding: 0 24px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 12px;
}

.sidebar-logo span { color: var(--text-secondary); font-weight: 400; font-size: 12px; }

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.15s;
}

.sidebar-nav a:hover { background: var(--bg-secondary); color: var(--text-primary); }
.sidebar-nav a.active { background: var(--accent-light); color: var(--accent); font-weight: 500; }
.sidebar-nav a .badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar user section */
.sidebar-user {
  margin-top: auto;
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-name {
  font-size: 14px;
  font-weight: 500;
}

.sidebar-user-role {
  font-size: 12px;
  color: var(--text-secondary);
}

.main-content {
  margin-left: 220px;
  padding: 32px 40px;
  flex: 1;
  max-width: calc(100% - 220px);
}

/* Page header */
.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-header h1 { font-size: 22px; font-weight: 600; }
.page-header .subtitle { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* Cards */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.stat-card .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 600; }
.stat-card .value.pending { color: var(--warning); }
.stat-card .value.approved { color: var(--success); }
.stat-card .value.rejected { color: var(--danger); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: #3b5bdb; border-color: #3b5bdb; color: white; }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #2b8a3e; color: white; }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #c92a2a; color: white; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 14px; }
.form-group .hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

input[type="text"], input[type="date"], input[type="time"],
input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(66,99,235,0.1);
}

textarea { resize: vertical; min-height: 100px; }

/* File upload */
.file-drop {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-secondary);
}

.file-drop:hover { border-color: var(--accent); background: var(--accent-light); }
.file-drop.dragover { border-color: var(--accent); background: var(--accent-light); }
.file-drop .icon { font-size: 36px; margin-bottom: 8px; }
.file-drop .text { color: var(--text-secondary); font-size: 14px; }
.file-drop .filename { color: var(--accent); font-weight: 500; margin-top: 8px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

tr:hover td { background: var(--bg-secondary); }

/* Badges */
.badge-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge-pending { background: var(--warning-light); color: var(--warning); }
.badge-approved { background: var(--success-light); color: var(--success); }
.badge-rejected { background: var(--danger-light); color: var(--danger); }
.badge-scheduled { background: var(--accent-light); color: var(--accent); }
.badge-uploaded { background: var(--success-light); color: var(--success); }

/* Platform tags */
.platform-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.platform-chip {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* User tag */
.user-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Content cards */
.content-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  background: var(--bg-primary);
}

.content-card .platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.content-card .platform-name {
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.char-counter {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.char-counter.over-limit { color: var(--danger); }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9999;
  font-size: 14px;
  display: none;
}

.toast.show { display: block; animation: slideUp 0.3s ease; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--accent); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Checkbox group */
.checkbox-group { display: flex; gap: 12px; flex-wrap: wrap; }

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.checkbox-item:hover { border-color: var(--accent); }
.checkbox-item.checked { background: var(--accent-light); border-color: var(--accent); }
.checkbox-item input { width: auto; }

/* Schedule calendar */
.schedule-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: all 0.15s;
}

.schedule-list-item:hover { border-color: var(--border-hover); }

.schedule-date {
  text-align: center;
  min-width: 60px;
}

.schedule-date .day { font-size: 22px; font-weight: 600; }
.schedule-date .month { font-size: 12px; color: var(--text-secondary); }

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.3; }

/* ========== Login Page ========== */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 28px;
}

.login-users {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.login-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.login-user-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}

.login-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.login-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.login-user-name {
  font-size: 14px;
  font-weight: 500;
}

.login-role-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  color: var(--danger);
  font-weight: 600;
}

.login-divider {
  text-align: center;
  margin: 20px 0;
  position: relative;
}

.login-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border-color);
}

.login-divider span {
  position: relative;
  background: white;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.login-form input {
  margin-bottom: 12px;
}

/* ========== Activity Log ========== */

.activity-log {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child { border-bottom: none; }

.activity-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 13px;
  line-height: 1.5;
}

.activity-user {
  font-weight: 600;
  margin-right: 4px;
}

.activity-action {
  color: var(--text-primary);
}

.activity-detail {
  color: var(--text-secondary);
  margin-left: 4px;
}

.activity-detail::before {
  content: '- ';
}

.activity-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Platform auth grid */
.platform-auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.auth-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  background: var(--bg-card);
}
.auth-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.auth-card-header .platform-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.auth-card-header .platform-name {
  font-weight: 600;
  font-size: 15px;
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #f1f3f5;
}
.auth-badge .status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.auth-badge .status-dot.ok { background: #2f9e44; }
.auth-badge .status-dot.no { background: #e03131; }
.auth-badge .status-dot.checking { background: #f08c00; animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.auth-status-text {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  min-height: 20px;
}
.auth-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
}
.btn-outline:hover {
  background: #f1f3f5;
}
.btn-danger-outline {
  background: transparent;
  border: 1px solid #e03131;
  color: #e03131;
  cursor: pointer;
}
.btn-danger-outline:hover {
  background: #fff5f5;
}
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
}
.alert-warning {
  background: #fff9db;
  border: 1px solid #ffe08a;
  color: #936f00;
}
.platform-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 11px;
  margin: 1px;
}

/* Progress modal */
.progress-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.progress-modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 24px;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  overflow: auto;
}
.progress-modal-header h3 {
  margin: 0 0 16px 0;
}
.progress-bar-container {
  position: relative;
  width: 100%;
  height: 24px;
  background: #e9ecef;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #4263eb, #7048e8);
  border-radius: 12px;
  transition: width 0.3s ease;
}
.progress-percent {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 600;
  color: #333;
}
.progress-message {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 12px;
  font-weight: 500;
}
.progress-log {
  max-height: 200px;
  overflow-y: auto;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
  background: #f8f9fa;
  border-radius: 6px;
  padding: 8px;
}
.progress-log div {
  padding: 2px 0;
  border-bottom: 1px solid #f1f3f5;
}
.progress-modal-footer {
  margin-top: 16px;
  text-align: right;
}
.empty-state {
  color: var(--text-tertiary);
  font-size: 14px;
  padding: 24px;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; max-width: 100%; padding: 20px; }
}

/* ========== Publish Page ========== */

.platform-login-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.platform-login-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.15s;
}

.platform-login-card:hover {
  border-color: var(--border-hover);
}

.platform-login-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.platform-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.platform-login-name {
  font-size: 15px;
  font-weight: 600;
}

.platform-login-status {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.platform-login-actions {
  display: flex;
  gap: 8px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.status-success { background: var(--success); }
.status-dot.status-fail { background: var(--danger); }
.status-dot.status-warning { background: var(--warning); }
.status-dot.status-unknown { background: var(--text-tertiary); }

.login-tip {
  margin-top: 16px;
  padding: 14px;
  background: var(--accent-light);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.status-scheduled { background: var(--accent-light); color: var(--accent); }
.status-badge.status-uploading { background: var(--warning-light); color: var(--warning); }
.status-badge.status-uploaded { background: var(--success-light); color: var(--success); }
.status-badge.status-rejected { background: var(--danger-light); color: var(--danger); }

/* Platform tag */
.platform-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  margin-right: 4px;
}

/* Card header */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.badge-info {
  background: var(--accent-light);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown .btn {
  width: 100%;
  justify-content: center;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 10;
  min-width: 140px;
  margin-top: 4px;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-menu a:hover {
  background: var(--bg-secondary);
}

/* Error cell */
.error-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--danger);
  font-size: 12px;
}

/* Links */
.link {
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* Page subtitle */
.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Data table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

/* ========== Modal (上传进度弹窗) ========== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 500px;
  max-width: 90vw;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.modal-close:hover {
  background: var(--bg-secondary);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #5c7cfa);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-percent {
  font-size: 28px;
  font-weight: 600;
  color: var(--accent);
  text-align: center;
  margin-bottom: 12px;
}

.progress-message {
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
  min-height: 20px;
}

.progress-log {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 12px;
  max-height: 240px;
  overflow-y: auto;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
  line-height: 1.6;
}

.log-line {
  color: var(--text-secondary);
  word-break: break-word;
}

.log-line:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

/* Spinning loader for buttons */
.btn.loading::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== 数据分析 / 图表 ========== */

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-box {
  position: relative;
  height: 300px;
}

.chart-box-sm {
  height: 260px;
}

.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 13px;
  background: var(--bg-secondary);
  border-radius: 8px;
  text-align: center;
  padding: 16px;
  line-height: 1.7;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-card .value {
  font-variant-numeric: tabular-nums;
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--warning-light);
  border: 1px solid #ffe08a;
  color: #936f00;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.7;
}

.pf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.pf-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mini-num {
  font-variant-numeric: tabular-nums;
}

.text-muted {
  color: var(--text-secondary);
}

.table-scroll {
  overflow-x: auto;
}

@media (max-width: 1200px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 平台数据看板 ========== */

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.pf-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pf-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pf-name {
  font-size: 15px;
  font-weight: 600;
}

.pf-account {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pf-metrics {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.pf-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color-light, rgba(0,0,0,0.04));
}

.pf-metric:last-child {
  border-bottom: none;
}

.pf-metric-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.pf-metric-value.accent {
  color: var(--success);
}

.pf-metric-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.pf-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pf-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 28px 0 12px;
  font-size: 13px;
}

/* 平台数据看板：汇总卡片大数字 */
.platform-dashboard .stat-card .value {
  font-size: 32px;
  font-weight: 700;
}

.platform-dashboard .stat-card .label {
  font-size: 13px;
  margin-bottom: 10px;
}

.platform-dashboard .stat-card .stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* 内容类型标签 */
.type-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.type-video {
  background: var(--accent-light);
  color: var(--accent);
}

.type-photo {
  background: var(--success-light);
  color: var(--success);
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-bar select {
  width: auto;
  min-width: 140px;
  padding: 6px 10px;
  font-size: 13px;
}
