:root {
    --bg: #1a1a2e;
    --bg-card: #16213e;
    --bg-input: #0f3460;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #0f3460;
    --accent-hover: #1a4a7a;
    --green: #4caf50;
    --red: #f44336;
    --yellow: #ffc107;
    --blue: #2196f3;
    --border: #2a2a4a;
}

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

body {
    font-family: 'Segoe UI', 'Cascadia Code', 'Consolas', monospace;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 14px;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.brand {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
}
.nav-search {
    display: flex;
    gap: 0.5rem;
    flex: 1;
    max-width: 600px;
}
.nav-search input, .nav-search select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
}
.nav-search input { flex: 1; }
.nav-search button {
    background: var(--accent);
    color: var(--text);
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}
.nav-search button:hover { background: var(--accent-hover); }
.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}
.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.nav-links a:hover { color: var(--text); }

.version-badge {
    background: var(--blue);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

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

/* Hero */
.hero {
    text-align: center;
    padding: 3rem 1rem;
}
.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.hero p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}
.big-search {
    display: flex;
    gap: 0.5rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}
.big-search input {
    flex: 1;
    padding: 0.8rem 1rem;
    font-size: 1.1rem;
    background: var(--bg-input);
    border: 2px solid var(--border);
    color: var(--text);
    border-radius: 8px;
}
.big-search input:focus {
    outline: none;
    border-color: var(--blue);
}
.big-search select, .big-search button {
    padding: 0.8rem 1.2rem;
    font-size: 1rem;
    background: var(--accent);
    color: var(--text);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.big-search button:hover { background: var(--accent-hover); }

.version-info {
    margin-bottom: 1.5rem;
}
.stats {
    color: var(--text-muted);
    margin-left: 1rem;
}

.quick-links {
    text-align: left;
    max-width: 400px;
    margin: 2rem auto;
}
.quick-links h3, .versions-list h3 {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}
.quick-links ul, .versions-list ul {
    list-style: none;
}
.quick-links li {
    padding: 0.3rem 0;
}
.quick-links a {
    color: var(--blue);
    text-decoration: none;
}
.quick-links a:hover { text-decoration: underline; }

/* Tables */
.results-table, .members-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.results-table th, .results-table td,
.members-table th, .members-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.results-table th, .members-table th {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}
.results-table tr:hover, .members-table tr:hover {
    background: var(--bg-card);
}
.results-table a, .members-table a {
    color: var(--blue);
    text-decoration: none;
}
.results-table a:hover { text-decoration: underline; }

/* Badges */
.type-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}
.type-class { background: var(--blue); color: white; }
.type-method { background: var(--green); color: white; }
.type-source { background: var(--yellow); color: black; }
.kind-badge {
    background: var(--accent);
    color: var(--text);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

/* Class view */
.class-view .breadcrumb {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}
.class-view .breadcrumb a {
    color: var(--blue);
    text-decoration: none;
}
.class-info {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.class-info p { margin: 0.3rem 0; }

.modifiers {
    color: var(--yellow);
    font-size: 0.85rem;
}

/* Source code */
.source-code {
    background: #0d1117;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
    max-height: 600px;
    overflow-y: auto;
}
.source-code .kw { color: #ff7b72; font-weight: bold; }
.source-code .str { color: #a5d6ff; }
.source-code .cmt { color: #6a737d; font-style: italic; }
.source-code mark {
    background: rgba(255, 235, 59, 0.3);
    color: inherit;
}

/* Search results */
.search-results h2 { margin-bottom: 0.5rem; }
.result-count { color: var(--text-muted); margin-bottom: 1rem; }
.snippet {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    align-items: center;
}
.pagination a {
    color: var(--blue);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
}
.pagination a:hover { background: var(--bg-card); }

/* Browse */
.package-list {
    list-style: none;
    columns: 2;
    column-gap: 2rem;
}
.package-list li {
    padding: 0.3rem 0;
    break-inside: avoid;
}
.package-list a {
    color: var(--blue);
    text-decoration: none;
}
.package-list a:hover { text-decoration: underline; }

/* Diff */
.diff-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.diff-form select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem;
    border-radius: 4px;
}
.diff-form button {
    background: var(--accent);
    color: var(--text);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
}

.diff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.diff-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid;
}
.diff-card.added { border-color: var(--green); }
.diff-card.removed { border-color: var(--red); }
.diff-card.changed { border-color: var(--yellow); }
.diff-card h4 { color: var(--text-muted); font-size: 0.9rem; }
.big-number {
    font-size: 2rem;
    font-weight: bold;
    display: block;
    margin-top: 0.5rem;
}
.diff-card.added .big-number { color: var(--green); }
.diff-card.removed .big-number { color: var(--red); }
.diff-card.changed .big-number { color: var(--yellow); }

.diff-list {
    list-style: none;
    margin: 0.5rem 0 1.5rem;
    padding-left: 1rem;
}
.diff-list li {
    padding: 0.2rem 0;
}
.diff-list.added li::before { content: "+ "; color: var(--green); }
.diff-list.removed li::before { content: "- "; color: var(--red); }

.diff-class-change {
    background: var(--bg-card);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.diff-class-change h4 { margin-bottom: 0.5rem; }
.diff-class-change .added { color: var(--green); margin: 0.5rem 0; }
.diff-class-change .removed { color: var(--red); margin: 0.5rem 0; }
.diff-class-change ul { list-style: none; padding-left: 1rem; }
.diff-class-change li { padding: 0.15rem 0; }

/* Misc */
.muted { color: var(--text-muted); }
.warning {
    color: var(--yellow);
    background: rgba(255, 193, 7, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}
.warning code {
    background: var(--bg-input);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Upload page */
.upload-page { max-width: 700px; margin: 0 auto; }
.upload-card, .progress-card, .done-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.upload-card h2, .progress-card h2, .done-card h2 {
    margin-bottom: 1.5rem;
}
.upload-card form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.upload-card label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.upload-card label > span {
    font-weight: bold;
    font-size: 0.9rem;
}
.upload-card input[type="file"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem;
    border-radius: 4px;
}
.upload-card input[type="text"] {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem;
    border-radius: 4px;
    font-size: 1rem;
}
.upload-card small {
    color: var(--text-muted);
    font-size: 0.8rem;
}
.upload-card button, .done-card .btn {
    background: var(--accent);
    color: var(--text);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 0.5rem;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}
.upload-card button:hover { background: var(--accent-hover); }
.upload-card button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Progress bar */
.progress-bar-container {
    position: relative;
    background: var(--bg-input);
    border-radius: 8px;
    height: 30px;
    margin: 1rem 0;
    overflow: hidden;
}
.progress-bar {
    background: linear-gradient(90deg, var(--blue), var(--green));
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 8px;
}
.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.progress-detail {
    color: var(--text);
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* Progress stats */
.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    margin: 1rem 0;
}
.stat-item {
    background: var(--bg-input);
    padding: 0.6rem;
    border-radius: 4px;
    text-align: center;
}
.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}
.stat-value {
    display: block;
    font-weight: bold;
    margin-top: 0.2rem;
    font-size: 0.9rem;
}

/* Progress log */
.progress-log {
    background: #0d1117;
    border-radius: 6px;
    padding: 0.8rem;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 1rem;
    font-size: 0.8rem;
    font-family: 'Cascadia Code', 'Consolas', monospace;
}
.log-line {
    color: #8b949e;
    padding: 0.1rem 0;
}

/* Error section */
.error-section {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--red);
}
.error-section h3 { color: var(--red); margin-bottom: 0.5rem; font-size: 0.9rem; }
.error-line {
    color: #f87171;
    font-size: 0.8rem;
    padding: 0.2rem 0;
    font-family: 'Cascadia Code', 'Consolas', monospace;
    word-break: break-word;
}

/* Done card */
.done-card { text-align: center; }
.done-card .btn { margin-top: 1rem; }

/* Version footer */
.version-footer {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 2px solid var(--border);
}
.version-footer .version-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}
