/* 全局响应式样式，优先保障移动端可读性 */
:root {
  --app-bg: #f5f6fa;
  --card-radius: 14px;
  --card-shadow: 0 8px 30px rgba(15, 23, 42, 0.05);
}

body {
  background: var(--app-bg);
}

.app-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 12px;
  width: 100%;
}

header .navbar {
  padding: 12px 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.92);
}

.navbar-brand {
  font-size: 1.15rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  width: 28px;
  height: 28px;
  display: inline-block;
}

.brand-name {
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-nav .nav-link {
  border-radius: 12px;
  color: #334155;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.navbar-nav .nav-link:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.navbar-nav .nav-link.active {
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.navbar-nav .nav-link.active:hover {
  background: #0b1220;
  color: #ffffff;
}

.navbar-nav .nav-link {
  padding: 8px 10px;
  font-weight: 600;
}

.nav-actions select {
  min-width: 180px;
}

@media (max-width: 991px) {
  .navbar-brand {
    max-width: calc(100% - 56px);
  }

  .navbar-collapse {
    padding-top: 10px;
  }

  .navbar-nav {
    gap: 6px;
  }

  .navbar-nav .nav-link {
    width: 100%;
    padding: 10px 12px;
  }
  .nav-actions {
    padding: 12px 0;
  }
  .nav-actions select {
    width: 100%;
  }
}

main .card,
.table-scroll {
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 760px;
}

.table th,
.table td {
  vertical-align: middle;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
}

.stat-card .label {
  color: #6b7280;
  font-size: 0.9rem;
}

.stat-card .value {
  font-size: 1.35rem;
  font-weight: 700;
  color: #0f172a;
}

.stat-card .hint {
  color: #94a3b8;
  font-size: 0.85rem;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.section-title .subtitle {
  color: #6b7280;
  font-size: 0.95rem;
}

.dashboard-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.dashboard-list .list-group-item {
  border-radius: 12px;
}

.card + .card {
  margin-top: 18px;
}

.table th.col-hide-sm,
.table td.col-hide-sm {
  display: table-cell;
}

@media (max-width: 767px) {
  .table-scroll table {
    min-width: 640px;
  }
  .table th.col-hide-sm,
  .table td.col-hide-sm {
    display: none;
  }
  .table th.col-hide-xs,
  .table td.col-hide-xs {
    display: none;
  }
  .section-title {
    align-items: flex-start;
  }
  .btn,
  .btn-sm,
  .btn-group-sm > .btn {
    min-height: 40px;
  }
  .anchor-card-row {
    padding: 14px;
  }
  .anchor-left {
    flex: 1 1 100%;
  }
  .anchor-middle {
    flex: 1 1 100%;
  }
  .anchor-right {
    width: 100%;
    align-items: flex-start;
  }
  .action-group {
    width: 100%;
    justify-content: flex-start;
  }
  .action-group .icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
  }
  .avatar-wrapper {
    width: 64px;
    height: 64px;
  }
  .anchor-title-row {
    align-items: flex-start;
  }
  .detail-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .detail-card-grid .list-group-item {
    padding: 10px 12px;
  }
  .card-body .row > [class^="col"] {
    margin-bottom: 12px;
  }
}

/* /anchors 主播列表：窄屏自动换行，避免挤压左侧 */
@media (max-width: 1200px) {
  .anchor-card--v2 {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .anchor-card--v2 .anchor-left,
  .anchor-card--v2 .anchor-middle,
  .anchor-card--v2 .anchor-actions {
    width: 100%;
  }
  .anchor-card--v2 .anchor-left {
    flex: 0 0 auto;
    min-width: 0;
  }
  .anchor-card--v2 .anchor-actions {
    justify-content: flex-end;
    margin-left: 0;
  }
  .anchor-card--v2 .anchor-metrics-row {
    flex-wrap: wrap;
  }
}

@media (min-width: 768px) {
  .detail-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}

.mobile-card-list {
  display: grid;
  gap: 12px;
}

.mobile-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--card-shadow);
}

.mobile-card .meta {
  color: #6b7280;
  font-size: 0.9rem;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-live {
  background: #22c55e;
  color: #0f172a;
}

.badge-offline {
  background: #e2e8f0;
  color: #475569;
}

.table-note {
  color: #64748b;
  font-size: 0.9rem;
}
