/**
 * 网址导航自定义模板样式
 * 包含ERP卡片式和紧凑型列表两种布局
 */

/* ============================================
   ERP卡片式布局样式
   ============================================ */

.erp-links-box {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.erp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.erp-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* 已在上面统一定义 */

.erp-cards-grid {
    /* Grid设置在内联样式中，支持响应式 */
}

.erp-card {
    background: #fafafa;
    border-radius: 12px;
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid transparent;
}

.erp-card:hover {
    background: #fff;
    border-color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.erp-card-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.erp-card-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.erp-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.erp-card-content {
    text-align: center;
    width: 100%;
}

.erp-card-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.erp-card-desc {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ============================================
   紧凑型列表布局样式
   ============================================ */

.compact-links-box {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    /* 与TikTok Shop对齐的宽度 - 使用B2主题的box类 */
}

.compact-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 20px !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
    width: 100% !important;
    text-align: center !important;
    position: relative !important;
}

/* 更多链接 - 固定样式,完全统一 - 只针对链接本身 */
.compact-header .compact-more-link,
.link-more a,
.erp-more-link,
.link-title .link-more a,
a.compact-more-link,
a.erp-more-link {
    background: rgba(230, 237, 255, 1) !important;
    background-color: rgba(230, 237, 255, 1) !important;
    border-radius: 9999px !important;
    -webkit-border-radius: 9999px !important;
    -moz-border-radius: 9999px !important;
    color: rgb(37, 99, 235) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 0 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    white-space: nowrap !important;
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    line-height: 36px !important;
    box-sizing: border-box !important;
    -webkit-box-sizing: border-box !important;
}

/* 更多按钮内的元素继承颜色,不设置固定尺寸 */
.compact-more-link span,
.compact-more-link i,
.erp-more-link span,
.erp-more-link i,
.link-more a span,
.link-more a i {
    color: inherit !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    width: auto !important;
    height: auto !important;
    min-width: auto !important;
    max-width: none !important;
    min-height: auto !important;
    max-height: none !important;
    line-height: inherit !important;
}

.compact-header .compact-more-link,
.link-more,
.link-more a,
.erp-more-link,
.link-title .link-more a,
a.compact-more-link {
    position: absolute !important;
    right: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
}

.compact-header .compact-more-link:hover,
.link-more:hover,
.link-more a:hover,
.erp-more-link:hover,
a.compact-more-link:hover {
    background: rgba(220, 230, 255, 1) !important;
    background-color: rgba(220, 230, 255, 1) !important;
    transform: translateY(-50%) translateX(2px) !important;
}

.compact-title {
    background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(79, 70, 229) 100%) !important;
    border-radius: 9999px !important;
    color: rgb(255, 255, 255) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 24px !important;
    padding: 12px 36px !important;
    box-shadow: rgba(9, 50, 144, 0.3) 0px 2px 8px 0px !important;
    display: inline-block !important;
    margin: 0px !important;
    border: none !important;
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    text-align: center !important;
    letter-spacing: 0px !important;
    position: relative !important;
    height: 48px !important;
    min-height: 48px !important;
    vertical-align: baseline !important;
    white-space: nowrap !important;
}

/* 覆盖B2主题默认的h2样式 */
.compact-links-box h2.compact-title,
.link-box h2.compact-title,
.link-box h2.cat-box {
    background: linear-gradient(135deg, rgb(37, 99, 235) 0%, rgb(79, 70, 229) 100%) !important;
    border-radius: 9999px !important;
    color: rgb(255, 255, 255) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 24px !important;
    padding: 12px 36px !important;
    box-shadow: rgba(9, 50, 144, 0.3) 0px 2px 8px 0px !important;
    display: inline-block !important;
    margin: 0px !important;
    border: none !important;
    width: 240px !important;
    min-width: 240px !important;
    max-width: 240px !important;
    text-align: center !important;
    letter-spacing: 0px !important;
    position: relative !important;
    height: 48px !important;
    min-height: 48px !important;
    vertical-align: baseline !important;
    white-space: nowrap !important;
}

/* 覆盖所有网址导航模块的标题容器 - 增加上边距 */
.link-box > .link-title,
.link-box .link-title,
.home_row.module-links .link-title,
.home_row.module-links .link-title-left,
.home_row.module-links > .wrapper > .link-box > .link-title,
html body .link-box .link-title {
    padding: 80px 0 20px 0 !important; /* 使用padding-top代替margin-top */
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    text-align: left !important;
    display: block !important;
}

/* 第一个标题也保持相同的上边距 */
.link-box > .link-title:first-child,
.home_row.module-links .link-title:first-child,
.link-box .link-title:first-of-type {
    padding-top: 80px !important;
    margin-top: 0 !important;
}

/* 覆盖所有网址导航模块的标题 - 参考tkfff.com简洁靠左样式 */
.link-title h2.cat-box,
.compact-header h2.compact-title,
.link-box > .link-title h2,
.link-box .link-title h2,
.link-title-left h2,
.home_row.module-links .link-title h2,
.home_row.module-links .link-title-left h2 {
    background: transparent !important; /* 移除背景色 */
    border-radius: 0 !important;
    color: #1a1a1a !important; /* 深色文字 */
    font-size: 17px !important; /* 稍微增大字体，让标题更明显 */
    font-weight: 600 !important;
    line-height: 1.5 !important;
    padding: 0 0 0 14px !important; /* 只保留左侧padding */
    box-shadow: none !important; /* 移除阴影 */
    display: inline-block !important;
    margin: 0px !important;
    border: none !important;
    width: auto !important; /* 自适应宽度 */
    min-width: auto !important;
    max-width: none !important;
    text-align: left !important; /* 靠左对齐 */
    letter-spacing: 0px !important;
    position: relative !important;
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    vertical-align: baseline !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}

/* 修复可能的伪元素干扰 - 保留::before作为左侧装饰条 */
.link-title h2.cat-box::after,
.compact-header .compact-title::after,
h2.compact-title::after {
    display: none !important;
    content: none !important;
}

/* 添加左侧装饰条 - 参考tkfff.com */
.link-title h2.cat-box::before,
.compact-header .compact-title::before,
h2.compact-title::before,
.link-box > .link-title h2::before,
.link-box .link-title h2::before,
.link-title-left h2::before,
.home_row.module-links .link-title h2::before,
.home_row.module-links .link-title-left h2::before {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 4px !important;
    height: 18px !important;
    background: linear-gradient(135deg, var(--b2color, #0073aa) 0%, rgba(0, 115, 170, 0.8) 100%) !important;
    border-radius: 2px !important;
}

/* 已在上面统一定义 */

.compact-grid {
    /* Grid设置在内联样式中，支持响应式 */
}

.compact-item {
    background: #ffffff !important;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #f0f0f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.compact-item:hover {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-4px);
}

.compact-link {
    display: flex;
    align-items: center;
    padding: 20px 16px;
    text-decoration: none;
    color: inherit;
    gap: 16px;
    height: 100%;
}

.compact-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    position: relative;
}

.compact-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    padding: 8px;
    background: linear-gradient(135deg, #f8fafc 0%, #f3f4f6 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.compact-item:hover .compact-icon img {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* 强制覆盖整个紧凑型布局容器的背景为白色 */
.compact-links-box {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.compact-grid {
    background: transparent !important;
    gap: 20px !important;
}

.compact-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.compact-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a !important;
    margin: 0 0 6px 0;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.compact-desc {
    font-size: 13px;
    color: #6b7280 !important;
    margin: 0;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    opacity: 0.85;
}

.compact-item:hover .compact-name {
    color: #093290 !important;
}

.compact-item:hover .compact-desc {
    opacity: 1;
}

/* ============================================
   响应式优化
   ============================================ */

/* 添加徽章效果 */
.compact-icon::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #ffffff;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.compact-item:hover .compact-icon::after {
    opacity: 1;
    transform: scale(1);
}

/* 添加加载动画 */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.compact-item {
    position: relative;
    overflow: hidden;
}

.compact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -1000px;
    width: 1000px;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.compact-item:hover::before {
    opacity: 1;
    animation: shimmer 1.5s ease-out;
}

@media (max-width: 768px) {
    .erp-links-box,
    .compact-links-box {
        padding: 20px;
    }
    
    .erp-header,
    .compact-header {
        margin-bottom: 16px;
    }
    
    .erp-title {
        font-size: 18px;
    }
    
    .compact-title {
        font-size: 16px;
    }
    
    .erp-card-link {
        padding: 20px 12px;
    }
    
    .erp-card-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }
    
    .erp-card-title {
        font-size: 14px;
    }
    
    .erp-card-desc {
        font-size: 12px;
    }
    
    .compact-link {
        padding: 10px;
        gap: 10px;
    }
    
    .compact-icon {
        width: 36px;
        height: 36px;
    }
    
    .compact-name {
        font-size: 13px;
    }
    
    .compact-desc {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .erp-links-box,
    .compact-links-box {
        padding: 12px;
        border-radius: 8px;
    }
    
    .erp-more-link,
    .compact-more-link {
        font-size: 12px;
    }
}

/* ============================================
   强制白天模式 - 覆盖所有深色样式
   ============================================ */

/* 覆盖系统深色模式偏好 */
@media (prefers-color-scheme: dark) {
    .erp-links-box,
    .compact-links-box {
        background: #ffffff !important;
        background-color: #ffffff !important;
    }
    
    .erp-card,
    .compact-item {
        background: #ffffff !important;
        border-color: #e5e7eb !important;
    }
    
    .erp-card:hover,
    .compact-item:hover {
        background: #f9fafb !important;
        border-color: #1565c0 !important;
    }
    
    .erp-card-title,
    .compact-name {
        color: #1f2937 !important;
    }
    
    .erp-card-desc,
    .compact-desc {
        color: #6b7280 !important;
    }
}

/* 覆盖B2主题的深色模式类 */
body.dark .erp-links-box,
body.dark .compact-links-box,
body.b2dark .erp-links-box,
body.b2dark .compact-links-box,
.b2dark .erp-links-box,
.b2dark .compact-links-box {
    background: #ffffff !important;
    background-color: #ffffff !important;
}

body.dark .erp-card,
body.dark .compact-item,
body.b2dark .erp-card,
body.b2dark .compact-item,
.b2dark .erp-card,
.b2dark .compact-item {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
}

body.dark .erp-card:hover,
body.dark .compact-item:hover,
body.b2dark .erp-card:hover,
body.b2dark .compact-item:hover {
    background: #f9fafb !important;
    border-color: #1565c0 !important;
}

body.dark .erp-card-title,
body.dark .compact-name,
body.b2dark .erp-card-title,
body.b2dark .compact-name {
    color: #1f2937 !important;
}

body.dark .erp-card-desc,
body.dark .compact-desc,
body.b2dark .erp-card-desc,
body.b2dark .compact-desc {
    color: #6b7280 !important;
}


/* ============================================
   TKFFF 卡片样式强制覆盖 - 6列布局优化
   ============================================ */

/* TKFFF 卡片容器 - 扁平长方形（对标跨境物流） */
.column-itemBox-item[data-v-9dfa5621] {
    height: 76px !important; /* 增加高度以容纳2行描述 */
    padding: 12px 14px !important;
    border-radius: 8px !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important; /* 顶部对齐 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    transition: all 0.3s ease !important;
}

.column-itemBox-item[data-v-9dfa5621]:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important;
    transform: translateY(-2px) !important;
}

/* TKFFF 图标 - TKFFF真实尺寸32px 圆形 */
.column-itemBox-item-h-i[data-v-9dfa5621] {
    width: 32px !important;
    height: 32px !important;
    margin-right: 10px !important;
    border-radius: 50% !important; /* 圆形图标 */
    flex-shrink: 0 !important;
}

/* TKFFF 内容容器 - 垂直排列 */
.column-itemBox-item-h[data-v-9dfa5621] {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    flex: 1 !important;
    min-width: 0 !important;
}

/* TKFFF 标题 - 单行显示 */
.column-itemBox-item-h-t[data-v-9dfa5621] {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
}

/* TKFFF 描述 - 显示2行 */
.column-itemBox-item-d[data-v-9dfa5621] {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    line-height: 1.5 !important;
    font-size: 12px !important;
    color: #666 !important;
    margin-top: 0px !important; /* 无间距，紧贴标题 */
    width: 100% !important;
}

