/* =========================================
   下载中心样式
   ========================================= */

/* 1. 组标题 */
.dl-group-title {
    margin-top: 40px !important;
    margin-bottom: 15px !important;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-left: 4px solid #009485;
    padding-left: 12px;
    line-height: 1.2;
}

/* 2. 表格包装器 */
.dl-table-wrapper {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow-x: auto;
    background: #fff;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    display: block; 
}

/* 3. 表格本体 */
.dl-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px; /* 保证小屏可滚动 */
    table-layout: auto;
    margin: 0;
    border: none; /* 去掉默认边框 */
}

/* 表头 */
.dl-table th {
    background-color: #eff2f5;
    color: #666;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

/* 列宽 */
.dl-table .col-name { /* 自动宽度 */ }
.dl-table .col-ver { width: 15%; min-width: 100px; }
.dl-table .col-date { width: 15%; min-width: 120px; }
.dl-table .col-size { width: 10%; min-width: 80px; }
.dl-table .col-action { width: 10%; min-width: 80px; }

/* 单元格 */
.dl-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
    white-space: nowrap;
}

/* 细节优化 */
.dl-table tr:last-child td { border-bottom: none; }
.dl-table tr:hover { background-color: #fcfcfc; }

.dl-table td:first-child { white-space: normal; word-break: break-word; }

.dl-name-wrap { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.dl-icon { width: 20px; height: 20px; min-width: 20px; fill: #999; }
.dl-tag { background-color: #e6f7ff; color: #009485; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-family: monospace; }
.dl-date, .dl-size { color: #888; font-size: 13px; }
.text-center { text-align: center !important; }

/* 下载按钮 */
.dl-btn {
    display: inline-block;
    padding: 5px 12px;
    background-color: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    color: #333;
    font-size: 12px;
    text-decoration: none !important;
    transition: all 0.2s;
}
.dl-btn:hover { color: #009485; border-color: #009485; background-color: #f0fdfa; }


/* ==========================================================================
   下载中心手机端改造：将表格转为“卡片式”布局
   解决必须横向滑动才能点击下载的问题
   ========================================================================== */
@media screen and (max-width: 768px) {
    
    /* 1. 移除表格容器的滚动限制和边框 */
    .dl-table-wrapper {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow-x: visible !important; /* 禁止横向滚动 */
    }

    /* 2. 强制表格变成块级元素，宽度100% */
    .dl-table {
        min-width: 0 !important;
        width: 100% !important;
        display: block !important;
    }

    /* 3. 隐藏表头 (手机端看表头没意义) */
    .dl-table thead {
        display: none !important;
    }

    .dl-table tbody {
        display: block !important;
    }

    /* 4. 将每一行 (tr) 变成一个独立的“卡片” */
    .dl-table tbody tr {
        display: flex !important;
        flex-wrap: wrap !important;
        background-color: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        margin-bottom: 15px; /* 卡片之间的间距 */
        padding: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.03);
        position: relative;
    }

    /* 5. 重置单元格 (td) 的样式 */
    .dl-table tbody td {
        display: block !important;
        border: none !important;
        padding: 0 !important;
        width: auto !important;
        text-align: left !important;
        white-space: normal !important; /* 允许换行 */
    }

    /* --- 具体列的样式调整 --- */

    /* [第1列] 资源名称：加粗，占满整行 */
    .dl-table tbody td:first-child {
        width: 100% !important;
        margin-bottom: 10px;
        border-bottom: 1px dashed #eee !important;
        padding-bottom: 10px !important;
    }
    
    .dl-name-wrap {
        font-weight: 700;
        font-size: 16px;
        color: #333;
    }

    /* [第2列] 版本号 */
    .dl-table tbody td:nth-child(2) {
        margin-right: 15px;
        margin-bottom: 8px;
        font-size: 13px;
        color: #666;
    }
    /* 给版本号加个前缀，不然看不懂 */
    .dl-table tbody td:nth-child(2)::before {
        content: "版本: ";
        color: #999;
    }

    /* [第3列] 日期 */
    .dl-table tbody td.dl-date {
        margin-right: 15px;
        margin-bottom: 8px;
        font-size: 13px;
    }

    /* [第4列] 大小 */
    .dl-table tbody td.dl-size {
        margin-bottom: 8px;
        font-size: 13px;
        flex-grow: 1; /* 占据剩余空间 */
    }

    /* [第5列] 下载按钮：变成一个大大的按钮放在最下面 */
    .dl-table tbody td:last-child {
        width: 100% !important;
        margin-top: 5px;
    }

    /* 改造下载按钮样式 */
    .dl-btn {
        display: flex !important;
        justify-content: center;
        align-items: center;
        width: 100%;           /* 按钮占满卡片宽度 */
        background-color: #009485 !important; /* 维控绿 */
        color: #fff !important;
        border: none !important;
        padding: 10px 0 !important;
        font-size: 14px !important;
        border-radius: 6px;
        font-weight: 500;
    }
    
    /* 按钮文字后面加个图标提示 */
    .dl-btn::after {
        content: " ↓";
        font-weight: bold;
        margin-left: 5px;
    }
    
    /* 如果没有下载链接显示的横杠 */
    .dl-table tbody td:last-child span {
        display: block;
        text-align: center;
        color: #ccc;
        font-size: 12px;
        padding: 5px 0;
    }
}
