/* styles.css
   强制深色模式版 - 移除了浅色模式变量和主题切换组件样式
*/

/* =========================
   Base: box sizing + smooth scroll
   ========================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: #2f343f; /* 提前设置背景色防止闪白 */
}

/* =========================
   Theme tokens (Forced Dark)
   直接将原深色主题变量设为默认
   ========================= */
:root {
    --bg: #2f343f;
    --bg-elev: #262a32;
    --fg: #ffffff;
    --muted: #9099a3;
    --row-hover: #3d4351;
    --rule: #3c404a;
    --accent: #cfd6df;
    --focus: 0 0 0 3px rgba(255, 255, 255, 0.25);
    --link: #ffffff;
    --clear-link: #cbd3dc;
    --input-border: #3c404a;
    --focus-border: #cfd6df;
    --table-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    --td-border: rgba(255, 255, 255, 0.07);
    --parent-hover: #ffffff;
    --footer-link: #ffffff;
}

/* =========================
   Global typography + colors
   ========================= */
html {
    font-family: system-ui, -apple-system, 'Segoe UI', Ubuntu, Cantarell, 'Noto Sans', sans-serif;
    color: var(--muted);
    font-weight: 300;
    font-size: clamp(14px, 1.2vw, 16px);
    line-height: 1.6;
    text-size-adjust: 100%;
    background-color: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    padding: clamp(12px, 2.5vw, 24px);
    color: var(--fg);
    background-color: var(--bg);
}

/* =========================
   Headings
   ========================= */
h1 {
     font-weight: 300;
     text-align: center;
     font-size: clamp(1.5rem, 2vw + 1rem, 2.4rem);
     line-height: 1.4;
     margin-bottom: 1.25rem;
}

/* =========================
   Links
   ========================= */
a {
    color: var(--link);
    text-decoration: none;
    transition: color 150ms ease;
}
a:hover {
    text-decoration: underline;
    color: var(--accent);
}

/* =========================
   Table Styles (Dark Optimized)
   ========================= */
table {
    border-collapse: collapse;
    font-size: 0.95em;
    width: 100%;
    margin: 24px 0 0;
    background: var(--bg-elev);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--table-shadow);
}

th {
    text-align: left;
    font-size: 0.75em;
    padding: 12px 20px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a94a6;
    background: #1f222b; /* 强制深色表头 */
}

td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--td-border);
    vertical-align: middle;
    transition: background 200ms ease;
}

tr:hover td {
    background: var(--row-hover);
}

td:last-child, th:last-child {
    text-align: right;
    padding-right: 20px;
}

/* =========================
   Breadcrumb navigation (Dark)
   ========================= */
.breadcrumb-nav {

        margin: 1rem 0 1.5rem;
        padding: 0.75rem 1rem;
        background: var(--bg-elev);
        border-radius: 8px;
        border: 1px solid var(--rule);
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;

}

.breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--muted);
}

.breadcrumb-current {
    color: var(--fg);
    font-weight: 500;
}

/* =========================
   Copy URL Button (Dark)
   ========================= */
.copy-page-url-btn {
    appearance: none;
    border: 1px solid var(--rule);
    background: var(--bg);
    color: var(--fg);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 150ms ease;
}

.copy-page-url-btn:hover {
    background: var(--row-hover);
    border-color: var(--accent);
}

/* =========================
   Pagination (Dark)
   ========================= */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
}

.pagination-btn {
    border: 1px solid var(--rule);
    background: var(--bg-elev);
    color: var(--fg);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.pagination-btn.active {
    background: var(--accent);
    color: #1e2430; /* 激活状态背景明亮，文字设为深色 */
    font-weight: 600;
}

/* =========================
   Icons (Emoji based)
   ========================= */
/* Directory/Folder */
#list tbody tr td:first-child a[href$="/"]::before {
        content: '📁';
}

/* Parent directory */
#list tbody tr.parent td:first-child a::before {
        content: '⬆️';
}

/* Images */
#list tbody tr td:first-child a[href$=".jpg"]::before,
#list tbody tr td:first-child a[href$=".jpeg"]::before,
#list tbody tr td:first-child a[href$=".png"]::before,
#list tbody tr td:first-child a[href$=".gif"]::before,
#list tbody tr td:first-child a[href$=".svg"]::before,
#list tbody tr td:first-child a[href$=".webp"]::before,
#list tbody tr td:first-child a[href$=".ico"]::before,
#list tbody tr td:first-child a[href$=".bmp"]::before {
        content: '🖼️';
}

/* Videos */
#list tbody tr td:first-child a[href$=".mp4"]::before,
#list tbody tr td:first-child a[href$=".avi"]::before,
#list tbody tr td:first-child a[href$=".mov"]::before,
#list tbody tr td:first-child a[href$=".wmv"]::before,
#list tbody tr td:first-child a[href$=".flv"]::before,
#list tbody tr td:first-child a[href$=".webm"]::before,
#list tbody tr td:first-child a[href$=".mkv"]::before {
        content: '🎬';
}

/* Audio */
#list tbody tr td:first-child a[href$=".mp3"]::before,
#list tbody tr td:first-child a[href$=".wav"]::before,
#list tbody tr td:first-child a[href$=".flac"]::before,
#list tbody tr td:first-child a[href$=".aac"]::before,
#list tbody tr td:first-child a[href$=".ogg"]::before,
#list tbody tr td:first-child a[href$=".m4a"]::before {
        content: '🎵';
}

/* Archives */
#list tbody tr td:first-child a[href$=".zip"]::before,
#list tbody tr td:first-child a[href$=".rar"]::before,
#list tbody tr td:first-child a[href$=".tar"]::before,
#list tbody tr td:first-child a[href$=".gz"]::before,
#list tbody tr td:first-child a[href$=".7z"]::before,
#list tbody tr td:first-child a[href$=".bz2"]::before,
#list tbody tr td:first-child a[href$=".xz"]::before {
        content: '📦';
}

/* Documents */
#list tbody tr td:first-child a[href$=".pdf"]::before {
        content: '📕';
}

#list tbody tr td:first-child a[href$=".doc"]::before,
#list tbody tr td:first-child a[href$=".docx"]::before {
        content: '📘';
}

#list tbody tr td:first-child a[href$=".xls"]::before,
#list tbody tr td:first-child a[href$=".xlsx"]::before,
#list tbody tr td:first-child a[href$=".csv"]::before {
        content: '📊';
}

#list tbody tr td:first-child a[href$=".ppt"]::before,
#list tbody tr td:first-child a[href$=".pptx"]::before {
        content: '📙';
}

#list tbody tr td:first-child a[href$=".txt"]::before,
#list tbody tr td:first-child a[href$=".md"]::before,
#list tbody tr td:first-child a[href$=".markdown"]::before {
        content: '📝';
}

/* Code files */
#list tbody tr td:first-child a[href$=".html"]::before,
#list tbody tr td:first-child a[href$=".htm"]::before,
#list tbody tr td:first-child a[href$=".css"]::before,
#list tbody tr td:first-child a[href$=".js"]::before,
#list tbody tr td:first-child a[href$=".json"]::before,
#list tbody tr td:first-child a[href$=".xml"]::before,
#list tbody tr td:first-child a[href$=".php"]::before,
#list tbody tr td:first-child a[href$=".py"]::before,
#list tbody tr td:first-child a[href$=".java"]::before,
#list tbody tr td:first-child a[href$=".c"]::before,
#list tbody tr td:first-child a[href$=".cpp"]::before,
#list tbody tr td:first-child a[href$=".h"]::before,
#list tbody tr td:first-child a[href$=".sh"]::before,
#list tbody tr td:first-child a[href$=".rb"]::before,
#list tbody tr td:first-child a[href$=".go"]::before,
#list tbody tr td:first-child a[href$=".rs"]::before,
#list tbody tr td:first-child a[href$=".ts"]::before,
#list tbody tr td:first-child a[href$=".tsx"]::before,
#list tbody tr td:first-child a[href$=".jsx"]::before {
        content: '💻';
}

/* Executables */
#list tbody tr td:first-child a[href$=".exe"]::before,
#list tbody tr td:first-child a[href$=".app"]::before,
#list tbody tr td:first-child a[href$=".dmg"]::before,
#list tbody tr td:first-child a[href$=".iso"]::before {
        content: '⚙️';
}

/* Configuration */
#list tbody tr td:first-child a[href$=".ini"]::before,
#list tbody tr td:first-child a[href$=".cfg"]::before,
#list tbody tr td:first-child a[href$=".conf"]::before,
#list tbody tr td:first-child a[href$=".yaml"]::before,
#list tbody tr td:first-child a[href$=".yml"]::before,
#list tbody tr td:first-child a[href$=".toml"]::before {
        content: '🔧';
}


/* =========================
   Mobile Optimization
   ========================= */
@media (max-width: 720px) {
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr {
        margin-bottom: 16px;
        border: 1px solid var(--td-border);
        border-radius: 12px;
        background: var(--bg-elev);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }
    td {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid var(--td-border);
    }
    td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--muted);
    }
}