/* ==============================================================
   月岭君山 · 全站公共样式表（style.css）
   适用范围：index.html / about.html / news.html / wenxian.html /
             contact_us.html / Leave_message.html / customer-sharing.html
   维护原则：改一处、全站生效；页面特殊样式在各自 <style> 中隔离
   ============================================================== */

/* ==============================================================
   一、CSS 变量（全站统一设计令牌）
   ============================================================== */
:root {
    --primary-green: #2E7D32;   /* 大健康主色 */
    --dark-green: #1B5E20;      /* 页脚 / 深色交互 */
    --light-green: #E8F5E9;     /* 背景浅绿 */
    --accent-green: #a5d6a7;    /* 链接高亮 */
    --text-main: #1d1d1f;
    --text-light: #666;
    --bg-gray: #f5f5f7;
    --white: #ffffff;
}

/* ==============================================================
   二、基础重置与全局排版
   ============================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
}

body {
    color: var(--text-main);
    background-color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* ==============================================================
   三、文本选中策略（来自协作手册 §三.2）
   信息类文字允许选中（方便复制电话/地址）；
   交互类元素禁止选中（避免误触蓝色选区）
   ============================================================== */
html, body, div, p, span, h1, h2, h3, h4, h5, h6,
section, ul, li, img, footer, header, nav {
    cursor: default;
    user-select: none;
}

input, textarea {
    user-select: text;
    cursor: text;
}

a, button, .btn, .menu-toggle, .nav-logo, .news-card,
.video-card, .paper-card-wrapper {
    cursor: pointer;
}

/* ==============================================================
   四、布局容器
   ============================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

.bg-gray  { background-color: var(--bg-gray); }
.bg-white { background-color: var(--white); }

/* ==============================================================
   五、通用标题组件
   ============================================================== */
.section-title {
    text-align: center;
    margin-bottom: 50px;
}
.section-title h2 {
    font-size: 36px;
    color: var(--primary-green);
    margin-bottom: 15px;
    font-weight: 700;
}
.section-title p {
    color: var(--text-light);
    font-size: 18px;
}
.section-title .line {
    width: 60px;
    height: 3px;
    background-color: var(--primary-green);
    margin: 0 auto;
}

/* ==============================================================
   六、通用按钮
   ============================================================== */
.btn {
    display: inline-block;
    background-color: var(--primary-green);
    color: white;
    padding: 14px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* 呼吸动效按钮（CTA 主推入口） */
@keyframes super-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px rgba(46, 125, 50, 0.4);
        background-color: #388E3C;
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(46, 125, 50, 0);
    }
}

.pulse-effect {
    animation: super-pulse 1.5s infinite ease-in-out !important;
    background-color: var(--primary-green) !important;
    color: white !important;
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.4);
    border: 2px solid var(--primary-green);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.pulse-effect:hover {
    animation-play-state: paused !important;
    transform: scale(1.08) !important;
    background-color: var(--dark-green) !important;
}

/* "查看更多"链接容器 */
.more-link-container {
    text-align: center;
    margin-top: 40px;
}

/* ==============================================================
   七、顶部导航栏（Navbar）
   默认：透明背景 + 滚动后变绿（index 首页模式）
   子页面通过 .navbar--solid 类名覆盖为始终纯色
   ============================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    z-index: 199999;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    transition: all 0.3s ease;
}

/* 滚动后 / 子页面强制纯色 */
.navbar.scrolled,
.navbar--solid {
    background-color: rgba(46, 125, 50, 0.98) !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(46, 125, 50, 0.2);
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    flex-shrink: 0;
}
.nav-logo span {
    font-size: 22px;
    font-weight: 600;
    color: white;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    white-space: nowrap;
}

/* 导航链接列表 */
.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}
.nav-links > li {
    margin-left: 25px;
    position: relative;
    height: 70px;
    display: flex;
    align-items: center;
}
.nav-links a {
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    color: white;
    transition: color 0.3s;
}
.nav-links > li > a {
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.nav-links > li > a:hover {
    color: var(--accent-green);
}

/* 下划线滑动效果 */
.nav-links > li > a::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--accent-green);
    transition: width 0.3s;
}
.nav-links > li:hover > a::after {
    width: 100%;
}

/* 电脑端下拉菜单（纯白卡片） */
.dropdown-menu {
    display: block;
    position: absolute;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 120px;
    padding: 5px 0;
    background-color: #ffffff !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 6px;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    list-style: none;
}
.nav-links li:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}
.dropdown-menu li {
    margin: 0 !important;
    display: block;
    text-align: center;
    width: 100%;
    height: auto !important;
}
.dropdown-menu a {
    color: var(--text-main) !important;
    text-shadow: none !important;
    padding: 10px 15px;
    display: block;
    font-size: 14px;
    text-align: center;
}
.dropdown-menu a:hover {
    background-color: rgba(46, 125, 50, 0.1);
    color: var(--primary-green) !important;
    font-weight: bold;
}

/* 下拉箭头动画 */
.fa-chevron-down {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.3s;
}
.nav-links li:hover .fa-chevron-down {
    transform: rotate(180deg);
}

/* 汉堡菜单按钮（默认隐藏） */
.menu-toggle {
    display: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    z-index: 200000;
    font-size: 15px;
    font-weight: 600;
}

/* ==============================================================
   八、导航栏 · 移动端（≤950px）
   横向滑动栏 + 动态追踪下拉气泡 + 大抽屉目录树
   ============================================================== */
@media (max-width: 950px) {
    .navbar {
        padding: 0 0 0 15px !important;
        background-color: rgba(46, 125, 50, 0.98) !important;
        height: 70px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .nav-logo {
        display: none !important;
    }

    /* 手机横向滑动分类栏 */
    .nav-links {
        position: static !important;
        display: flex !important;
        flex-direction: row !important;
        background-color: transparent !important;
        padding: 0 !important;
        width: calc(100% - 65px) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
        height: 70px !important;
        box-shadow: none !important;
    }
    .nav-links::-webkit-scrollbar {
        display: none !important;
    }

    .nav-links > li {
        margin: 0 22px 0 0 !important;
        display: inline-flex !important;
        width: auto !important;
        flex-shrink: 0 !important;
        height: 70px !important;
        align-items: center !important;
    }

    /* 剥离手机横滑栏里的重复下拉菜单 */
    .nav-links > li .dropdown-menu {
        display: none !important;
    }

    .nav-links a {
        font-size: 15px !important;
        color: #ffffff !important;
        display: block !important;
        padding: 24px 0 !important;
    }

    /* 右边缘渐变半遮挡 */
    .navbar::after {
        content: "";
        position: absolute;
        top: 0;
        right: 65px;
        width: 35px;
        height: 100%;
        background: linear-gradient(
            to right,
            rgba(46, 125, 50, 0) 0%,
            rgba(46, 125, 50, 0.98) 100%
        );
        pointer-events: none;
        z-index: 1999999;
    }

    /* 右侧汉堡按钮 */
    .menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 65px !important;
        height: 70px !important;
        background-color: transparent !important;
        color: white !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }

    /* ---------- 动态坐标追踪吸附气泡（fixed 脱离裁剪） ---------- */
    .nav-links > li.mobile-expanded .dropdown-menu {
        display: flex !important;
        flex-direction: column !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: fixed !important;
        top: 70px !important;
        background-color: #ffffff !important;
        box-shadow: 0 12px 35px rgba(0,0,0,0.35) !important;
        border-radius: 8px !important;
        padding: 6px 0 !important;
        min-width: 120px !important;
        z-index: 299999999 !important;
    }
    .nav-links > li.mobile-expanded .dropdown-menu li {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        text-align: center !important;
    }
    .nav-links > li.mobile-expanded .dropdown-menu a {
        color: var(--text-main) !important;
        font-size: 14px !important;
        padding: 11px 16px !important;
        font-weight: 600 !important;
        text-align: center !important;
    }
    .nav-links > li.mobile-expanded .dropdown-menu a::before {
        content: "" !important;
        margin: 0 !important;
    }

    /* ---------- 大抽屉纵向书籍目录树 ---------- */
    .nav-links.active {
        position: absolute !important;
        top: 70px !important;
        left: 0 !important;
        width: 100% !important;
        background-color: #1B5E20 !important;
        flex-direction: column !important;
        padding: 15px 24px !important;
        display: flex !important;
        z-index: 9999999 !important;
        height: calc(100vh - 70px) !important;
        overflow-y: auto !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.35) !important;
    }
    .nav-links.active > li {
        width: 100% !important;
        margin: 8px 0 !important;
        display: block !important;
        text-align: left !important;
        height: auto !important;
    }
    .nav-links.active > li > a {
        font-size: 17px !important;
        font-weight: 600 !important;
        color: #ffffff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 6px 0 !important;
        width: 100% !important;
    }
    .nav-links.active .dropdown-menu {
        display: block !important;
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        background-color: transparent !important;
        box-shadow: none !important;
        padding: 2px 0 2px 18px !important;
        margin: 4px 0 6px 5px !important;
        border-left: 1.5px dashed rgba(255,255,255,0.25) !important;
        transition: none !important;
        width: 100% !important;
    }
    .nav-links.active .dropdown-menu li {
        text-align: left !important;
        margin: 6px 0 !important;
    }
    .nav-links.active .dropdown-menu a {
        text-align: left !important;
        padding: 4px 0 !important;
        font-size: 14px !important;
        color: #c8e6c9 !important;
        display: inline-block !important;
    }
    .nav-links.active .dropdown-menu a::before {
        content: "> " !important;
        margin-right: 6px !important;
        font-family: monospace;
        font-weight: bold;
        color: #a5d6a7 !important;
    }
}

/* ==============================================================
   九、页面顶部标题区（Page Header）
   子页面统一用：margin-top: 70px 避开固定导航
   具体高度/背景由各页面在自身 <style> 中覆盖
   ============================================================== */
.page-header {
    margin-top: 70px;
    text-align: center;
}

/* ==============================================================
   十、页脚（Footer）
   全站统一深绿底
   ============================================================== */
footer {
    background: var(--dark-green);
    color: var(--light-green);
    text-align: center;
    padding: 50px 0;
    margin-top: 50px;
}
.footer-links {
    margin-bottom: 20px;
}
.footer-links a {
    color: var(--light-green);
    text-decoration: none;
    margin: 0 15px;
    opacity: 0.8;
}
.copyright {
    font-size: 14px;
    opacity: 0.6;
}

/* ==============================================================
   十一、通用联系入口（Contact CTA）
   页内双按钮行动号召：立即联系 + 在线留言
   支持两种场景：
     - 页面标题区内嵌（about.html 风格）：白色药片 + 半透明副按钮
     - 独立行间（内容区末尾）：绿底药片 + 镂空副按钮
   HTML 结构由 contact-cta.php 统一输出
   ============================================================== */

/* --- 行间独立 CTA（默认） --- */
.contact-cta {
    text-align: center;
    padding: 40px 20px;
    margin: 30px auto 0;
    max-width: 700px;
}
.contact-cta__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-green);
    margin-bottom: 20px;
}
.contact-cta__actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}
.contact-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 999px;
    background: var(--primary-green);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 6px 18px rgba(46, 125, 50, 0.25);
    transition: all 0.25s ease;
}
.contact-cta__btn:hover {
    background: var(--dark-green);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(46, 125, 50, 0.35);
}
.contact-cta__btn--secondary {
    background: #fff;
    color: var(--primary-green);
    border: 1.5px solid var(--primary-green);
    box-shadow: none;
}
.contact-cta__btn--secondary:hover {
    background: var(--light-green);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(46, 125, 50, 0.12);
}

/* --- 标题区内嵌（变体，需 .page-header 提供背景） --- */
.contact-cta--overlay .contact-cta__title {
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.contact-cta--overlay .contact-cta__btn {
    background: rgba(255,255,255,0.95);
    color: var(--primary-green);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.contact-cta--overlay .contact-cta__btn--secondary {
    background: rgba(255,255,255,0.16);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.45);
    box-shadow: none;
}
.contact-cta--overlay .contact-cta__btn--secondary:hover {
    background: rgba(255,255,255,0.28);
}

@media (max-width: 768px) {
    .contact-cta {
        padding: 30px 15px;
    }
    .contact-cta__title {
        font-size: 17px;
    }
    .contact-cta__actions {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .contact-cta__btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}

/* ==============================================================
   十二、悬浮小助手（Float Assistant）
   右侧贴边可拖拽浮动按钮 + 呼吸动效 + 弹出菜单
   HTML 结构见各页面中 "悬浮小助手 一键插入代码" 区块
   ============================================================== */

/* --- 基础布局 --- */
.float-assistant {
    position: fixed;
    right: 0px;
    top: 66vh;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    user-select: none;
    -webkit-user-select: none;
    transition:
        transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
        opacity 0.4s ease,
        left 0.3s ease,
        right 0.3s ease,
        top 0.3s ease;
}

/* --- 中心圆按钮（径向渐变呼吸） --- */
.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: grab;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
    flex-shrink: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    animation: bgVignetteBreath 3s infinite ease-in-out;
}
.float-btn:active {
    cursor: grabbing;
}

/* --- 折叠半隐藏（贴边收起） --- */
.float-assistant.fold-state.fold-right {
    right: 0px !important;
    left: auto !important;
}
.float-assistant.fold-state.fold-right .float-btn {
    transform: translateX(50%);
    opacity: 0.7;
}
.float-assistant.fold-state.fold-left {
    left: 0px !important;
    right: auto !important;
}
.float-assistant.fold-state.fold-left .float-btn {
    transform: translateX(-50%);
    opacity: 0.7;
}

/* 折叠态 hover 临时弹出 */
.float-assistant.fold-state:hover .float-btn {
    transform: translateX(0);
    opacity: 1;
}

/* 强制闭合（鼠标移出前压制 hover） */
.float-assistant.force-fold.fold-right .float-btn {
    transform: translateX(50%) !important;
    opacity: 0.7 !important;
}
.float-assistant.force-fold.fold-left .float-btn {
    transform: translateX(-50%) !important;
    opacity: 0.7 !important;
}

/* --- 弹出菜单 --- */
.float-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    min-width: 160px;
    position: absolute;
    top: 68px;
}
.float-assistant.fold-right .float-menu {
    right: 10px;
    left: auto;
}
.float-assistant.fold-left .float-menu {
    left: 10px;
    right: auto;
}

/* 展开态 */
.float-assistant.active .float-btn {
    transform: translateX(0) scale(1.05) !important;
    opacity: 1 !important;
}
.float-assistant.active .float-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- 菜单项 --- */
.float-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background-color: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    text-decoration: none;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}
.float-menu-item:hover {
    background-color: #2E7D32;
    color: #fff;
}
.float-menu-item:hover i {
    color: #fff;
}
.float-menu-item i {
    font-size: 15px;
    color: #2E7D32;
    transition: color 0.2s;
}
.close-menu-btn {
    background-color: #f5f5f7;
}

/* --- 图标轮播动画 --- */
.float-icon {
    position: absolute;
    background: transparent;
    animation: iconStrictSequence 6s infinite ease-in-out;
}
.float-icon:nth-child(1) { animation-delay: 0s; }
.float-icon:nth-child(2) { animation-delay: -3s; }

@keyframes iconStrictSequence {
    0%, 50%, 100% { opacity: 0; transform: scale(0.4); }
    10%, 40%       { opacity: 1; transform: scale(1); }
}

@keyframes bgVignetteBreath {
    0%, 100% {
        filter: drop-shadow(0 4px 10px rgba(46, 125, 50, 0.35));
        background: radial-gradient(
            circle,
            #2E7D32 0%,
            #2E7D32 15%,
            rgba(46, 125, 50, 0.75) 35%,
            rgba(46, 125, 50, 0.35) 65%,
            rgba(46, 125, 50, 0.08) 85%,
            rgba(46, 125, 50, 0) 100%
        );
    }
    20%, 80% {
        filter: drop-shadow(0 8px 22px rgba(46, 125, 50, 0.55));
        background: radial-gradient(
            circle,
            #2E7D32 0%,
            #2E7D32 25%,
            rgba(46, 125, 50, 0.85) 48%,
            rgba(46, 125, 50, 0.45) 72%,
            rgba(46, 125, 50, 0.12) 90%,
            rgba(46, 125, 50, 0) 100%
        );
    }
}

/* --- 移动端适配 --- */
@media (max-width: 768px) {
    .float-assistant {
        right: 0px;
    }
    .float-btn {
        width: 52px;
        height: 52px;
        font-size: 18px;
    }
    .float-menu {
        top: 60px;
    }
}

/* ==============================================================
   十三、通用响应式断点（移动端兜底）
   ============================================================== */
@media (max-width: 768px) {
    .section-title h2 {
        font-size: 28px;
    }
    .section-padding {
        padding: 50px 0;
    }
    .btn {
        width: 100%;
        text-align: center;
    }
    footer {
        padding: 40px 0;
    }
}
