/* 基础重置 */
* { box-sizing: border-box; }
body {
    margin: 0;
    padding: 0;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f7f7f7;
}
a { text-decoration: none; color: inherit; }

/* 容器 */
.container {
    width: 1200px;
    margin: 0 auto;
}

/* 顶部导航占位 */
.site-header {
    background: #7b1fa2;
    color: #fff;
    padding: 12px 0;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header .logo {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: bold;
}
.site-header .logo img {
    height: 36px;
    margin-right: 10px;
}
.top-nav a {
    color: #fff;
    margin-left: 28px;
    font-size: 15px;
}
.top-nav a.active,
.top-nav a:hover {
    text-decoration: underline;
}

/* 面包屑 */
.main-wrap { padding: 16px 0 40px; }
.breadcrumb {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}
.breadcrumb a { color: #7b1fa2; }

/* 左右布局 */
.layout {
    display: flex;
    gap: 18px;
}

/* 左侧栏目 */
.sidebar {
    width: 180px;
    flex-shrink: 0;
}
.category-tabs {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.category-tabs li a,
.category-tabs li span {
    display: block;
    padding: 16px 20px;
    color: #555;
    font-size: 15px;
    border-left: 4px solid transparent;
    transition: all .2s;
}
.category-tabs li a:hover,
.category-tabs li span:hover {
    background: #f3e5f5;
    color: #7b1fa2;
}
.category-tabs li.active a,
.category-tabs li.active span {
    background: #7b1fa2;
    color: #fff;
    border-left-color: #4a148c;
}

/* 右侧内容 */
.content {
    flex: 1;
    background: #fff;
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.content h2 {
    margin: 0 0 18px;
    font-size: 20px;
    color: #7b1fa2;
    border-left: 4px solid #7b1fa2;
    padding-left: 12px;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
}
.search-title {
    font-weight: bold;
    color: #7b1fa2;
    margin-right: 8px;
}
.search-input {
    width: 170px;
    padding: 7px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 13px;
}
.search-btn {
    padding: 7px 22px;
    background: #7b1fa2;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}
.search-btn:hover { background: #6a1b9a; }

/* 信息提示 */
.info-line {
    margin-bottom: 14px;
    color: #666;
    font-size: 13px;
}
.icon-sound {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #7b1fa2;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
}

/* 顶部门诊类型筛选按钮（南京院区页面） */
.type-filter {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.type-btn {
    min-width: 80px;
    padding: 6px 16px;
    font-size: 14px;
    color: #7b1fa2;
    background: #fff;
    border: 1px solid #9c27b0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.type-btn:hover {
    background: #f3e5f5;
}
.type-btn.active {
    color: #fff;
    background: #7b1fa2;
    border-color: #7b1fa2;
}
.type-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 排班表格（双向冻结：表头日期行固定 + 科室/时段/诊间三列固定） */
.schedule-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 340px);
    min-height: 220px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}
.schedule-table {
    width: 100%;
    border-collapse: separate; /* sticky 与 border-collapse: collapse 在部分浏览器不兼容 */
    border-spacing: 0;
    table-layout: fixed;
    font-size: 13px;
}
.schedule-table th,
.schedule-table td {
    border: 1px solid #e0e0e0;
    border-left: none;
    border-top: none;
    padding: 8px;
    vertical-align: top;
    text-align: center;
}
.schedule-table thead th {
    background: #f3e5f5;
    color: #7b1fa2;
    font-weight: bold;
}
/* 冻结表头：垂直滚动时日期行始终固定在表格区顶部 */
.schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #d1c4e9;
}
/* 恢复最左列与空数据行的上/左边框（改用 separate 后补回） */
.schedule-table th:first-child,
.schedule-table td:first-child {
    border-left: 1px solid #e0e0e0;
}
.schedule-table .no-data {
    border-top: 1px solid #e0e0e0;
}
.schedule-table .date { font-size: 13px; }
.schedule-table .week { font-size: 12px; color: #888; margin-top: 2px; }
.schedule-table .col-dept { width: 110px; background: #fafafa; font-weight: bold; }
.schedule-table .col-slot { width: 60px; background: #fafafa; color: #666; }
.schedule-table .col-clinic { width: 70px; background: #fafafa; color: #666; }
.schedule-table .dept-name {
    background: #fff;
    color: #7b1fa2;
    font-weight: bold;
    vertical-align: middle;
}
.schedule-table .slot-name {
    background: #fafafa;
    color: #666;
}
.schedule-table .clinic-name {
    background: #fafafa;
    color: #666;
}
.schedule-table .cell {
    min-height: 40px;
    text-align: left;
    padding: 6px;
}

/* ---- 冻结左侧列：科室 / 时段 / 诊间（横向滚动时固定） ---- */
.schedule-table .col-dept,
.schedule-table .dept-name {
    position: sticky;
    left: 0;
    z-index: 2;
}
.schedule-table .col-slot,
.schedule-table .slot-name {
    position: sticky;
    left: 110px;   /* 110 = 科室列宽 */
    z-index: 2;
}
.schedule-table .col-clinic,
.schedule-table .clinic-name {
    position: sticky;
    left: 170px;   /* 170 = 110 + 60 */
    z-index: 2;
}
/* 冻结区与滚动区之间加分隔线，提示冻结边界 */
.schedule-table .col-clinic,
.schedule-table .clinic-name {
    border-right: 1px solid #c8c8c8;
}
/* 表头冻结列（交叉区域）始终置顶 */
.schedule-table thead .col-dept,
.schedule-table thead .col-slot,
.schedule-table thead .col-clinic {
    z-index: 4;
}
.doctor-line {
    margin-bottom: 4px;
    line-height: 1.8;
}
.doctor-line .disease {
    color: #666;
    font-size: 12px;
    margin-top: -2px;
}
.doctor-line .name {
    color: #333;
    margin-right: 4px;
}
.doctor-line a.name:hover {
    color: #7b1fa2;
    text-decoration: underline;
}
/* 停诊行：底色与其他行一致，仅保留红色"停诊"标签 */
.tag {
    display: inline-block;
    padding: 0 5px;
    border-radius: 2px;
    font-size: 11px;
    margin-left: 3px;
    color: #fff;
}
.tag.famous { background: #7b1fa2; }
.tag.special { background: #00acc1; }
.tag.stop { background: #e53935; }
/* 门诊类型标记：专/特/多（统一调小，与停诊一致） */
.tag.o1, .tag.o2, .tag.o3, .tag.stop {
    padding: 0 3px;
    font-size: 10px;
    line-height: 1.4;
}
.tag.o1 { background: #7b1fa2; }
.tag.o2 { background: #00acc1; }
.tag.o3 { background: #e67e22; }

.no-data {
    padding: 40px 0;
    color: #999;
    text-align: center;
}

/* 分页 */
.pager-bar {
    margin-top: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}
.page-btn {
    padding: 6px 14px;
    border: 1px solid #7b1fa2;
    color: #7b1fa2;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
}
.page-btn:hover { background: #f3e5f5; }
.page-info { color: #666; }

/* 顶部工具条：翻页 + 图例 同一行 */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 14px;
    border-top: 1px dashed #eee;
    border-bottom: 1px dashed #eee;
    padding: 10px 0;
}
.top-bar .top-pager {
    margin-top: 0;
    justify-content: flex-start;
    flex: 1;
}
.top-bar .legend {
    margin-top: 0;
    justify-content: flex-end;
    flex-shrink: 0;
}



/* 图例 */
.legend {
    margin-top: 18px;
    display: flex;
    gap: 20px;
    justify-content: flex-end;
    align-items: center;
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
}
.legend-item .tag {
    margin: 0;
    width: 14px;
    height: 14px;
    padding: 0;
    flex-shrink: 0;
}

/* 分页按钮（原生 button 样式重置 + 禁用态） */
.page-btn {
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
}
.page-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    background: #f5f5f5;
}
.page-btn:disabled:hover {
    background: #f5f5f5;
}
.search-input:focus {
    outline: none;
    border-color: #7b1fa2;
    box-shadow: 0 0 0 2px rgba(123, 31, 162, .12);
}

/* 加载与错误提示 */
.loading {
    padding: 30px 0;
    text-align: center;
    color: #999;
    font-size: 14px;
}
.error-box {
    margin: 14px 0;
    padding: 12px 16px;
    background: #fdecea;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #c0392b;
    font-size: 13px;
}
