/* 基本样式 */
:root {
  font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}

a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  display: block; /* 确保不影响布局 */
  min-width: 320px;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}

button:hover {
  border-color: #646cff;
}

button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

.card {
  padding: 2em;
}

#app {
  max-width: 100%;
  margin: 0 auto;
  text-align: center;
}

/* 确保 AG Grid 的容器样式不受影响 */
.ag-grid-container {
  width: 100%; /* 使容器自适应宽度 */
  max-width: 100%; /* 最大宽度为 100% */
  margin: 0 auto;
  padding: 20px 0; /* 上下留白 */
}

.ag-theme-alpine {
  width: 100% !important; /* 确保表格宽度 100% */
}

/* 防止 body 中的其他样式影响 AG Grid */
body > * {
  box-sizing: border-box;
}

/* 响应式布局 */
@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }

  a:hover {
    color: #747bff;
  }

  button {
    background-color: #f9f9f9;
  }
}

/* 竖屏优化 - 防止分页器换行 */
@media (orientation: portrait) {
  /* 分页器整体 - 强制不换行，允许水平滚动 */
  .ag-paging-panel {
    padding: 4px 2px !important;
    min-height: 32px !important;
    font-size: 10px !important;
    display: flex !important;
    flex-wrap: nowrap !important; /* 禁止换行 */
    white-space: nowrap !important; /* 禁止文本换行 */
    overflow-x: auto !important; /* 水平溢出时可以滚动 */
    align-items: center !important;
  }
  
  /* 页面大小选择器 - 保持在一行 */
  .ag-paging-page-size {
    flex: 0 0 auto !important; /* 不伸缩，不收缩 */
    margin-right: 8px !important;
  }
  
  .ag-paging-page-size .ag-picker-field-wrapper {
    padding: 2px 4px !important;
    min-width: 50px !important; /* 确保足够宽度 */
  }
  
  /* 隐藏页面大小标签，减小宽度 */
  .ag-paging-page-size .ag-picker-field-label {
    display: none;
  }
  
  /* 中间的页面信息 - 完全隐藏 */
  .ag-paging-row-summary-panel {
    display: none !important;
  }
  
  /* 翻页按钮 - 必须保留，不换行 */
  .ag-paging-button {
    flex: 0 0 auto !important; /* 不伸缩，不收缩 */
    min-width: 28px !important; /* 稍微增加宽度 */
    height: 24px !important;
    padding: 0 4px !important;
    margin: 0 2px !important; /* 减小按钮间距 */
  }
  
  .ag-paging-button .ag-icon {
    font-size: 12px !important;
  }
}
