/* ==========================================================
   Header + Banner（桌面端 + 手机端：汉堡菜单 + 侧滑抽屉）
   ========================================================== */

/* ===== 基础 ===== */
.header {
    background: #fff;
}

.header .container {
    width: 1350px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    position: relative;
}

/* ===== 头部：Logo 及文字设计 ===== */
.header .logo {
    display: flex;
    align-items: center;
    width: 25%; /* 稍微加宽以容纳文字 */
    margin-left: 5%;
    gap: 15px; /* Logo 和文字的间距 */
}

.header .logo .logo-img {
    width: 200px; /* 固定一个合理的宽度，避免被挤压 */
    height: auto;
    display: block;
}

/* 始于1980 标签设计 */
.logo-since {
    font-size: 15px;
    font-weight: 800;
    color: #1890ff;
    background: linear-gradient(135deg, #e6f7ff, #bae7ff);
    padding: 4px 12px;
    border-radius: 20px;
    letter-spacing: 2px;
    white-space: nowrap;
    border: 1px solid #91d5ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

/* ===== 头部：右侧信息设计 ===== */
.header .contact {
    display: flex;
    flex-direction: column; /* 改为垂直排列，实现换行 */
    align-items: flex-end;  /* 靠右对齐 */
    justify-content: center;
    width: auto;
    margin-top: 0;
    gap: 8px; /* 两行之间的间距 */
}

/* 资质标签行 */
.hospital-tags {
    display: flex;
    gap: 8px;
}

.hospital-tags span {
    font-size: 14px;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 1px;
}

.tag-primary {
    color: #1890ff;
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
}

.tag-success {
    color: #52c41a;
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
}

/* 电话行 */
.header .phone {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 0; /* 清除原有的 margin-right */
    font-size: 20px; /* 字体稍微放大 */
    color: #1a3f66;  /* 使用更深的主题色 */
    font-weight: bold;
    font-family: Arial, sans-serif;
}

.phone-icon {
    font-size: 18px;
}

/* ===== 桌面端导航容器 ===== */
.nav {
    display: flex;
    justify-content: space-evenly;
    margin-top: 1%;
    margin-bottom: 1%;
}

/* ===== 桌面端导航项基础样式 ===== */
.nav > p,
.nav-item-dropdown > p {
    width: 100%;
    text-align: center;
    border-left: 1px solid #c9c9c9;
    height: 30px;
    line-height: 30px;
    margin: 0;
    box-sizing: border-box;
    color: #333;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.2s;
}

.nav > p:hover,
.nav-item-dropdown:hover > p {
    color: #1890ff;
}

.nav > p a {
    display: block;
    color: #333;
    text-decoration: none;
}

.nav > p a:hover {
    color: #1890ff;
}

/* ==========================================
   核心解决：下拉菜单（防闪烁 + 高级样式）
   ========================================== */
.nav-item-dropdown {
    position: relative;
    width: 100%; /* 保持和父级导航宽度一致 */
}

/* 下拉面板（悬浮卡片风格） */
.dropdown-panel {
    display: none;
    position: absolute;
    top: 30px; /* 紧贴父元素 */
    left: 0;
    width: 100%;
    min-width: 140px; /* 保证宽度，不会被挤成细条 */
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 0 0 8px 8px;
    border-top: 2px solid #1890ff; /* 顶部亮蓝色点缀 */
    z-index: 999;
    flex-direction: column;
    /* 防止鼠标移入瞬间因为缝隙断开导致闪烁 */
    padding: 6px 0;
}

/* 鼠标移上去显示 */
.nav-item-dropdown:hover .dropdown-panel {
    display: flex;
}

/* 下拉菜单中的链接 */
.dropdown-panel a {
    display: block;
    padding: 10px 0;
    text-align: center;
    color: #555;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s, color 0.2s;
    line-height: 1.5;
    height: auto;
    border-left: 3px solid transparent; /* 预留边框位置 */
}

.dropdown-panel a:hover {
    background: #f4f8fd;
    color: #1890ff;
    border-left: 3px solid #1890ff; /* 鼠标移入时左侧出现蓝条 */
}

/* ===== 手机端元素：桌面默认隐藏 ===== */
.hamburger-btn,
.mobile-menu-mask,
.mobile-menu {
    display: none;
}

/* ===== 轮播图 ===== */
.banner-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
}

.banner-track {
    display: flex;
    height: 100%;
    transition: transform 0.6s ease;
    will-change: transform;
}

.banner-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.banner-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dots .dot.active {
    background: #1890ff;
    transform: scale(1.2);
}

/* ==========================================================
   手机端适配（≤768px）
   ========================================================== */
@media (max-width: 768px) {

    .header .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 12px !important;
    }

    .header-top {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
    }

    /* logo 左对齐 */
    .header .logo {
        width: auto !important;
        margin-left: 0 !important;
        flex: 0 0 auto;
    }

    .header .logo .logo-img {
        max-width: 120px;
        width: auto;
        height: 36px;
        object-fit: contain;
    }

    /* 手机端隐藏始于1980和资质文字 */
    .logo-since {
        display: none !important;
    }

    /* 电话：手机端隐藏 */
    .header .contact {
        display: none !important;
    }

    /* 汉堡按钮：右上角 */
    .hamburger-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        position: static;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        flex: 0 0 auto;
        z-index: 1001;
    }

    .hamburger-btn span {
        display: block;
        width: 24px;
        height: 2.5px;
        background: #1a3f66;
        border-radius: 2px;
        transition: all 0.3s;
    }

    /* 隐藏桌面导航 */
    .desktop-nav {
        display: none !important;
    }

    /* 抽屉遮罩 */
    .mobile-menu-mask {
        display: block !important;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s, visibility 0.3s;
        z-index: 1000;
    }

    .mobile-menu-mask.active {
        opacity: 1;
        visibility: visible;
    }

    /* 抽屉本体 */
    .mobile-menu {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 78%;
        max-width: 300px;
        height: 100vh;
        background: #fff;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1002;
        overflow-y: auto;
    }

    .mobile-menu.active {
        transform: translateX(0);
    }

    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 18px;
        border-bottom: 1px solid #eaf0f8;
        font-size: 1.1rem;
        font-weight: 600;
        color: #1a3f66;
    }

    .mobile-menu-close {
        background: none;
        border: none;
        font-size: 28px;
        line-height: 1;
        color: #666;
        cursor: pointer;
        padding: 0 4px;
    }

    .mobile-menu-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .mobile-menu-list > li {
        border-bottom: 1px solid #f0f4fa;
    }

    .mobile-menu-list > li > a,
    .mobile-dropdown-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 20px;
        color: #1a3f66;
        text-decoration: none;
        font-size: 1rem;
        transition: background 0.2s;
        cursor: pointer;
    }

    .mobile-menu-list > li > a:active,
    .mobile-menu-list > li > a:hover,
    .mobile-dropdown-title:hover {
        background: #f4f8fd;
    }

    /* 手机端二级子菜单 */
    .mobile-sub-menu {
        display: none;
        list-style: none;
        padding: 0;
        margin: 0;
        background: #f8fbff;
    }

    .mobile-has-dropdown.open .mobile-sub-menu {
        display: block;
    }

    .mobile-sub-menu li a {
        display: block;
        padding: 12px 20px 12px 40px;
        color: #4a5568;
        font-size: 0.95rem;
        text-decoration: none;
    }

    .mobile-sub-menu li a:active,
    .mobile-sub-menu li a:hover {
        color: #1890ff;
    }

    .mobile-dropdown-title .arrow {
        font-size: 0.8rem;
        color: #999;
    }

    body.menu-open {
        overflow: hidden;
    }

    /* 轮播高度缩小 */
    .banner-wrapper {
        height: 220px !important;
    }

    .banner-dots {
        bottom: 12px !important;
        gap: 6px !important;
    }

    .banner-dots .dot {
        width: 8px !important;
        height: 8px !important;
    }

    .banner-dots .dot.active {
        transform: scale(1.3);
    }
}

/* ==========================================================
   超小屏（≤480px）
   ========================================================== */
@media (max-width: 480px) {

    .header .logo .logo-img {
        height: 32px !important;
        max-width: 105px !important;
    }

    .banner-wrapper {
        height: 180px !important;
    }

    .mobile-menu {
        width: 82%;
    }

    .mobile-menu-list > li > a,
    .mobile-dropdown-title {
        padding: 14px 18px;
        font-size: .95rem;
    }

    .mobile-sub-menu li a {
        padding: 12px 18px 12px 36px;
        font-size: .9rem;
    }
}