/* 全局样式 */
:root {
  /* 主色调 - 龙焱科技蓝 */
  --primary-color: #3a86ff; 
  --primary-hover: #2a6fd6;
  --secondary-color: #8338ec;
  
  /* 状态色 */
  --success-color: #06d6a0;
  --info-color: #4cc9f0;
  --warning-color: #ffbe0b;
  --danger-color: #ff006e;
  
  /* 中性色 */
  --light-color: #f8f9fa;
  --dark-color: #212529;
  --text-primary: #2b2d42;
  --text-secondary: #8d99ae;
  
  /* 背景色 */
  --sidebar-bg: #1e2128;
  --sidebar-hover: rgba(255, 255, 255, 0.1);
  --card-bg: #ffffff;
  --body-bg: #f4f7fe; /* 更清爽的浅蓝灰背景 */
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(149, 157, 165, 0.1);
  --shadow-lg: 0 15px 35px rgba(0,0,0,0.1);
  --shadow-hover: 0 15px 30px rgba(0,0,0,0.12);
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

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

/* 平台配置卡片样式 */
.platform-card {
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease-out;
}

.platform-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15) !important;
}

.platform-number {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.platform-card .input-group-text {
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.platform-card .form-control {
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.platform-card .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.platform-icon-preview {
  transition: transform 0.2s ease;
}

.platform-icon-preview:hover {
  transform: scale(1.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 侧边栏样式 */
.sidebar {
  min-height: 100vh;
  background: var(--sidebar-bg);
  /* 增加微妙的渐变 */
  background: linear-gradient(180deg, #1e2128 0%, #16181d 100%);
  color: white;
  box-shadow: 4px 0 20px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
  z-index: 1000;
  padding-top: 15px;
  width: 300px;
}

.sidebar-header {
  padding: 20px 25px;
  margin-bottom: 20px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-header h4 {
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 折叠功能已移除 */

/* 移动端汉堡菜单按钮 */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  left: 15px;
  z-index: 1100;
  background: var(--primary-color);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(58, 134, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.mobile-menu-toggle i {
  font-size: 20px;
}

/* 移动端遮罩层 */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* 默认不阻挡点击 */
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: auto; /* 激活时才阻挡点击 */
}

/* 移动端响应式：侧边栏占屏幕80%宽度，支持滑入/滑出 */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .mobile-overlay {
    display: block;
  }
  
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 80vw;
    max-width: 320px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .content-area {
    padding: 70px 15px 20px 15px;
    margin-left: 0 !important;
  }
}

/* 侧边栏导航 */
.sidebar .nav-link {
  color: rgba(255,255,255,0.65);
  padding: 12px 20px;
  margin: 4px 15px;
  border-radius: 10px;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  font-weight: 500;
  font-size: 0.95rem;
}

.sidebar .nav-link i {
  margin-right: 15px;
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  transition: transform 0.2s;
}

.sidebar .nav-link:hover {
  color: white;
  background: var(--sidebar-hover);
  transform: translateX(3px);
}

.sidebar .nav-link:hover i {
  transform: scale(1.1);
}

.sidebar .nav-link.active {
  color: white;
  background: var(--primary-color);
  /* 增加光晕效果 */
  box-shadow: 0 4px 15px rgba(58, 134, 255, 0.4);
  background: linear-gradient(45deg, var(--primary-color), var(--primary-hover));
}

/* 内容区域样式 */
.content-area {
  padding: 30px 40px;
}

/* 卡片样式 */
.card {
  background: var(--card-bg);
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  overflow: hidden;
}

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

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  padding: 20px 25px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-body {
  padding: 25px;
}

/* 统计卡片优化 */
.stat-card {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* 统计卡片背景装饰 */
.stat-card::after {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  z-index: -1;
}

.stat-card.primary .card-body { background: linear-gradient(135deg, #3a86ff 0%, #2a6fd6 100%); color: white; }
.stat-card.success .card-body { background: linear-gradient(135deg, #06d6a0 0%, #05b386 100%); color: white; }
.stat-card.warning .card-body { background: linear-gradient(135deg, #ffbe0b 0%, #e6ab0a 100%); color: white; }
.stat-card.danger .card-body { background: linear-gradient(135deg, #ff006e 0%, #d6005c 100%); color: white; }

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--primary-color);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  margin-right: 15px;
}

.stat-info h5 {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 5px;
  font-weight: 500;
}

.stat-info h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.5px;
}

/* 表格样式优化 */
.table-responsive {
  border-radius: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  /* 添加滚动提示 */
  position: relative;
}

/* 移动端滚动提示阴影 */
.table-responsive::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(to left, rgba(0,0,0,0.05), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.table-responsive.has-scroll::after {
  opacity: 1;
}

/* 滚动提示文字 */
.table-responsive.has-scroll::before {
  content: '← 左右滑动查看更多';
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(58, 134, 255, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  z-index: 10;
  pointer-events: none;
  animation: scrollHint 2s ease-in-out infinite;
}

@keyframes scrollHint {
  0%, 100% { transform: translateX(0); opacity: 0.8; }
  50% { transform: translateX(-5px); opacity: 1; }
}

/* 移动端才显示滚动提示 */
@media (min-width: 769px) {
  .table-responsive.has-scroll::before {
    display: none;
  }
}

.table {
  vertical-align: middle;
  margin-bottom: 0;
  min-width: 100%;
  /* 确保表格不会被压缩 */
  width: max-content;
}

.table thead th {
  background: #f8f9fc;
  border-bottom: none;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
  padding: 15px 20px;
  white-space: nowrap;
  /* 防止表头文字换行 */
  min-width: 80px;
}

.table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  color: var(--text-primary);
  font-size: 0.9rem;
  white-space: nowrap;
  /* 防止单元格内容换行 */
}

.table-hover tbody tr:hover {
  background-color: #f8f9fc;
  transition: background-color 0.2s;
}

/* 按钮样式优化 */
.btn {
  border-radius: 10px;
  padding: 10px 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
  border: none;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--primary-color);
  box-shadow: 0 4px 12px rgba(58, 134, 255, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 16px rgba(58, 134, 255, 0.4);
  transform: translateY(-2px);
}

.btn-outline-secondary {
  border: 1px solid #e0e0e0;
  color: var(--text-secondary);
}

.btn-outline-secondary:hover {
  background: #f8f9fa;
  color: var(--text-primary);
  border-color: #d0d0d0;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* 徽章样式 */
.badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.3px;
}

/* 模态框样式 */
.modal-content {
  border-radius: 20px;
  border: none;
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

.modal-header {
  border-bottom: 1px solid #f0f0f0;
  padding: 25px;
}

.modal-title {
  font-weight: 700;
  color: var(--text-primary);
}

.modal-body {
  padding: 30px;
}

.modal-footer {
  border-top: 1px solid #f0f0f0;
  padding: 20px 30px;
  background: #fcfcfc;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
}

/* 表单控件 */
.form-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.form-control, .form-select {
  border-radius: 10px;
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  transition: all 0.25s ease;
  font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
  background: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(58, 134, 255, 0.1);
}

.input-group-text {
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: var(--text-secondary);
}

/* 开关控件美化 */
.form-check-input {
  width: 3em;
  height: 1.5em;
  cursor: pointer;
}

.form-check-input:checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* 动画 */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#page-content > * {
  animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* 加载状态 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(58, 134, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

/* 工具类补充 */
.text-primary-gradient {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== 布局增强：两栏响应式结构 ===== */
.app-layout { display: flex; align-items: stretch; min-height: 100vh; }
.app-layout .sidebar { width: 260px; flex: 0 0 260px; }
.app-layout .content-area { flex: 1 1 auto; min-width: 0; min-height: 100vh; }

/* 平板端适配 */
@media (max-width: 1024px) {
  .app-layout .sidebar { width: 220px; flex: 0 0 220px; }
}

/* 移动端适配：优化布局 */
@media (max-width: 768px) {
  .app-layout { display: block; position: relative; }
  .app-layout .content-area { padding: 70px 15px 20px 15px; min-height: 100vh; }
  
  /* 统计卡片在移动端堆叠 */
  .row > [class*="col-"] {
    margin-bottom: 15px;
  }
  
  /* 表格在移动端横向滚动 */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 按钮组在移动端堆叠 */
  .btn-group {
    flex-direction: column;
  }
  
  .btn-group .btn {
    width: 100%;
    margin-bottom: 8px;
  }
  
  /* 卡片在移动端减小内边距 */
  .card-body {
    padding: 15px;
  }
  
  .card-header {
    padding: 15px;
    font-size: 1rem;
  }
  
  /* 模态框在移动端全屏 */
  .modal-dialog {
    margin: 0;
    max-width: 100%;
    height: 100vh;
  }
  
  .modal-content {
    height: 100%;
    border-radius: 0;
  }
}
