/* 下载附件样式 */
.download-container {
    display: flex;
    justify-content: center;
    padding: 20px;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.download-area {
    width: 100%;
    max-width: 1000px;
    min-width: 300px;
}

.file-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 62px;
}

.file-item {
    display: flex;
    align-items: flex-start; /* 改为顶部对齐，适应多行文本 */
    background-color: #fff;
    border-radius: 6px;
    padding: 16px 20px; /* 增加内边距 */
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e0e6ed;
    box-sizing: border-box;
    min-height: 70px; /* 设置最小高度确保一致性 */
}

.file-item:hover {
    background-color: #f0f7ff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px); /* 添加悬停上浮效果 */
    border-color: #1890ff;
}

.file-item:hover .file-name {
    color: #1890ff;
}

.file-icon {
    width: 40px; /* 稍微增大图标 */
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 14px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    margin-top: 2px; /* 微调与文本对齐 */
}

.file-pdf {
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
}

.file-doc {
    background: linear-gradient(135deg, #1890ff, #40a9ff);
}

.file-zip {
    background: linear-gradient(135deg, #9254de, #b37feb);
}

.file-other {
    background: linear-gradient(135deg, #8c8c8c, #a6a6a6);
}

.file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    text-align: left;
    justify-content: center; /* 垂直居中 */
    overflow: hidden;
    padding-right: 8px; /* 为文本增加右边距 */
}

.file-name {
    font-size: 14px;
    font-weight: 500; /* 稍微加粗 */
    color: #333;
    /* 允许换行设置 */
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    transition: color 0.2s;
    margin-bottom: 6px;
    text-align: left;
    line-height: 1.5;
    /* 限制最多显示2行，超出显示省略号 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* 非webkit浏览器备用方案 */
    max-height: 3em; /* 2行 * 1.5行高 */
}

/* 悬停时显示完整文件名提示 */
.file-item:hover .file-name {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.file-size {
    font-size: 12px;
    color: #666;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 4px;
}

.file-size::before {
     font-size: 11px;
    opacity: 0.7;
}

.download-action {
    margin-left: 8px;
    padding-left: 12px;
    border-left: 1px solid #eee;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 100%;
    min-height: 40px; /* 与图标高度一致 */
}

.icon-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.2s;
    color: #666;
    background-color: #f5f5f5;
}

.icon-download:hover {
    background-color: #e6f7ff;
    color: #1890ff;
    transform: scale(1.1); /* 添加缩放效果 */
}

.downloading {
    color: #1890ff;
    background-color: #e6f7ff;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 文件下载进度提示 */
.download-progress {
    font-size: 11px;
    color: #1890ff;
    margin-top: 2px;
    display: none;
}

.file-item.downloading .download-progress {
    display: block;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .file-list {
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .file-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .file-item {
        padding: 14px 16px;
        min-height: 65px;
    }
    
    .file-icon {
        width: 36px;
        height: 36px;
        margin-right: 14px;
    }
}

@media (max-width: 480px) {
    .download-container {
        padding: 16px 12px;
    }
    
    .file-item {
        padding: 12px 14px;
    }
    
    .file-name {
        font-size: 13px;
        -webkit-line-clamp: 2; /* 移动端保持2行限制 */
    }
    
    .file-size {
        font-size: 11px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .file-item {
        background-color: #1f1f1f;
        border-color: #333;
    }
    
    .file-item:hover {
        background-color: #262626;
        border-color: #1890ff;
    }
    
    .file-name {
        color: #e0e0e0;
    }
    
    .file-size {
        color: #999;
    }
    
    .download-action {
        border-left-color: #333;
    }
    
    .icon-download {
        background-color: #2a2a2a;
        color: #aaa;
    }
}