/* ==========================================================================
   值班页（/zhiban）样式，前缀 zb-
   2026-11-25 新增
   ========================================================================== */

.zb-page {
    --zb-primary: #2563eb;
    --zb-text: #1f2937;
    --zb-muted: #6b7280;
    --zb-line: #e5e7eb;
    --zb-bg: #f4f6fa;
    box-sizing: border-box;
    min-height: 100vh;
    padding-bottom: 24px;
    background: var(--zb-bg);
    color: var(--zb-text);
    font-family: "Microsoft YaHei", "微软雅黑", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.zb-page *,
.zb-page *::before,
.zb-page *::after {
    box-sizing: border-box;
}

/* ===== 顶部栏 ===== */

.zb-header {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--zb-line);
}

.zb-header-text {
    flex: 1 1 auto;
    min-width: 0;
}

.zb-header-text h1 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.zb-header-text p {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--zb-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zb-header-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zb-icon-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--zb-line);
    border-radius: 50%;
    background: #fff;
    color: #4b5563;
    font-size: 14px;
    cursor: pointer;
}

.zb-icon-btn:hover {
    background: #f3f4f6;
}

/* 右上角加号 */
.zb-add {
    position: relative;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .32);
}

.zb-add:hover {
    filter: brightness(1.05);
}

.zb-add:active {
    transform: translateY(1px);
}

.zb-add:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===== 通用按钮 ===== */

.zb-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid var(--zb-line);
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.zb-btn:hover {
    background: #f9fafb;
}

.zb-btn.ghost {
    background: #fff;
    color: #4b5563;
}

.zb-btn.primary {
    border-color: transparent;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(37, 99, 235, .26);
}

.zb-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

.zb-mini {
    padding: 3px 10px;
    border: 1px solid var(--zb-line);
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
}

/* ===== 卡片列表 ===== */

/* 2026-11-26 用户定：大屏最多三列水平均分铺满，小屏一列（不再有中间两列档） */
.zb-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

@media (max-width: 768px) {
    .zb-cards {
        grid-template-columns: 1fr;
        padding: 12px;
    }
}

.zb-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 14px;
    border: 1px solid var(--zb-line);
    border-radius: 14px;
    background: #fff;
    text-align: left;
    cursor: default;
    transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}

/* 卡片上半部分：图标 + 标题 + 撤回/箭头（只有这块点击才打开值班表） */
.zb-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border-radius: 10px;
}

.zb-card-head:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* 点开值班表的交互只在上方信息栏，名单栏不参与 */
.zb-card-head:hover {
    background: #f8fafc;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .10);
}

.zb-card-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #eff6ff;
    color: var(--zb-primary);
    font-size: 18px;
}

.zb-card-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.zb-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.zb-card-file {
    font-size: 12px;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zb-card-time {
    font-size: 11px;
    color: #9ca3af;
}

.zb-card-go {
    flex: 0 0 auto;
    color: #c7d2fe;
    font-size: 13px;
}

.zb-card-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    align-self: stretch;
}

/* ===== 卡片上的当天值班名单（大值班 / 小值班，点姓名签到） ===== */

.zb-card-duty {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 10px;
    border-top: 1px dashed #e5e7eb;
}

.zb-duty-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: #374151;
}

.zb-duty-label {
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}

.zb-duty-label.big {
    background: #fef3c7;
    color: #92400e;
}

/* 2026-11-26 用户定：管理员在卡片上选日期（选完显示当天的值班，可给未签到的人补签） */
.zb-duty-pick {
    padding-bottom: 2px;
}

.zb-day-input {
    padding: 3px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    font: inherit;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
}

.zb-day-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}

.zb-duty-name {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
    white-space: nowrap;
    transition: background .14s ease;
}

.zb-duty-name:hover {
    background: #dbeafe;
}

/* 已签到：还能再点一次撤回签到，hover 变红提示 */
.zb-duty-name.done {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
    cursor: pointer;
}

.zb-duty-name.done:hover {
    border-color: #fecaca;
    background: #fff5f5;
    color: #b91c1c;
}

.zb-duty-name:disabled {
    opacity: 1;
    cursor: default;
}

.zb-duty-name:disabled:hover {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.zb-duty-name i {
    font-size: 11px;
}

/* 不是今天的大值班：姓名仍可点（点了会提示无权限），用虚线和淡色区分。
   已签到（done）的人始终显示绿色，不被锁定样式盖掉 */
.zb-duty-name.locked:not(.done) {
    border-style: dashed;
    border-color: #e5e7eb;
    background: #f9fafb;
    color: #9ca3af;
}

.zb-duty-name.locked:not(.done):hover {
    background: #f3f4f6;
}

/* 2026-11-30 校级值班表：只展示不签到的人员（带班领导 / 其他值班）与工作事项 */
.zb-duty-plain {
    display: inline-block;
    margin: 0 10px 0 0;
    color: #334155;
    font-size: 13px;
    line-height: 1.9;
    white-space: nowrap;
}

.zb-duty-items {
    margin-top: 4px;
    padding-left: 2px;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
}

.zb-duty-none {
    color: #9ca3af;
    font-size: 12px;
}

.zb-card-duty-empty {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.5;
}

.zb-card-note {
    margin: 2px 0 0;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.55;
}

/* 说明文字里的关键词着色（2026-11-26 用户定：大值班 / 到位 / 签到 统一红色） */
.zb-card-note .hl-big,
.zb-card-note .hl-arrive,
.zb-card-note .hl-sign {
    color: #dc2626;
    font-weight: 700;
}

/* 卡片右下角「撤回」：只对上传者本人（3 天内）或管理员显示 */
.zb-card-recall {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border: 1px solid #fecaca;
    border-radius: 999px;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 11px;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
}

.zb-card-recall:hover {
    background: #fee2e2;
}

/* ===== 空状态 / 载入 ===== */

.zb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 64px 20px;
    text-align: center;
}

.zb-empty-icon {
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: #e8efff;
    color: var(--zb-primary);
    font-size: 26px;
    margin-bottom: 6px;
}

.zb-empty h2 {
    margin: 0;
    font-size: 17px;
}

.zb-empty p {
    margin: 0;
    font-size: 13px;
    color: var(--zb-muted);
}

.zb-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--zb-muted);
    font-size: 14px;
}

.zb-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #dbeafe;
    border-top-color: var(--zb-primary);
    border-radius: 50%;
    animation: zbSpin .8s linear infinite;
}

.zb-spinner.small {
    width: 13px;
    height: 13px;
    border-width: 2px;
}

@keyframes zbSpin {
    to { transform: rotate(360deg); }
}

/* ===== 工作表标签 ===== */

.zb-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 16px 0;
    overflow-x: auto;
}

.zb-tab {
    padding: 6px 14px;
    border: 1px solid var(--zb-line);
    border-radius: 8px 8px 0 0;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}

.zb-tab.on {
    background: #fff;
    border-bottom-color: #fff;
    color: var(--zb-primary);
    font-weight: 600;
}

/* ===== 详情页顶部工具栏（2026-11-30 用户定） ===== */

/* 常驻占位：调班提示与保存提示直接显示在工具栏里，底部下载工具栏合并进来（节省空间）；
   提示出现/消失不推挤表格（双击编辑的第二次点击不会落到下面一格） */
.zb-toolbar {
    position: sticky;
    top: 56px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 16px 0;
    padding: 10px 14px;
    border: 1px solid var(--zb-line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .97);
    color: var(--zb-muted);
    font-size: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
}

.zb-toolbar-tip {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zb-toolbar-tip i {
    color: #f59e0b;
}

.zb-toolbar-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

/* 调班等待第二步：整条工具栏变橙色呼吸横幅，提示一眼可见 */
.zb-toolbar.swapping {
    border-color: #d97706;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .3px;
    box-shadow: 0 10px 24px rgba(234, 88, 12, .32);
    animation: zbSwapPulse 1.6s ease-in-out infinite;
}

.zb-toolbar-icon {
    font-size: 18px;
    animation: zbSwapArrow 1.2s ease-in-out infinite;
}

.zb-toolbar b {
    color: #fff;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.zb-toolbar.swapping .zb-mini {
    padding: 5px 14px;
    border: none;
    background: #fff;
    color: #b45309;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    white-space: nowrap;
}

/* 「编辑」「取消」在工具栏最右侧，间距交给 .zb-toolbar 的 gap */

@keyframes zbSwapPulse {
    0%, 100% { box-shadow: 0 10px 24px rgba(234, 88, 12, .3); }
    50% { box-shadow: 0 10px 30px rgba(234, 88, 12, .7); }
}

@keyframes zbSwapArrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* 调班进行中：非起点的姓名格稍淡，鼠标移上去恢复，避免整张表抢注意力 */
.zb-swapping .zb-name:not(.sel) {
    opacity: .72;
}

.zb-swapping .zb-name:not(.sel):hover {
    opacity: 1;
}

/* ===== 值班表 ===== */

/* 2026-11-26 用户定：查看详情时不要裁剪值班表，整张表全部展现（纵向不限制高度，页面整体滚动）；
   列比屏幕宽时容器内出现左右滚动条，并且显式画出滚动条，避免被系统浮层式滚动条藏起来看不见 */
.zb-table-wrap {
    margin: 12px 16px;
    padding: 0;
    background: #fff;
    border: 1px solid var(--zb-line);
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #a5b4fc #eef2ff;
}

.zb-table-wrap::-webkit-scrollbar {
    height: 13px;
}

.zb-table-wrap::-webkit-scrollbar-track {
    background: #eef2ff;
    border-radius: 0 0 12px 12px;
}

.zb-table-wrap::-webkit-scrollbar-thumb {
    background: #a5b4fc;
    border: 2px solid #eef2ff;
    border-radius: 999px;
}

.zb-table-wrap::-webkit-scrollbar-thumb:hover {
    background: #818cf8;
}

.zb-table {
    border-collapse: collapse;
    width: max-content;
    min-width: 100%;
    font-size: 13px;
}

/* 打开详情后滚到「今天」那一行：顶部给 sticky 标题栏让出位置 */
.zb-table tr.zb-today-row {
    scroll-margin-top: 76px;
}

/* 当天值班的整行标红（单元格自己带 Excel 底色，用 !important 盖掉才能红得一致） */
.zb-table tr.zb-today-row td {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
    font-weight: 600;
    border-color: #fca5a5 !important;
}

/* 本月表匹配不到今天的日期时给一条说明，免得以为自动定位没生效 */
.zb-today-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 16px 0;
    padding: 9px 14px;
    border: 1px solid #fde68a;
    border-radius: 10px;
    background: #fffbeb;
    color: #92400e;
    font-size: 12px;
    line-height: 1.5;
}

.zb-table td {
    border: 1px solid #d1d5db;
    padding: 4px 6px;
    text-align: center;
    vertical-align: middle;
    white-space: pre-line;
    line-height: 1.35;
    color: #111827;
}

/* 2026-11-26 用户定：横向滚动时「时间（日期）」列及其左边的列固定在表格左侧。
   position/left 由页面脚本量好列宽后逐格写内联样式（量不全就不冻结，避免错位出现空白） */
.zb-table td.zb-frozen {
    z-index: 3;
    background: #fff;
    background-clip: padding-box;
}

/* 冻结区最后一列加一道竖线，横向滚动时能看出从哪里开始是新内容
   （表格 border-collapse 下边框会跟着表格走，所以用 inset 阴影代替） */
.zb-table td.zb-frozen-last {
    box-shadow: inset -2px 0 0 #93a3b8;
}

.zb-name {
    cursor: pointer;
    position: relative;
}

.zb-name:hover {
    box-shadow: inset 0 0 0 2px #60a5fa;
    border-radius: 2px;
}

/* 调班起点：加粗橙框 + 底色 + 边框闪烁，和提示横幅同色系 */
.zb-name.sel {
    box-shadow: inset 0 0 0 3px #ea580c;
    background-image: linear-gradient(rgba(251, 191, 36, .45), rgba(251, 191, 36, .45));
    color: #7c2d12;
    font-weight: 700;
    animation: zbSwapSel 1.4s ease-in-out infinite;
}

@keyframes zbSwapSel {
    0%, 100% { box-shadow: inset 0 0 0 3px #ea580c; }
    50% { box-shadow: inset 0 0 0 4px #f59e0b; }
}

/* 自己的姓名：虚线蓝框，方便一眼找到从哪开始调班 */
.zb-name.me {
    outline: 1px dashed #60a5fa;
    outline-offset: -3px;
}

/* 管理员双击编辑时的单元格输入框 */
.zb-cell-input {
    width: 100%;
    min-width: 64px;
    max-width: 240px;
    padding: 2px 4px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    background: #fff;
    color: #111827;
    font: inherit;
    text-align: center;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .18);
}

.zb-cell.zb-editable:not(.zb-name) {
    cursor: cell;
}

/* 已经过去的值班：非管理员灰掉、不可调（管理员不受限制，不会加这个 class） */
.zb-name.past {
    cursor: not-allowed;
    opacity: .45;
    filter: grayscale(1);
}

.zb-name.past:hover {
    box-shadow: none;
}

/* ===== 教师调班记录（值班表下方） ===== */

.zb-swaps {
    margin: 12px 16px 4px;
    padding: 12px 14px 14px;
    background: #fff;
    border: 1px solid var(--zb-line);
    border-radius: 12px;
}

.zb-swaps-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.zb-swaps-head h3 {
    flex: 1 1 auto;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}

.zb-swaps-head h3 i {
    color: var(--zb-primary);
    margin-right: 4px;
}

.zb-swaps-count {
    font-size: 12px;
    color: var(--zb-muted);
}

.zb-swaps-empty {
    padding: 14px 4px;
    color: #9ca3af;
    font-size: 13px;
}

/* 2026-11-26 用户定：调班记录窄屏排不开时横向滚动，不压到文字换行 */
.zb-swaps-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.zb-swaps-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 13px;
}

.zb-swaps-table th,
.zb-swaps-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f1f5f9;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

.zb-swaps-table th {
    font-weight: 600;
    color: #6b7280;
    font-size: 12px;
    background: #f8fafc;
}

.zb-swaps-table tbody tr:last-child td {
    border-bottom: 0;
}

/* 操作列固定宽：容得下「撤回（59:59）」整颗按钮，不会把列撑开或换行 */
.zb-swaps-table th.zb-swaps-op,
.zb-swaps-table td.zb-swaps-op {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    padding-left: 0;
    padding-right: 8px;
    text-align: right;
    white-space: nowrap;
}

.zb-swaps-table td.zb-swaps-op .zb-mini {
    white-space: nowrap;
}

.zb-mono {
    font-variant-numeric: tabular-nums;
    color: #4b5563;
}

.zb-arrow {
    color: #93c5fd;
    font-size: 11px;
    margin: 0 4px;
}

.zb-mini.danger {
    border-color: #fecaca;
    background: #fff5f5;
    color: #b91c1c;
}

.zb-mini.danger:hover {
    background: #fee2e2;
}

.zb-mini:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ===== 底部操作栏（2026-11-30 用户定：已合并进顶部 .zb-toolbar，样式删除） ===== */

/* ===== 添加弹窗 ===== */

/* 2026-12-01：用可视视口（visualViewport）定位，软键盘弹出时弹层整体留在键盘上方。
   变量由 js/vvKeyboard.js 写入；取不到时退回 100vh（原行为）。 */
.zb-mask {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--tx-vv-top, 0px);
    height: var(--tx-vv-h, 100vh);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .42);
}

.zb-modal {
    width: 480px;
    max-width: 100%;
    max-height: calc(var(--tx-vv-h, 100vh) - 40px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .28);
    overflow: hidden;
}

.zb-modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
}

.zb-modal-head h3 {
    flex: 1 1 auto;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.zb-modal-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    /* 2026-12-01：flex 子项默认 min-height:auto，内容多时会撑开而不是内部滚动，
       overflow:auto 形同失效（值班分值表被弹窗裁掉、键盘一弹就找不到输入框）。 */
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.zb-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.zb-label {
    font-size: 13px;
    color: #4b5563;
    font-weight: 600;
}

/* 2026-12-01 用户定：级部、年份和各自的输入框排在同一行 */
.zb-field-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zb-pick {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zb-pick .zb-label {
    flex: 0 0 auto;
    white-space: nowrap;
}

.zb-pick .zb-select {
    flex: 1 1 auto;
    min-width: 0;
}

.zb-select {
    flex: 1 1 0;
    padding: 9px 10px;
    border: 1px solid var(--zb-line);
    border-radius: 10px;
    background: #fff;
    color: #111827;
    font-size: 14px;
}

.zb-select:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .16);
}

.zb-select-sm {
    flex: 0 0 auto;
    max-width: 150px;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 13px;
}

/* 2026-12-01：详情页标题栏右侧的级部切换 */
.zb-jibu-switch {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.zb-jibu-switch .zb-select {
    max-width: 96px;
}

/* 2026-12-01：详情工具栏左侧的月份筛选（本月及以后 / 全部月份 / 1-12 月） */
.zb-month-pick {
    flex: 0 0 auto;
    max-width: 112px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 13px;
}

.zb-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.zb-file-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zb-file-name.muted {
    color: #9ca3af;
}

.zb-modal-msg {
    padding: 9px 12px;
    border-radius: 10px;
    background: #f3f6fb;
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-all;
}

.zb-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px 16px;
    border-top: 1px solid #eef2f7;
}

/* ===== 2026-11-26 值班设置（右上角齿轮，仅管理员可见） ===== */

/* 齿轮按钮：白底幽灵样式，和「+」并排 */
.zb-add.ghost {
    background: #fff;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .08);
}

.zb-add.ghost:hover {
    background: #f8fafc;
    color: #1f2937;
    filter: none;
}

.zb-modal-sm {
    max-width: 420px;
}

/* 2026-11-30 值班分值表（值班设置里，项目/平日/周末/备注） */
.zb-score-table {
    margin-top: 14px;
    border: 1px solid #eef2f7;
    border-radius: 10px;
    overflow: hidden;
}

.zb-score-head,
.zb-score-row {
    display: grid;
    grid-template-columns: 88px 1fr 1fr 1.2fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
}

.zb-score-head {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
}

.zb-score-row + .zb-score-row,
.zb-score-head + .zb-score-row {
    border-top: 1px solid #eef2f7;
}

.zb-score-name {
    font-size: 13px;
    color: #334155;
}

.zb-score-input {
    width: 100%;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #1f2937;
}

.zb-score-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.zb-setting-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.zb-setting-text {
    flex: 1 1 auto;
    min-width: 0;
}

.zb-setting-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.zb-setting-desc {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.55;
}

.zb-switch {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    width: 48px;
    height: 26px;
    padding: 3px;
    border: 0;
    border-radius: 999px;
    background: #e5e7eb;
    cursor: pointer;
    transition: background .16s ease;
}

.zb-switch-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
    transition: transform .16s ease;
}

.zb-switch.on {
    background: #2563eb;
}

.zb-switch.on .zb-switch-dot {
    transform: translateX(22px);
}

.zb-switch:disabled {
    opacity: .6;
    cursor: default;
}

/* 卡片说明的第二条：已允许教师本人签到 */
.zb-card-note.zb-note-self {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #1d4ed8;
}

/* 卡片说明的第三条：签到仅限当天，过期补卡需级部主任审批 */
.zb-card-note.zb-note-expire {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #9ca3af;
}

/* 审批按钮上的待办数字 */
.zb-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

/* ===== 补卡审批面板 ===== */

.zb-approve-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #e5e7eb;
}

.zb-approve-item:last-child {
    border-bottom: 0;
}

.zb-approve-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: #111827;
    line-height: 1.6;
}

.zb-approve-sub {
    margin-top: 2px;
    font-size: 12px;
    color: #9ca3af;
}

.zb-approve-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
}

/* ===== 窄屏 ===== */

@media (max-width: 560px) {
    .zb-cards {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .zb-table-wrap {
        margin: 10px 8px;
    }

    .zb-toolbar {
        margin: 10px 8px 0;
        padding: 8px 10px;
    }

    /* 窄屏：常态提示隐藏（省空间），调班提示保留 */
    .zb-toolbar:not(.swapping) .zb-toolbar-tip {
        display: none;
    }

    .zb-toolbar-actions {
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    .zb-btn {
        padding: 8px 11px;
        font-size: 13px;
    }

    .zb-modal {
        width: 100%;
    }
}
