/* css/style.css */

/* =========================================
   1. 基础布局与响应式修正
   ========================================= */

/* Header 整体容器 */
.site-header {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #eee;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.4s ease-in-out;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 6rem;
    transition: height 0.4s ease-in-out;
}

/* --- Logo 区域 --- */
.logo-area {
    padding-top: 0.5rem;
    /* 防止Logo被压缩 */
    flex-shrink: 0;
    margin-right: 1rem;
}
.logo-initial { display: block; max-height: 4rem; width: auto; }
.logo-scrolled { display: none; }

/* --- 搜索框区域 --- */
.search-area {
    /* 防止搜索框被压缩 */
    flex-shrink: 0;
    margin-left: 1rem;
}
.search-box {
    display: flex;
    border: 1px solid #ddd;
    background: #fff;
}
.search-box input {
    border: none;
    padding: 0.5rem;
    font-size: 0.9rem;
    outline: none;
    width: 12rem;
}
.search-box button {
    border: none;
    background-color: #555;
    color: white;
    padding: 0 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* =========================================
   2. 导航条核心样式 (已修正箭头去除)
   ========================================= */

.main-nav {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.main-nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
    white-space: nowrap;
}

.main-nav ul li {
    position: relative;
    padding: 0.5rem 0;
}

/* 链接样式 */
.main-nav ul li a {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
    display: block;
    position: relative;
    padding-bottom: 0.5rem;
    /* 【修改】删除了之前为了箭头预留的 padding-right */
}

/* 【修改】删除了之前的 .has-dropdown > a::after 箭头代码 */

/* --- 下划线效果 (保持不变，使用 ::before) --- */
.main-nav ul li a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: #005bac;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.main-nav ul li:hover a::before,
.main-nav ul li.active a::before {
    width: 100%;
}


/* =========================================
   3. 下拉菜单 (已修正位置和新增顶部箭头)
   ========================================= */

.dropdown-menu {
    position: absolute;
    top: 100%;
    /* 【修改核心点1：位置下移】增加顶部外边距，把菜单挤下来，给箭头留位置 */
    margin-top: 15px;
    left: 50%;
    /* 初始状态：水平居中且垂直方向压扁 */
    transform: translateX(-50%) scaleY(0);

    background-color: #fff;
    /* 稍微加重一点阴影增加立体感 */
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    min-width: 11rem;
    border-radius: 4px;
    padding: 0.5rem 0;
    z-index: 1001;

    /* 动画设置 */
    opacity: 0;
    visibility: hidden;
    transform-origin: top center; /* 变形原点在顶部中心，实现向下展开 */
    transition:
            opacity 0.3s ease,
            transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            visibility 0.3s ease;
}

/* 【修改核心点2：新增顶部向上箭头】 */
/* 使用伪元素在下拉菜单顶部画一个三角形 */
.dropdown-menu::before {
    content: '';
    position: absolute;
    /* 定位在菜单顶部边框的上方 */
    top: -10px;
    left: 50%;
    /* 水平居中 */
    transform: translateX(-50%);

    /* CSS 三角形制作技巧 */
    width: 0;
    height: 0;
    border-left: 10px solid transparent;  /* 左边透明 */
    border-right: 10px solid transparent; /* 右边透明 */
    border-bottom: 10px solid #166eaa;       /* 底部是白色，形成向上的尖角 */
    /* 这里的颜色 #fff 必须和下拉菜单背景色一致 */
}

/* 鼠标划过显示 */
.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    /* 展开状态：水平居中且垂直方向恢复正常大小 */
    transform: translateX(-50%) scaleY(1);
}

/* 下拉菜单项样式 (保持不变) */
.dropdown-menu a {
    display: block;
    padding: 0.8rem 1rem !important;
    color: #333 !important;
    font-size: 0.95rem !important;
    text-align: center;
    border-bottom: 1px solid #f5f5f5;
}
.dropdown-menu a:last-child {
    border-bottom: none;
}

/* 清除下拉菜单里的下划线 */
.dropdown-menu a::before {
    display: none !important;
}

.dropdown-menu a:hover {
    background-color: #f0f8ff;
    color: #005bac !important;
}

/* =========================================
   4. 响应式处理 (解决 1200px-1685px 拥挤问题)
   ========================================= */

/* 当屏幕宽度小于 1685px 时触发 */
@media screen and (max-width: 1685px) {
    /* 缩小容器边距，利用更多空间 */
    .container {
        max-width: 98%;
        padding: 0 1rem;
    }

    /* 缩小导航字体和间距 */
    .main-nav ul {
        gap: 1rem; /* 间距从 2rem 减小到 1rem */
    }

    .main-nav ul li a {
        font-size: 0.95rem; /* 字体稍微改小 */
    }

    /* 搜索框也稍微缩小点 */
    .search-box input {
        width: 8rem;
    }
}

/* 当屏幕进一步缩小到 1300px (接近笔记本尺寸) */
@media screen and (max-width: 1300px) {
    .main-nav ul {
        gap: 0.8rem;
    }
    .main-nav ul li a {
        font-size: 0.9rem;
    }
    /* 如果实在挤不下，可以隐藏搜索框或者 "联系我们" 这种次要导航 */
}


/* =========================================
   5. 固定滚动状态 (蓝色背景)
   ========================================= */

.site-header.is-fixed {
    position: fixed;
    background-color: #3685df;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: none;
}

.site-header.is-fixed .header-flex { height: 4rem; }
.site-header.is-fixed .search-area { display: none; }
.site-header.is-fixed .logo-initial { display: none; }
.site-header.is-fixed .logo-scrolled { display: block; max-height: 3rem; }

/* 固定状态下的文字颜色变化 */
.site-header.is-fixed .main-nav ul li a {
    color: #ffffff;
}

/* 固定状态下的箭头颜色变成白色 */
.site-header.is-fixed .has-dropdown > a::after {
    border-top-color: #ffffff;
}

/* 固定状态下的下划线变成白色 */
.site-header.is-fixed .main-nav ul li a::before {
    background-color: #ffffff;
}

/* 额外菜单显示 */
.site-header.is-fixed .scrolled-only {
    display: block;
    animation: fadeIn 0.5s ease;
}

/* 定义 fadeIn 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}



/* =========================================
   页脚 Footer 样式
   ========================================= */

.site-footer {
    position: relative;
    width: 100%;
    /* 预留高度或用padding撑开 */
    padding: 3rem 0 2rem 0;
    color: #fff;
    overflow: visible; /* 允许二维码弹出时超出容器 */
}

/* --- 背景层 --- */
.footer-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}
.footer-bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* --- 容器设置 --- */
.site-footer .container {
    position: relative;
    z-index: 1;
}

/* --- 上半部分布局 --- */
.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 顶部对齐 */
    padding-bottom: 2rem;
}

/* 1. 左侧链接 */
.link-label-box {
    background-color: #fff;
    color: #005bac; /* 医院蓝 */
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}
.link-label-box h3 {
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.link-list li {
    margin-bottom: 0.8rem;
}
.link-list a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    transition: color 0.3s;
    text-decoration: none;
}
.link-list a:hover {
    color: #fff;
    text-decoration: underline;
}

/* 2. 右侧社交图标 */
.footer-socials {
    display: flex;
    gap: 2rem;
    padding-top: 1rem; /* 稍微下沉一点对齐 */
}

.social-item {
    text-align: center;
    position: relative; /* 为了定位二维码 */
}

/* 白色图标盒子 */
.social-icon-box {
    width: 4rem;
    height: 4rem;
    background-color: #fff;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative; /* 为了定位里面的 popup */
}
.social-icon-box:hover {
    transform: translateY(-5px); /* 悬浮上移 */
}

.social-icon-box img {
    width: 2.5rem;
    height: auto;
}

.social-label {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.9);
}

/* --- 二维码弹窗 (核心交互) --- */
.qr-popup {
    position: absolute;
    /* 定位在图标盒子的正上方 */
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px); /* 初始位置稍微靠下 */

    width: 8rem; /* 二维码容器宽度 */
    background-color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);

    /* 底部小三角 */
    margin-bottom: 12px; /* 留出三角的位置 */

    /* 初始隐藏状态 */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* 保证在最上层 */
    z-index: 100;
}

/* 纯CSS制作底部小三角 */
.qr-popup::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fff;
}

.qr-popup img {
    width: 100%;
    height: auto;
    display: block;
}

.qr-tip {
    display: block;
    text-align: center;
    color: #333;
    font-size: 0.75rem;
    margin-top: 0.3rem;
}

/* 鼠标悬停显示二维码 */
.social-icon-box:hover .qr-popup {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0); /* 归位 */
}


/* --- 底部版权 --- */
.footer-divider {
    width: 100%;
    height: 1px;
    background-color: rgba(255,255,255,0.15); /* 淡淡的分割线 */
    margin-bottom: 1.5rem;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}


/* --- 进场动画定义 --- */
@keyframes fadeInUpFooter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 应用动画类 */
.anim-up {
    opacity: 0; /* 初始不可见 */
    animation: fadeInUpFooter 0.8s ease-out forwards;
}


/* css/guide.css */

/* =========================================
   1. 顶部 Banner 区域
   ========================================= */

.guide-banner {
    position: relative;
    width: 100%;
    /* 参考图片，Banner看起来比较扁长，高度设为 22rem 左右比较合适 */
    height: 32rem;
    /* 背景图设置 */

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* 解决 Header 绝对定位遮挡问题 */
    padding-top: 6rem;
}

/* 遮罩层 (可选：如果图片太亮，文字看不清，可以加深这个颜色) */
.banner-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 50, 100, 0.1); /* 微微带一点蓝色的遮罩 */
    z-index: 1;
}

/* 内部对齐容器 */
.banner-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直居中 */
    align-items: flex-start; /* 水平靠左对齐 (参考图片) */
}

/* 文字包装器 */
.banner-text-wrapper {
    margin-left: 1rem; /* 稍微留点左边距，视情况调整 */
}

.page-title {
    font-size: 3rem; /* 大字体 */
    font-weight: normal; /* 图片上的字体看起来不粗，比较清秀 */
    color: #fff;
    letter-spacing: 2px;
    margin-bottom: 1.5rem; /* 标题和线的距离 */
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* --- 核心：装饰线实现 --- */
.decorative-line {
    position: relative;
    width: 14rem;   /* 1. 总长度：较长的细线 */
    height: 1px;    /* 细线的高度 */
    background-color: rgba(255, 255, 255, 0.6); /* 2. 细线颜色：半透明白 */
}

/* 使用伪元素制作那根“粗一点的蓝色线” */
.decorative-line::after {
    content: '';
    position: absolute;
    left: 0;
    top: -1.5px;    /* 3. 向上偏移，使其在垂直方向上覆盖住细线 ( (4px - 1px) / 2 ) */
    width: 3.5rem;  /* 4. 蓝色粗线部分的长度 */
    height: 4px;    /* 5. 蓝色粗线的高度 */
    background-color: #3f8fe6; /* 6. 需求指定的蓝色 */
    border-radius: 2px; /* 圆润一点 */
}


/* =========================================
   2. 次级导航 (Sub-Nav)
   ========================================= */

.sub-nav-bar {
    width: 100%;
    background-color: #fff;
    /* 仅保留下边框，显得干净 */
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.sub-nav-list {
    display: flex;
    /* 核心需求：居中显示，无论只有2个还是10个 */
    justify-content: center;
    align-items: center;
    flex-wrap: wrap; /* 如果屏幕太小，允许换行 */
    gap: 0.5rem; /* 按钮之间的间隙 */
}

/* 链接基础样式 */
.sub-nav-list li a {
    display: block;
    padding: 0.6rem 1.8rem; /* 类似胶囊按钮的内边距 */
    font-size: 1rem;
    color: #555; /* 默认深灰字 */
    border-radius: 4px; /* 小圆角 */
    transition: all 0.3s ease;
    text-align: center;
    white-space: nowrap;
}

/* --- 状态1：当前选中 (Active) ---
   参考图片：蓝色背景，白色文字
*/
.sub-nav-list li.active a {
    background-color: #3f8fe6; /* 需求色 */
    color: #fff;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(63, 143, 230, 0.3); /* 加一点投影更立体 */
}

/* --- 状态2：鼠标悬停 (Hover) ---
   交互设计：未选中的，滑上去变浅蓝背景+蓝字
*/
.sub-nav-list li:not(.active) a:hover {
    color: #3f8fe6;
    background-color: rgba(63, 143, 230, 0.1); /* 10%透明度的蓝底 */
}

/* =========================================
   3. 临时内容区
   ========================================= */
.guide-content-area {
    min-height: 500px;
    background-color: #fff;
}