/**
 * 软件表格式模板样式
 * 专业商务风格，表格布局
 */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: #f8f9fa;
    line-height: 1.6;
    color: #212529;
}

/* 辅助功能 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 容器 */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 12px 0;
    margin-bottom: 16px;
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

#pageTitle {
    font-size: 22px;
    font-weight: 700;
    color: #212529;
    margin: 0;
    white-space: nowrap;
}
#pageTitle a {
    color: inherit;
    text-decoration: none;
}
#pageTitle a:hover { opacity: 0.7; }


.search-box {
    width: 100%;
    max-width: 360px;
}

.search-box input {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #409eff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 筛选区域 */
.filter-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tab {
    padding: 5px 12px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
}

.filter-tab:hover {
    border-color: #409eff;
    color: #409eff;
}

.filter-tab.active {
    background: #409eff;
    color: white;
    border-color: #409eff;
}

/* 表格样式 */
.table-wrapper {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

#softwareTable {
    width: 100%;
    border-collapse: collapse;
}

#softwareTable thead {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

#softwareTable th {
    padding: 8px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

#softwareTable td {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

#softwareTable tbody tr {
    cursor: pointer;
    transition: all 0.2s;
}

#softwareTable tbody tr:hover {
    background: #f8f9fa;
}

#softwareTable tbody tr:last-child td {
    border-bottom: none;
}

.software-icon-small {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.software-icon-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.software-name {
    font-size: 14px;
    font-weight: 500;
    color: #212529;
}

.software-desc {
    font-size: 12px;
    color: #6c757d;
    margin-top: 2px;
}

.version-tag {
    padding: 4px 8px;
    background: #ecf5ff;
    color: #409eff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.platform {
    display: inline-block;
    padding: 2px 6px;
    background: #f3e5f5;
    color: #7b1fa2;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 4px;
}

.views {
    font-size: 12px;
    color: #6c757d;
}

.download-btn {
    padding: 6px 12px;
    background: #409eff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.download-btn:hover {
    background: #5a6fd8;
    color: white;
    text-decoration: none;
}

/* 🎨 表格式独特详情页样式 */
.detail-table {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden;
}

.table-header {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.header-icon {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #dee2e6;
}

.header-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-icon .icon-placeholder {
    font-size: 32px;
    color: #6c757d;
    font-weight: 700;
}

.header-info {
    flex: 1;
}

.table-title {
    font-size: 28px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 12px;
}

.table-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.platform-badge, .version-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    background: #ecf5ff;
    color: #409eff;
}

.version-badge {
    background: #e8f5e8;
    color: #2e7d32;
}

.table-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-label {
    font-size: 11px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 14px;
    font-weight: 600;
    color: #212529;
}

/* 详情内容 */
.detail-content {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 30px;
}

.version-section, .content-section, .tags-section {
    margin-bottom: 30px;
}

.version-section:last-child, .content-section:last-child, .tags-section:last-child {
    margin-bottom: 0;
}

.version-section h3, .content-section h3, .tags-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f3f5;
}

.version-table {
    overflow-x: auto;
}

.version-table table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.version-table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    border-bottom: 1px solid #dee2e6;
}

.version-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

.version-table tr:last-child td {
    border-bottom: none;
}

.software-content {
    line-height: 1.8;
    color: #495057;
}

.software-content p {
    margin-bottom: 16px;
}

.software-content p:last-child {
    margin-bottom: 0;
}

.software-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.software-tag {
    padding: 6px 12px;
    background: #f8f9fa;
    color: #495057;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #dee2e6;
}

.no-download {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.tutorial-btn {
    padding: 4px 8px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.tutorial-btn:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.back-btn:hover {
    background: #5a6268;
    color: white;
    text-decoration: none;
}

/* 页脚 */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 16px 0;
    text-align: center;
    margin-top: 20px;
    color: #6c757d;
    font-size: 13px;
}

/* 移动端: 平台、浏览量列隐藏，确保下载按钮可见 */
@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .header { padding: 10px 0; margin-bottom: 10px; }
    #pageTitle { font-size: 16px; }
    .search-box { max-width: none; }
    .search-box input { font-size: 14px; padding: 8px 12px; }
    .filter-section { padding: 10px 12px; margin-bottom: 8px; }
    .filter-tab { padding: 4px 10px; font-size: 12px; }

    /* 隐藏版本、平台、浏览量列，保留图标+名称+下载 */
    #softwareTable th:nth-child(3),
    #softwareTable td:nth-child(3),
    #softwareTable th:nth-child(4),
    #softwareTable td:nth-child(4),
    #softwareTable th:nth-child(5),
    #softwareTable td:nth-child(5) {
        display: none;
    }
    #softwareTable th, #softwareTable td { padding: 6px 8px; font-size: 13px; }
    .software-icon-small { width: 28px; height: 28px; }
    .download-btn { padding: 5px 10px; font-size: 11px; }
    .version-tag { font-size: 11px; padding: 2px 6px; }

    /* 弹窗 */
    .modal { padding: 10px; }
    .modal-content { max-height: 85vh; }
    .modal-header { padding: 14px 16px; }
    .modal-header h2 { font-size: 16px; }
    .modal-body { padding: 16px; }
    .version-item { padding: 12px; }
    .version-links { gap: 6px; }
    .download-link, .tutorial-link { padding: 5px 10px; font-size: 11px; }

    .table-header { flex-direction: column; text-align: center; gap: 12px; padding: 16px; }
    .header-icon { width: 50px; height: 50px; }
    .table-title { font-size: 20px; }
    .detail-content { padding: 16px; }
}

/* 🎨 新增：软件描述和详细信息样式 */
.software-description {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.software-description h3 {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.description-content {
    line-height: 1.6;
}

.description-text {
    color: #495057;
    font-size: 14px;
}

.description-text p {
    margin-bottom: 12px;
}

.software-details {
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 24px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.software-details h3 {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 640px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 3px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #333;
}

.close {
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 24px;
}

.software-detail .detail-header {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.software-detail .software-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: linear-gradient(135deg, #409eff, #337ecc);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.software-detail .software-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.software-detail .icon-placeholder {
    font-size: 24px;
    color: white;
}

.software-detail .software-info h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #333;
}

.software-detail .software-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.software-detail .meta-item {
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    color: #666;
}

.software-detail .description {
    margin-bottom: 20px;
}

.software-detail .description h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
}

.software-detail .description p {
    color: #666;
    line-height: 1.6;
}

.software-detail .versions-section h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #333;
}

.version-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    background: #fafafa;
}

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

.version-tag {
    background: #409eff;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.version-platform {
    color: #666;
    font-size: 12px;
}

.version-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.download-link, .tutorial-link {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.download-link.xunlei { background: #ff6b35; color: white; }
.download-link.quark { background: #4CAF50; color: white; }
.download-link.baidu { background: #409eff; color: white; }
.download-link.ali { background: #FF9800; color: white; }
.download-link.lanzou { background: #9C27B0; color: white; }
.download-link.direct { background: #607D8B; color: white; }
.tutorial-link { background: #E91E63; color: white; }

.download-link:hover, .tutorial-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.no-version {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

