body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: min(1200px, 100%);
    padding: 30px;
}

.card {
    background: rgba(22, 27, 34, 0.96);
    border: 1px solid rgba(96, 106, 116, 0.24);
    border-radius:12px;
    padding:20px;
    margin-bottom:20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.18);
}

button {
    background:#238686;
    color:white;
    border:none;
    padding:8px 16px;
    border-radius:8px;
    cursor:pointer;
}

button:hover {
    background: #1d7d7f;
}

.top-card {
    position: relative;
}

.top-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.update-block {
    text-align: right;
    font-size: 0.95rem;
    color: #9cc;
}

.update-block div {
    line-height: 1.4;
}

.top-card-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.top-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: transparent;
    border: none;
}

@media (max-width: 700px) {
    .top-card-right {
        width: 100%;
        justify-content: center;
    }
    .top-card-actions {
        justify-content: center;
        width: 100%;
    }
}

#fetch-now-button {
    background-color: #ff8c42 !important;
    color: #0d1117 !important;
    border: 1px solid rgba(0,0,0,0.12);
}

#fetch-now-button:hover {
    background-color: #ff9f5d !important;
}

.fetch-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 17, 23, 0.78);
    padding: 20px;
}

.fetch-overlay.hidden {
    display: none;
}

.fetch-overlay-content {
    background: rgba(15, 20, 27, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 24px 28px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    color: #ffffff;
    min-width: 240px;
}

.fetch-overlay-content div {
    margin-top: 12px;
    font-size: 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.18);
    border-top-color: #ff8c42;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

select, input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding:6px;
    border-radius:6px;
}

input[type="date"] {
    color: var(--text);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
}

input[type="date"]::-moz-calendar-picker-indicator {
    filter: invert(1) brightness(1.2);
}

.grid-2 {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
}

.tables-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
    height: auto;
}

.tables-grid > div {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius:12px;
    padding:20px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    flex-wrap: wrap;
}

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

.stat-card {
    text-align: center;
}

.stat-card p {
    font-size: 2rem;
    margin: 10px 0 0;
    color: var(--color-clones);
}

.best-day-card .stat-value {
    font-size: 2rem;
    margin: 10px 0 0;
    color: var(--color-views);
}

.best-day-card .stat-subtext {
    font-size: 0.8rem;
}

.stat-subtext {
    font-size: 0.9rem;
    color: #8b98a6;
    margin-top: 4px;
}

.fetch-status {
    margin-left: 12px;
    color: rgb(204, 187, 153);
    font-size: 0.95rem;
}

.global-summary {
    padding: 16px;
}

.controls > select {
    padding: 8px 12px;
    flex: 0 0 auto;
}

.controls > input {
    padding: 8px 10px;
    flex: 0 0 auto;
}

.controls > button {
    padding: 8px 12px;
    flex: 0 0 auto;
}
.divider {
    width: 1px;
    height: 30px;
    background: var(--border);
    flex: 0 0 auto;
}

.nav-button,
.repo-link {
    display: inline-block;
    background: #238686;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.nav-button:hover,
.repo-link:hover {
    background: #1b6a6c;
}

.data-table a {
    color: #79ffe1;
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

.charts {
    display: block;
}

.charts canvas {
    width: 100%;
    height: 400px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead th:first-child {
    border-top-left-radius: 12px;
}

.data-table thead th:last-child {
    border-top-right-radius: 12px;
}

.data-table th {
    background:#238686;
    padding:8px;
    text-align:left;
}

.data-table td {
    padding:6px 8px;
    border-bottom:1px solid var(--border);
}

:root {
    --color-clones: #a041ff;
    --color-unique-clones: #fdf327;
    --color-views: #ff5338;
    --color-unique-views: #a9ff38;
    --bg: #0d1117;
    --bg2: #161b22;
    --text: #c9d1d9;
    --border: #30363d;
}

:root[data-theme="dark"] {
    --bg: #0d1117;
    --bg2: #161b22;
    --text: #c9d1d9;
    --border: #30363d;
}

:root[data-theme="light"] {
    --bg: #ffffff;
    --bg2: #f6f8fa;
    --text: #24292f;
    --border: #d0d7de;
}
/* ── 新增：徽章、横幅、代码块 ── */

.badge {
    display: inline-block;
    background: #238686;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.badge-topic {
    background: #1f6feb;
    margin: 2px;
}

code {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.repo-overview {
    border-left: 4px solid #238686;
}

.banner {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.banner.warning {
    background: rgba(255, 140, 66, 0.12);
    border: 1px solid rgba(255, 140, 66, 0.3);
    color: #ff8c42;
}

/* ═══════════════════════════════════════════════════
   动画
   ═══════════════════════════════════════════════════ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideDown {
    from { opacity: 0; max-height: 0; }
    to   { opacity: 1; max-height: 600px; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

.animate-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.repo-link, .nav-button, button {
    transition: all 0.2s ease;
}

.repo-link:hover, .nav-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

.data-table tbody tr:hover {
    background: rgba(35, 134, 134, 0.08);
}

/* ═══════════════════════════════════════════════════
   Release 折叠
   ═══════════════════════════════════════════════════ */

.release-item {
    animation: fadeIn 0.3s ease;
}

.release-title {
    position: relative;
}

.release-title::after {
    content: ' ↗';
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.release-title:hover::after {
    opacity: 1;
}

.btn-collapse {
    background: transparent;
    color: #8b98a6;
    border: 1px solid rgba(139, 152, 166, 0.3);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-collapse:hover {
    color: #79ffe1;
    border-color: #79ffe1;
    background: rgba(121, 255, 225, 0.06);
}

.release-body-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 0;
}

.release-body-collapse.open {
    max-height: 600px;
    opacity: 1;
}

.release-body-text {
    margin: 8px 0 0;
    padding: 10px 14px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: #c9d1d9;
    font-family: system-ui, sans-serif;
}

.release-body-full {
    margin: 0;
    padding: 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    color: #c9d1d9;
    font-family: system-ui, sans-serif;
}

/* ═══════════════════════════════════════════════════
   Release 详情页 - 附件列表
   ═══════════════════════════════════════════════════ */

.asset-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.asset-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: #c9d1d9;
    transition: all 0.2s ease;
}

.asset-item:hover {
    background: rgba(35, 134, 134, 0.1);
    border-color: #238686;
    transform: translateX(4px);
}

.asset-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.asset-name {
    flex: 1;
    font-weight: 500;
    word-break: break-all;
}

.asset-meta {
    font-size: 0.8rem;
    color: #8b98a6;
    white-space: nowrap;
}

.asset-action {
    font-size: 0.85rem;
    color: #79ffe1;
    white-space: nowrap;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════
   提交项动画
   ═══════════════════════════════════════════════════ */

.commit-item {
    transition: background 0.15s ease;
    border-radius: 4px;
}

.commit-item:hover {
    background: rgba(35, 134, 134, 0.06);
}

/* ═══════════════════════════════════════════════════
   小按钮
   ═══════════════════════════════════════════════════ */

.btn-sm {
    background: transparent;
    color: #8b98a6;
    border: 1px solid rgba(139, 152, 166, 0.3);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm:hover {
    color: #79ffe1;
    border-color: #79ffe1;
    background: rgba(121, 255, 225, 0.06);
}
paginate-footer { display:flex; justify-content:center; gap:8px; }

.paginate-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 0;
}

.paginate-footer .btn-sm {
    min-width: 100px;
}

/* 性能优化：动画 GPU 加速 */
.animate-in {
    will-change: transform, opacity;
}
.stat-card, .repo-link, .nav-button, button, .asset-item, .commit-item, .data-table tbody tr {
    will-change: transform;
}
.release-body-collapse {
    will-change: max-height, opacity;
}

/* 分页器样式 */
.paginate-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
}
.paginate-footer .btn-sm {
    min-width: 36px;
    padding: 6px 12px;
    font-size: 1rem;
    line-height: 1;
}
.paginate-footer .btn-sm:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.page-num {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════
   标签栏
   ═══════════════════════════════════════════════════ */

.tab-bar {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(22, 27, 34, 0.8);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.tab-btn {
    background: transparent;
    color: #8b98a6;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #c9d1d9;
    background: rgba(255,255,255,0.05);
}

.tab-btn.active {
    color: #fff;
    background: #238686;
}

/* ═══════════════════════════════════════════════════
   文件树
   ═══════════════════════════════════════════════════ */

.file-tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #c9d1d9;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.9rem;
}

.file-tree-item:hover {
    background: rgba(35, 134, 134, 0.08);
}

.file-tree-dir {
    color: #79c0ff;
    font-weight: 500;
}

.file-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.file-name {
    flex: 1;
    word-break: break-all;
}

.file-meta {
    font-size: 0.8rem;
    color: #8b98a6;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════
   Markdown 渲染
   ═══════════════════════════════════════════════════ */

.markdown-body {
    line-height: 1.7;
    font-size: 0.95rem;
    overflow-x: auto;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-top: 24px;
}

.markdown-body h1 { font-size: 1.6rem; }
.markdown-body h2 { font-size: 1.3rem; }
.markdown-body h3 { font-size: 1.1rem; }

.markdown-body p { margin: 8px 0; }

.markdown-body a { color: #79ffe1; }

.markdown-body code {
    background: rgba(255,255,255,0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.markdown-body pre {
    background: rgba(0,0,0,0.25);
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
}

.markdown-body pre code {
    background: transparent;
    padding: 0;
}

.markdown-body blockquote {
    border-left: 3px solid #238686;
    padding: 4px 12px;
    margin: 8px 0;
    color: #8b98a6;
}

.markdown-body ul, .markdown-body ol {
    padding-left: 24px;
    margin: 8px 0;
}

.markdown-body img {
    max-width: 100%;
    border-radius: 6px;
    margin: 8px 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.markdown-body th, .markdown-body td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.markdown-body th {
    background: rgba(35, 134, 134, 0.15);
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ═══════════════════════════════════════════════════
   代码块（文件查看页）
   ═══════════════════════════════════════════════════ */

.code-block {
    margin: 0;
    padding: 20px;
    background: rgba(0,0,0,0.3);
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    color: #c9d1d9;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}
