./* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
    padding: 20px;
}

/* 标题 */
h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    padding-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 16px;
    word-break: break-word;
    display: flex;
    align-items: center;
    gap: 8px;
}

h1 .icon {
    width: 24px;
    height: 24px;
    color: #4CAF50;
}

/* 表格容器 - 支持横向滚动 */
.table-wrapper {
    overflow-x: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

table {
    width: 100%;
    min-width: 500px;
    border-collapse: collapse;
    font-size: 14px;
}

/* 表头 */
th {
    text-align: left;
    padding: 12px 8px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

/* 单元格 */
td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

/* 名称列 */
.name-cell {
    word-break: break-word;
    max-width: 300px;
}

.name-cell a {
    text-decoration: none;
    color: #2c7da0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    word-break: break-word;
}

.name-cell a:hover {
    text-decoration: underline;
    color: #1f5068;
}

.name-cell .file-icon,
.name-cell .folder-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.name-cell .folder-icon {
    color: #FFC107;
}

.name-cell .file-icon {
    color: #9E9E9E;
}

/* 日期和大小列 */
.date-cell, .size-cell {
    color: #888;
    font-size: 12px;
    white-space: nowrap;
}

/* 父目录行 */
.parent-row td {
    background: #fafafa;
    padding: 8px;
}

.parent-row a {
    color: #666;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.parent-row .icon {
    width: 16px;
    height: 16px;
}

/* 悬停效果 */
tbody tr:hover {
    background: #f9f9f9;
}

/* 统计信息 */
.stats {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e8e8e8;
    font-size: 12px;
    color: #888;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stats .icon {
    width: 14px;
    height: 14px;
}

/* 搜索框 */
.search-box {
    margin-bottom: 16px;
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #999;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: none;
}

.search-box input:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover,
.back-to-top:active {
    background: #45a049;
    transform: scale(1.05);
}

.back-to-top .icon {
    width: 24px;
    height: 24px;
}

/* 自定义分割线样式 */
.custom-hr {
    display: none !important;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .container {
        padding: 16px;
        border-radius: 10px;
    }
    
    h1 {
        font-size: 18px;
        padding-bottom: 10px;
        margin-bottom: 12px;
    }
    
    h1 .icon {
        width: 20px;
        height: 20px;
    }
    
    .table-wrapper {
        margin: 0 -8px;
        padding: 0 8px;
    }
    
    table {
        min-width: 480px;
        font-size: 13px;
    }
    
    th {
        padding: 10px 6px;
        font-size: 12px;
    }
    
    td {
        padding: 8px 6px;
    }
    
    .date-cell, .size-cell {
        font-size: 11px;
    }
    
    .name-cell a {
        gap: 6px;
        font-size: 13px;
    }
    
    .name-cell .file-icon,
    .name-cell .folder-icon {
        width: 16px;
        height: 16px;
    }
    
    .stats {
        font-size: 11px;
        margin-top: 12px;
        padding-top: 10px;
    }
    
    .stats .icon {
        width: 12px;
        height: 12px;
    }
    
    .search-box input {
        padding: 8px 12px 8px 36px;
        font-size: 14px;
    }
    
    .search-box .search-icon {
        width: 16px;
        height: 16px;
        left: 10px;
    }
    
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
    }
    
    .back-to-top .icon {
        width: 20px;
        height: 20px;
    }
}

/* 小屏手机（宽度 ≤ 480px） */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .container {
        padding: 12px;
    }
    
    h1 {
        font-size: 16px;
    }
    
    h1 .icon {
        width: 18px;
        height: 18px;
    }
    
    .table-wrapper {
        margin: 0 -4px;
        padding: 0 4px;
    }
    
    table {
        min-width: 420px;
        font-size: 12px;
    }
    
    th {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    td {
        padding: 6px 4px;
    }
    
    .date-cell, .size-cell {
        font-size: 10px;
    }
    
    .name-cell a {
        font-size: 12px;
    }
    
    .name-cell .file-icon,
    .name-cell .folder-icon {
        width: 14px;
        height: 14px;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .name-cell a {
        padding: 4px 0;
    }
    
    th, td {
        touch-action: manipulation;
    }
    
    .search-box input {
        font-size: 16px;
    }
}