/**
 * 自适应 UI 样式
 * 移动端：卡片列表；PC 端（≥992px）：表格列表
 */

:root {
  --adaptive-breakpoint: 992px;
  --desktop-max-width: 1400px;
}

/* 视口切换 */
@media (max-width: 991.98px) {
  .desktop-only {
    display: none !important;
  }
}

@media (min-width: 992px) {
  .mobile-only {
    display: none !important;
  }

  body.adaptive-desktop {
    font-size: 14px;
  }

  body.adaptive-desktop .container {
    max-width: var(--desktop-max-width);
  }

  /* 统计区：PC 端改为横向条带，弱化卡片感 */
  body.adaptive-desktop .stats-container .row {
    flex-wrap: nowrap;
    gap: 12px;
  }

  body.adaptive-desktop .stats-container .col-4,
  body.adaptive-desktop .stats-container .col-md-2 {
    flex: 1;
    max-width: none;
    width: auto;
  }

  body.adaptive-desktop .stat-card {
    margin-bottom: 0;
    padding: 14px 16px !important;
    box-shadow: none;
    border: 1px solid #e8ebf0;
    border-radius: 10px;
  }

  /* 筛选区：PC 端横向工具栏 */
  body.adaptive-desktop .filter-tags,
  body.adaptive-desktop .filter-section .filter-row {
    align-items: center;
  }

  body.adaptive-desktop .filter-section {
    padding: 14px 18px;
  }
}

/* 表格容器 */
.table-view {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 20px;
}

.data-table {
  margin-bottom: 0;
  font-size: 13px;
}

.data-table thead th {
  background: #f8f9fc;
  color: #666;
  font-weight: 600;
  border-bottom: 1px solid #eee;
  white-space: nowrap;
  padding: 12px 14px;
}

.data-table tbody td {
  vertical-align: middle;
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

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

.data-table .table-actions {
  white-space: nowrap;
}

.data-table .table-actions .btn-table {
  border: none;
  background: none;
  color: #667eea;
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
}

.data-table .table-actions .btn-table:hover {
  background: rgba(102, 126, 234, 0.1);
}

.data-table .table-actions .btn-table.danger {
  color: #dc3545;
}

.data-table .table-actions .btn-table.danger:hover {
  background: rgba(220, 53, 69, 0.08);
}

.data-table .table-actions .btn-table.warning {
  color: #ff9800;
}

.data-table .source-tag-inline {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
}

.data-table .tag-mini {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-right: 4px;
}

.data-table .tag-mini.guide {
  background: #fff3e0;
  color: #e65100;
}

.data-table .tag-mini.ticket {
  background: #e8f5e9;
  color: #2e7d32;
}

/* 表单页 PC 布局 */
@media (min-width: 992px) {
  body.adaptive-desktop .form-page-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }

  body.adaptive-desktop .form-page-grid .form-panel-full {
    grid-column: 1 / -1;
  }

  body.adaptive-desktop .page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  body.adaptive-desktop .page-toolbar .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
  }
}

/* 详情弹窗（PC 表格详情） */
.detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2100;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.detail-modal.show {
  display: flex;
}

.detail-modal-box {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 760px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

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

.detail-modal-header h5 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.detail-modal-body {
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.detail-modal-close {
  border: none;
  background: #f5f5f5;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
}
