/* 文件列表层：表格 / 哈希列 / 下载按钮 / 预览链接（index.php 引用） */

.file-table { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.file-table-header { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(220px, 1.5fr) 70px 90px 100px; gap: 16px; 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: minmax(120px, 1fr) minmax(220px, 1.5fr) 70px 90px 100px; gap: 16px; 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-preview-link { color: inherit; text-decoration: none; min-width: 0; }
.file-preview-link > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-link:hover { color: var(--primary); text-decoration: underline; }

.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; }

/* 哈希校验列 */
.file-hash { font-family: 'SF Mono', 'Consolas', 'Monaco', monospace; font-size: .72rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hash-btn { display: block; width: 100%; padding: 2px 6px; margin: -2px -6px; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; border-radius: 3px; transition: color .15s, background .15s; }
.hash-btn:hover { color: var(--primary); background: var(--hover-bg); }
.hash-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.hash-btn.copied { color: var(--success); background: rgba(22,163,74,.1); }
.hash-btn.copy-fail { color: #dc2626; background: rgba(220,38,38,.1); }
.file-hash.pending { cursor: default; color: var(--text-secondary); }
.hash-pending { color: var(--text-secondary); font-style: italic; display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; }
.hash-pending::before { content: ''; width: 9px; height: 9px; border: 2px solid var(--primary); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
.hash-timeout { color: #d97706; font-style: italic; font-size: .7rem; }
.hash-error { color: #dc2626; font-style: italic; font-size: .7rem; }

/* 下载按钮 */
.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); }

/* 响应式（表格部分：隐藏哈希与修改时间列） */
@media (max-width: 768px) {
    .file-table-header, .file-row { grid-template-columns: 1fr 60px 60px; gap: 8px; }
    .file-modified, .file-table-header > :nth-child(4) { display: none; }
    .file-hash, .file-table-header > :nth-child(2) { display: none; }
}
