:root {
    --primary-dark: #022C22;
    --primary-emerald: #059669;
    --primary-teal: #0D9488;
    --primary-purple: #8B5CF6;
    --accent-gold: #D97706;
    --accent-light-gold: #FEF3C7;
    --bg-white: #FFFFFF;
    --bg-offwhite: #F8FAFC;
    --text-main: #0F172A;
    --text-muted: #475569;
    --border-light: #E2E8F0;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 40px -10px rgba(2, 44, 34, 0.08);
    --radius-lg: 20px;
    --radius-xl: 32px;
}

/* Floating TOC (Strict Custom Logic) */
.floating-toc {
    position: fixed;
    bottom: 40px;
    /* 严格设为 40px */
    left: 40px;
    /* 严格设为 40px */
    z-index: 95;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.toc-toggle {
    background: var(--primary-dark);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 24px;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.toc-toggle:hover {
    background: var(--primary-emerald);
    transform: translateY(-2px);
}

.toc-menu {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 12px;
    display: none;
    flex-direction: column;
    gap: 4px;
    width: max-content;
    min-width: 220px;
    max-height: 65vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom left;
}

.toc-menu ul {
    list-style-type: none;
    list-style: none;
}

.toc-menu::-webkit-scrollbar {
    width: 4px;
}

.toc-menu::-webkit-scrollbar-thumb {
    background: rgba(2, 44, 34, 0.1);
    border-radius: 4px;
}

.toc-menu.open {
    display: flex;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.toc-menu a {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toc-menu a::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s;
}

.toc-menu a:hover,
.toc-menu a.active {
    background: rgba(5, 150, 105, 0.08);
    color: var(--primary-emerald);
}

/* 紫色追踪点 */
.toc-menu a.active::before {
    background: var(--primary-purple);
    box-shadow: 0 0 8px var(--primary-purple);
}

.wa-float-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

/* 悬停提示词 (Tooltip) */
.wa-tooltip {
    position: absolute;
    right: 75px;
    /* 距离按钮的距离 */
    background: white;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 800;
    padding: 10px 18px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    white-space: nowrap;
    pointer-events: none;
    /* 动画初始状态 */
    opacity: 0;
    visibility: hidden;
    transform: translateX(15px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 提示词右侧的小三角箭头 */
.wa-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: white;
    border-top: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
}

.wa-float-container:hover .wa-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* WhatsApp 主按钮 */
.wa-btn {
    position: relative;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 35px;
    box-shadow: 0 4px 14px 0 rgba(37, 211, 102, 0.4);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.wa-float-container:hover .wa-btn {
    transform: scale(1.1);
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.5);
}

/* 心跳呼吸灯动画 (Ping) */
.wa-ping {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #25D366;
    z-index: 0;
    animation: wa-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes wa-ping {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    75%,
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* =========================================
          移动端终极优化 (Mobile Optimization)
       ========================================= */
@media (max-width: 768px) {

    /* 1. 顶部导航按钮防挤压 */
    .nav-inner {
        padding: 0 10px;
    }

    .nav-inner .btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .brand {
        font-size: 1.1rem;
    }

    /* 2. 修复 Hero 统计栏内边距 */
    .hero-stats-bar {
        padding: 30px 20px;
    }

    .hero-stats-bar h2 {
        font-size: 32px !important;
    }

    /* 3. 修复表格横向滚动 */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 600px;
        /* 保证表格内容不被过度挤压，触发横向滚动 */
    }

    /* 4. 修复 100% 外资控股的内联双列布局 */
    /* 利用属性选择器强行覆盖内联的 grid-template-columns */
    div[style*="grid-template-columns: 1fr 2fr"] {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 24px !important;
    }

    /* 将中间的竖线分割改为横线分割 */
    div[style*="grid-template-columns: 1fr 2fr"]>div:first-child {
        border-right: none !important;
        padding-right: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 24px;
    }

    /* WhatsApp 和 TOC 悬浮按钮位置优化 (防挡) */
    .wa-float-container {
        bottom: 24px;
        right: 16px;
    }

    .wa-btn {
        width: 54px;
        height: 54px;
        font-size: 32px;
    }

    .wa-tooltip {
        display: none;
    }

    /* 确保胶囊目录在移动端不遮挡核心阅读区域 */
    .floating-toc {
        bottom: 24px;
        left: 16px;
    }

    .toc-toggle {
        padding: 10px 18px;
        font-size: 14px;
    }
}

/* 移动端特定优化 */
@media (max-width: 1024px) {

    /* 1. 隐藏文字标题，仅保留图标 */
    .toc-toggle span {
        display: none !important;
    }

    /* 2. 调整按钮形状为圆形，并与呼吸灯水平对齐 */
    .floating-toc {
        bottom: 40px !important;
        /* 强制设为 40px，与右侧呼吸灯对齐高度 */
        left: 30px !important;
        /* 适当向左移动 */
    }

    .toc-toggle {
        padding: 0 !important;
        width: 60px !important;
        /* 与 WhatsApp 按钮宽度一致 */
        height: 60px !important;
        /* 与 WhatsApp 按钮高度一致 */
        border-radius: 50% !important;
        /* 变为圆形胶囊图标 */
        justify-content: center;
        font-size: 22px;
        /* 放大图标比例 */
    }

    .toc-toggle i {
        margin: 0 !important;
    }

    /* 3. 展开后的菜单位置微调 */
    .toc-menu {
        bottom: 70px;
        left: 0;
        min-width: 200px;
        max-width: 80vw;
    }
}

/* 优化移动端 TOC 与 WhatsApp 对齐 */
@media (max-width: 1024px) {

    /* 1. 强制对齐高度 (Bottom: 40px 与 WA 一致) */
    .floating-toc {
        bottom: 40px !important;
        left: 30px !important;
        /* 离左边留一点呼吸感 */
    }

    .wa-float-container {
        bottom: 40px !important;
        right: 30px !important;
    }

    /* 2. TOC 按钮变圆形图标，去掉文字 */
    .toc-toggle {
        width: 55px !important;
        height: 55px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        background: var(--primary-dark) !important;
        box-shadow: 0 4px 14px 0 rgba(0, 0, 0, 0.2) !important;
    }

    .toc-toggle span {
        display: none !important;
        /* 移动端隐藏文字 */
    }

    .toc-toggle i {
        font-size: 22px !important;
        margin: 0 !important;
    }

    /* 3. 菜单卡片弹出位置微调，避免贴地 */
    .toc-menu {
        bottom: 75px !important;
        left: 0 !important;
        min-width: 220px;
    }
}


/* 移动端悬浮按钮水平对齐优化 */
@media (max-width: 1024px) {

    /* 目录按钮对齐 (左侧) */
    .floating-toc {
        bottom: 40px !important;
        left: 20px !important;
    }

    /* 目录切换按钮图标化 */
    .toc-toggle {
        width: 60px !important;
        height: 60px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        justify-content: center !important;
        background: var(--primary-dark) !important;
    }

    .toc-toggle span {
        display: none !important;
    }

    /* 移动端隐藏文字 */
    .toc-toggle i {
        font-size: 22px !important;
        margin: 0 !important;
    }

    /* WhatsApp 按钮对齐 (右侧) */
    .wa-float-container {
        bottom: 40px !important;
        right: 20px !important;
    }

    .wa-btn {
        width: 60px !important;
        height: 60px !important;
    }

    /* 修复案例板块在移动端的排版，防止挤压 */
    .case-founder {
        display: flex;
        align-items: center;
        gap: 12px;
        flex-wrap: nowrap;
        /* 强制头像与文字在一行 */
    }
}