/* ============================================
 鲜艳清爽｜商务高端SaaS版 全局基础变量 & 重置
============================================ */
:root {
    --primary-color: #165DFF;
    --primary-light: #E8F3FF;
    --primary-soft: #F2F7FF;
    --primary-dark: #0E42D2;

    --bg-gray: #F7F8FA;
    --bg-white: #ffffff;

    --text-dark: #1D2129;
    --text-normal: #4E5969;
    --text-light: #86909C;
    --text-placeholder: #C9CDD4;

    --border-light: #F2F3F5;
    --border-soft: #E5E6EB;

    --card-radius: 20px;
    --item-radius: 12px;
    --tab-radius: 12px 12px 0 0;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-card: 0 2px 14px rgba(22, 93, 255, 0.06);
    --shadow-hover: 0 12px 32px rgba(22, 93, 255, 0.14);

    --transition-fast: 0.2s cubic-bezier(0.2,0,0.2,1);
    --transition-normal: 0.3s cubic-bezier(0.2,0,0.2,1);
    --transition-smooth: 0.26s cubic-bezier(0.2,0,0.2,1);

    --footer-primary: #165DFF;
    --footer-text: #86909C;
    --footer-border: #E5E6EB;
    --footer-bg: #ffffff;

    --link-item-height: 50px;
    --link-item-min-width: 140px;
    --link-gap-h: 26px;
    --link-gap-v: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* 全屏渐变背景 fixed：滚动页面背景不动；100% 100% 铺满全屏 */
    background: linear-gradient(160deg, #F7F8FA 0%, #EDF2FC 100%);
    background-size: 100% 100%;
    background-attachment: fixed;
    background-repeat: no-repeat;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans‑serif;
    color: var(--text-normal);
    line-height: 1.65;
}
.main-content { flex: 1 0 auto; padding-bottom: 40px; }

/* ============================================
 顶部导航｜通透磨砂商务
============================================ */
.navbar {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}
.navbar-brand {
    font-weight: 700;
    font-size: 1.45rem;
    color: var(--primary-color) !important;
    letter-spacing: -0.4px;
}
.navbar-brand img { max-height: 38px; margin-right: 10px; }
.nav-link {
    font-weight: 500;
    color: var(--text-light) !important;
    padding: 9px 20px !important;
    border-radius: var(--item-radius);
    transition: var(--transition-fast);
}
.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary-color) !important;
}
.nav-link.active {
    background: var(--primary-color);
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(22,93,255,0.25);
}

/* ============================================
 【首页顶部】统计卡片面板 stats-wrapper｜鲜艳渐变统计块
============================================ */
.stats-wrapper {
    background: var(--bg-white);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-card);
    padding: 26px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
    max-height: 999px;
    margin: 0 0 1.25rem 0;
    opacity: 1;
    pointer-events: auto;
    transition: max-height var(--transition-smooth), margin var(--transition-smooth), opacity var(--transition-smooth);
}
.stats-wrapper:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}
/* 隐藏状态 */
.stats-wrapper.hide-stats {
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    opacity: 0;
    pointer-events: none;
}
/* 统计卡片关闭按钮 - hover显现 */
.stats-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 28px;
    height: 28px;
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: transparent;
    transition: var(--transition-smooth);
    z-index: 10;
    appearance: none;
}
.stats-close-btn:focus,
.stats-close-btn:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}
.stats-wrapper:hover .stats-close-btn {
    color: var(--text-light);
}
.stats-wrapper:hover .stats-close-btn:hover {
    background: rgba(239, 68, 68, 0.10);
    color: #ef4444;
}
.stats-close-btn:active {
    transform: scale(0.90);
}
[data-theme="dark"] .stats-wrapper:hover .stats-close-btn:hover {
    background: rgba(239, 68, 68, 0.20);
}

.stats-row {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
}
.stats-item {
    flex: 1;
    min-width: 230px;
    padding: 20px 22px;
    border-radius: calc(var(--card-radius)*0.85);
    transition: var(--transition-normal);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}
.stats-item::after{
    content:"";
    position:absolute;
    right:-40px;
    bottom:-40px;
    width:120px;
    height:120px;
    border-radius:50%;
    background: radial-gradient(circle, rgba(255,255,255,0.55) 0%, transparent 72%);
    transition: var(--transition-normal);
    z-index: 1;
    pointer-events: none;
}
.stats-item:hover { transform: translateY(-5px); }
.stats-item:hover::after{ transform: scale(1.25); }

.stats-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap:8px;
    position: relative;
    z-index: 2;
}
.stats-label i{ font-size:20px; }
.stats-value {
    font-size: 28px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.7px;
    line-height:1.1;
    position: relative;
    z-index: 2;
}

/* 蓝色 */
.stats-item--1 {
    background: linear-gradient(135deg, #F2F7FF 0%, #E0EDFF 100%);
    border-color: #B3D4FF;
}
[data-theme="dark"] .stats-item--1 {
    background: rgba(22, 93, 255, 0.13);
    border-color: rgba(22, 93, 255, 0.24);
}
.stats-item--1 .stats-label i { color: #165DFF; }
.stats-item--1 .stats-value { color: #0E42D2; }

/* 绿色 */
.stats-item--2 {
    background: linear-gradient(135deg, #F0FDF4 0%, #D1FAE5 100%);
    border-color: #99F6C9;
}
[data-theme="dark"] .stats-item--2 {
    background: rgba(16, 185, 129, 0.13);
    border-color: rgba(16, 185, 129, 0.24);
}
.stats-item--2 .stats-label i { color: #10B981; }
.stats-item--2 .stats-value { color: #039855; }

/* 紫色 */
.stats-item--3 {
    background: linear-gradient(135deg, #FAF5FF 0%, #F3E8FF 100%);
    border-color: #DDD6FE;
}
[data-theme="dark"] .stats-item--3 {
    background: rgba(139, 92, 246, 0.13);
    border-color: rgba(139, 92, 246, 0.24);
}
.stats-item--3 .stats-label i { color: #8B5CF6; }
.stats-item--3 .stats-value { color: #7E22CE; }

/* 合计橙色 */
.stats-item--total {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEAD0 100%);
    border-color: #FEC89A;
}
[data-theme="dark"] .stats-item--total {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.25);
}
.stats-item--total .stats-label i { color: #F97316; }
.stats-item--total .stats-value { color: #C2410C; }

/* ============================================
 分类卡片｜大圆角，通透悬浮
============================================ */
.category-card {
    background: var(--bg-white);
    border-radius: var(--card-radius);
    padding: 32px 36px 38px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-light);
    transition: var(--transition-normal);
    position: relative;
}
.category-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}
.category-card:last-child { margin-bottom: 0; }

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 22px;
    border-bottom: 2px solid var(--border-light);
    margin-bottom: 28px;
}
.category-header .category-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.category-header .category-title i {
    color: var(--primary-color);
    font-size: 1.3rem;
}
.category-header .category-count {
    font-size: 0.8rem;
    color: var(--text-placeholder);
    background: var(--border-light);
    padding: 6px 20px;
    border-radius: 32px;
    font-weight: 500;
    transition: var(--transition-fast);
}
.category-card:hover .category-header .category-count {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* ============================================
 链接列表｜按钮式清爽商务链接块
============================================ */
.link-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(max(var(--link-item-min-width), 0px), 1fr));
    gap: var(--link-gap-v) var(--link-gap-h);
    padding: 0;
    margin-bottom: 30px;
}
.link-list .link-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--link-item-height);
    min-width: var(--link-item-min-width);
    padding: 0 16px;
    color: var(--text-normal);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: var(--item-radius);
    background: #F7F8FA;
    border: 1px solid var(--border-light);
    transition: var(--transition-fast);
    user-select: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.link-list .link-item:hover {
    background: var(--primary-soft);
    color: var(--primary-color);
    border-color: #B3D4FF;
    transform: translateY(-4px) scale(1.025);
    box-shadow: 0 8px 18px rgba(22,93,255,0.11);
}

/* ============================================
 Tab导航 & 内容面板｜商务标签【一行均分，无横向滚动，解决右侧截断】
============================================ */
.tab-nav {
    display: flex;
    gap: 6px;
    padding: 22px 0 0;
    border-bottom: 2px solid var(--border-light);
    /* 关闭横向滚动 */
    overflow-x: visible;
    flex-wrap: nowrap;
}
.tab-nav .tab-btn {
    /* 核心：按钮自动均分剩余宽度，允许压缩，文字自适应 */
    flex: 1 1 0%;
    min-width: 0;
    padding: 8px 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-light);
    border: none;
    border-radius: var(--tab-radius);
    background: transparent;
    cursor: pointer;
    transition: var(--transition-fast);
    /* 文字允许压缩，不强制nowrap，空间极度紧张文字会换行；如果不想换行打开下面注释 */
    /* white-space: nowrap; */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 44px;
}
.tab-nav .tab-btn:hover {
    color: var(--text-dark);
    background: #F7F8FA;
}
.tab-nav .tab-btn.active {
    color: var(--primary-color);
    background: var(--primary-soft);
}
.tab-nav .tab-btn .badge-count {
    font-size: 0.62rem;
    background: var(--border-soft);
    color: var(--text-placeholder);
    padding: 1px 7px;
    border-radius: 14px;
    flex-shrink:0;
}
.tab-nav .tab-btn.active .badge-count {
    background: #B3D4FF;
    color: var(--primary-color);
}

.tab-content { padding: 24px 0 10px; }
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
    animation: tabFadeIn 0.32s ease forwards;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
 空状态 & 三级分类
============================================ */
.empty-state {
    text-align: center;
    padding: 44px 24px;
    color: var(--text-placeholder);
}
.empty-state i {
    font-size: 2rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.38;
}
.empty-state p { margin: 0; font-size: 0.9rem; }

.global-empty {
    text-align: center;
    padding: 80px 24px;
    background: var(--bg-white);
    border-radius: var(--card-radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
}
.global-empty i {
    font-size: 3.6rem;
    color: #D0D3D9;
    display: block;
    margin-bottom: 18px;
}
.global-empty h4 {
    color: var(--text-light);
    margin-bottom: 10px;
    font-weight: 600;
}
.global-empty p {
    color: var(--text-placeholder);
    font-size: 0.98rem;
}
.global-empty a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}
.global-empty a:hover { text-decoration: underline; }

.tier3-title {
    font-size: 16px;
    color: var(--text-dark);
    margin: 18px 0 10px;
    padding-left:10px;
    border-left:4px solid var(--primary-color);
    font-weight:600;
}
.tier3-wrap {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-soft);
}
.tier3-wrap:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}
.tier3-empty {
    font-size: 14px;
    color: var(--text-placeholder);
    padding-left: 10px;
    margin-bottom: 10px;
}

/* ============================================
 回到顶部 & 页脚
============================================ */
.back-to-top {
    position: fixed;
    bottom: 36px;
    right: 36px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-white);
    color: var(--primary-color);
    border: 1px solid var(--border-soft);
    box-shadow: 0 6px 22px rgba(22,93,255,0.12);
    font-size: 1.3rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: var(--transition-normal);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 12px 34px rgba(22,93,255,0.30);
}

.footer {
    flex-shrink: 0;
    background: var(--footer-bg);
    border-top: 1px solid var(--footer-border);
    padding: 28px 0;
    margin-top: auto;
    width: 100%;
    box-shadow: 0 -2px 14px rgba(0,0,0,0.04);
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.copyright {
    font-size: 0.94rem;
    color: var(--footer-text);
}
.copyright a {
    color: var(--footer-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}
.copyright a:hover {
    color: #0E42D2;
    text-decoration: underline;
}
.footer-info {
    font-size: 0.94rem;
    color: var(--footer-text);
}

/* ============================================
 暗色模式全局适配｜商务深色主题
============================================ */
[data-theme="dark"] {
    --bg-gray: #111827;
    --bg-white: #1F2937;

    --text-dark: #F3F4F6;
    --text-normal: #D1D5DB;
    --text-light: #9CA3AF;
    --text-placeholder: #6B7280;

    --border-light: #374151;
    --border-soft: #4B5563;

    --shadow-card: 0 2px 14px rgba(0,0,0,0.35);
    --shadow-hover: 0 12px 32px rgba(22,93,255,0.22);

    --footer-bg: #1F2937;
    --footer-border: #374151;
    --footer-text: #9CA3AF;
}
[data-theme="dark"] body {
    background: linear-gradient(160deg, #111827 0%, #1A2436 100%);
}
[data-theme="dark"] .navbar {
    background: rgba(31,41,55,0.92);
    border-bottom-color: #374151;
}
[data-theme="dark"] .link-list .link-item {
    background: #374151;
    border-color: #4B5563;
}
[data-theme="dark"] .link-list .link-item:hover {
    background: rgba(22,93,255,0.16);
    border-color: var(--primary-color);
}
[data-theme="dark"] .tier3-title {
    border-left-color: var(--primary-light);
}

/* ============================================
 响应式移动端适配
============================================ */
@media (max-width: 768px) {
    :root {
        --link-item-height: 46px;
        --link-item-min-width: 115px;
        --link-gap-h: 18px;
        --link-gap-v: 16px;
    }
    .category-card {
        padding: 24px 22px 28px;
        border-radius: 16px;
        margin-bottom: 28px;
    }
    .category-header .category-title { font-size: 1.15rem; }
    .tab-nav .tab-btn {
        padding: 9px 20px;
        font-size: 0.84rem;
        height: 44px;
    }
    .footer { padding: 20px 0; }
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .copyright, .footer-info { font-size: 0.86rem; }
    .back-to-top {
        bottom: 28px;
        right: 28px;
        width: 44px;
        height: 44px;
        font-size: 1.15rem;
    }

    /* 统计卡片移动端 */
    .stats-wrapper {
        padding: 20px;
        margin-bottom: 22px;
    }
    .stats-row{ gap:16px; }
    .stats-value { font-size: 24px; }
    .stats-item {
        min-width: unset;
        width: 100%;
        padding: 16px 18px;
    }
}

@media (max-width: 480px) {
    :root {
        --link-item-height: 42px;
        --link-item-min-width: 100px;
        --link-gap-h: 14px;
        --link-gap-v: 12px;
    }
    .category-card {
        padding: 20px 18px 24px;
        border-radius: 14px;
        margin-bottom: 22px;
    }
    .tab-nav .tab-btn {
        padding: 7px 16px;
        font-size: 0.78rem;
        height: 42px;
    }
    .footer { padding: 18px 0; }
    .copyright, .footer-info { font-size: 0.78rem; }

    .stats-value { font-size: 22px; }
}