:root {
    --nav-bg: #1a365d;
    --nav-text: #e2e8f0;
    --primary: #2b4c7e;
    --primary-light: #3b6ba5;
    --sidebar-bg: #f7f8fa;
    --sidebar-active: #e8eef6;
    --text: #1e293b;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --hover-bg: #f1f5f9;
    --row-hover: #f8fafc;
    --tag-bg: #eef2f7;
    --success: #16a34a;
    --footer-bg: #1e293b;
    --footer-text: #94a3b8;
}

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

/* SVG 图标基础样式 */
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    display: inline-block;
    flex-shrink: 0;
}

.icon-folder { color: #e8a838; }
.icon-file { color: var(--text-secondary); }
.icon-download { color: #fff; }

body {
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.navbar {
    background: var(--nav-bg);
    color: var(--nav-text);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .5px;
}

.navbar-brand img { height: 28px; }

.navbar-links {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: .875rem;
}

.navbar-links a {
    color: var(--nav-text);
    text-decoration: none;
    opacity: .85;
    transition: opacity .2s;
}

.navbar-links a:hover { opacity: 1; }

/* 主体布局 */
.container {
    display: flex;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
    padding: 16px 0;
}

.sidebar-title {
    padding: 0 16px 12px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.folder-tree ul {
    list-style: none;
    padding-left: 0;
}

.folder-tree ul ul { padding-left: 16px; }

.folder-tree li {
    position: relative;
}

.folder-tree li::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border);
}

.folder-tree li:last-child::before { bottom: 50%; }

.folder-tree a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: .875rem;
    border-radius: 4px;
    margin: 1px 8px;
    transition: background .15s;
}

.folder-tree a:hover { background: var(--hover-bg); }

.folder-tree li.active > a {
    background: var(--sidebar-active);
    color: var(--primary);
    font-weight: 500;
}

.folder-tree a svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

/* 主内容区 */
.content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

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

.content-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

/* 搜索框 */
.search-bar {
    position: relative;
    width: 400px;
}

.search-bar .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    z-index: 1;
}

.search-bar input {
    width: 100%;
    padding: 8px 130px 8px 34px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: .875rem;
    outline: none;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43,76,126,.1);
}

.search-check {
    position: absolute;
    right: 58px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: .8rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    z-index: 1;
}

.search-check input {
    display: none;
}

.check-box {
    width: 13px;
    height: 13px;
    border: 1.5px solid var(--border);
    border-radius: 2px;
    position: relative;
    flex-shrink: 0;
    transition: all .15s;
}

.search-check input:checked + .check-box {
    background: var(--primary);
    border-color: var(--primary);
}

.search-check input:checked + .check-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 3px;
    width: 4px;
    height: 7px;
    border: solid #fff;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

.search-check input:checked ~ * {
    color: var(--text);
}

.search-bar .shortcut {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .65rem;
    color: var(--text-secondary);
    background: var(--hover-bg);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid var(--border);
    pointer-events: none;
    white-space: nowrap;
    line-height: 1.4;
}

/* 面包屑 */
.breadcrumb {
    margin-bottom: 16px;
    font-size: .85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb .sep {
    color: var(--text-secondary);
    margin: 0 2px;
}

/* 文件表格 */
.file-table {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.file-table-header {
    display: grid;
    grid-template-columns: 1fr 80px 100px 110px;
    padding: 10px 16px;
    background: var(--hover-bg);
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
}

.file-row {
    display: grid;
    grid-template-columns: 1fr 80px 100px 110px;
    padding: 10px 16px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: .875rem;
    transition: background .1s;
    text-decoration: none;
    color: var(--text);
}

.file-row:last-child { border-bottom: none; }
.file-row:hover { background: var(--row-hover); }

.file-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-name span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-name svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.file-type .tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: .75rem;
    border-radius: 3px;
    background: var(--tag-bg);
    color: var(--text-secondary);
}

.file-size { color: var(--text-secondary); font-size: .8rem; }

.file-modified { color: var(--text-secondary); font-size: .8rem; }

.file-path {
    color: var(--text-secondary);
    font-size: .8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-btn {
    display: inline-grid;
    grid-template-columns: 16px 1fr auto;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    width: 100px;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: .8rem;
    white-space: nowrap;
    transition: background .2s;
}

.download-btn .btn-icon { text-align: left; }
.download-btn .btn-size { text-align: right; }
.download-btn .btn-unit { text-align: left; }

.download-btn:hover { background: var(--primary-light); }

.empty-message {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-secondary);
}

/* 页脚 */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 16px 24px;
    font-size: .8rem;
}

.site-footer a {
    color: var(--footer-text);
    text-decoration: none;
}

.site-footer a:hover { color: #cbd5e1; }

/* 响应式 */
@media (max-width: 768px) {
    .navbar { padding: 0 16px; }
    .navbar-links { display: none; }

    .container { flex-direction: column; }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 200px;
        overflow-y: auto;
    }

    .content { padding: 16px; }

    .search-bar { width: 100%; }

    .search-bar input { padding-right: 16px; }

    .search-check,
    .search-bar .shortcut { display: none; }

    .content-header {
        flex-direction: column;
        align-items: stretch;
    }

    .file-table-header,
    .file-row {
        grid-template-columns: 1fr 60px 60px;
    }

    .file-modified,
    .file-table-header > :nth-child(3) {
        display: none;
    }
}
