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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  min-height: 100vh;
}

nav {
  background: #1a1a2e;
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-links a {
  color: #a0aec0;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.nav-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  margin: 1rem 2rem 0;
  font-size: 0.85rem;
  color: #664d03;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
}

.notice-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
}

.notice-links a {
  color: #2b6cb0;
  text-decoration: none;
  font-weight: 600;
}

.notice-links a:hover {
  text-decoration: underline;
}

.notice strong {
  margin-right: 0.25rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.loading {
  text-align: center;
  padding: 4rem;
  color: #718096;
  font-size: 1.1rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #1a1a2e;
}

h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: #2d3748;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

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

th {
  background: #f7fafc;
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #718096;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #edf2f7;
  font-size: 1rem;
  word-break: break-all;
}

tr:hover td {
  background: #f7fafc;
}

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

.model-link {
  color: #2b6cb0;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  word-break: break-all;
}

.model-link:hover {
  text-decoration: underline;
}

.compare-link {
  font-size: 0.78rem;
  color: #718096;
  text-decoration: none;
  white-space: nowrap;
}

.compare-link:hover {
  color: #2b6cb0;
  text-decoration: underline;
}

.rank {
  font-weight: 700;
  color: #4a5568;
  width: 40px;
}

.rank-1 { color: #d69e2e; }
.rank-2 { color: #a0aec0; }
.rank-3 { color: #c05621; }

.text-right { text-align: right; }
.text-mono { font-variant-numeric: tabular-nums; }
.text-muted { color: #a0aec0; }

/* Model detail */
.model-header {
  margin-bottom: 1.5rem;
}

.model-header h1 {
  margin-bottom: 0.25rem;
}

.model-header .model-id {
  color: #718096;
  font-size: 0.9rem;
}

.bench-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
}

.bench-card {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bench-name {
  font-size: 0.85rem;
  color: #2d3748;
  word-break: break-all;
}

.bench-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  font-variant-numeric: tabular-nums;
}

/* Compare page */
.compare-form {
  display: flex;
  gap: 1rem;
  align-items: end;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 220px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  min-width: 220px;
  width: 100%;
  background: #fff;
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: #2b6cb0;
  box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}

.searchable-select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-select-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.85rem;
  background: #fff;
}

.search-select-input:focus {
  outline: none;
  border-color: #2b6cb0;
  box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}

.searchable-select select {
  min-height: 120px;
}

.btn {
  padding: 0.5rem 1.25rem;
  background: #2b6cb0;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}

.btn:hover {
  background: #1a4f7a;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.winner-banner {
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.winner-banner .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #2b6cb0;
  font-weight: 600;
}

.winner-banner .model-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a365d;
  margin-top: 0.25rem;
}

.winner-banner .reason {
  color: #4a5568;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.compare-result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.model-summary {
  background: #fff;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.model-summary h3 {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #2d3748;
}

.model-summary .stat {
  font-size: 0.85rem;
  color: #4a5568;
  margin-bottom: 0.25rem;
}

.model-summary .stat span {
  font-weight: 600;
}

.win { color: #38a169; font-weight: 700; }
.loss { color: #e53e3e; }

.compare-table .bench-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #edf2f7;
}

.compare-table .bench-row:last-child {
  border-bottom: none;
}

.compare-table .bench-label {
  flex: 0 0 180px;
  font-size: 0.85rem;
  color: #2d3748;
}

.compare-table .scores {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.compare-table .vs {
  color: #a0aec0;
  font-size: 0.75rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: #2b6cb0;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: #a0aec0;
}

@media (max-width: 768px) {
  main { padding: 1rem; }
  .compare-result { grid-template-columns: 1fr; }
  .compare-form { flex-direction: column; align-items: stretch; }
  .form-group select { min-width: unset; }
}

/* ========== ДИАГРАММА ДЛЯ ТОП-10 ========== */
.benchmark-chart {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.benchmark-chart h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.chart-model {
  flex: 0 0 180px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-model a {
  color: #2b6cb0;
  text-decoration: none;
}

.chart-model a:hover {
  text-decoration: underline;
}

.bar-container {
  flex: 1;
  background-color: #edf2f7;
  border-radius: 9999px;
  height: 24px;
  overflow: hidden;
}

.bar-fill {
  background-color: #2b6cb0;
  width: 0%;
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.chart-score {
  flex: 0 0 60px;
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1a1a2e;
}

@media (max-width: 768px) {
  .chart-row {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .chart-model {
    flex-basis: 100%;
  }
  .bar-container {
    order: 1;
    flex-basis: calc(100% - 70px);
  }
  .chart-score {
    order: 2;
  }
}

/* ========== SKELETON LOADING ========== */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f7fafc 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1rem;
  width: 60%;
}

.skeleton-rank {
  height: 1rem;
  width: 2rem;
}

.skeleton-link {
  height: 0.8rem;
  width: 4rem;
  margin-left: auto;
}

/* ========== MODEL SEARCH ========== */
.model-search {
  margin-bottom: 1rem;
}

.model-search input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  background: #fff;
}

.model-search input:focus {
  outline: none;
  border-color: #2b6cb0;
  box-shadow: 0 0 0 3px rgba(43,108,176,0.15);
}
