.trade-list {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
  .trade-list {
    padding: 2rem;
  }
}

.trade-list h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .trade-list h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
  }
}

.filter-panel {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .filter-panel {
    padding: 1.5rem;
    margin-bottom: 2rem;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
  }
}

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-section label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.period-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .period-buttons {
    display: flex;
    flex-wrap: wrap;
  }
}

.period-buttons button {
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s;
  touch-action: manipulation;
  min-height: 44px;
}

@media (min-width: 768px) {
  .period-buttons button {
    padding: 0.5rem 1rem;
    min-height: auto;
  }
}

.period-buttons button:hover {
  background: #e9ecef;
  border-color: #2196F3;
}

.period-buttons button.active {
  background: #2196F3;
  color: white;
  border-color: #2196F3;
}

.date-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .date-inputs {
    flex-direction: row;
    align-items: center;
  }
}

.date-inputs input[type="date"] {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
}

@media (min-width: 768px) {
  .date-inputs input[type="date"] {
    padding: 0.5rem;
    width: auto;
  }
}

.date-inputs span {
  color: #666;
  font-size: 0.9rem;
}

.filter-section input[type="text"],
.filter-section select {
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 768px) {
  .filter-section input[type="text"],
  .filter-section select {
    padding: 0.5rem;
    width: auto;
  }
}

.filter-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  width: 100%;
}

@media (min-width: 768px) {
  .filter-actions {
    display: flex;
    margin-left: auto;
    width: auto;
  }
}

.btn-primary,
.btn-secondary {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
  touch-action: manipulation;
  min-height: 44px;
}

@media (min-width: 768px) {
  .btn-primary,
  .btn-secondary {
    padding: 0.5rem 1.5rem;
    min-height: auto;
  }
}

.btn-primary {
  background: #2196F3;
  color: white;
}

.btn-primary:hover {
  background: #1976D2;
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background: #d5d5d5;
}

/* 导出按钮样式 */
.btn-export {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
  background: #4CAF50;
  color: white;
  min-height: 44px;
}

@media (min-width: 768px) {
  .btn-export {
    padding: 0.5rem 1.5rem;
    min-height: auto;
  }
}

.btn-export:hover {
  background: #43A047;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .stats-summary {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

.stat-value.positive {
  color: #4CAF50;
}

.stat-value.negative {
  color: #F44336;
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid #eee;
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 1000px; /* 保证在小屏幕上也能横向滚动 */
}

.trades-table th,
.trades-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.trades-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
}

.trades-table tr:hover {
  background-color: #f8f9fa;
}

/* 交易方向样式 */
.trades-table td.buy {
  color: #1976D2;
  font-weight: 500;
}

.trades-table td.sell {
  color: #D32F2F;
  font-weight: 500;
}

.side-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
}

.side-badge.buy {
  background: #E3F2FD;
  color: #1976D2;
}

.side-badge.sell {
  background: #FFEBEE;
  color: #D32F2F;
}

/* 盈亏样式 */
.trades-table td.positive,
.stat-value.positive,
.trade-card-value.positive {
  color: #2e7d32; /* 更深一点的绿色，便于阅读 */
  font-weight: 600;
}

.trades-table td.negative,
.stat-value.negative,
.trade-card-value.negative {
  color: #c62828; /* 更深一点的红色 */
  font-weight: 600;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

.status-open {
  background: #E3F2FD;
  color: #2196F3;
}

.status-closed {
  background: #E8F5E9;
  color: #4CAF50;
}

.status-cancelled {
  background: #FFEBEE;
  color: #F44336;
}

.no-data {
  text-align: center;
  padding: 3rem;
  color: #999;
  background: #f8f9fa;
  border-radius: 8px;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: #666;
}

/* 统计复制区域优化 */
.stats-copy-section {
  background: #f1f3f5;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.stats-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #333;
}

.btn-copy {
  padding: 0.4rem 0.8rem;
  background: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  color: #495057;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-copy:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #e9ecef;
}

.stats-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f3f5;
  font-size: 0.95rem;
  color: #333;
}

.stats-table tr:last-child td {
  border-bottom: none;
}

.stats-table td:first-child {
  width: 200px;
  background: #f8f9fa;
  font-weight: 500;
  color: #495057;
  border-right: 1px solid #f1f3f5;
}

.stats-table td:nth-child(2) {
  font-family: 'SF Mono', 'Roboto Mono', monospace;
}

/* 统计折叠按钮 */
.stats-toggle-row {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.btn-toggle {
  background: none;
  border: none;
  color: #2196F3;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

.btn-toggle:hover {
  text-decoration: underline;
}

/* 移动端卡片视图 */
.trades-cards {
  display: none; /* 默认隐藏，仅在小屏幕显示 */
  flex-direction: column;
  gap: 1rem;
}

.trade-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.trade-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #f1f3f5;
}

.trade-card-symbol {
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
}

.trade-card-side {
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
}

.trade-card-side.buy {
  background: #E3F2FD;
  color: #1976D2;
}

.trade-card-side.sell {
  background: #FFEBEE;
  color: #D32F2F;
}

.trade-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.trade-card-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.trade-card-label {
  font-size: 0.8rem;
  color: #888;
}

.trade-card-value {
  font-size: 0.95rem;
  color: #333;
}

.trade-card-value.positive {
  color: #4CAF50;
  font-weight: 500;
}

.trade-card-value.negative {
  color: #F44336;
  font-weight: 500;
}

.trade-card-footer {
  border-top: 1px solid #f1f3f5;
  padding-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #666;
}

.trade-time-item {
  display: flex;
  gap: 0.5rem;
}

/* 响应式控制 */
@media (max-width: 767px) {
  .table-wrapper {
    display: none; /* 小屏幕隐藏表格 */
  }
  
  .trades-cards {
    display: flex; /* 小屏幕显示卡片 */
  }
}
