/* ============================================
   问题库录入页面样式
   布局结构：固定 header + 左侧边栏 + 右侧主内容
   ============================================ */

/* ============================================
   CSS 变量 - 方案G 天穹蓝配色方案
   主题：清亮天蓝导航 × 云白底 × 杏黄点缀
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* 主强调色 - 清亮天蓝 */
  --primary-color: #4A90C4;
  --primary-hover: #5EA6D8;
  --primary-light: rgba(74, 144, 196, 0.08);
  --primary-glow: rgba(74, 144, 196, 0.16);

  /* 功能色 - 已完成（清爽绿） */
  --success-color: #3A9E78;
  --success-bg: rgba(58, 158, 120, 0.08);
  --success-border: rgba(58, 158, 120, 0.22);

  /* 功能色 - 未完成（杏黄） */
  --warning-color: #C09020;
  --warning-bg: rgba(192, 144, 32, 0.08);
  --warning-border: rgba(192, 144, 32, 0.24);

  /* 中性色 */
  --text-primary: #1A2530;
  --text-secondary: #3E5060;
  --text-muted: #7A90A0;
  --text-disabled: #B8CAD6;
  --border-color: #DAEAF4;
  --divider-color: #EAF3FA;

  /* 背景色 - 云白 */
  --bg-canvas: #F6F9FC;
  --bg-white: #FFFFFF;
  --bg-light: #EDF4FA;
  --bg-hover: #E2EEF6;
  --bg-gray: #D4E6F2;

  /* 侧边栏 - 清亮天蓝 */
  --sidebar-bg: #4A90C4;
  --sidebar-border: rgba(255, 255, 255, 0.15);
  --sidebar-item-hover: rgba(255, 255, 255, 0.15);
  --sidebar-item-active-bg: rgba(255, 255, 255, 0.22);
  --sidebar-text: rgba(220, 238, 252, 0.68);
  --sidebar-text-hover: rgba(255, 255, 255, 0.97);
  --sidebar-text-active: #FFFFFF;
  --sidebar-accent: #FFD966;

  /* 顶栏 - 同天蓝 */
  --header-bg: #4A90C4;
  --header-border: rgba(255, 255, 255, 0.15);

  /* 阴影 - 蓝调轻柔 */
  --shadow-sm: 0 2px 8px rgba(74, 144, 196, 0.08);
  --shadow-md: 0 4px 16px rgba(74, 144, 196, 0.10);

  /* 圆角 */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* 过渡 */
  --transition-fast: 0.12s ease;
  --transition-normal: 0.22s ease;

  /* 字体 */
  --font-mono: 'JetBrains Mono', 'Cascadia Code', 'SF Mono', Consolas, monospace;
}

/* ============================================
   全局样式重置
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Noto Sans SC', -apple-system, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  padding-top: 52px;
}

/* ============================================
   Header - 顶部导航栏
   ============================================ */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  color: white;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  gap: 12px;
}

/* 左侧品牌标识区 */
.app-header .header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.app-header .header-logo {
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-header .header-logo::before {
  content: '';
  width: 10px;
  height: 10px;
  border: 2px solid rgba(255,255,255,0.9);
  border-radius: 2px;
  transform: rotate(12deg);
  display: block;
}

.app-header h1 {
  font-size: 13px;
  font-weight: 600;
  color: rgba(220, 228, 235, 0.95);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* 右侧弹性空间 */
.app-header .header-spacer {
  flex: 1;
}

/* ============================================
   Sidebar - 左侧边栏（炭黑主题）
   ============================================ */
.sidebar {
  flex: 0 0 200px;
  background-color: var(--sidebar-bg);
  overflow-y: auto;
  height: calc(100vh - 52px);
  position: sticky;
  top: 52px;
  border-right: 1px solid var(--sidebar-border);
}

.sidebar-content {
  padding: 20px 10px 20px;
}

.sidebar h2 {
  font-size: 10px;
  color: var(--text-disabled);
  margin-bottom: 8px;
  padding: 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  font-family: var(--font-mono);
}

/* ============================================
   Nav List - 导航列表
   ============================================ */
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  font-size: 13px;
  font-weight: 500;
  position: relative;
  gap: 10px;
  letter-spacing: 0.01em;
}

/* 导航项左侧竖线指示器 */
.nav-item::before {
  content: '';
  width: 3px;
  height: 14px;
  background: transparent;
  border-radius: 2px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

/* 悬停效果 */
.nav-item:hover {
  background-color: var(--sidebar-item-hover);
  color: var(--sidebar-text-hover);
}

.nav-item:hover::before {
  background: rgba(255, 255, 255, 0.6);
}

/* 点击效果 */
.nav-item:active {
  transform: scale(0.98);
}

/* 当前选中项 */
.nav-item.active {
  background-color: var(--sidebar-item-active-bg);
  color: var(--sidebar-text-active);
}

.nav-item.active::before {
  background: var(--sidebar-accent);
}

/* ============================================
   Main Content - 右侧主内容区
   ============================================ */
.main-content {
  flex: 1;
  background-color: var(--bg-canvas);
  overflow-y: auto;
  padding: 28px 32px;
  min-width: 0;
}

/* ============================================
   Data Table - 数据表格
   ============================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--bg-white);
}

/* 表头样式 */
.data-table thead {
  background: var(--bg-light);
}

.data-table th {
  padding: 11px 16px;
  text-align: center;
  font-weight: 500;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  font-family: var(--font-mono);
}

/* 表格单元格样式 */
.data-table td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--divider-color);
  text-align: center;
  vertical-align: middle;
}

/* 最后一行无底线 */
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* 鼠标悬停高亮 */
.data-table tbody tr {
  transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: var(--bg-hover);
}

.data-table tbody tr:hover td {
  color: var(--text-primary);
}

/* 列宽设置 */
.data-table th:nth-child(1),
.data-table td:nth-child(1) {
  width: 7%;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  width: 33%;
  text-align: left;
}

.data-table th:nth-child(3),
.data-table td:nth-child(3) {
  width: 34%;
  text-align: left;
}


/* ============================================
   Status Badge - 状态标签
   ============================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}

/* 状态标签前的圆点 */
.status-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 未完成状态 - 锈橙 */
.status-pending {
  background-color: var(--warning-bg);
  color: var(--warning-color);
  border-color: var(--warning-border);
}

.status-pending::before {
  background-color: var(--warning-color);
  box-shadow: 0 0 4px var(--warning-color);
}

/* 已完成状态 - 鼠尾草绿 */
.status-completed {
  background-color: var(--success-bg);
  color: var(--success-color);
  border-color: var(--success-border);
}

.status-completed::before {
  background-color: var(--success-color);
}

/* ============================================
   Pagination Container - 翻页容器
   ============================================ */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  padding: 12px 0 4px;
}

/* ============================================
   Pagination - 翻页控件
   ============================================ */
.pagination {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: all var(--transition-fast);
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
}

/* 悬停效果 */
.pagination-item:hover {
  border-color: var(--border-color);
  color: var(--text-primary);
  background: var(--bg-white);
}

/* 当前页 */
.pagination-item.pagination-active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(74, 144, 196, 0.28);
}

.pagination-item.pagination-active:hover {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

/* 禁用状态 */
.pagination-item.pagination-disabled {
  color: var(--text-disabled);
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-item.pagination-disabled:hover {
  border-color: transparent;
  background: transparent;
  color: var(--text-disabled);
}

/* ============================================
   响应式适配
   ============================================ */
@media (max-width: 992px) {
  .sidebar {
    flex: 0 0 180px;
  }

  .sidebar h2 {
    font-size: 12px;
  }

  .nav-item {
    padding: 10px 12px;
    font-size: 13px;
  }

  .main-content {
    padding: 16px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    padding: 16px;
  }

  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }

  .pagination-item {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 16px;
  }

  .main-content {
    padding: 12px;
  }

  .search-input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .pagination {
    gap: 4px;
  }

  .pagination-item {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }
}

/* 表格行进入动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.data-table tbody tr {
  animation: fadeInUp 0.3s ease forwards;
}

.data-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.data-table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.data-table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.data-table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.data-table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.data-table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.data-table tbody tr:nth-child(8) { animation-delay: 0.4s; }
.data-table tbody tr:nth-child(9) { animation-delay: 0.45s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.5s; }

/* ============================================
   滚动条美化
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-gray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
  transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 深色侧边栏滚动条 */
.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
/* ============================================
   Page Header - 页面标题区
   ============================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}

/* ============================================
   Stats Grid - 统计卡片
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-color);
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   Table Wrap - 表格容器
   ============================================ */
.table-wrap {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

