/* 直播编码机系统样式 - 现代化UI设计 */

/* 字体与CSS变量 */
:root {
  /* 现代渐变主题色 */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-color: #667eea;
  --primary-hover: #5568d3;
  --secondary-color: #764ba2;
  
  /* 强调色 */
  --success-color: #10b981;
  --success-hover: #059669;
  --danger-color: #ef4444;
  --danger-hover: #dc2626;
  --warning-color: #f59e0b;
  --warning-hover: #d97706;
  --info-color: #06b6d4;
  
  /* 中性色 */
  --bg-main: #f3f4f6;
  --bg-card: #ffffff;
  --bg-sidebar: #1e293b;
  --bg-sidebar-header: #0f172a;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e5e7eb;
  --select-arrow-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* 过渡 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.main-content,
.card,
.card-header,
.card-body,
.platform-item,
.recording-item,
.source-card,
.source-card-header,
.source-card-body,
.target-form-panel,
.target-list,
.target-item,
.platform-info,
.recording-info {
  min-width: 0;
}

.platform-name,
.platform-url,
.recording-name,
.recording-meta,
.section-caption,
.target-empty,
.status-indicator,
.platform-badge,
.page-header h1,
.page-header p,
small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 登录页面 - 现代化设计 */
.login-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  position: relative;
  overflow: hidden;
}

/* 登录页背景装饰 */
.login-container::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.08) 0%, transparent 40%);
  animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-2%, -2%) rotate(1deg); }
}

.login-box {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--primary-gradient);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}

.login-box h1 {
  text-align: center;
  color: #2563eb;
  margin-bottom: 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 36px;
  font-size: 14px;
  font-weight: 500;
}

.login-box .system-logo {
  width: 128px;
  height: 128px;
  object-fit: contain;
  display: block;
  margin: 0 auto 24px;
}

/* 表单组 */
.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 13px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all var(--transition-normal);
  background: #f9fafb;
  color: var(--text-primary);
  font-weight: 500;
}

.form-group input:hover,
.form-group select:hover {
  border-color: #d1d5db;
  background-color: #fff;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

/* 现代化按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  width: 100%;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  transform: translateY(-2px);
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.btn-info {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
}

.btn-small {
  padding: 10px 18px;
  font-size: 13px;
  border-radius: var(--radius-md);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

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

/* 现代化侧边栏 */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  color: white;
  position: fixed;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: all var(--transition-slow);
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.sidebar.sidebar-collapsed {
  width: 0;
  overflow: hidden;
}

.sidebar-header {
  padding: 28px 24px;
  background: var(--bg-sidebar-header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

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

.sidebar-logo-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo-image {
  width: 72px;
  height: 72px;
  object-fit: contain;
  display: block;
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: -0.3px;
}

.sidebar.sidebar-collapsed .sidebar-header h2,
.sidebar.sidebar-collapsed .sidebar-header .version,
.sidebar.sidebar-collapsed .nav-menu,
.sidebar.sidebar-collapsed .sidebar-footer {
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.sidebar-header .version {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* 侧边栏折叠按钮 - 桌面端 */
.sidebar-toggle-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: none; /* 默认隐藏 */
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  font-size: 16px;
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.sidebar.sidebar-collapsed .sidebar-toggle-btn {
  right: -16px;
}

/* 导航菜单 */
.nav-menu {
  list-style: none;
  padding: 20px 16px;
}

.nav-menu li {
  margin: 6px 0;
}

.nav-menu a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: all var(--transition-normal);
  border-radius: var(--radius-md);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.nav-menu a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary-gradient);
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transform: scaleY(0);
  transition: all var(--transition-normal);
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.nav-menu a.active {
  background: rgba(102, 126, 234, 0.15);
  color: white;
}

.nav-menu a.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.nav-menu a i {
  font-size: 20px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  min-width: 0;
}

.nav-runtime-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

/* 侧边栏运行态绿框提示，统一用于“编码中/录制中/推流中/拉流中/推拉中”等正常运行状态。 */
/* 实现原因：这些徽标表示功能正在运行而非错误告警，使用绿色能避免与红色异常状态混淆。 */
.nav-runtime-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.95);
  background: rgba(34, 197, 94, 0.16);
  color: #bbf7d0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: navRuntimeBadgePulse 1.5s infinite;
}

@keyframes navRuntimeBadgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0);
  }
}

/* 侧边栏底部 */
.sidebar-footer {
  width: 100%;
  padding: 20px 16px;
  background: var(--bg-sidebar-header);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  margin-top: auto;
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-info .user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
}

.user-info span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  font-weight: 500;
}

.user-info .btn {
  padding: 8px 16px;
  font-size: 12px;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 32px 40px;
  transition: margin-left var(--transition-slow);
  min-height: 100vh;
  background: var(--bg-main);
}

.sidebar.sidebar-collapsed + .main-content {
  margin-left: 0;
}

/* 页面头部 */
.page-header {
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.page-header > div {
  flex: 1;
}

.page-header .header-toggle-btn {
  width: 48px;
  height: 48px;
  background: var(--primary-gradient);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
  font-size: 22px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.page-header .header-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* 现代化卡片 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.04);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.card-header h2 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.card-body {
  padding: 24px;
}

/* 状态指示器 - 现代化 */
.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
}

.status-running {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(5, 150, 105, 0.12) 100%);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-stopped {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(220, 38, 38, 0.12) 100%);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-buffering {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14) 0%, rgba(217, 119, 6, 0.12) 100%);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.22);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-running .status-dot {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-stopped .status-dot {
  background: #ef4444;
  animation: none;
}

.status-buffering .status-dot {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.45);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* 表单网格 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.settings-section + .settings-section {
  margin-top: 32px;
}

.settings-section-header {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.settings-section-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.form-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* 现代化开关 */
.switch-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e5e7eb;
  transition: all var(--transition-normal);
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all var(--transition-normal);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
  background: var(--primary-gradient);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* 命令显示区 */
.command-display {
  background: linear-gradient(180deg, #1a1a2e 0%, #16162a 100%);
  color: #a5b4fc;
  padding: 24px;
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 13px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 24px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.command-label {
  color: #818cf8;
  font-weight: 600;
  margin-bottom: 12px;
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 控制按钮组 */
.control-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.control-group .btn {
  min-width: 140px;
}

/* 平台列表 */
.platform-list {
  margin-top: 20px;
}

.platform-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.platform-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.platform-info {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.platform-name {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-size: 15px;
}

.platform-url {
  display: block;
  max-width: 100%;
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.address-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 16px;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
}

.address-label {
  width: 76px;
  justify-content: center;
  flex-shrink: 0;
}

.address-url {
  flex: 1;
  min-width: 0;
}

.btn-copy {
  flex: 0 0 auto;
  min-width: 64px;
  padding-left: 14px;
  padding-right: 14px;
  border-radius: var(--radius-md);
}

.platform-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(102, 126, 234, 0.12);
  color: #4f46e5;
  border: 1px solid rgba(102, 126, 234, 0.15);
  font-size: 12px;
  font-weight: 600;
}

.platform-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

/* 添加平台表单 */
.add-platform-form {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.add-platform-form input {
  flex: 1;
  min-width: 200px;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all var(--transition-normal);
  background: white;
}

.add-platform-form select {
  flex: 0 0 140px;
  min-width: 140px;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all var(--transition-normal);
  background: white;
  color: var(--text-primary);
  font-weight: 500;
}

.add-platform-form #platformName {
  flex: 0 0 160px;
  min-width: 160px;
}

.add-platform-form #platformUrl {
  flex: 1;
}

.pull-source-form #pullName {
  flex: 0 1 140px;
  min-width: 120px;
  max-width: 150px;
}

.pull-source-form #pullUrl {
  flex: 1 1 520px;
  min-width: 360px;
}

.replay-channel-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 140px 120px auto;
  align-items: center;
}

.replay-channel-form .replay-channel-name-input {
  width: 100%;
  min-width: 0;
}

.delay-input-group {
  flex: 0 1 120px;
  min-width: 120px;
  max-width: 100%;
  position: relative;
}

.add-platform-form .delay-input-group input {
  min-width: 0;
  width: 100%;
  padding-right: 38px;
}

.delay-input-unit {
  position: absolute;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}

.add-platform-form input:focus,
.add-platform-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.add-platform-form input.is-disabled {
  background: #f3f4f6;
  color: var(--text-muted);
}

.delay-input-group.is-disabled .delay-input-unit {
  color: var(--text-muted);
}

.platform-tip {
  margin-top: -8px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* 录制文件列表 */
.recording-list {
  margin-top: 20px;
}

.recording-storage-summary {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.recording-storage-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.recording-storage-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.recording-storage-percent {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  white-space: nowrap;
}

.recording-storage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.recording-storage-stat {
  padding: 10px 12px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.recording-storage-stat span,
.recording-storage-stat strong {
  display: block;
}

.recording-storage-stat span {
  font-size: 12px;
  color: var(--text-secondary);
}

.recording-storage-stat strong {
  margin-top: 4px;
  font-size: 16px;
  color: var(--text-primary);
}

.recording-storage-bar {
  margin-top: 14px;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e7eb;
}

.recording-storage-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
  transition: width var(--transition-normal), background var(--transition-normal);
}

.recording-storage-bar-fill.is-warning {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}

.recording-storage-bar-fill.is-danger {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.recording-storage-unavailable {
  color: var(--text-secondary);
  font-size: 13px;
}

.recording-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.recording-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.recording-info {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.recording-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recording-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recording-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

/* 正在录制的文件样式 */
.recording-item.recording-active {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.recording-item.recording-active .recording-name {
  color: #92400e;
}

/* 正在录制标识 */
.recording-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 12px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  animation: pulse 1.5s infinite;
}

.source-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  max-width: 100%;
  overflow: hidden;
}

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

.cloud-info-tile {
  padding: 12px 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  min-width: 0;
}

.cloud-info-tile p {
  color: var(--text-muted);
  font-size: 12px;
  margin: 0 0 5px;
}

.cloud-info-tile strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-info-tile.is-highlight strong {
  color: var(--primary-color);
}

.cloud-info-message {
  grid-column: 1 / -1;
  margin: 0;
}

.cloud-account-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.cloud-account-actions .btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  padding-left: 16px;
  padding-right: 16px;
  white-space: normal;
  min-height: 44px;
}

.cloud-account-actions #cloudOpenConnectBtn {
  min-width: 0;
}

.cloud-account-actions #cloudLogoutBtn,
.cloud-account-actions a.btn {
  min-width: 0;
}

.cloud-channel-form {
  align-items: center;
  margin-bottom: 10px;
}

.cloud-channel-form #cloudChannelName {
  flex: 0 1 150px;
  min-width: 130px;
}

.cloud-channel-form #cloudSourceSelect {
  flex: 3 1 460px;
  min-width: 360px;
}

.cloud-channel-form #cloudIngestProtocol {
  flex: 0 0 150px;
}

.cloud-channel-form .ttl-input-group {
  flex: 0 0 214px;
  min-width: 204px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-secondary);
  font-weight: 700;
}

.cloud-channel-form .ttl-input-group:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.cloud-channel-form .ttl-input-label,
.cloud-channel-form .ttl-input-unit {
  flex: 0 0 auto;
  font-size: 13px;
}

.cloud-channel-form #cloudLinkTtlDays {
  flex: 1 1 auto;
  min-width: 48px;
  width: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: center;
  box-shadow: none;
  font-weight: 800;
  color: var(--text-primary);
}

.cloud-channel-form #cloudLinkTtlDays:focus {
  box-shadow: none;
  border-color: transparent;
}

.cloud-channel-form #cloudDelayMode {
  flex: 0 0 132px;
  min-width: 128px;
}

.cloud-channel-form #cloudDelayGroup {
  flex: 0 0 108px;
}

.cloud-channel-form .btn {
  flex: 0 0 auto;
}

.cloud-channel-card .source-card-body {
  padding-top: 14px;
  margin-top: 14px;
}

.cloud-pull-address-list .section-caption {
  margin-top: 0;
  font-weight: 700;
}

.target-inline-form.cloud-relay-inline-form {
  grid-template-columns: 150px minmax(260px, 1fr) 128px;
}

.cloud-channel-card .target-item {
  flex-wrap: wrap;
}

.cloud-channel-card .target-item .error-message {
  flex-basis: 100%;
}

.cloud-channel-card.is-expired {
  border-color: rgba(239, 68, 68, 0.3);
  background: linear-gradient(180deg, #fff 0%, #fff7f7 100%);
}

.platform-badge.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.22);
}

.platform-badge.is-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.22);
}

/* 码率对比区域：本地编码码率 vs 云端探测码率 */
.cloud-bitrate-compare {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(248, 250, 252, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
}

.cloud-bitrate-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.cloud-bitrate-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.cloud-bitrate-value {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.cloud-bitrate-peak {
  font-size: 11px;
  color: var(--text-secondary);
  padding: 2px 6px;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 4px;
}

/* 协议在线统计 */
.cloud-protocol-online {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.cloud-section-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* 时间戳信息 */
.cloud-timestamps {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cloud-timestamp-item {
  font-size: 12px;
  color: var(--text-secondary);
}

.cloud-timestamp-item .cloud-section-label {
  font-weight: 500;
}

.cloud-source-edit-note {
  padding: 12px 14px;
  margin: 14px 0;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: rgba(248, 250, 252, 0.9);
  font-size: 13px;
}

.target-inline-form.cloud-source-inline-form {
  grid-template-columns: minmax(500px, 3fr) 132px 112px 116px;
}

.target-inline-form.cloud-source-inline-form .delay-input-group {
  min-width: 112px;
}

.cloud-source-inline-form .delay-input-group input {
  width: 100%;
  min-width: 0;
  padding-right: 38px;
}

.cloud-billing-panel {
  display: grid;
  gap: 16px;
}

.cloud-billing-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

.cloud-billing-today span,
.cloud-billing-updated {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
}

.cloud-billing-today strong {
  display: block;
  margin-top: 4px;
  color: var(--primary-color);
  font-size: 26px;
  line-height: 1.2;
}

.cloud-billing-table-wrap {
  overflow-x: auto;
}

.cloud-billing-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.cloud-billing-table th,
.cloud-billing-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.cloud-billing-table th {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  background: #f8fafc;
}

.source-card-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.source-card-body {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  min-width: 0;
}

.source-status-group,
.source-toolbar,
.source-inline-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.target-inline-form {
  display: grid;
  grid-template-columns: 150px minmax(240px, 1fr) 128px;
  gap: 12px;
  align-items: center;
}

.source-inline-meta {
  margin-top: 10px;
}

.source-toolbar {
  justify-content: space-between;
  margin-bottom: 16px;
}

.source-toolbar .platform-actions {
  margin-left: auto;
}

.target-form-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(102, 126, 234, 0.12);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.target-form-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.target-inline-form input,
.target-inline-form select {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: white;
}

.target-inline-form input:focus,
.target-inline-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* macOS 浏览器选择框适配 */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: var(--select-arrow-icon);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  line-height: 1.4;
  min-height: 44px;
  padding-right: 42px;
}

select::-ms-expand {
  display: none;
}

.form-group select {
  background-color: #f9fafb;
  background-image: var(--select-arrow-icon);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 42px;
}

.add-platform-form select,
.target-inline-form select,
select.btn {
  background-color: white;
  background-image: var(--select-arrow-icon);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

.add-platform-form select,
.target-inline-form select {
  padding-right: 42px;
}

select.btn {
  display: inline-block;
  padding-right: 36px !important;
}

.target-inline-form .btn {
  width: 100%;
  white-space: nowrap;
}

.target-inline-form .delay-input-group {
  width: 100%;
  min-width: 108px;
}

.time-controls {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #e0e7ff;
  border-radius: var(--radius-lg);
}

.time-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px;
  min-width: 0;
}

.time-controls #manualDateTime {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 2px solid #dbeafe;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.time-action-btn {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.time-action-btn span:first-child {
  line-height: 1;
}

.time-helper {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-secondary);
  font-size: 13px;
}

.target-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.target-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%);
  border: 1px solid rgba(148, 163, 184, 0.24);
  min-width: 0;
}

.target-item:hover {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.target-empty {
  padding: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}

.section-caption {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.4;
}

/* Toast 提示 - 现代化 */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
}

.toast {
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 16px 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 320px;
  animation: slideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.toast-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.toast.error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.toast.info .toast-icon {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
}

.toast.warning .toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.toast.success {
  border-left: 4px solid #10b981;
}

.toast.error {
  border-left: 4px solid #ef4444;
}

.toast.info {
  border-left: 4px solid #06b6d4;
}

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

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

/* Logo列表样式 */
#logoList > div {
  transition: background-color var(--transition-normal);
}

#logoList > div:hover {
  background-color: #f9fafb;
}

#logoList > div:last-child {
  border-bottom: none !important;
}

#logoList::-webkit-scrollbar {
  width: 6px;
}

#logoList::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#logoList::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

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

  .target-inline-form {
    grid-template-columns: minmax(140px, 180px) minmax(260px, 1fr) 92px;
  }

  .target-inline-form.cloud-source-inline-form {
    grid-template-columns: minmax(390px, 1fr) 128px 108px 112px;
  }

  .target-inline-form .target-url-input {
    grid-column: 2 / 4;
  }

  .target-inline-form .target-delay-mode-select,
  .target-inline-form .delay-input-group,
  .target-inline-form .target-add-button {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }
  
  .sidebar {
    position: fixed !important;
    left: -100% !important;
    top: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    z-index: 1000 !important;
    background: var(--bg-sidebar) !important;
    transition: left var(--transition-slow) !important;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.4);
  }
  
  .sidebar.sidebar-expanded {
    left: 0 !important;
  }
  
  .sidebar.sidebar-collapsed {
    left: -100% !important;
  }
  
  /* 显示移动端汉堡菜单按钮 */
  .mobile-toggle-btn {
    display: flex !important;
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 1001;
    background: var(--primary-gradient);
    color: white;
    border: none;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    align-items: center;
    justify-content: center;
  }
  
  .mobile-toggle-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
  }
  
  /* 桌面端隐藏侧边栏切换按钮 */
  .sidebar-toggle-btn {
    display: none;
  }
  
  /* 移动端侧边栏展开时的遮罩层 */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
  }
  
  .sidebar-overlay.active {
    display: block;
  }
  
  .nav-menu {
    padding: 16px;
  }
  
  .nav-menu a {
    padding: 16px 20px;
    font-size: 15px;
  }
  
  .sidebar-footer {
    padding: 16px;
  }
  
  .main-content {
    margin-left: 0;
    padding: 20px;
  }

  .card-header {
    align-items: flex-start;
  }
  
  .page-header {
    margin-bottom: 24px;
    padding-left: 0 !important;
  }
  
  .page-header h1 {
    font-size: 24px;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .platform-item,
  .recording-item,
  .target-item,
  .source-card-header,
  .source-toolbar {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  
  .platform-actions,
  .recording-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .platform-actions .btn,
  .recording-actions .btn,
  .source-toolbar .platform-actions .btn {
    flex: 1 1 120px;
    min-width: 0;
    max-width: 100%;
  }

  .address-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .address-label {
    width: auto;
    min-width: 64px;
  }

  .btn-copy {
    width: 100%;
  }

  .source-toolbar .platform-actions {
    margin-left: 0;
  }

  .cloud-account-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  
  .control-group {
    flex-direction: column;
  }
  
  .control-group .btn {
    width: 100%;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .add-platform-form {
    flex-direction: column;
  }

  .replay-channel-form {
    grid-template-columns: 1fr;
  }
  
  .add-platform-form input,
  .add-platform-form select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    flex: 1 1 auto !important;
  }
  
  .add-platform-form #platformName,
  .add-platform-form #platformUrl,
  .pull-source-form #pullName,
  .pull-source-form #pullUrl,
  .delay-input-group,
  .cloud-channel-form .ttl-input-group,
  .cloud-channel-form #cloudDelayMode,
  .add-platform-form #platformDelaySeconds,
  .add-platform-form #platformDelayMode {
    flex: 1;
    min-width: 0 !important;
    width: 100%;
  }

  .pull-source-form #pullName,
  .pull-source-form #pullUrl {
    max-width: none;
  }
  
  .add-platform-form .btn {
    width: 100% !important;
    min-width: 0;
  }

  .target-inline-form {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .target-inline-form > * {
    grid-column: 1 / -1 !important;
    min-width: 0 !important;
    max-width: 100%;
  }

  .target-inline-form input,
  .target-inline-form select,
  .target-inline-form .delay-input-group,
  .target-inline-form .btn,
  .target-inline-form .target-name-input,
  .target-inline-form .target-url-input,
  .target-inline-form .target-delay-mode-select,
  .target-inline-form .target-add-button {
    width: 100% !important;
    min-width: 0 !important;
  }

  .target-inline-form .target-add-button {
    grid-column: 1 / -1 !important;
  }

  .time-controls {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    padding: 12px;
  }

  .time-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .time-action-btn {
    width: 100%;
    min-width: 0;
  }

  .time-helper {
    gap: 8px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* 输入框组 */
.input-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.input-group input {
  flex: 1;
}

.input-group .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.capability-status {
  transition: color var(--transition-fast);
}

.capability-status-loading {
  color: var(--info-color);
}

.capability-status-success {
  color: var(--success-color);
}

.capability-status-warning {
  color: var(--warning-color);
}

.capability-status-error {
  color: var(--danger-color);
}

/* 日志显示样式 */
#logContent::-webkit-scrollbar {
  width: 8px;
}

#logContent::-webkit-scrollbar-track {
  background: #1a1a2e;
  border-radius: 4px;
}

#logContent::-webkit-scrollbar-thumb {
  background: #4a4a6a;
  border-radius: 4px;
}

/* 全局汉堡菜单按钮 - 现代化设计 */
.mobile-toggle-btn {
  display: none; /* 默认隐藏，在移动端显示 */
}

/* 弹窗样式 - 现代化 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 20000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 20001;
}

@keyframes scaleIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-container {
  position: relative;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  z-index: 20001;
}

.modal-header {
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--bg-sidebar) 0%, #334155 100%);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.modal-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
}

/* 播放器容器样式 */
.player-container {
  width: 100%;
}

.player-container video {
  width: 100%;
  border-radius: var(--radius-md);
  background: #000;
}

.player-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.volume-control span {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

#volumeSlider {
  width: 120px;
  height: 6px;
  -webkit-appearance: none;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 3px;
  outline: none;
}

#volumeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#volumeValue {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
  min-width: 45px;
}

.player-buttons {
  display: flex;
  gap: 12px;
}

.btn-small {
  padding: 10px 18px;
  font-size: 13px;
  border-radius: var(--radius-md);
}

.player-status {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.player-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* 系统指标样式 */
.system-metrics {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  border: 1px solid var(--border-color);
}

.metric-group {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.metric-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.metric-label {
  color: var(--text-secondary);
  font-weight: 600;
}

.metric-value {
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  padding: 6px 14px;
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  min-width: 100px;
  text-align: center;
  font-size: 13px;
  color: var(--primary-color);
}

/* Logo设置区域 */
#logoSettings {
  background: #f9fafb;
  border-radius: var(--radius-md);
  margin-top: 24px;
  border: 1px dashed var(--border-color);
}

#logoSettings .card-header {
  background: transparent;
}

/* 文件上传区域 */
input[type="file"] {
  padding: 12px;
  background: white;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

input[type="file"]:hover {
  border-color: var(--primary-color);
  background: #f0f4ff;
}

/* 小字体提示 */
small {
  color: var(--text-muted);
  font-size: 12px;
  display: block;
  margin-top: 6px;
}

/* 表格样式 */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f9fafb;
}

tr:hover td {
  background: #f9fafb;
}

/* 分隔线 */
hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 24px 0;
}

/* 代码块 */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  color: #7c3aed;
}

pre code {
  display: block;
  padding: 16px;
  overflow-x: auto;
}

/* 禁用按钮样式 */
.btn-disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
  pointer-events: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-width: 95%;
  }
  
  .player-controls {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }
  
  .volume-control {
    justify-content: space-between;
  }
  
  .player-buttons {
    justify-content: center;
  }
  
  .metric-group {
    flex-direction: column;
    gap: 12px;
  }
  
  .metric-item {
    justify-content: space-between;
  }
  
  .metric-value {
    min-width: auto;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .toast {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    align-items: flex-start;
  }

  .toast span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  input[type="file"] {
    width: 100% !important;
    min-width: 0;
    max-width: 100%;
  }

  .recording-storage-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 16px;
  }

  .card-header {
    padding: 16px 18px;
  }

  .card-body {
    padding: 18px;
  }

  .platform-item,
  .recording-item,
  .target-item,
  .source-card {
    padding: 16px;
  }

  .btn {
    padding-left: 16px;
    padding-right: 16px;
    white-space: normal;
  }

  .btn-small {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* 动画效果 */
.fade-in {
  animation: fadeIn 0.3s ease;
}

.slide-up {
  animation: slideUp 0.4s ease;
}

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

/* 悬停效果 */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

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

/* 卡片悬停效果 */
.card.hover-lift {
  border-color: transparent;
}

.card.hover-lift:hover {
  border-color: var(--primary-color);
}

/* 选中状态 */
.selected {
  background: rgba(102, 126, 234, 0.1) !important;
  border-color: var(--primary-color) !important;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 0.8s linear infinite;
}

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

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 玻璃拟态效果 */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 渐变边框 */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 2px;
  border-radius: inherit;
  background: var(--primary-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* 文本省略 */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #c1c1c1 0%, #a1a1a1 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a1a1a1 0%, #818181 100%);
}

/* 颜色选择器 - 现代化样式 */
input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  background: #f9fafb;
}

input[type="color"]:hover {
  border-color: #d1d5db;
  background: #fff;
}

input[type="color"]:focus {
  outline: none;
  border-color: var(--primary-color);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
}

/* 激活状态指示 */
.active-indicator {
  position: relative;
}

.active-indicator::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  background: var(--success-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
