:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-orange: #d29922;
    --accent-red: #f85149;
    --accent-purple: #bc8cff;
    --shadow: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 40px 20px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.section h2 {
    font-size: 1.8rem;
    margin-bottom: 24px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: 12px;
}

.table-container {
    overflow-x: auto;
}

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

thead {
    background: var(--bg-tertiary);
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--accent-blue);
    border-bottom: 2px solid var(--border-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background: var(--bg-tertiary);
}

.rank-badge {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; }
.rank-2 { background: linear-gradient(135deg, #C0C0C0, #808080); color: #000; }
.rank-3 { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; }
.rank-other { background: var(--bg-tertiary); color: var(--text-secondary); }

.lang-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.lang-python { background: #3776ab33; color: #3776ab; border: 1px solid #3776ab; }
.lang-javascript { background: #f7df1e33; color: #f7df1e; border: 1px solid #f7df1e; }
.lang-rust { background: #ce422b33; color: #ff6b4a; border: 1px solid #ce422b; }
.lang-csharp { background: #68217a33; color: #a179dc; border: 1px solid #68217a; }
.lang-cpp { background: #00599c33; color: #00a4ef; border: 1px solid #00599c; }

.speed-bar {
    background: var(--bg-tertiary);
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.speed-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue));
    transition: width 0.5s ease-out;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.success-rate {
    font-weight: 600;
}

.success-100 { color: var(--accent-green); }
.success-partial { color: var(--accent-orange); }
.success-fail { color: var(--accent-red); }

.chart-container {
    position: relative;
    height: 400px;
    margin-top: 20px;
}

.chart-container-small {
    position: relative;
    height: 250px;
    margin-top: 15px;
}

.accuracy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.accuracy-impl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.accuracy-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.accuracy-impl-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.accuracy-impl-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.accuracy-impl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.accuracy-impl-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.accuracy-metric-row {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.accuracy-metric-row:last-child {
    margin-bottom: 0;
}

.accuracy-metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.accuracy-metric-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.accuracy-metric-tolerance {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 2px 8px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.accuracy-metric-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.accuracy-metric-stat {
    text-align: center;
}

.accuracy-metric-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}

.accuracy-metric-stat-value {
    font-size: 1rem;
    font-weight: 600;
    display: block;
}

.accuracy-grade {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
}

.grade-excellent {
    background: #3fb95033;
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.grade-good {
    background: #58a6ff33;
    color: #58a6ff;
    border: 1px solid #58a6ff;
}

.grade-fair {
    background: #d2992233;
    color: #d29922;
    border: 1px solid #d29922;
}

.grade-poor {
    background: #f8514933;
    color: #f85149;
    border: 1px solid #f85149;
}

.accuracy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.accuracy-card h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--accent-blue);
}

.tolerance-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.accuracy-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 15px;
}

.accuracy-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.accuracy-stats .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.accuracy-stats .stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.accuracy-stats .stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-green);
}

.accuracy-legend {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.accuracy-legend h4 {
    color: var(--accent-blue);
    margin-bottom: 12px;
    font-size: 1rem;
}

.accuracy-legend ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.accuracy-legend li {
    display: flex;
    align-items: center;
    padding: 8px 0;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.legend-color {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    margin-right: 12px;
    flex-shrink: 0;
}

.accuracy-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.accuracy-cell-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.accuracy-cell-pass {
    font-size: 0.75rem;
    font-weight: 500;
}

.overall-pass-rate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.pass-rate-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.pass-rate-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.pass-rate-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.implementation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.impl-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.impl-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.impl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.impl-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.impl-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.impl-stat {
    display: flex;
    flex-direction: column;
}

.impl-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.impl-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-blue);
}

.test-results {
    margin-top: 15px;
}

.test-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

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

.test-name {
    color: var(--text-secondary);
}

.test-status {
    font-weight: 600;
}

.status-pass { color: var(--accent-green); }
.status-fail { color: var(--accent-red); }
.status-warning { color: var(--accent-orange); }

.loading {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-style: italic;
}

footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    border-top: 2px solid var(--border-color);
    color: var(--text-secondary);
}

footer a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--accent-purple);
    text-decoration: underline;
}

.impl-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.impl-link:hover {
    color: var(--accent-blue);
}

.impl-link:hover::after {
    content: " →";
    color: var(--accent-blue);
}

.impl-link-large {
    display: block;
}

.impl-link-large:hover {
    text-decoration: none;
}

.impl-link-large:hover .impl-name,
.impl-link-large:hover .accuracy-impl-name {
    color: var(--accent-blue);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .section {
        padding: 20px;
    }

    .chart-container {
        height: 300px;
    }

    .accuracy-stats {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .accuracy-description {
        font-size: 0.8rem;
    }

    .accuracy-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
