/**
 * Tab紧凑表格式模板样式 — 暗色主题
 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
    background: #0a0a0f; color: #e0e0e0; line-height: 1.5; -webkit-font-smoothing: antialiased;
}

/* ============ 导航 ============ */
.nav {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(12,12,18,0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-content { max-width: 1200px; margin: 0 auto; padding: 0 20px; height: 48px; display: flex; align-items: center; }
.logo { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: -0.01em; text-decoration: none; flex-shrink: 0; }
.logo:hover { color: #66b1ff; }
.search-wrap { position: relative; flex: 0 1 260px; margin-left: auto; display: flex; align-items: center; }
.nav-search {
    width: 100%; padding: 6px 30px 6px 12px; font-size: 13px;
    border: 1px solid #333; border-radius: 6px; background: #1a1a2e;
    color: #e0e0e0; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.nav-search::placeholder { color: #666; }
.nav-search:focus { border-color: #0066ff; box-shadow: 0 0 0 2px rgba(0,102,255,0.15); }
.search-clear {
    position: absolute; right: 8px; width: 16px; height: 16px; border-radius: 50%;
    background: #444; color: #aaa; font-size: 10px; line-height: 16px;
    text-align: center; cursor: pointer; display: none; border: none; padding: 0;
}
.search-clear:hover { background: #555; color: #fff; }

/* ============ 平台 tabs（导航内） ============ */
.platform-tabs { display: flex; gap: 6px; margin-left: 16px; flex: 1; min-width: 0; flex-wrap: wrap; }
.plat-tab {
    padding: 4px 12px; font-size: 12px; font-weight: 500; color: #999;
    background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 6px;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.plat-tab:hover { color: #66b1ff; border-color: #0066ff40; background: #1a1a3e; }
.plat-tab.active { background: #0066ff; color: #fff; border-color: #0066ff; }

/* ============ 主布局 ============ */
.main-wrapper { max-width: 1200px; margin: 0 auto; padding: 16px 20px 60px; display: flex; gap: 14px; align-items: flex-start; }

/* ============ 分类侧栏 ============ */
.category-panel {
    width: 120px; flex-shrink: 0; position: sticky; top: 64px;
    background: #111118; border: 1px solid rgba(255,255,255,0.06); border-radius: 8px;
    padding: 4px 0; max-height: calc(100vh - 120px); overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.category-panel::-webkit-scrollbar { width: 3px; }
.category-panel::-webkit-scrollbar-track { background: transparent; }
.category-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
.category-list { display: flex; flex-direction: column; }
.cat-item {
    padding: 5px 10px; font-size: 12px; color: #999; cursor: pointer;
    transition: background 0.12s, color 0.12s; border-left: 3px solid transparent;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-item:hover { background: rgba(255,255,255,0.03); color: #ccc; }
.cat-item.active { color: #66b1ff; background: rgba(0,102,255,0.08); border-left-color: #0066ff; font-weight: 600; }

/* ============ 内容区 ============ */
.content-area { flex: 1; min-width: 0; }
.content-header { margin-bottom: 8px; }
.software-count { font-size: 12px; color: #666; }
.empty-cell { text-align: center; padding: 40px 0; color: #666; font-size: 14px; }

/* ============ 表格 ============ */
.table-wrap { background: #111118; border-radius: 8px; border: 1px solid rgba(255,255,255,0.06); overflow: hidden; }
.software-table { width: 100%; border-collapse: collapse; }
.software-table thead { background: #0e0e16; border-bottom: 1px solid rgba(255,255,255,0.08); }
.software-table th {
    padding: 8px 10px; font-size: 11px; font-weight: 600; color: #666;
    text-align: left; text-transform: uppercase; letter-spacing: 0.3px;
}
.software-table td { padding: 10px 10px; font-size: 13px; color: #e0e0e0; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.data-row { cursor: pointer; transition: background 0.12s; }
.data-row:hover { background: rgba(0,102,255,0.06); }
.data-row:last-child td { border-bottom: none; }

.col-icon { width: 36px; }
.col-name { width: 20%; }
.col-category { width: 12%; }
.col-version { width: 8%; }
.col-platform { width: 10%; }
.col-download { width: auto; }

.row-icon { width: 28px; height: 28px; border-radius: 6px; background: #1a1a2e; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.row-icon-img { width: 100%; height: 100%; object-fit: cover; }
.row-icon-letter { font-size: 13px; font-weight: 700; color: #666; }
.td-name { font-weight: 500; color: #e0e0e0; }
.td-version { color: #666; font-size: 12px; }
.td-platform { color: #666; font-size: 12px; }
.cat-tag { display: inline-block; padding: 2px 7px; font-size: 11px; color: #999; background: #1a1a2e; border-radius: 4px; margin-right: 3px; }

/* 下载按钮 */
.dl-btn {
    display: inline-block; padding: 5px 12px; font-size: 13px; font-weight: 600;
    color: #fff; border-radius: 4px; text-decoration: none; border: none;
    cursor: pointer; transition: all 0.15s; white-space: nowrap; margin: 1px;
}
.dl-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.dl-btn.more { background: #444; font-weight: 500; }
.dl-btn.tutorial { background: #ec4899; }
.dl-btn.xunlei { background: #f4511e; }
.dl-btn.quark { background: #00bfa5; }
.dl-btn.baidu { background: #2196f3; }
.dl-btn.ali { background: #f59e0b; }
.dl-btn.lanzou { background: #8b5cf6; }
.dl-btn.direct { background: #64748b; }

/* ============ 骨架屏 ============ */
.skeleton-row td { padding: 12px 10px; }
.skeleton-line { height: 14px; border-radius: 4px; background: linear-gradient(90deg, #1a1a2e 25%, #222238 50%, #1a1a2e 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; width: 60%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============ 分页 ============ */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 16px 0; flex-wrap: wrap; }
.pg-btn {
    min-width: 32px; height: 32px; padding: 0 8px; font-size: 13px; font-weight: 500;
    color: #999; background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 6px;
    cursor: pointer; transition: all 0.15s;
}
.pg-btn:hover:not(:disabled) { border-color: #0066ff; color: #66b1ff; }
.pg-btn.active { background: #0066ff; color: #fff; border-color: #0066ff; }
.pg-btn:disabled { opacity: 0.3; cursor: default; }
.pg-dots { display: flex; align-items: center; color: #666; font-size: 13px; padding: 0 4px; }

/* ============ Footer ============ */
.footer { text-align: center; padding: 20px; color: #444; font-size: 12px; border-top: 1px solid rgba(255,255,255,0.04); }

/* ============ 弹窗 ============ */
.modal {
    display: none; position: fixed; z-index: 10000; left: 0; top: 0;
    width: 100%; height: 100%; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    align-items: center; justify-content: center;
}
.modal-content {
    background: #111118; border: 1px solid #333; margin: 6vh auto; border-radius: 12px;
    width: 92%; max-width: 600px; max-height: 88vh; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6); animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header {
    padding: 16px 20px; border-bottom: 1px solid #333;
    display: flex; justify-content: space-between; align-items: center; background: #0e0e16;
}
.modal-header h2 { font-size: 16px; font-weight: 600; color: #fff; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.close {
    width: 28px; height: 28px; background: #1a1a2e; border: 1px solid #333; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: #999; cursor: pointer; transition: all 0.15s; line-height: 1; flex-shrink: 0; margin-left: 10px;
}
.close:hover { background: #2a2a3e; color: #fff; }
.modal-body {
    padding: 20px; max-height: calc(88vh - 60px); overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.modal-body::-webkit-scrollbar { width: 4px; }
.modal-body::-webkit-scrollbar-track { background: transparent; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* 弹窗版本 */
.version-item { padding: 14px; background: #1a1a2e; border-radius: 8px; border: 1px solid #2a2a3e; margin-bottom: 10px; }
.version-item:first-child { background: rgba(0,102,255,0.08); border-color: rgba(0,102,255,0.3); }
.version-item:last-child { margin-bottom: 0; }
.version-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.version-tag { font-size: 13px; font-weight: 600; color: #fff; }
.version-date { color: #666; font-size: 11px; }
.version-links { display: flex; flex-wrap: wrap; gap: 6px; }

/* ============ 移动端筛选按钮+抽屉 ============ */
.mobile-filter-btn { display: none; }
.filter-drawer-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 9000; opacity: 0; transition: opacity 0.25s;
}
.filter-drawer-overlay.show { display: block; opacity: 1; }
.filter-drawer {
    display: none; position: fixed; left: 0; right: 0; bottom: 0;
    background: #111118; border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 30px rgba(0,0,0,0.4); z-index: 9001;
    max-height: 70vh; transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
    flex-direction: column; overflow: hidden;
}
.filter-drawer.show { transform: translateY(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #333; }
.drawer-title { font-size: 16px; font-weight: 600; color: #fff; }
.drawer-close { width: 28px; height: 28px; border-radius: 50%; background: #1a1a2e; border: 1px solid #333; font-size: 14px; color: #999; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.drawer-close:hover { background: #2a2a3e; color: #fff; }
.drawer-body { padding: 14px 18px; overflow-y: auto; flex: 1; }
.drawer-section { margin-bottom: 16px; }
.drawer-section:last-child { margin-bottom: 0; }
.drawer-label { font-size: 11px; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.drawer-items { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-item {
    padding: 7px 14px; font-size: 13px; font-weight: 500; color: #999;
    background: #1a1a2e; border: 1px solid #2a2a3e; border-radius: 6px;
    cursor: pointer; transition: all 0.15s;
}
.drawer-item:active { transform: scale(0.96); }
.drawer-item.active { background: #0066ff; color: #fff; border-color: #0066ff; }
.drawer-footer { display: flex; gap: 10px; padding: 12px 18px; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #333; }
.drawer-reset { flex: 1; padding: 10px 0; font-size: 14px; font-weight: 600; color: #999; background: #1a1a2e; border: 1px solid #333; border-radius: 6px; cursor: pointer; }
.drawer-reset:hover { background: #2a2a3e; }
.drawer-apply { flex: 2; padding: 10px 0; font-size: 14px; font-weight: 600; color: #fff; background: #0066ff; border: none; border-radius: 6px; cursor: pointer; }
.drawer-apply:hover { background: #0052cc; }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
    .category-panel { width: 120px; }
    .cat-item { font-size: 12px; padding: 5px 10px; }
    .col-category, .col-platform { display: none; }
    .td-category, .td-platform { display: none; }
}

@media (max-width: 768px) {
    .category-panel { display: none; }
    .platform-tabs { display: none; }
    .mobile-filter-btn {
        display: flex; align-items: center; gap: 6px;
        position: fixed; bottom: 20px; right: 16px; z-index: 800;
        padding: 10px 18px; font-size: 14px; font-weight: 600;
        color: #fff; background: #0066ff; border: none; border-radius: 20px;
        box-shadow: 0 4px 16px rgba(0,102,255,0.4); cursor: pointer; transition: transform 0.15s;
    }
    .mobile-filter-btn:active { transform: scale(0.95); }
    .filter-icon { font-size: 15px; }
    .filter-badge { min-width: 18px; height: 18px; background: #ff4444; color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; }
    .filter-drawer { display: flex; }
    .main-wrapper { padding: 10px 10px 80px; }
    .nav-content { padding: 0 12px; }
    .logo { font-size: 15px; }
    .search-wrap { flex: 0 1 200px; }
    .nav-search { font-size: 12px; padding: 5px 28px 5px 10px; }
    .software-table th { font-size: 10px; padding: 6px 6px; }
    .software-table td { padding: 8px 6px; font-size: 12px; }
    .col-version { display: none; }
    .td-version { display: none; }
    .col-download { width: auto; }
    .td-download { white-space: normal; }
    .td-download a, .td-download button, .td-download span,
    .dl-btn {
        padding: 4px 10px !important; font-size: 11px !important;
        margin: 2px !important; border-radius: 4px !important;
        display: inline-block !important; line-height: 1.3 !important;
    }
    .row-icon { width: 24px; height: 24px; border-radius: 5px; }
    .modal-content { margin: 3vh auto; width: 96%; max-height: 94vh; border-radius: 10px; }
    .modal-body { padding: 16px; max-height: calc(94vh - 52px); }
    .version-item { padding: 12px; }
}
