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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  line-height: 1.6;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

a {
  color: #58a6ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  color: #f0f6fc;
  margin-bottom: 16px;
}

h1 {
  font-size: 2rem;
  border-bottom: 1px solid #30363d;
  padding-bottom: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

h1 a {
  color: inherit;
}

.nav {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px 0;
  border-bottom: 1px solid #30363d;
}

.nav a {
  padding: 8px 16px;
  background: #21262d;
  border-radius: 6px;
}

.nav a:hover {
  background: #30363d;
  text-decoration: none;
}

.card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 16px;
}

.card h3 {
  margin-bottom: 8px;
}

.card p {
  color: #8b949e;
  margin-bottom: 8px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

th, td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid #30363d;
}

th {
  background: #21262d;
  color: #f0f6fc;
}

tr:hover {
  background: #1c2128;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  background: #21262d;
  border-radius: 16px;
  font-size: 0.85em;
  margin-right: 4px;
}

.metric {
  font-family: monospace;
  color: #7ee787;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #8b949e;
}

.error {
  background: #3d1f1f;
  border: 1px solid #f85149;
  color: #f85149;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-grid dt {
  color: #8b949e;
}

.detail-grid dd {
  color: #c9d1d9;
  word-break: break-all;
}

pre {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.9em;
  margin-top: 8px;
}

.section {
  margin-top: 32px;
}

.section h3 {
  margin-bottom: 12px;
}

.lineage-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-left: 3px solid #58a6ff;
  margin-left: 16px;
  margin-bottom: 8px;
  background: #161b22;
}

.lineage-item.current {
  border-left-color: #7ee787;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 500;
}

.badge-rank {
  background: #238636;
  color: #fff;
}

.back-link {
  font-size: 0.9em;
  color: #8b949e;
}

.back-link:hover {
  color: #58a6ff;
}

.section-hint {
  color: #8b949e;
  font-size: 0.9em;
  margin-bottom: 12px;
}

.lineage-table tr.current {
  background: #1c2128;
}

.lineage-table tr.current td:first-child {
  border-left: 3px solid #7ee787;
}

.improvement {
  color: #7ee787;
  font-weight: 500;
}

.regression {
  color: #f85149;
  font-weight: 500;
}

.partial {
  color: #d29922;
  font-weight: 500;
}

.mismatch {
  color: #8b949e;
}

.ref-badge {
  display: inline-block;
  padding: 1px 4px;
  background: #d29922;
  color: #0d1117;
  border-radius: 3px;
  font-size: 0.7em;
  font-weight: 600;
  margin-left: 4px;
  vertical-align: middle;
}

.warn-icon {
  color: #d29922;
  font-size: 1.1em;
}

/* Machine page styles */
.machine-table {
  width: 100%;
}

.score-cell {
  width: 120px;
}

.score-bar-container {
  position: relative;
  width: 100px;
  height: 20px;
  background: #21262d;
  border-radius: 4px;
  overflow: hidden;
}

.score-bar {
  height: 100%;
  transition: width 0.3s ease;
}

.score-bar.score-high {
  background: linear-gradient(90deg, #238636, #7ee787);
}

.score-bar.score-mid {
  background: linear-gradient(90deg, #9e6a03, #d29922);
}

.score-bar.score-low {
  background: linear-gradient(90deg, #da3633, #f85149);
}

.score-value {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8em;
  font-weight: 600;
  color: #f0f6fc;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.score-bar-empty {
  width: 100px;
  height: 20px;
  background: #21262d;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8b949e;
  font-size: 0.8em;
}

.nav a.active {
  background: #388bfd;
  color: #fff;
}

/* Golden comparison styles */
.golden-match {
  color: #7ee787;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(35, 134, 54, 0.2);
  border-radius: 4px;
}

.golden-mismatch {
  color: #f85149;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(248, 81, 73, 0.2);
  border-radius: 4px;
}

.golden-error {
  color: #d29922;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(210, 153, 34, 0.2);
  border-radius: 4px;
}
