/* 下载中心小部件样式 */

.geniatech-download-center {
    width: 100%;
}

.geniatech-download-center-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666666;
    font-size: 16px;
}

/* 搜索结果数量样式 */
.geniatech-results-count {
    margin-bottom: 33px;
    font-size: 14px;
    color: #666666;
    font-weight: 500;
}

/* 表格模式样式 */
.geniatech-download-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -webkit-overflow-scrolling: touch; /* iOS 惯性滚动 */
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
    touch-action: pan-x; /* 允许横向滑动 */
}

.geniatech-download-table-wrapper::-webkit-scrollbar { display: none; } /* WebKit 隐藏滚动条 */

.geniatech-download-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border: none;
    display: table;
}

.geniatech-download-table thead th {
    background-color: #e53e3e;
    color: #ffffff;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 2px solid #dee2e6;
    position: relative;
    display: table-cell;
}

.geniatech-download-table thead th:first-child {
    border-top-left-radius: 8px;
}

.geniatech-download-table thead th:last-child {
    border-top-right-radius: 8px;
}

.geniatech-download-table tbody td {
    padding: 16px 20px;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    font-size: 14px;
    color: #333333;
    display: table-cell;
}

.geniatech-download-table tbody tr {
    background-color: #ffffff;
    transition: background-color 0.3s ease;
}

.geniatech-download-table tbody tr:hover {
    background-color: #f8f9fa;
}

.geniatech-download-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.geniatech-download-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* 表格文件名样式 */
.geniatech-download-name-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.geniatech-download-file-icon {
    color: #e53e3e;
    font-size: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.geniatech-download-file-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.geniatech-download-name {
    font-weight: 500;
    color: #333333;
}

/* 表格列宽度 */
.geniatech-download-table-name {
    width: 40%;
    min-width: 200px;
}

.geniatech-download-table-type {
    width: 25%;
    min-width: 150px;
}

.geniatech-download-table-date {
    width: 20%;
    min-width: 120px;
}

.geniatech-download-table-action {
    width: 15%;
    min-width: 100px;
    text-align: center;
}

/* 列表模式样式 */
.geniatech-download-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.geniatech-download-list-item {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.geniatech-download-list-item:hover {
    background-color: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.geniatech-download-list-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.geniatech-download-list-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.geniatech-download-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e53e3e;
    font-size: 20px;
    flex-shrink: 0;
    overflow: hidden;
}

.geniatech-download-list-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.geniatech-download-list-info {
    flex: 1;
}

.geniatech-download-list-title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.geniatech-download-list-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #666666;
    line-height: 1.4;
}

.geniatech-download-list-category {
    font-weight: 500;
}

.geniatech-download-list-separator {
    color: #cccccc;
}

.geniatech-download-list-date {
    color: #888888;
}

.geniatech-download-list-right {
    flex-shrink: 0;
}

/* 下载按钮样式 */
.geniatech-download-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #007cba;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
 
    transition: all 0.3s ease;
    cursor: pointer;
}

.geniatech-download-button:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
  
}

.geniatech-download-button-icon {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.geniatech-download-button-icon.before {
    margin-right: 4px;
}

.geniatech-download-button-icon.after {
    margin-left: 4px;
}

/* 无文件状态 */
.geniatech-download-no-file {
    color: #999999;
    font-size: 12px;
    font-style: italic;
}

/* 筛选器样式 */
.geniatech-download-filter {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    
}

.geniatech-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 20px;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.geniatech-filter-title-image {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    object-fit: contain;
    flex-shrink: 0;
}

.geniatech-filter-title-text {
    flex: 1;
}

.geniatech-filter-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.geniatech-filter-label {
    font-weight: 500;
    color: #666666;
    font-size: 14px;
    white-space: nowrap;
    margin: 0;
}

.geniatech-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.geniatech-filter-btn {
    padding: 8px 16px 8px 39px; /* 左侧空间：圆圈14px + 间距13px + 左边距12px = 39px */
    background-color: #ffffff;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    outline: none;
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* 左侧圆圈 */
.geniatech-filter-btn::before {
    content: '';
    position: absolute;
    left: 12px; /* 左边距12px，确保与文字有13px间距 */
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 1px solid #E5E7E8;
    border-radius: 50%;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

/* 选中时的勾号 */
.geniatech-filter-btn::after {
    content: '';
    position: absolute;
    left: 12px; /* 与圆圈对齐 */
    top: 52%;
    transform: translateY(-50%) scale(0);
    width: 14px; /* 与圆圈同大小 */
    height: 14px;
    font-size: 9px;
    color: #ffffff; /* 白色勾号 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    line-height: 1;
    z-index: 2; /* 确保在圆圈之上 */
    font-family: 'iconfont' !important;
    font-style: normal;
    font-weight: normal;
}

/* 选中状态显示勾号图标 */
.geniatech-filter-btn.active::after {
    content: '\2713'; /* 使用标准Unicode勾号 ✓ 确保显示 */
    font-family: Arial, sans-serif !important; /* 使用系统字体确保兼容性 */
    font-weight: bold; /* 加粗使勾号更清晰 */
}

/* 如果要使用阿里矢量图标，请取消下面的注释并注释上面的规则 */
/*
.geniatech-filter-btn.active::after {
    content: '\e6ad'; // 或者其他正确的Unicode
    font-family: 'iconfont' !important;
    font-weight: normal;
}
*/

.geniatech-filter-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* 悬停状态的圆圈样式 */
.geniatech-filter-btn:hover::before {
    border-color: #adb5bd;
}

.geniatech-filter-btn.active {
    background-color: transparent !important; /* 强制无背景 */
    color: #E40011 !important; /* 红色文字 */
    border-color: #E40011 !important; /* 红色边框 */
    box-shadow: none !important;
}

.geniatech-filter-btn.active:hover {
    background-color: transparent !important; /* 悬停时也保持无背景 */
    color: #E40011 !important;
    border-color: #E40011 !important;
    transform: translateY(-1px);
}

/* 选中状态的圆圈样式 */
.geniatech-filter-btn.active::before {
    border-color: #E40011;
    background-color: #E40011; /* 红色背景 */
}

/* 选中状态显示勾号 */
.geniatech-filter-btn.active::after {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.geniatech-filter-btn:focus {
    box-shadow: 0 0 0 2px rgba(228, 0, 17, 0.25);
}

/* 加载更多按钮样式 */
.geniatech-load-more-wrapper {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.geniatech-load-more-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 30px;
    background: none;
    color: #007cba;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    outline: none;
}

.geniatech-load-more-btn:hover {
    color: #005a87;
    text-decoration: none;
}

.geniatech-load-more-btn:active {
    transform: translateY(1px);
}

.geniatech-load-more-btn:disabled {
    color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.geniatech-load-more-text {
    display: block;
    margin-bottom: 4px;
}

.geniatech-load-more-arrow {
    display: block;
    font-size: 16px;
    margin-top: 8px;
    transition: all 0.3s ease;
}

.geniatech-load-more-btn:hover .geniatech-load-more-arrow {
    transform: translateY(2px);
}

/* 一闪一闪的动画效果 */
@keyframes blink {
    0%, 40% {
        opacity: 1;
        transform: scale(1);
    }
    50%, 90% {
        opacity: 0.4;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.geniatech-load-more-btn.blinking {
    animation: blink 0.8s infinite ease-in-out;
}

/* 移除了 .geniatech-loading 样式，不再需要 */

/* 错误状态 */
.geniatech-download-center-error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 20px 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .geniatech-download-table thead th,
    .geniatech-download-table tbody td {
        padding: 12px 16px;
        font-size: 13px;
    }
    
    .geniatech-download-list-item {
        padding: 16px;
    }
    
    .geniatech-download-list-content {
        gap: 16px;
    }
    
    .geniatech-download-list-left {
        gap: 12px;
    }
    
    .geniatech-download-list-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .geniatech-download-list-title {
        font-size: 15px;
    }
    
    .geniatech-download-list-meta {
        font-size: 13px;
    }
    
    /* 筛选器响应式 */
    .geniatech-download-filter {
        padding: 15px;
    }
    
    .geniatech-filter-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .geniatech-filter-content {
        gap: 15px;
    }
    
    .geniatech-filter-buttons {
        gap: 6px;
    }
    
    .geniatech-filter-btn {
        padding: 6px 12px 6px 35px; /* 移动端左侧空间：圆圈12px + 间距13px + 边距10px = 35px */
        font-size: 13px;
    }
    
    /* 移动端圆圈大小调整 */
    .geniatech-filter-btn::before {
        left: 10px; /* 左边距10px，确保与文字有13px间距 */
        width: 12px;
        height: 12px;
        border: 1px solid #E5E7E8;
    }
    
    .geniatech-filter-btn::after {
        left: 10px; /* 与12px圆圈对齐 */
        width: 12px;
        height: 12px;
        font-size: 7px;
        color: #ffffff; /* 白色勾号 */
    }
    
    .geniatech-load-more-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .geniatech-download-table-wrapper {
        border-radius: 6px;
    }
    
    .geniatech-download-table thead th,
    .geniatech-download-table tbody td {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .geniatech-download-table-name {
        min-width: 150px;
    }
    
    .geniatech-download-table-type {
        min-width: 120px;
    }
    
    .geniatech-download-table-date {
        min-width: 100px;
    }
    
    .geniatech-download-table-action {
        min-width: 80px;
    }
    
    .geniatech-download-name-wrapper {
        gap: 8px;
    }
    
    .geniatech-download-file-icon {
        font-size: 14px;
    }
    
    .geniatech-download-file-icon img {
        width: 14px;
        height: 14px;
    }
    
    .geniatech-download-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .geniatech-download-list-item {
        padding: 12px;
    }
    
    .geniatech-download-list-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .geniatech-download-list-left {
        width: 100%;
        gap: 10px;
    }
    
    .geniatech-download-list-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .geniatech-download-list-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .geniatech-download-list-meta {
        font-size: 12px;
        flex-wrap: wrap;
    }
    
    .geniatech-download-list-right {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .geniatech-download-table thead th,
    .geniatech-download-table tbody td {
        padding: 8px 10px;
        font-size: 11px;
    }
    
    .geniatech-download-table-name {
        min-width: 120px;
    }
    
    .geniatech-download-table-type {
        min-width: 100px;
    }
    
    .geniatech-download-table-date {
        min-width: 80px;
    }
    
    .geniatech-download-table-action {
        min-width: 60px;
    }
    
    .geniatech-download-button {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px;
    }
    
    .geniatech-download-button-text {
        display: none;
    }
    
    .geniatech-download-list-item {
        padding: 10px;
    }
    
    .geniatech-download-list-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .geniatech-download-list-separator {
        display: none;
    }
    
    /* 移动端筛选器 */
    .geniatech-filter-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .geniatech-filter-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .geniatech-filter-label {
        font-size: 13px;
    }
    
    .geniatech-filter-buttons {
        gap: 4px;
        width: 100%;
    }
    
    .geniatech-filter-btn {
        padding: 6px 10px 6px 33px; /* 小屏幕左侧空间：圆圈10px + 间距13px + 边距10px = 33px */
        font-size: 12px;
        border-radius: 16px;
    }
    
    /* 小屏幕圆圈大小调整 */
    .geniatech-filter-btn::before {
        left: 10px; /* 左边距10px，确保与文字有13px间距 */
        width: 10px;
        height: 10px;
        border: 1px solid #E5E7E8;
    }
    
    .geniatech-filter-btn::after {
        left: 10px; /* 与10px圆圈对齐 */
        width: 10px;
        height: 10px;
        font-size: 6px;
        color: #ffffff; /* 白色勾号 */
    }
    
    .geniatech-load-more-btn {
        padding: 8px 20px;
        font-size: 12px;
    }
}

/* 加载状态 */
.geniatech-download-center.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.geniatech-download-center.loading::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    .geniatech-download-list-item,
    .geniatech-download-button {
        transition: none;
    }
    
    .geniatech-download-list-item:hover {
        transform: none;
    }
    
    .geniatech-download-button:hover {
        transform: none;
    }
    
    .geniatech-download-center.loading::before {
        animation: none;
    }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
    .geniatech-download-table {
        border-width: 2px;
    }
    
    .geniatech-download-table thead th,
    .geniatech-download-table tbody td {
        border-width: 2px;
    }
    
    .geniatech-download-list-item {
        border-width: 2px;
    }
    
    .geniatech-download-button {
        border-width: 2px;
    }
}

/* 打印样式 */
@media print {
    .geniatech-download-button {
        display: none;
    }
    
    .geniatech-download-table-action {
        display: none;
    }
    
    .geniatech-download-list-right {
        display: none;
    }
    
    .geniatech-download-list-item {
        box-shadow: none;
        border: 1px solid #000000;
    }
    
    .geniatech-download-table {
        border: 1px solid #000000;
    }
}
