:root {
    /* Variables */
    --tencent-bg-sidebar: #f5f7fa;
    --tencent-bg-content: transparent;
    --tencent-bg-card: #ffffff;
    --tencent-border-color: #e4e7ed; /* Kept for other elements like nav border */
    --tencent-text-primary: #1d2129;
    --tencent-text-secondary: #586069;
    --tencent-active-blue: #0052D9;
    --tencent-active-text: #ffffff;
    --tencent-hover-bg: #ebeff5;
    --tencent-link-blue: #0052D9;
    --tencent-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    --tencent-border-radius: 4px;
    --tencent-wrapper-padding-bottom: 150px;
    --tencent-wrapper-padding-x: 24px;
    --tencent-transition-speed: 0.2s; /* Base transition speed */
    --tencent-right-grid-max-height: 750px;
}

body {
    font-family: var(--tencent-font-family);
    background-color: #fff;
    color: var(--tencent-text-primary);
    margin: 0; padding: 0; font-size: 14px; line-height: 1.6;
}

/* --- Main Header Section (最终版) --- */
.cloudprod-main-header {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 40px 20px 30px 20px;
}
.cloudprod-main-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: var(--tencent-text-primary);
    margin: 0 0 10px 0; /* 仅保留下方边距 */
}
/* 副标题和链接的容器 */
.subtitle-line {
    display: flex;
    align-items: baseline; /* 文本基线对齐 */
    justify-content: center; /* 水平居中 */
    flex-wrap: wrap; /* 允许换行 */
    gap: 15px; /* 副标题和链接之间的间距 */
    margin-bottom: 20px; /* 该行下方的间距 */
}
.cloudprod-main-header p {
    font-size: 16px;
    color: var(--tencent-text-secondary);
    margin: 0; /* 移除默认边距，由 flex gap 控制间距 */
}
.cloudprod-view-all {
    display: inline-flex;
    align-items: center;
    color: var(--tencent-link-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color var(--tencent-transition-speed) ease;
    margin-left: 0; /* 确保没有旧的 auto 边距 */
}
.cloudprod-view-all:hover { color: #003fab; }
.cloudprod-view-all .arrow-icon { width: 16px; height: 16px; margin-left: 4px; stroke-width: 2; }


/* --- Horizontal Navigation Section --- */
.cloudprod-navigation-wrapper {
    background-color: #fff;
    padding: 10px 0;
    border-bottom: 1px solid var(--tencent-border-color);
    margin-bottom: 0;
    z-index: 10;
    transition: box-shadow var(--tencent-transition-speed) ease;
}

.cloudprod-navigation { max-width: 1200px; margin: 0 auto; padding: 0 var(--tencent-wrapper-padding-x); display: flex; flex-wrap: wrap; gap: 16px 20px; justify-content: flex-start; }
.cloudprod-nav-item {
    padding: 12px 24px;
    cursor: pointer;
    color: #181818;
    font-size: 15px;
    font-weight: 500;
    border-radius: 4px;
    
    /* Visual Style from .tpm-hero2__entry */
    background-image: linear-gradient(0deg, #fff, #f3f5f8);
    border: 2px solid #fff;
    box-shadow: 8px 8px 20px 0 rgba(55, 99, 170, .1);
    
    transition: all 0.3s ease-in-out;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    box-sizing: border-box;
}

.cloudprod-nav-item .nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    flex-shrink: 0;
    fill: currentColor;
    transition: all 0.3s ease;
}

.cloudprod-nav-item:hover {
    box-shadow: 8px 8px 20px 0 rgba(55, 99, 170, .2);
    color: #0052D9;
}

.cloudprod-nav-item.active {
    background-image: linear-gradient(0deg, #fff, #e6f7ff);
    border-color: #0052D9;
    color: #0052D9;
    font-weight: 600;
    box-shadow: 8px 8px 20px 0 rgba(0, 82, 217, 0.15);
}

/* --- Content Area Wrapper --- */
.cloudprod-wrapper {
    margin: 0 0 40px 0;
    padding-top: 50px; /* Adjusted for non-sticky nav */
    padding-left: var(--tencent-wrapper-padding-x);
    padding-right: var(--tencent-wrapper-padding-x);
    padding-bottom: var(--tencent-wrapper-padding-bottom);
    position: relative;
    background-color: var(--tencent-bg-sidebar);
    box-sizing: border-box;
    width: 100%;
}
.cloudprod-wrapper::before, .cloudprod-wrapper::after { content: ''; display: block; position: absolute; left: 0; right: 0; height: 1px; background-color: var(--tencent-border-color); z-index: 5; }
.cloudprod-wrapper::before { top: 0; }
.cloudprod-wrapper::after { bottom: 0; }

/* --- Content Area --- */
.cloudprod-content { background-color: transparent; min-width: 0; box-sizing: border-box; position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }

/* --- Section Activation & Animation --- */
.cloudprod-section { display: none; opacity: 0; animation: fadeIn 0.4s ease forwards; box-sizing: border-box; }
.cloudprod-section.active { display: block; opacity: 1; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Section Layout --- */
.section-layout-container { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.section-featured { flex: 0 0 300px; min-width: 280px; }
.section-main-grid { flex: 1 1 60%; min-width: 280px; position: relative; }
.featured-cards-layout { display: flex; flex-direction: column; gap: 16px; }

/* --- Regular Cards Grid --- */
.regular-cards-layout {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-height: var(--tencent-right-grid-max-height);
    overflow-y: auto;
    padding-right: 10px; padding-bottom: 10px;
    &::-webkit-scrollbar { width: 6px; }
    &::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
    &::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
    &::-webkit-scrollbar-thumb:hover { background: #aaa; }
}

/* ================================================ */
/* --- Product Card Styles (企业风格优化) --- */
/* ================================================ */
.cloudprod-card {
    background: var(--tencent-bg-card);
    padding: 24px;
    border-radius: var(--tencent-border-radius);
    border: 1px solid #ebeef5; /* Optional subtle border */
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}
.cloudprod-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
    border-color: #dcdfe6; /* Hover border color if border is used */
}

/* 为左边的featured卡片添加背景图片 */
.cloudprod-card.featured {
    border-left: 3px solid #ff9900;
    padding-left: calc(24px - 3px);
    background-color: rgba(0, 82, 217, 0.02); /* Optional subtle background */
    border-color: #ebeef5; /* Match normal border or slightly different */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05); /* Match normal shadow or slightly different */
    background-image: url('/themes/web/www/pic/cdn-bg_01.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 为右边的regular卡片添加背景图片 */
.regular-cards-layout .cloudprod-card {
    background-image: url('/themes/web/www/pic/hoverbg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 确保卡片内容在背景图片上有良好的可读性 */
.cloudprod-card.featured,
.regular-cards-layout .cloudprod-card {
    background-color: rgba(255, 255, 255, 0.9); /* 半透明白色背景确保文字可读 */
    backdrop-filter: blur(2px); /* 轻微模糊效果 */
}

.cloudprod-card .card-icon {
     width: 22px; height: 22px; margin-right: 10px; stroke: var(--tencent-active-blue); stroke-width: 1.5; flex-shrink: 0;
}
.cloudprod-card .card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}
.cloudprod-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--tencent-text-primary);
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cloudprod-card p {
    color: var(--tencent-text-secondary);
    margin-bottom: 20px;
    font-size: 13px;
    line-height: 1.7;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(13px * 1.7 * 2);
}
.cloudprod-tags {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping if space is tight */
    gap: 10px; /* Spacing between elements */
    align-items: center;
    margin-top: auto; /* Push to bottom */
    padding-top: 12px;
    border-top: 1px solid #f0f2f5; /* Separator line */
    /* Extend separator line */
    margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; padding-bottom: 0;
    /* Default alignment */
    justify-content: flex-start;
}
.cloudprod-tag-highlight {
    background: transparent;
    color: var(--tencent-link-blue);
    border: 1px solid rgba(0, 82, 217, 0.3);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 400;
}
.cloudprod-detail-link {
    color: var(--tencent-link-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    margin-left: auto; /* <<< Crucial: Pushes this link to the right */
    transition: color var(--tencent-transition-speed) ease;
}
.cloudprod-detail-link:hover {
    color: #003fab;
}
.cloudprod-detail-link .arrow-icon {
    width: 16px;
    height: 16px;
    margin-left: 4px;
    stroke-width: 2;
    opacity: 0;
    transform: translateX(-3px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.cloudprod-card:hover .cloudprod-detail-link .arrow-icon {
    opacity: 1;
    transform: translateX(0);
}

/* --- Featured Card Specific Styles --- */
.cloudprod-card.featured {
    border-left: 3px solid #ff9900;
    padding-left: calc(24px - 3px);
    background-color: rgba(0, 82, 217, 0.02); /* Optional subtle background */
    border-color: #ebeef5; /* Match normal border or slightly different */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05); /* Match normal shadow or slightly different */
}
.cloudprod-card.featured:hover {
     box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
     transform: translateY(-3px);
     border-color: #dcdfe6;
}
.card-icon.featured-icon {
    stroke: #ff9900;
}
.cloudprod-card.featured .cloudprod-tags {
     border-top: 1px solid #f0f2f5; /* Match normal separator */
     /* Adjust padding/margin for border */
     margin-left: -calc(24px - 3px); margin-right: -24px; padding-left: calc(24px - 3px); padding-right: 24px;
}
.cloudprod-card.featured p {
    -webkit-line-clamp: 3;
    min-height: calc(13px * 1.7 * 3);
}

/* --- Buy Now Button Styles --- */
.cloudprod-buy-now-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tencent-active-text); /* White text */
    background-color: var(--tencent-active-blue); /* Blue background */
    border: 1px solid var(--tencent-active-blue);
    border-radius: var(--tencent-border-radius);
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--tencent-transition-speed) ease, border-color var(--tencent-transition-speed) ease, color var(--tencent-transition-speed) ease;
    /* margin-right: 10px; */ /* Gap handles spacing now */
    white-space: nowrap;
}
.cloudprod-buy-now-btn:hover {
    background-color: #003fab; /* Darker blue */
    border-color: #003fab;
    color: var(--tencent-active-text);
}

/* ================================================ */
/* --- End of Product Card Styles --- */
/* ================================================ */


/* --- Mobile "Show More" Button --- */
.show-more-button {
    display: none;
    margin: 20px auto 10px auto;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tencent-link-blue);
    background-color: #fff;
    border: 1px solid var(--tencent-link-blue);
    border-radius: var(--tencent-border-radius);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.show-more-button:hover {
    background-color: var(--tencent-hover-bg);
}

/* --- Mobile Navigation Toggle --- */
.cloudprod-nav-toggle {
    display: none; /* Desktop hidden */
    justify-content: center;
    align-items: center;
    padding: 10px;
    margin-top: 10px;
    cursor: pointer;
    color: var(--tencent-text-secondary);
    font-size: 13px;
    gap: 4px;
}
.cloudprod-nav-toggle:hover {
    color: var(--tencent-link-blue);
}
.cloudprod-nav-toggle i {
    width: 16px;
    height: 16px;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) { /* Tablet */
    .section-layout-container { flex-direction: column; gap: 30px; }
    .section-featured, .section-main-grid { flex-basis: auto; width: 100%; }
    .regular-cards-layout {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        max-height: none; overflow-y: visible;
        padding-right: 0; padding-bottom: 0;
    }
    .cloudprod-wrapper {
        padding-top: calc(50px / 1.5);
        padding-bottom: calc(var(--tencent-wrapper-padding-bottom) / 1.5);
    }
    .cloudprod-navigation { padding-left: var(--tencent-wrapper-padding-x); padding-right: var(--tencent-wrapper-padding-x); }
}
@media (max-width: 767px) { /* Mobile (最终版) */
    /* 调整标题字号 */
    .cloudprod-main-header h2 {
        font-size: 22px; /* 或根据需要调整 */
        margin-bottom: 15px; /* 调整标题下方间距 */
    }
    /* 隐藏小标题 */
    .cloudprod-main-header p {
        display: none;
    }
    /* 调整 subtitle-line 在移动端的表现 */
    .subtitle-line {
       justify-content: center; /* 确保链接单独时也居中 */
       margin-bottom: 15px; /* 调整下方间距 */
       /* gap 在只有一个子元素时通常不起作用 */
    }
    /* 可选：调整链接字号 */
    .cloudprod-view-all {
       font-size: 13px;
    }

    .cloudprod-nav-item { font-size: 13px; padding: 8px 14px; }
    
    /* --- Mobile Tab System Styles (New) --- */
    .sections-tab {
        position: relative;
        width: 100%;
        border-bottom: 1px solid #f2f2f2;
        margin-bottom: 15px;
    }

    .tab-container {
        height: 50px;
        background: #fff;
        display: flex;
        align-items: center;
        position: relative;
    }

    .tab-buttons-container {
        width: 100%;
        height: 100%;
        overflow: hidden;
        margin-right: 44px; /* Space for expand button */
    }

    .tab-scroll-wrapper {
        height: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .tab-scroll-wrapper::-webkit-scrollbar { display: none; } /* Chrome/Safari */

    /* Override cloudprod-navigation for mobile horizontal scroll */
    .cloudprod-navigation { 
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        height: 100%;
        padding: 0 10px;
        gap: 0;
        margin: 0;
    }

    .cloudprod-nav-item {
        flex-shrink: 0;
        height: 100%;
        display: flex;
        align-items: center;
        padding: 0 15px;
        margin: 0;
        border-radius: 0;
        background: transparent;
        color: #666;
        font-weight: normal;
        border-bottom: 2px solid transparent;
    }
    
    .cloudprod-nav-item.active {
        color: #006eff; /* Tencent Blue */
        background: transparent;
        border-bottom-color: #006eff;
        font-weight: 500;
    }
    .cloudprod-nav-item:hover { background: transparent; color: #006eff; }

    /* Expand Button */
    .tab-expand {
        display: flex !important; /* Force show on mobile */
        position: absolute;
        right: 0;
        top: 0;
        width: 44px;
        height: 100%;
        background: #fff;
        align-items: center;
        justify-content: center;
        box-shadow: -5px 0 10px -5px rgba(0,0,0,0.05);
        z-index: 10;
        cursor: pointer;
        border-left: 1px solid #f2f2f2;
    }
    
    .tab-expand i, .tab-expand svg {
        width: 20px;
        height: 20px;
        color: #999;
        transition: transform 0.3s;
    }
    
    .sections-tab.expanded .tab-expand i, .sections-tab.expanded .tab-expand svg {
        transform: rotate(180deg);
    }

    /* Dropdown Panel */
    .expand-panel {
        display: none;
        position: absolute;
        top: 50px; /* Height of tab-container */
        left: 0;
        width: 100%;
        background: #fff;
        z-index: 100;
        padding: 15px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        border-top: 1px solid #f2f2f2;
    }

    .sections-tab.expanded .expand-panel {
        display: block;
    }

    .panel-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .panel-item {
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f7fa;
        border-radius: 4px;
        font-size: 13px;
        color: #666;
        cursor: pointer;
        transition: all 0.2s;
    }

    .panel-item.active {
        background: #e6f0ff;
        color: #006eff;
    }

    /* Overlay */
    .panel-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: transparent;
        z-index: 90;
    }
    
    .sections-tab.expanded .panel-overlay {
        display: block;
    }
    
    /* Hide old toggle */
    .cloudprod-nav-toggle { display: none; }

    .featured-cards-layout, .regular-cards-layout { grid-template-columns: 1fr; }
    .cloudprod-card { padding: 16px; }
    .cloudprod-card h3 { font-size: 15px; }
    .cloudprod-card p { font-size: 13px; -webkit-line-clamp: 3; min-height: calc(13px * 1.7 * 3);}
    .cloudprod-card.featured {padding-left: calc(16px - 3px);}

    /* 调整移动端卡片底部标签/按钮区域的 padding/margin */
     .cloudprod-tags {
         margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px;
    }
     .cloudprod-card.featured .cloudprod-tags {
         margin-left: -calc(16px - 3px); margin-right: -16px; padding-left: calc(16px - 3px); padding-right: 16px;
         border-top: 1px solid #f0f2f5; /* Match normal card separator */
    }

    .cloudprod-wrapper {
        padding-top: calc(50px / 2);
        padding-bottom: calc(var(--tencent-wrapper-padding-bottom) / 2);
    }
    .cloudprod-navigation { padding-left: var(--tencent-wrapper-padding-x); padding-right: var(--tencent-wrapper-padding-x); }
    .regular-cards-layout {
        max-height: none; overflow-y: visible;
        padding-right: 0; padding-bottom: 0;
    }
    .show-more-button { display: block; } /* Let JS control creation/removal */
}


/* Desktop defaults (Hide mobile tab elements) */
.tab-expand, .expand-panel, .panel-overlay {
    display: none;
}
.tab-buttons-container {
    width: 100%;
}
.sections-tab {
    position: relative;
}

/* Desktop styles for sections-tab to match old wrapper */
@media (min-width: 768px) {
    .sections-tab {
        background-color: #fff;
        padding: 10px 0;
        border-bottom: 1px solid var(--tencent-border-color);
        margin-bottom: 0;
        z-index: 10;
        transition: box-shadow var(--tencent-transition-speed) ease;
    }
}