/* ============================================
 * 直播运营系统 - 统一设计系统 v4.0
 * 导航：左横条 | 配色：深色导航+暖灰背景 | 层级：清晰卡片
 * ============================================ */

/* ===== 设计Token ===== */
:root {
  /* 品牌色 */
  --primary: #1677ff;
  --primary-light: #e6f4ff;
  --primary-hover: #4096ff;
  --primary-active: #0958d9;
  /* 功能色 */
  --success: #52c41a;
  --success-bg: #f6ffed;
  --success-border: #b7eb8f;
  --warning: #faad14;
  --warning-bg: #fffbe6;
  --warning-border: #ffe58f;
  --danger: #ff4d4f;
  --danger-bg: #fff1f0;
  --danger-border: #ffa39e;
  --info: #13c2c2;
  /* 中性色（优化对比度） */
  --bg-page: #eff1f5;
  --bg-card: #ffffff;
  --text-primary: #1f2329;
  --text-secondary: #5a5f6b;
  --text-muted: #8b9099;
  --border-color: #dddfe4;
  --border-light: #eceef2;
  /* 阴影（加深层级） */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 3px 10px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 10px;
}

/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5715;
  -webkit-font-smoothing: antialiased;
}

/* ============================================
 * 导航栏 v4.0 — 左横条（品牌+菜单一行排开）
 * 深色底，白字，紧凑专业
 * ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 9999;
  background: rgba(29,29,31,0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  margin-right: 28px;
  flex-shrink: 0;
}
.navbar-brand .nav-icon { font-size: 18px; }
.navbar-brand::after {
  content: '';
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.18);
  margin-left: 18px;
}

.navbar-nav {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2px;
  height: 100%;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 14px;
  border-radius: 6px;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all .16s ease;
  white-space: nowrap;
  line-height: 1;
  height: 34px;
}
.nav-link i { font-size: 14px; opacity: 0.85; }
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.10);
}
.nav-link.active {
  color: #fff;
  background: rgba(22,119,255,0.45);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(22,119,255,0.25);
}

/* 页面内容区给导航栏留空间 */
.page-body {
  padding-top: 50px;
  min-height: 100vh;
}

/* ============================================
 * Toast 通知组件
 * ============================================ */
#toast-container {
  position: fixed;
  top: 58px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 40px);
}

.toast-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn .28s ease forwards;
  border-left: 3px solid transparent;
  font-size: 13px;
  line-height: 1.55;
}

.toast-success { border-left-color: var(--success); }
.toast-warning { border-left-color: var(--warning); }
.toast-error   { border-left-color: var(--danger); }
.toast-info    { border-left-color: var(--info); }

.toast-icon { font-size: 16px; flex-shrink: 0; line-height: 1.3; }
.toast-success .toast-icon { color: var(--success); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-error .toast-icon   { color: var(--danger); }
.toast-info .toast-icon    { color: var(--info); }
.toast-msg { color: var(--text-primary); flex: 1; word-break: break-word; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) translateX(12px); }
  to   { opacity: 1; transform: translateY(0) translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) translateX(0); }
  to   { opacity: 0; transform: translateY(-8px) translateX(12px); }
}

/* ============================================
 * 统一组件样式
 * ============================================ */

/* 页面标题栏 */
.page-header {
  padding: 20px 24px 0;
}
.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 统计卡片 — 加深阴影+顶部细线强调 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  padding: 16px 24px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all .2s ease;
  border-top: 3px solid transparent;
  position: relative;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}
.stat-value.primary   { color: var(--primary); }
.stat-value.success   { color: var(--success); }
.stat-value.warning   { color: #e6a000; }
.stat-value.danger    { color: var(--danger); }
.stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* 内容面板 */
.panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin: 0 24px 16px;
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #fafbfd;
}
.panel-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-body {
  padding: 18px 20px;
}

/* 工具栏/筛选栏 */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #fafbfd;
}
.toolbar select,
.toolbar input[type="text"],
.toolbar input[type="search"],
.toolbar input[type="date"] {
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  color: var(--text-primary);
  background: #fff;
  transition: border-color .15s;
  height: 32px;
}
.toolbar select:focus,
.toolbar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,119,255,.08);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  border: 1px solid var(--border-color);
  background: #fff;
  color: var(--text-secondary);
  white-space: nowrap;
  height: 32px;
  line-height: 1;
}
.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff !important;
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff !important;
}
.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff !important;
}
.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff !important;
}
.btn-danger {
  color: var(--danger) !important;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff !important;
}
.btn-sm {
  padding: 3px 10px;
  font-size: 12px;
  height: 26px;
}

/* 表格 */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: #f5f6f9;
  padding: 10px 14px;
  text-align: left;
  font-weight: 650;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.2px;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-primary);
  font-size: 13px;
}
tr:hover td { background: #fafbfd; }

.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
}
.sortable:hover { color: var(--primary); }
.sortable::after {
  content: '\2195';
  font-size: 10px;
  margin-left: 4px;
  color: var(--text-muted);
  opacity: 0.5;
}
.sortable.asc::after { content: '\2191'; color: var(--primary); opacity: 1; }
.sortable.desc::after { content: '\2193'; color: var(--primary); opacity: 1; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 550;
  line-height: 1.65;
}
.tag-success { background: var(--success-bg); color: #389e0d; border: 1px solid var(--success-border); }
.tag-info    { background: var(--primary-light); color: var(--primary); border: 1px solid #adc9ff; }
.tag-warning { background: var(--warning-bg); color: #d48806; border: 1px solid var(--warning-border); }
.tag-danger  { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
.tag-default { background: #f0f1f3; color: var(--text-muted); border: 1px solid var(--border-color); }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.empty-state i { font-size: 36px; margin-bottom: 10px; display: block; opacity: .35; }

/* ============================================
 * 响应式
 * ============================================ */
@media (max-width: 900px) {
  .navbar { padding: 0 14px; height: 48px; }
  .navbar-brand { margin-right: 14px; font-size: 14px; }
  .navbar-brand .nav-icon { font-size: 16px; }
  .nav-link { padding: 0 9px; font-size: 12px; height: 30px; }
  .stat-cards, .panel, .toolbar { padding-left: 14px; padding-right: 14px; margin-left: 0; margin-right: 0; }
  .page-header { padding-left: 14px; padding-right: 14px; }
  #toast-container { left: 14px; right: 14px; max-width: none; width: auto; }
}

@media print {
  .navbar, #toast-container { display: none !important; }
  .page-body { padding-top: 0 !important; }
}
