/* 医生卡片容器：默认适配（小屏优先） */
.doctors-container {
    display: grid;
    grid-template-columns: 1fr;
    /* 小屏默认1列 */
    gap: 10px;
    max-width: 1100px;
    /* 适配5列的最大宽度 */
    width: 100%;
    padding: 0 10px;
    margin: 0 auto;
    justify-items: stretch;
    /* 强制子项拉伸填满列宽 */
    align-items: start;
    /* 避免行高拉伸列宽 */
}

/* 大屏（≥1200px）：强制5列（优先执行） */
@media (min-width: 1200px) {
    .doctors-container {
        grid-template-columns: repeat(4, 1fr);
        /* 固定5列平分 */
        gap: 20px;
        padding: 0 20px;
    }
}

/* 中屏（1024px~1199px）：4列 */
@media (min-width: 1024px) and (max-width: 1199px) {
    .doctors-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
        padding: 0 20px;
    }
}

/* 平板（768px~1023px）：自适应列数 */
@media (min-width: 768px) and (max-width: 1023px) {
    .doctors-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
        padding: 0 20px;
    }
}

/* 超小屏（<768px）：1列 */
@media (max-width: 767px) {
    .doctors-container {
        grid-template-columns: 1fr;
    }
}

/* 医生卡片外层a标签（关键！必须100%宽度） */
.doctors-container a {
    display: block;
    /* 转为块级元素，继承列宽 */
    width: 100%;
    text-decoration: none;
    /* 去掉下划线（可选） */
    min-width: 0;
    /* 打破最小内容宽度限制 */
}

/* 医生卡片 */
.doctor-card {
    background-color: white;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    /* 继承a标签宽度 */
    min-width: 0;
    /* 允许列宽收缩 */
    overflow: hidden;
    /* 隐藏溢出内容，避免撑开列宽 */
}

/* 医生卡片悬停效果 */
.doctor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* 医生头像 */
.doctor-avatar {
    width: 100%;
    height: 270px;
    object-fit: cover;
    border-radius: 20px 20px 0 0;
}

/* 医生姓名 */
.doctor-name {
    font-size: 18px;
    font-weight: bold;
    color: #333333;
    margin-bottom: 8px;
    white-space: nowrap;
    /* 单行不换行 */
    overflow: hidden;
    /* 溢出隐藏 */
    text-overflow: ellipsis;
    /* 省略号 */
}

.doctor-name span.leve {
    float: right;
    color: red;
    border: 1px solid;
    padding: 0 4px;
    border-radius: 5px;
    font-size: 12px;
    /* 缩小级别标签，避免撑开 */
}

.doctor-name span {
    font-size: 14px;
    /* 缩小科室名称，避免撑开 */
    font-weight: normal;
    color: #666;
}

/* 医生职称 */
.doctor-title {
    height: 19px;
    font-size: 14px;
    color: #666666;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 医生评分 */
.doctor-rating {
    font-size: 14px;
    color: #ff9900;
    margin-bottom: 10px;
}

/* 医生信息 */
.doctor-info {
    font-size: 12px;
    color: #999999;
    margin-bottom: 16px;
    line-height: 1.6;
}

.doctor-info>p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* 操作按钮容器 */
.doctor-buttons {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    flex: 1;
    padding: 6px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    /* 按钮文字不换行 */
}

/* 在线咨询按钮 */
.btn-online {
    background-color: #2dbad6;
    color: white;
    border-radius: 20px;
}

.btn-online:hover {
    background-color: #22a0db;
}

/* 留言咨询按钮 */
.btn-message {
    background-color: #62a0ed;
    color: white;
    border-radius: 20px;
}

.btn-message:hover {
    background-color: #22a0db;
}

/* 保留原有其他样式 */
.disease-header {
    background-color: #e5f9f7;
    padding: 20px 30px;
    border-bottom: 1px solid #30c1d3;
}

.disease-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.disease-header .dept-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

.disease-header .right-tools {
    float: right;
    margin-top: -40px;
}

.nav-tabs {
    background-color: #fff;
    padding: 0 30px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.nav-tabs ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-tabs li {
    padding: 15px 0;
}

.nav-tabs li a {
    text-decoration: none;
    color: #666;
    font-size: 16px;
}

.nav-tabs li.active a {
    color: #0e419c;
    font-weight: bold;
    border-bottom: 2px solid #0e419c;
    padding-bottom: 13px;
}

.main-content {
    flex: 3;
    margin-right: 30px;
    min-height: 600px;
}

.filter-bar {
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-bar select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 120px;
}

.sidebar {
    flex: 1;
}

.sidebar-section {
    background-color: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 16px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.related-diseases {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-diseases li {
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.related-hospitals {
    list-style: none;
}

.related-hospitals li {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.more-btn {
    font-size: 12px;
    color: #0e419c;
    text-align: right;
    cursor: pointer;
}