/* Apple Style CSS */
@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Text:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #007AFF;
  --primary-dark: #0056b3;
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  --gray: #8E8E93;
  --gray-light: #F2F2F7;
  --gray-lighter: #EFEFF4;
  --text: #1C1C1E;
  --text-secondary: #6C6C70;
  --border: #E5E5EA;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #F5F7FA 0%, #FFFFFF 100%);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
}

/* Header */
.header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #007AFF, #5856D6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  gap: 8px;
  background: var(--gray-lighter);
  padding: 4px;
  border-radius: var(--radius-lg);
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
}

.nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
}

.nav a.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Cards */
.filter-card, .content-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.filter-card {
  padding: 24px;
  margin-bottom: 24px;
}

.content-card {
  padding: 0;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.badge {
  background: var(--gray-lighter);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* Filter */
.filter-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 140px;
}

.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238E8E93' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.filter-group select:hover {
  border-color: var(--primary);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #007AFF, #0056D6);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 16px;
}

/* Table */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: var(--gray-lighter);
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.data-table td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(0, 122, 255, 0.04);
  cursor: pointer;
}

.data-table .score {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  text-align: center;
}

.data-table .team {
  font-weight: 500;
}

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

.data-table .result-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.data-table .result-tag.胜 { background: rgba(52, 199, 89, 0.15); color: var(--success); }
.data-table .result-tag.平 { background: rgba(255, 149, 0, 0.15); color: var(--warning); }
.data-table .result-tag.负 { background: rgba(255, 59, 48, 0.15); color: var(--danger); }

.data-table .loading, .data-table .empty {
  text-align: center;
  color: var(--gray);
  padding: 40px;
}

/* Pagination */
.pagination {
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.page-btn {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: var(--radius);
  width: 95%;
  max-width: 1200px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s ease;
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--gray-lighter);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: var(--danger);
  color: white;
}

.modal-body {
  padding: 24px;
}

.modal-summary {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--gray-lighter);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.modal-summary-item {
  display: flex;
  flex-direction: column;
  min-width: 120px;
}

.modal-summary-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.modal-summary-value {
  font-size: 18px;
  font-weight: 600;
}

.modal-summary-value.positive { color: var(--success); }
.modal-summary-value.negative { color: var(--danger); }
.modal-summary-value.profit-positive { color: #e74c3c; }
.modal-summary-value.profit-negative { color: var(--success); }

.data-table td.positive { color: #e74c3c; font-weight: 600; }
.data-table td.negative { color: var(--success); font-weight: 600; }
.data-table .profit-positive { color: #e74c3c; font-weight: 600; }
.data-table .profit-negative { color: var(--success); font-weight: 600; }

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.detail-item {
  padding: 16px;
  background: var(--gray-lighter);
  border-radius: var(--radius-sm);
}

.detail-item.full {
  grid-column: span 2;
}

.detail-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.detail-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.detail-value .score-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 28px;
}

.detail-value .score-large .team-name {
  font-size: 16px;
}

.detail-value .score-large .score {
  font-size: 36px;
}

.detail-value .win { color: var(--success); }
.detail-value .draw { color: var(--warning); }
.detail-value .lose { color: var(--danger); }

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }
  
  .nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .filter-row {
    flex-direction: column;
  }
  
  .filter-group {
    width: 100%;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
  }
  
  .detail-item.full {
    grid-column: span 1;
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-card {
  animation: fadeIn 0.4s ease;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-lighter);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray);
}

.footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  color: #666;
  font-size: 13px;
  border-top: 1px solid var(--border);
}
