/* ========================================
   公交智能站台管理系统 - 后台管理样式
   ======================================== */

/* -------------------- 登录页面 -------------------- */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 40%, #1a73e8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.login-container {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px 36px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  text-align: center;
}

.login-logo {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1a73e8, #4a9bf5);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(26,115,232,0.3);
}

.login-logo i {
  font-size: 32px;
  color: #fff;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 4px;
}

.login-subtitle {
  font-size: 14px;
  color: #999;
  margin: 0 0 32px;
}

.login-field {
  position: relative;
  margin-bottom: 18px;
}

.login-field > i:first-child {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #bbb;
  font-size: 15px;
}

.login-field input {
  width: 100%;
  height: 46px;
  border: 2px solid #e8e8e8;
  border-radius: 10px;
  padding: 0 44px 0 42px;
  font-size: 15px;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.login-field input:focus {
  border-color: #1a73e8;
}

.login-field input::placeholder {
  color: #bbb;
}

.login-toggle-pwd {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  padding: 4px;
  font-size: 14px;
}

.login-toggle-pwd:hover {
  color: #666;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
}

.login-remember input[type="checkbox"] {
  accent-color: #1a73e8;
}

.login-error {
  color: #ea4335;
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 10px;
}

.login-btn {
  width: 100%;
  height: 46px;
  background: linear-gradient(135deg, #1a73e8, #4a9bf5);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s, transform 0.1s;
}

.login-btn:hover {
  opacity: 0.9;
}

.login-btn:active {
  transform: scale(0.98);
}

.login-footer {
  margin-top: 28px;
  font-size: 12px;
  color: #ccc;
}

/* -------------------- CSS 变量 -------------------- */
:root {
  --primary-color: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #4a9bf5;
  --success-color: #34a853;
  --danger-color: #ea4335;
  --warning-color: #fbbc04;
  --info-color: #4285f4;
  --dark-bg: #1e2330;
  --darker-bg: #151922;
  --sidebar-width: 260px;
  --header-height: 60px;
  --border-radius: 8px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --transition: all 0.3s ease;
}

/* -------------------- 重置样式 -------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f7fa;
  overflow: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
}

/* -------------------- 主布局 -------------------- */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* -------------------- 侧边栏 -------------------- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo i {
  font-size: 28px;
  color: var(--primary-color);
}

.sidebar-logo span {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 0;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  padding: 0 20px;
  margin-bottom: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.4);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(90deg, var(--primary-color) 0%, transparent 100%);
  color: #fff;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-color);
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-item span {
  font-size: 14px;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--danger-color);
  color: #fff;
  font-size: 11px;
  border-radius: 10px;
}

/* -------------------- 主内容区 -------------------- */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* -------------------- 顶部栏 -------------------- */
.header {
  height: var(--header-height);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-title {
  font-size: 20px;
  font-weight: 600;
  color: #333;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #666;
}

.breadcrumb span {
  color: var(--primary-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-time {
  font-size: 13px;
  color: #666;
}

.header-time i {
  margin-right: 6px;
  color: var(--primary-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f7fa;
  border-radius: 50%;
  color: #666;
  transition: var(--transition);
}

.header-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

.header-btn .badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--danger-color);
  color: #fff;
  font-size: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--info-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

/* -------------------- 内容区域 -------------------- */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: #f5f7fa;
}

.page {
  display: none;
  animation: fadeIn 0.3s ease;
}

.page.active {
  display: block;
}

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

/* -------------------- 统计卡片 -------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.blue::before {
  background: var(--primary-color);
}

.stat-card.green::before {
  background: var(--success-color);
}

.stat-card.orange::before {
  background: #fbbc04;
}

.stat-card.red::before {
  background: var(--danger-color);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 16px;
}

.stat-card.blue .stat-icon {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-color);
}

.stat-card.green .stat-icon {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success-color);
}

.stat-card.orange .stat-icon {
  background: rgba(251, 188, 4, 0.1);
  color: #fbbc04;
}

.stat-card.red .stat-icon {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 4px;
}

.stat-change.up {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success-color);
}

.stat-change.down {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

/* -------------------- 仪表盘地图 -------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.map-container {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.section-title i {
  color: var(--primary-color);
}

.mock-map {
  height: 400px;
  background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 100%);
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}

.map-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 1px;
}

.map-grid-cell {
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.bus-marker {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  animation: busPulse 2s infinite;
  z-index: 10;
}

@keyframes busPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(26, 115, 232, 0.4);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(26, 115, 232, 0);
  }
}

.station-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--success-color);
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.station-marker.offline {
  background: #999;
}

.station-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
}

/* -------------------- 最近事件 -------------------- */
.event-list {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  max-height: 480px;
  overflow-y: auto;
}

.event-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  transition: var(--transition);
}

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

.event-item:hover {
  background: #f9fafb;
  margin: 0 -12px;
  padding: 12px;
  border-radius: var(--border-radius);
}

.event-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.event-icon.arrival {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success-color);
}

.event-icon.departure {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-color);
}

.event-icon.alert {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

.event-content {
  flex: 1;
}

.event-title {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
}

.event-meta {
  font-size: 12px;
  color: #999;
}

.event-time {
  font-size: 12px;
  color: #999;
  flex-shrink: 0;
}

/* -------------------- 数据表格 -------------------- */
.data-table-container {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.table-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f5f7fa;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: var(--transition);
}

.search-box:focus-within {
  border-color: var(--primary-color);
  background: #fff;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 200px;
  color: #333;
}

.search-box input::placeholder {
  color: #999;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.filter-select:focus {
  border-color: var(--primary-color);
}

/* -------------------- 按钮样式 -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #f5f7fa;
  color: #666;
  border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
  background: #e8eaed;
  color: #333;
}

.btn-success {
  background: var(--success-color);
  color: #fff;
}

.btn-success:hover {
  background: #2d9147;
}

.btn-danger {
  background: var(--danger-color);
  color: #fff;
}

.btn-danger:hover {
  background: #d33426;
}

.btn-warning {
  background: #fbbc04;
  color: #fff;
}

.btn-warning:hover {
  background: #e5a800;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
}

.btn-icon.btn-edit {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-color);
}

.btn-icon.btn-edit:hover {
  background: var(--primary-color);
  color: #fff;
}

.btn-icon.btn-delete {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

.btn-icon.btn-delete:hover {
  background: var(--danger-color);
  color: #fff;
}

/* -------------------- 数据表格 -------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  background: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #333;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: #f8f9fa;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* -------------------- 状态标签 -------------------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.online {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success-color);
}

.status-badge.online::before {
  background: var(--success-color);
}

.status-badge.offline {
  background: rgba(153, 153, 153, 0.1);
  color: #999;
}

.status-badge.offline::before {
  background: #999;
}

.status-badge.running {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success-color);
}

.status-badge.running::before {
  background: var(--success-color);
}

.status-badge.stopped {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-color);
}

.status-badge.stopped::before {
  background: var(--primary-color);
}

/* -------------------- 线路颜色标记 -------------------- */
.route-color {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.route-color span {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

/* -------------------- 分页 -------------------- */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid #eee;
}

.table-info {
  font-size: 13px;
  color: #666;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: #fff;
  color: #666;
  font-size: 13px;
  transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.pagination button.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* -------------------- 模态框 -------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9) translateY(-20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f5f7fa;
  color: #666;
  font-size: 18px;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--danger-color);
  color: #fff;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #eee;
  background: #fafafa;
}

/* -------------------- 表单样式 -------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.form-label .required {
  color: var(--danger-color);
  margin-left: 2px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.form-input.error {
  border-color: var(--danger-color);
}

.form-error {
  font-size: 12px;
  color: var(--danger-color);
  margin-top: 4px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-help {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

/* -------------------- 复选框组 -------------------- */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #f5f7fa;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.checkbox-item:hover {
  background: #e8eaed;
}

.checkbox-item input {
  display: none;
}

.checkbox-item input:checked + span {
  color: var(--primary-color);
}

.checkbox-item span {
  font-size: 14px;
  color: #666;
}

.checkbox-item.checked {
  background: rgba(26, 115, 232, 0.1);
  border: 1px solid var(--primary-color);
}

/* -------------------- 颜色选择器 -------------------- */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-option {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition);
}

.color-option:hover {
  transform: scale(1.1);
}

.color-option.selected {
  border-color: #333;
  box-shadow: var(--shadow-md);
}

/* -------------------- Toast 提示 -------------------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  min-width: 300px;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.error {
  border-left: 4px solid var(--danger-color);
}

.toast.warning {
  border-left: 4px solid #fbbc04;
}

.toast.info {
  border-left: 4px solid var(--info-color);
}

.toast-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast.success .toast-icon {
  color: var(--success-color);
}

.toast.error .toast-icon {
  color: var(--danger-color);
}

.toast.warning .toast-icon {
  color: #fbbc04;
}

.toast.info .toast-icon {
  color: var(--info-color);
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: #333;
}

.toast-close {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #999;
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.toast-close:hover {
  color: #333;
}

/* -------------------- 确认对话框 -------------------- */
.confirm-modal .modal {
  max-width: 400px;
}

.confirm-modal .modal-body {
  text-align: center;
  padding: 32px;
}

.confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.confirm-modal.warning .confirm-icon {
  background: rgba(251, 188, 4, 0.1);
  color: #fbbc04;
}

.confirm-modal.danger .confirm-icon {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

.confirm-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.confirm-message {
  font-size: 14px;
  color: #666;
}

/* -------------------- 媒体管理 -------------------- */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  padding: 20px;
}

.media-card {
  background: #fff;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.media-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.media-preview {
  height: 140px;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview.video {
  color: #999;
  font-size: 48px;
}

.media-info {
  padding: 12px;
}

.media-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-meta {
  font-size: 12px;
  color: #999;
  margin-bottom: 8px;
}

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

/* -------------------- 拖拽上传区 -------------------- */
.upload-zone {
  border: 2px dashed #e0e0e0;
  border-radius: var(--border-radius);
  padding: 40px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: #fafafa;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary-color);
  background: rgba(26, 115, 232, 0.05);
}

.upload-zone i {
  font-size: 48px;
  color: #ccc;
  margin-bottom: 16px;
}

.upload-zone:hover i {
  color: var(--primary-color);
}

.upload-zone p {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.upload-zone .hint {
  font-size: 12px;
  color: #999;
}

/* -------------------- 关联设置 -------------------- */
.relation-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.relation-panel {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.relation-list {
  max-height: 400px;
  overflow-y: auto;
}

.relation-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: var(--transition);
}

.relation-item:hover {
  background: #f9fafb;
}

.relation-item.selected {
  background: rgba(26, 115, 232, 0.05);
  border-left: 3px solid var(--primary-color);
}

.relation-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.relation-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #e0e0e0;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.relation-item.checked .relation-checkbox {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

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

/* -------------------- 车辆监控 -------------------- */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 20px;
}

.vehicle-card {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.vehicle-card:hover {
  box-shadow: var(--shadow-md);
}

.vehicle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.vehicle-id {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.vehicle-route {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  color: #fff;
}

.vehicle-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.vehicle-info-item {
  font-size: 13px;
  color: #666;
}

.vehicle-info-item label {
  color: #999;
}

/* -------------------- 系统设置 -------------------- */
.settings-section {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.settings-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eee;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f0;
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 14px;
  color: #333;
}

.settings-desc {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.settings-value {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-input {
  width: 200px;
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
}

/* -------------------- 开关 -------------------- */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.switch.active {
  background: var(--primary-color);
}

.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.switch.active::after {
  left: 22px;
}

/* -------------------- 日志列表 -------------------- */
.log-list {
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 12px;
}

.log-item {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  gap: 12px;
}

.log-time {
  color: #999;
  flex-shrink: 0;
}

.log-level {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  flex-shrink: 0;
}

.log-level.info {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-color);
}

.log-level.warning {
  background: rgba(251, 188, 4, 0.1);
  color: #fbbc04;
}

.log-level.error {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

.log-content {
  color: #333;
}

/* -------------------- 响应式 -------------------- */
@media (max-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .relation-container {
    grid-template-columns: 1fr;
  }
}

/* -------------------- 线路弹窗加宽 -------------------- */
.route-modal-wide {
  max-width: 720px;
}

/* -------------------- 站点计数标签 -------------------- */
.station-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 600;
  border-radius: 10px;
  margin-left: 8px;
}

/* -------------------- 站点批量导入区域 -------------------- */
.station-batch-section {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.station-batch-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f8f9fa;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  transition: all 0.2s ease;
  user-select: none;
}

.station-batch-toggle:hover {
  background: #eef1f5;
  color: #333;
}

.station-batch-toggle i:first-child {
  color: var(--primary-color);
}

.station-batch-body {
  padding: 14px;
  border-top: 1px solid #e8eaed;
  background: #fafbfc;
}

.station-batch-textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.6;
}

/* -------------------- 逐个添加站点行 -------------------- */
.station-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.station-add-row .form-input {
  flex: 1;
}

/* -------------------- 站点列表容器 -------------------- */
.station-list-container {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.station-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 20px;
  color: #bbb;
  font-size: 14px;
}

.station-list-empty i {
  font-size: 32px;
}

/* -------------------- 站点列表 -------------------- */
.station-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

.station-list::-webkit-scrollbar {
  width: 4px;
}

.station-list::-webkit-scrollbar-track {
  background: transparent;
}

.station-list::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 2px;
}

/* -------------------- 单个站点项 -------------------- */
.station-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s ease;
  cursor: grab;
}

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

.station-item:hover {
  background: #f8f9fa;
}

.station-item.dragging {
  opacity: 0.5;
  background: #e8f0fe;
}

.station-item.drag-over {
  border-top: 2px solid var(--primary-color);
}

/* 站点序号 */
.station-item-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f0f2f5;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.station-item:first-child .station-item-index {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-color);
}

.station-item:last-child .station-item-index {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

/* 站点方向标识 */
.station-item-start,
.station-item-end {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  flex-shrink: 0;
}

.station-item-start {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary-color);
}

.station-item-end {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}

/* 站点名称 */
.station-item-name {
  flex: 1;
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 站点操作按钮 */
.station-item-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.station-item:hover .station-item-actions {
  opacity: 1;
}

.station-item-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s ease;
  background: transparent;
}

.station-item-btn.btn-up,
.station-item-btn.btn-down {
  color: #999;
}

.station-item-btn.btn-up:hover,
.station-item-btn.btn-down:hover {
  background: #e8eaed;
  color: #333;
}

.station-item-btn.btn-remove {
  color: #ccc;
}

.station-item-btn.btn-remove:hover {
  background: rgba(234, 67, 53, 0.1);
  color: var(--danger-color);
}
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: #999;
}

.text-success {
  color: var(--success-color);
}

.text-danger {
  color: var(--danger-color);
}

.text-warning {
  color: #fbbc04;
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

/* -------------------- 加载动画 -------------------- */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

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

/* -------------------- 空状态 -------------------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 16px;
  color: #ddd;
}

.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #666;
}

.empty-state p {
  font-size: 14px;
}

/* ==========================================
   媒体管理 - 标签页
   ========================================== */

.media-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 2px solid #e8eaed;
  margin-bottom: 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

.media-tab {
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.media-tab:hover {
  background: #f5f7fa;
  color: #333;
}

.media-tab.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
  background: #f8f9fa;
  font-weight: 600;
}

.media-tab-content {
  display: none;
}

.media-tab-content.active {
  display: block;
}

.media-total-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  margin-left: 10px;
}

/* ==========================================
   媒体管理 - 媒体卡片网格
   ========================================== */

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 20px;
  min-height: 200px;
}

.media-card-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
  border: 1px solid #eee;
  position: relative;
}

.media-card-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.media-card-item.inactive {
  opacity: 0.6;
}

.media-card-thumb {
  height: 140px;
  background: linear-gradient(135deg, #f0f4f8, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.media-card-thumb i {
  font-size: 40px;
  color: #b0bec5;
}

.media-card-thumb.video-thumb {
  background: linear-gradient(135deg, #1a237e20, #0d47a120);
}

.media-card-thumb.video-thumb i {
  color: #42a5f5;
}

.media-card-thumb.image-thumb {
  background: linear-gradient(135deg, #1b5e2020, #2e7d3220);
}

.media-card-thumb.image-thumb i {
  color: #66bb6a;
}

.media-card-status {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.media-card-status.active {
  background: #e8f5e9;
  color: #2e7d32;
}

.media-card-status.inactive {
  background: #ffebee;
  color: #c62828;
}

.media-card-type-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255,255,255,0.9);
  color: #555;
}

.media-card-body {
  padding: 12px 14px;
}

.media-card-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.media-card-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #f5f7fa;
  color: #666;
}

.media-card-tag.tag-image { background: #e8f5e9; color: #2e7d32; }
.media-card-tag.tag-video { background: #e3f2fd; color: #1565c0; }

.media-card-detail {
  font-size: 12px;
  color: #999;
  display: flex;
  gap: 12px;
}

.media-card-detail span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.media-card-footer {
  display: flex;
  justify-content: flex-end;
  padding: 8px 14px;
  border-top: 1px solid #f0f0f0;
  gap: 6px;
}

.media-card-footer .btn {
  font-size: 12px;
  padding: 4px 10px;
}

/* 媒体库空状态 */
.media-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #bbb;
}

.media-empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
}

.media-empty-state h3 {
  font-size: 16px;
  color: #999;
  margin-bottom: 8px;
}

.media-empty-state p {
  font-size: 13px;
  color: #bbb;
}

/* ==========================================
   站台广告配置页面
   ========================================== */

.ad-config-container {
  display: flex;
  gap: 0;
  height: calc(100vh - 200px);
  min-height: 500px;
}

/* 左侧站台列表 */
.ad-station-list-panel {
  width: 260px;
  min-width: 260px;
  background: #fff;
  border-right: 1px solid #e8eaed;
  overflow-y: auto;
}

.ad-station-list-panel .section-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e8eaed;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 5;
}

.ad-station-item {
  padding: 14px 20px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.15s ease;
}

.ad-station-item:hover {
  background: #f5f7fa;
}

.ad-station-item.selected {
  background: #e8f0fe;
  border-left: 3px solid #1a73e8;
}

.ad-station-name {
  font-weight: 500;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-station-meta {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  padding-left: 20px;
}

/* 右侧配置面板 */
.ad-config-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #f8f9fa;
}

.ad-config-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ad-config-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ad-config-header h3 i {
  color: #1a73e8;
}

/* 广告配置分区 */
.ad-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ad-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #555;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.ad-section-title i {
  color: #1a73e8;
  font-size: 14px;
}

/* 表单行 */
.ad-form-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ad-form-row label {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  min-width: 110px;
}

.ad-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  font-family: inherit;
}

.ad-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,0.15);
}

.ad-input-sm {
  width: 80px;
  flex: none;
}

.ad-form-hint {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f0f7ff;
  border-radius: 6px;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
}

.ad-form-hint i {
  color: #1a73e8;
  margin-right: 4px;
}

/* 已关联媒体区域 */
.ad-assigned-media {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 60px;
  padding: 12px;
  background: #f5f7fa;
  border-radius: 8px;
  border: 2px dashed #ddd;
}

.ad-assigned-media:empty::after {
  content: '暂未关联媒体，请从下方资源库点击添加';
  color: #bbb;
  font-size: 13px;
}

.ad-empty-hint {
  color: #bbb;
  font-size: 13px;
  padding: 16px;
  text-align: center;
  width: 100%;
}

/* 媒体卡片 */
.ad-media-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 8px;
  width: 260px;
  transition: all 0.2s ease;
  cursor: default;
}

.ad-media-card:not(.assigned) {
  cursor: pointer;
}

.ad-media-card:not(.assigned):hover {
  border-color: #1a73e8;
  box-shadow: 0 2px 8px rgba(26,115,232,0.15);
  transform: translateY(-1px);
}

.ad-media-card.assigned {
  background: #e8f0fe;
  border-color: #aecbfa;
}

.ad-media-preview {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #999;
  flex-shrink: 0;
}

.ad-media-info {
  flex: 1;
  min-width: 0;
}

.ad-media-title {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-media-type {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.ad-media-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ad-media-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1a73e8;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

/* 媒体资源库 */
.ad-media-library {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

/* 滚动公告 */
.ad-announcements {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-announcement-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ad-announcement-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f0f0f0;
  color: #666;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.ad-announcement-item .ad-input {
  flex: 1;
}

/* 预览链接 */
.ad-preview-link {
  padding: 12px 0;
}

.ad-preview-link a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(135deg, #1a73e8, #4285f4);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.ad-preview-link a:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,115,232,0.3);
}

/* 状态小圆点 */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.online {
  background: #34a853;
  box-shadow: 0 0 4px rgba(52,168,83,0.5);
}

.status-dot.offline {
  background: #ea4335;
}

/* ==========================================
   媒体上传区域
   ========================================== */

.media-upload-zone {
  border: 2px dashed #d0d5dd;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
  background: #f9fafb;
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-upload-zone:hover {
  border-color: #1a73e8;
  background: #f0f6ff;
}

.media-upload-zone.dragover {
  border-color: #1a73e8;
  background: #e8f0fe;
  transform: scale(1.01);
}

.media-upload-zone.has-file {
  border-style: solid;
  border-color: #34a853;
  background: #f8fdf8;
  padding: 12px;
  cursor: default;
}

.media-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.media-upload-placeholder i {
  font-size: 40px;
  color: #b0bec5;
  transition: color 0.2s;
}

.media-upload-zone:hover .media-upload-placeholder i {
  color: #1a73e8;
}

.media-upload-placeholder p {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.media-upload-hint {
  font-size: 12px;
  color: #999;
}

/* 上传预览容器 */
.media-upload-preview {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.media-preview-container {
  max-width: 100%;
  max-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
}

.media-preview-container img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 8px;
}

.media-preview-container video {
  max-width: 100%;
  max-height: 260px;
  border-radius: 8px;
  background: #000;
}

.media-upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(234, 67, 53, 0.9);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}

.media-upload-remove:hover {
  background: #c62828;
  transform: scale(1.1);
}

/* 有效时间设置行 */
.media-validity-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.media-validity-field {
  flex: 1;
}

.media-validity-field label {
  display: block;
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.media-validity-separator {
  color: #999;
  font-size: 14px;
  padding-bottom: 12px;
  flex-shrink: 0;
}

/* ==========================================
   媒体卡片 - 文件预览 & 有效期标签
   ========================================== */

/* 卡片缩略图增强：有真实图片/视频时 */
.media-card-thumb.has-real-thumb {
  cursor: pointer;
}

.media-card-thumb.has-real-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-card-thumb.has-real-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 有效期标签 */
.media-card-validity {
  position: absolute;
  bottom: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.media-card-validity.valid {
  background: rgba(52, 168, 83, 0.85);
  color: #fff;
}

.media-card-validity.expired {
  background: rgba(234, 67, 53, 0.85);
  color: #fff;
}

.media-card-validity.pending {
  background: rgba(251, 188, 4, 0.85);
  color: #fff;
}

/* 媒体预览模态框 */
.media-preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.media-preview-modal.active {
  opacity: 1;
  visibility: visible;
}

.media-preview-modal-content {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
}

.media-preview-modal-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.media-preview-modal-content video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 4px;
}

.media-preview-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: none;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.media-preview-modal-close:hover {
  background: rgba(255,255,255,0.4);
}

/* 媒体卡片有效期信息行 */
.media-card-validity-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  margin-top: 4px;
}

.media-card-validity-info i {
  font-size: 10px;
}

.media-card-validity-info.valid-info {
  color: #34a853;
}

.media-card-validity-info.expired-info {
  color: #ea4335;
}

.media-card-validity-info.pending-info {
  color: #fbbc04;
}

.media-card-validity-info.permanent-info {
  color: #999;
}

/* ==========================================
   车辆监控 - Tab 切换
   ========================================== */

.vehicle-tabs {
  display: flex;
  gap: 0;
  background: #fff;
  border-bottom: 2px solid #e8eaed;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  margin-bottom: 0;
}

.vehicle-tab {
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.vehicle-tab:hover {
  background: #f5f7fa;
  color: #333;
}

.vehicle-tab.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
  background: #f8f9fa;
  font-weight: 600;
}

.vehicle-tab-content {
  display: none;
}

.vehicle-tab-content.active {
  display: block;
}

/* ==========================================
   表格操作按钮组
   ========================================== */

.table-action-btns {
  display: flex;
  gap: 6px;
}

/* ==========================================
   驾驶员管理 - 年审状态
   ========================================== */

.driver-review-status {
  font-size: 13px;
  color: #333;
}

.driver-review-status.valid {
  color: #34a853;
}

.driver-review-status.expiring {
  color: #f57c00;
  font-weight: 500;
}

.driver-review-status.expired {
  color: #ea4335;
  font-weight: 600;
}

/* ==========================================
   驾驶员管理 - 驾照分数
   ========================================== */

.driver-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
}

.driver-score.score-good {
  background: #e8f5e9;
  color: #2e7d32;
}

.driver-score.score-warning {
  background: #fff3e0;
  color: #e65100;
}

.driver-score.score-danger {
  background: #ffebee;
  color: #c62828;
}

/* ==========================================
   驾驶员管理 - 扣分记录
   ========================================== */

.deduction-driver-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 16px;
}

.deduction-driver-name {
  font-size: 16px;
  font-weight: 600;
  color: #1a73e8;
}

.deduction-driver-score {
  font-size: 14px;
  color: #666;
}

.deduction-list-container {
  max-height: 400px;
  overflow-y: auto;
}

.deduction-table {
  font-size: 13px;
}

.deduction-reason-tag {
  display: inline-block;
  padding: 2px 8px;
  background: #fff3e0;
  color: #e65100;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.deduction-points {
  display: inline-block;
  padding: 2px 8px;
  background: #ffebee;
  color: #c62828;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

/* 操作按钮 - 扣分 */
.btn-icon.btn-deduct {
  color: #ea4335;
}
.btn-icon.btn-deduct:hover {
  color: #c62828;
  background: #ffebee;
}

/* 操作按钮 - 记录 */
.btn-icon.btn-history {
  color: #f57c00;
}
.btn-icon.btn-history:hover {
  color: #e65100;
  background: #fff3e0;
}
