/* 首页样式 */

/* 筛选区域样式 */
.filter-section {
  background: #fff;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.time-filter {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.time-item {
  flex: 1;
  padding: 8px 20px;
  font-size: 14px;
  color: #666;
  background: #f5f5f5;
  border-radius: 6px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  min-width: 60px;
}

.time-item.active {
  color: #fff;
  background: #4a90e2;
}

.search-box {
  margin-top: 0;
  flex: 0 0 200px;
  margin-left: 20px;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 20px;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 14px;
  border: none;
  outline: none;
}

/* 表格样式 */
.stock-summary-card {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.header-item.name {
  flex: 1.5;
  text-align: center;
}

.sort-header {
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #4285f4; /* 蓝色 */
}

.sort-icon {
  margin-left: 6px;
  font-size: 12px;
  display: none; /* 隐藏箭头 */
}

/* 表格样式 */
.table-header {
  display: flex;
  background-color: #f8f9fa;
  color: #333;
  padding: 5px 10px; /* 从原来的8px 10px缩小到5px 10px */
  font-weight: bold;
  font-size: 12px;
  border-bottom: 1px solid #eee;
}

.header-item {
  flex: 1;
  text-align: center;
  padding: 0 5px;
}

.header-item.code {
  flex: 1;
  text-align: center;
}

.header-item.name {
  flex: 1.2;
  text-align: center;
}

.header-item.sort-header {
  flex: 1;
  text-align: center;
}

/* 列表样式 */
.stock-list {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  box-sizing: border-box;
  max-height: calc(100vh - 200px); /* 为筛选区域、表头和分页控件留出空间 */
}

.stock-item {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px; /* 从原来的8.8px 11px缩小到5px 10px */
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  box-sizing: border-box;
  cursor: pointer;
}

.stock-item .stock-code {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stock-item .stock-name {
  flex: 1.5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stock-item .amount-group {
  flex: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stock-item:nth-child(even) {
  background: #fafbfc;
}

.stock-item:hover {
  background: #f5f7fa;
}

.stock-item:last-child {
  border-bottom: none;
}

.stock-code {
  font-size: 14px;
  color: #333;
  width: 15%;
  text-align: center;
}

.stock-name {
  font-size: 14px;
  color: #666;
  width: 30%;
  text-align: center;
}

.amount-group {
  display: flex;
  gap: 5px;
  width: 60%;
}

.amount-item {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-width: 60px;
  padding: 0 2px; /* 从原来的0 3px缩小到0 2px */
}

.amount-item .value {
  font-size: 14px;
}

/* 颜色样式 */
.bullish .value {
  color: #ff4d4f;
}

.bearish .value {
  color: #52c41a;
}

.black .value {
  color: #000000;
}

.total-positive {
  color: #ff4d4f;
}

.total-negative {
  color: #52c41a;
}

/* 空状态样式 */
.no-data {
  text-align: center;
  color: #999;
  padding: 40px;
  font-size: 16px;
  box-shadow: none;
  background: none;
  border-radius: 0;
  margin-top: 0;
}

/* 分页控件样式 */
.pagination {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 0;
    padding: 10px 0;
}

.page-btn {
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover {
    background-color: #e0e0e0;
}

.page-btn:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.page-info {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

/* 页脚样式 */
.footer {
  text-align: center;
  padding: 15px 0;
  margin-top: 20px;
}

.footer a {
  text-decoration: none;
  color: #666;
}

.footer p {
  margin: 0;
  font-size: 14px;
}

/* 调整容器样式以确保页脚可见 */
.container {
  min-height: calc(100vh - 120px); /* 减去导航栏和页脚的高度 */
}

/* 响应式设计 */
@media (max-width: 768px) {
  .filter-section {
    padding: 5px;
    margin-bottom: 5px;
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    flex: 0 0 auto;
    width: 100%;
    margin-left: 0;
    margin-bottom: 5px;
    min-width: unset;
  }
  
  .search-box input {
    height: 36px;
    padding: 0 15px;
  }
  
  .time-filter {
    gap: 4px;
    width: 100%;
    justify-content: center;
  }
  
  .time-item {
    padding: 4px 6px;
    font-size: 12px;
    min-width: 40px;
    flex: 1;
  }
  
  .stock-summary-card {
    padding: 6px;
    margin-bottom: 5px;
  }
  
  .table-header {
    padding: 6px 5px;
  }
  
  .header-item {
    padding: 0 3px;
  }
  
  .header-item.code {
    flex: 1;
  }
  
  .header-item.name {
    flex: 1.5;
  }
  
  .header-item.sort-header {
    flex: 1;
  }
  
  .stock-item {
    padding: 6.6px 5.5px; /* 增加10% */
  }
  
  .stock-item .stock-code {
    flex: 1;
  }
  
  .stock-item .stock-name {
    flex: 1.5;
  }
  
  .stock-item .amount-group {
    flex: 4;
  }
  
  .stock-code {
    font-size: 14px;
  }
  
  .stock-name {
    font-size: 12px;
  }
  
  .amount-group {
    gap: 3px;
  }
  
  .amount-item {
    padding: 0 2px;
    min-width: 50px;
  }
  
  .amount-item .value {
    font-size: 14px;
  }
  
  /* 移动端页脚样式 */
  .footer {
    padding: 15px 0;
  }
  
  .footer p {
    font-size: 12px;
  }
}