/* ============================================================
   校园后勤管理系统 后台样式
   对标参考站 k12.qingzhou.link 配色方案
   ============================================================ */

:root {
    --primary: #4277f1;
    --primary-dark: #336ae8;
    --primary-darker: #1c3ca6;
    --primary-soft: #f5f8ff;
    --primary-soft2: #eff4ff;
    --primary-hover: #336ae8;
    --sidebar-bg: #4277f1;
    --sidebar-bg2: #336ae8;
    --sidebar-text: rgba(255,255,255,.75);
    --sidebar-active-bg: #ffffff;
    --sidebar-active-text: #4277f1;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #2c3e50;
    --text-2: #606266;
    --muted: #909399;
    --border: #eaeaea;
    --border-strong: #dcdfe6;
    --success: #10b981;
    --success-soft: #e6f7f1;
    --warning: #ed6a0c;
    --warning-soft: #fdf2e0;
    --danger: #ea0000;
    --danger-soft: #fdecec;
    --info: #909399;
    --info-soft: #f4f4f5;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 2px 8px rgba(0,0,0,.06);
    --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* SVG 图标默认尺寸（菜单/卡片等位置已单独覆盖） */
svg.ico { width: 16px; height: 16px; vertical-align: -2px; flex-shrink: 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background-color: #fff; }
::-webkit-scrollbar-thumb { background-color: #eaeaea; border-radius: 10px; cursor: pointer; }
::-webkit-scrollbar-thumb:hover { background-color: #eaeaea; }

/* ---------------- 布局骨架 ---------------- */

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 180px;
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.brand-mark {
    width: 36px; height: 36px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.15);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { color: #fff; font-size: 15px; letter-spacing: .5px; white-space: nowrap; }
.brand-text span { font-size: 11px; color: rgba(255,255,255,.6); white-space: nowrap; }

.menu { flex: 1; padding: 4px 0; }

/* 可折叠菜单分组 */
.menu-group-wrap { margin-bottom: 2px; }
.menu-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2px 10px;
    padding: 12px 12px 6px;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    color: #fff;
    transition: color .15s;
}
.menu-group-header:hover { color: rgba(255,255,255,.85); }
.menu-group-name { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.menu-group-icon {
    width: 24px; height: 24px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.menu-group-icon .ico { width: 14px; height: 14px; color: #fff; }
.menu-group-label { white-space: nowrap; }
.menu-arrow {
    width: 12px; height: 12px;
    transform: rotate(0deg);
    transition: transform .2s ease;
    opacity: .6;
    flex-shrink: 0;
}
.menu-group-wrap.expanded .menu-arrow { transform: rotate(90deg); }
.menu-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height .25s ease;
}
.menu-group-wrap.expanded .menu-group-body { max-height: 600px; }
.menu-group-wrap.expanded .menu-group-header { padding-bottom: 6px; }
.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 10px;
    padding: 0 20px;
    height: 46px;
    border-radius: 7px;
    color: #fff;
    font-size: 14px;
    transition: background .15s, color .15s;
}
.menu-item .ico { width: 18px; height: 18px; flex-shrink: 0; }
.menu-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.menu-item.active {
    background: #fff;
    color: var(--primary);
    font-weight: 600;
}
.sidebar-foot { padding: 8px 0; border-top: 1px solid rgba(255,255,255,.12); margin-top: 4px; }
.menu-item.logout { color: rgba(255,255,255,.9); }
.menu-item.logout:hover { background: rgba(234,0,0,.25); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    height: 60px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-logo {
    width: 34px; height: 34px;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.topbar-logo svg { width: 20px; height: 20px; }
.school-name { font-size: 16px; font-weight: 600; color: var(--text); white-space: nowrap; }
.topbar-line { width: 1px; height: 18px; background: var(--border-strong); flex-shrink: 0; }
.platform-name { font-size: 15px; font-weight: 700; color: var(--text); white-space: nowrap; }
.version-tag {
    background: #fdf6ec;
    color: #e6a23c;
    border: 1px solid #f5dab1;
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-search {
    position: relative;
    width: 360px;
    max-width: 30vw;
}
.topbar-search .ts-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    width: 15px; height: 15px;
    color: var(--muted);
    pointer-events: none;
}
.topbar-search .ts-input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    color: var(--text);
    background: var(--bg);
    transition: border .15s;
}
.topbar-search .ts-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.topbar-icon-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-2);
    flex-shrink: 0;
}
.topbar-icon-btn svg { width: 19px; height: 19px; }
.topbar-icon-btn:hover { background: var(--primary-soft); color: var(--primary); }

.role-badge {
    background: var(--primary-soft2);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 15px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.3; }
.user-meta strong { font-size: 13.5px; }
.user-meta span { font-size: 11.5px; color: var(--muted); }

.content { padding: 20px 24px 40px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0 26px; }

/* ---------------- 卡片 / 表格 ---------------- */

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 18px 20px;
    margin-bottom: 16px;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.card-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title::before {
    content: "";
    width: 4px; height: 16px;
    border-radius: 2px;
    background: var(--primary);
    display: inline-block;
}

.table-wrap { overflow-x: auto; }
table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.data th {
    text-align: left;
    padding: 10px 12px;
    background: #f5f7fa;
    color: var(--text-2);
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
table.data td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--primary-soft); }
table.data .num { font-variant-numeric: tabular-nums; }
.td-strong { font-weight: 600; color: var(--text); }
.td-sub { font-size: 12px; color: var(--muted); }
.empty-row td { text-align: center; color: var(--muted); padding: 36px 0 !important; }

/* ---------------- 状态标签 ---------------- */

.pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.pill-indigo { background: var(--primary-soft2); color: var(--primary); }
.pill-green  { background: var(--success-soft); color: var(--success); }
.pill-amber  { background: var(--warning-soft); color: var(--warning); }
.pill-red    { background: var(--danger-soft); color: var(--danger); }
.pill-blue   { background: var(--info-soft); color: var(--info); }
.pill-orange { background: #fff3e6; color: #ea7a0c; }
.pill-gray   { background: #f4f4f5; color: var(--muted); }

/* ---------------- 按钮 / 表单 ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    background: #fff;
    color: var(--text);
    line-height: 1.4;
}
.btn:hover { border-color: var(--border-strong); }
.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-primary:active { background: var(--primary-darker) !important; }
.btn-success { background: var(--success); color: #fff; border-color: transparent; }
.btn-success:hover { background: #0ea271; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { background: #c00; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-link {
    background: none; border: none; color: var(--primary);
    padding: 2px 6px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.btn-link:hover { color: var(--primary-dark); }
.btn-link.danger { color: var(--danger); }
.btn-link.gray { color: var(--muted); }

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    background: var(--primary-soft);
    padding: 10px 14px;
    border-radius: var(--radius);
}
.filter-bar form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.form-row { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 4px; }
.form-group { margin-bottom: 16px; flex: 1; min-width: 220px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
}
.form-group label .req { color: var(--danger); margin-left: 2px; }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border .15s;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
}
.form-control:hover {
    border-color: var(--primary);
}
textarea.form-control { min-height: 96px; resize: vertical; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }

.alert {
    position: relative;
    padding: 12px 44px 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
}
.alert-success { background: var(--success-soft); color: #0c8a66; border: 1px solid #bfead9; }
.alert-error   { background: var(--danger-soft); color: var(--danger); border: 1px solid #f5c6c6; }
.alert-info    { background: var(--info-soft); color: #0284c7; border: 1px solid #bfe3f7; }

/* 提示正文：多行明细（如批量导入错误）逐行显示、自动换行 */
.alert-msg { display: block; line-height: 1.8; white-space: normal; word-break: break-all; }
.alert-sticky { font-weight: 500; }
.alert-sticky.alert-error { max-height: 320px; overflow-y: auto; }

/* 手动关闭按钮 */
.alert-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: .55;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.alert-close:hover { opacity: 1; background: rgba(0,0,0,.07); }

/* ---------------- 统计卡片 ---------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform .15s, box-shadow .15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.indigo { background: var(--primary-soft2); color: var(--primary); }
.stat-icon.green  { background: var(--success-soft); color: var(--success); }
.stat-icon.amber  { background: var(--warning-soft); color: var(--warning); }
.stat-icon.red    { background: var(--danger-soft); color: var(--danger); }
.stat-icon.blue   { background: var(--info-soft); color: var(--info); }
.stat-info { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.stat-num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-label { font-size: 13px; color: var(--muted); }

/* ---------------- 首页（对标 k12 首页） ---------------- */

.home-grid { display: flex; align-items: flex-start; }
.home-left { flex: 1; min-width: 0; padding: 0 15px 10px 0; }
.home-right { width: 320px; flex-shrink: 0; padding: 7px 0 10px; }

/* 顶部统计条 */
.stat-strip {
    background: #fff;
    border-radius: var(--radius);
    min-height: 124px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    flex-wrap: wrap;
    padding: 10px 20px;
    margin-bottom: 10px;
}
.stat-strip .strip-item {
    text-align: center;
    padding: 10px 20px;
}
.stat-strip .strip-label {
    color: #696969;
    font-size: 14px;
    font-weight: 700;
}
.stat-strip .strip-num {
    margin-top: 14px;
    color: #000;
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}
.stat-strip .strip-num small { font-size: 14px; font-weight: 400; margin-left: 2px; }
.stat-strip .strip-num.indigo { color: var(--primary); }
.stat-strip .strip-num.green { color: var(--success); }
.stat-strip .strip-num.amber { color: var(--warning); }
.stat-strip .strip-num.red { color: var(--danger); }

/* 首页数据面板 */
.hpanel {
    background: #fff;
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 14px 16px 16px;
}
.hpanel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.hpanel-title .t-name { font-size: 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.hpanel-title .t-name::before {
    content: "";
    width: 4px; height: 16px;
    border-radius: 2px;
    background: var(--primary);
}
.hpanel-title .t-more { font-size: 13px; color: var(--primary); cursor: pointer; }
.hpanel-title .t-more:hover { color: var(--primary-dark); }
.hpanel-unit { color: #999; font-size: 10px; }

/* 快捷入口/常用应用 */
.app-row { display: flex; flex-wrap: wrap; gap: 8px; }
.app-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-2);
    transition: background .15s, color .15s;
}
.app-chip:hover { background: var(--primary-soft); color: var(--primary); }
.app-chip .ico { width: 16px; height: 16px; }

/* 概览小统计（今日请假X人 一行） */
.mini-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 6px 2px 12px;
}
.mini-stat .ms-num { font-size: 22px; font-weight: 700; color: var(--text); }
.mini-stat .ms-num.indigo { color: var(--primary); }
.mini-stat .ms-num.green { color: var(--success); }
.mini-stat .ms-num.amber { color: var(--warning); }
.mini-stat .ms-num.red { color: var(--danger); }
.mini-stat .ms-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 首页 tab（对标 el-tabs） */
.htabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.htab {
    padding: 8px 16px;
    font-size: 14px;
    color: #909399;
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 700;
    position: relative;
    bottom: -1px;
    border-bottom: 2px solid transparent;
}
.htab:hover { color: var(--primary); }
.htab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* 右侧待办列表 */
.todo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    font-size: 13.5px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { color: var(--primary); background: var(--primary-soft); border-radius: var(--radius-sm); }

/* 右侧个人卡片 */
.right-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
}
.right-card .rc-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.personal { display: flex; align-items: center; gap: 12px; }
.personal .p-avatar {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5e8cf7, #4277f1);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
    flex-shrink: 0;
}
.personal .p-name { font-size: 16px; font-weight: 700; }
.personal .p-role { font-size: 12px; color: var(--primary); margin-top: 2px; }
.personal-kv { margin-top: 12px; font-size: 13px; color: var(--text-2); line-height: 2; border-top: 1px solid var(--border); padding-top: 10px; }
.personal-kv b { color: var(--text); font-weight: 600; margin-left: 8px; }

/* 通知公告 */
.notice-item { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); }
.notice-item:last-child { border-bottom: none; }
.notice-item .n-title {
    font-size: 14px; color: var(--text); font-weight: 500;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notice-item .n-title:hover { color: var(--primary); }
.notice-item .n-meta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; align-items: center; }
.notice-item .n-tag { background: var(--primary-soft2); color: var(--primary); padding: 0 8px; border-radius: var(--radius-sm); font-size: 11px; }

/* 分段按钮（今日/近7天） */
.seg-group { display: inline-flex; border: 1px solid var(--primary); border-radius: var(--radius-sm); overflow: hidden; }
.seg-item {
    padding: 5px 14px;
    font-size: 12px;
    background: #fff;
    color: var(--primary);
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.seg-item + .seg-item { border-left: 1px solid var(--primary); }
.seg-item.active { background: var(--primary); color: #fff; }

/* 进度环/条列表（归寝/请假概况） */
.bar-stat { margin-bottom: 12px; }
.bar-stat .bs-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.bar-stat .bs-head .bs-val { font-weight: 700; color: var(--text); }

/* 页面内标题（内容区顶部，对标参考站子页面） */
.page-head { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 18px; font-weight: 700; color: var(--text); }
.page-head .page-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------------- 宿舍管理（对标 k12 宿舍管理） ---------------- */

/* 宿舍管理中心：左树 + 右内容 */
.dorm-center { display: flex; align-items: flex-start; gap: 16px; }
.dorm-aside {
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
}
.dorm-main { flex: 1; min-width: 0; }
.dorm-tree-search { margin-bottom: 12px; }
.dorm-tree-search .form-control { height: 34px; font-size: 13px; }
.dtree { font-size: 14px; }
.dtree-node { user-select: none; }
.dtree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
}
.dtree-row:hover { background: var(--primary-soft); }
.dtree-row.active { background: var(--primary-soft2); color: var(--primary); font-weight: 700; }
.dtree-row .dt-arrow {
    width: 14px; height: 14px;
    flex-shrink: 0;
    color: var(--muted);
    transition: transform .15s;
}
.dtree-node.open > .dtree-row .dt-arrow { transform: rotate(90deg); }
.dtree-row .dt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dtree-row .dt-count { font-size: 12px; color: var(--muted); font-weight: 400; }
.dtree-row.active .dt-count { color: var(--primary); }
.dtree-children { display: none; padding-left: 18px; }
.dtree-node.open > .dtree-children { display: block; }
.dtree-row.leaf .dt-arrow { visibility: hidden; }
.dtree-row.leaf { padding-left: 10px; font-weight: 400; }
.dtree-row.leaf .dt-name { font-weight: 400; font-size: 13.5px; }

/* 楼层汇总卡片（管理中心） */
.floor-summary {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    transition: box-shadow .15s, border-color .15s;
}
.floor-summary:hover { box-shadow: var(--shadow); border-color: var(--primary-soft2); }
.fs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fs-name { font-size: 16px; font-weight: 700; color: var(--text); }
.fs-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; background: var(--bg); border-radius: var(--radius-sm); padding: 12px 4px; margin-bottom: 12px; }
.fs-stat .v { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.3; }
.fs-stat .v.green { color: var(--success); }
.fs-stat .v.amber { color: var(--warning); }
.fs-stat .l { font-size: 12px; color: var(--muted); }
.fs-guard { font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.fs-guard .gname { color: var(--primary); font-weight: 600; margin-right: 8px; }

/* 面包屑 */
.crumb-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 13px;
}
.crumb-bar .crumb-now { color: var(--text); font-weight: 600; }
.crumb-bar .crumb-sub { color: var(--muted); }

/* 楼栋卡片网格 */
.dorm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.dorm-building-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: box-shadow .15s, border-color .15s;
}
.dorm-building-card:hover { box-shadow: var(--shadow); border-color: var(--primary-soft2); }
.dbc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dbc-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius);
    background: var(--primary-soft2);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.dbc-icon svg { width: 22px; height: 22px; }
.dbc-name { font-size: 16px; font-weight: 700; color: var(--text); }
.dbc-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    text-align: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 10px 4px;
    margin-bottom: 14px;
}
.dbc-stat .v { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.3; }
.dbc-stat .l { font-size: 11px; color: var(--muted); }
.dbc-foot { display: flex; gap: 8px; align-items: center; }
.dbc-foot .btn-link { font-size: 13px; }

/* 楼层条网格 */
.floor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.floor-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: block;
    transition: box-shadow .15s, border-color .15s;
}
.floor-card:hover { box-shadow: var(--shadow); border-color: var(--primary-soft2); }
.floor-card .fc-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.floor-card .fc-sub { font-size: 12px; color: var(--muted); line-height: 1.8; }

/* 房间卡片网格 */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
}
.room-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.room-card:hover { box-shadow: var(--shadow); }
.room-card.full { border-color: #f3c3c3; }
.rc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 8px;
}
.rc-no { font-size: 17px; font-weight: 700; color: var(--text); }
.rc-count { font-size: 13px; color: var(--muted); }
.rc-count b { font-size: 16px; }
.rc-count b.green { color: var(--success); }
.rc-count b.red { color: var(--danger); }
.rc-bar { height: 4px; background: var(--border); margin: 0 14px; border-radius: 999px; overflow: hidden; }
.rc-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.rc-bar i.full { background: var(--danger); }
.rc-residents {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px 14px;
    min-height: 38px;
}
.rc-residents .pill { font-size: 12px; padding: 2px 8px; }
.rc-empty { color: var(--muted); font-size: 12px; padding: 10px 14px; }
.rc-ops {
    display: flex;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.rc-ops a, .rc-ops button {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--primary);
}
.rc-ops a + a, .rc-ops a + button, .rc-ops button + a { border-left: 1px solid var(--border); }
.rc-ops .danger { color: var(--danger); }
.rc-ops a:hover, .rc-ops button:hover { background: var(--primary-soft); }

/* 房间详情 - 床位视图 */
.room-info-bar {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.room-info-bar .rib-no { font-size: 22px; font-weight: 800; color: var(--text); }
.room-info-bar .rib-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.room-info-bar .rib-stat { font-size: 14px; color: var(--text-2); }
.room-info-bar .rib-stat b { font-size: 20px; color: var(--primary); }
.room-info-bar .rib-ops { margin-left: auto; display: flex; gap: 8px; }
.room-info-bar .rib-bar { width: 100%; height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; }
.room-info-bar .rib-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

.bed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 12px;
}
.bed-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    position: relative;
}
.bed-card .bed-tag {
    position: absolute;
    top: 12px; right: 12px;
    font-size: 11px;
    color: var(--muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.bed-card.empty {
    border-style: dashed;
    background: var(--bg);
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--muted);
}
.bed-card.empty svg { width: 30px; height: 30px; opacity: .4; }
.bed-card.empty .bed-tag { background: #fff; }
.bed-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; padding-right: 40px; }
.bed-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5e8cf7, #4277f1);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 700;
    flex-shrink: 0;
}
.bed-avatar.girl { background: linear-gradient(135deg, #fb7ba2, #f43f5e); }
.bed-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.3; }
.bed-no { font-size: 12px; color: var(--muted); }
.bed-info { font-size: 13px; color: var(--text-2); line-height: 1.9; }
.bed-info .bi-label { color: var(--muted); display: inline-block; min-width: 52px; }
.bed-parent {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px dashed var(--border);
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.8;
}
.bed-parent .bp-rel { color: var(--primary); font-weight: 600; margin-right: 4px; }
.bed-card.temp-out { background: #fffaf2; border-color: #f5dab1; }
.bed-card.temp-out .bed-avatar { filter: grayscale(.4); opacity: .8; }
.bed-ops {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.bed-ops .btn { flex: 1; justify-content: center; padding: 6px 8px; font-size: 12.5px; min-width: 70px; }
.bed-card.empty .btn { flex: none; }

/* ---------------- 年级班级管理（左树右卡） ---------------- */
.cg-layout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
/* 左栏树 */
.cg-sidebar {
    width: 280px;
    flex: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}
.cg-side-tools {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cg-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
}
.cg-search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.cg-search input { border: none; background: none; outline: none; flex: 1; font-size: 13px; font-family: inherit; min-width: 0; }
.cg-add-grade { width: 100%; text-align: center; }
.cg-tree {
    overflow-y: auto;
    padding: 8px;
    flex: 1;
}
.cg-tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13.5px;
    color: var(--text-2);
    position: relative;
}
.cg-tree-row:hover { background: var(--primary-soft); }
.cg-tree-row.active { background: var(--primary-soft2); color: var(--primary); font-weight: 700; }
.cg-arrow {
    width: 14px; flex: none; font-size: 10px; color: var(--muted);
    transition: transform .15s; display: inline-block; text-align: center;
}
.cg-node-group.expanded > .cg-grade-row .cg-arrow { transform: rotate(90deg); }
.cg-node-icon { flex: none; font-size: 14px; }
.cg-node-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.cg-node-name { color: inherit; }
.cg-node-count {
    flex: none; font-size: 12px; color: var(--muted);
    background: var(--bg); border-radius: 10px; padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.cg-tree-row.active .cg-node-count { background: #fff; color: var(--primary); font-weight: 700; }
.cg-children { display: none; padding-left: 26px; }
.cg-node-group.expanded .cg-children { display: block; }
.cg-child-empty { font-size: 12px; color: var(--muted); padding: 6px 8px; }
.cg-class-row { padding: 6px 8px; font-size: 13px; }
.cg-row-ops {
    display: none; gap: 4px; flex: none;
}
.cg-grade-row:hover .cg-row-ops, .cg-grade-row.active .cg-row-ops,
.cg-class-row:hover .cg-row-ops { display: flex; }
.cg-class-row .cg-row-ops { margin-left: 2px; }
.cg-op {
    width: 22px; height: 22px; line-height: 20px; text-align: center;
    border: 1px solid var(--border); border-radius: 5px; background: #fff;
    color: var(--text-2); font-size: 12px; font-weight: 700;
}
.cg-op:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.cg-tree-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0; }
/* 右栏 */
.cg-main { flex: 1; min-width: 0; }
.cg-view-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 14px;
}
.cg-view-title { font-size: 17px; font-weight: 800; color: var(--text); }
.cg-view-sub { font-size: 13px; color: var(--muted); }
.cg-view-sub b { color: var(--primary); font-size: 14px; }
.cg-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}
.cg-stat-card {
    background: #fff;
    border: 1px solid #ebeef5;
    border-top: 3px solid var(--success);
    border-radius: 6px;
    padding: 14px 16px 12px;
}
.cg-class-card { border-top-color: var(--primary); }
.cg-class-card.cg-card-off { opacity: .75; }
.cg-grade-card { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.cg-grade-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.cg-card-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.cg-card-title a { color: inherit; }
.cg-kv {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; line-height: 1.9;
}
.cg-k { color: var(--muted); }
.cg-v { color: var(--text-2); }
.cg-v.strong { font-size: 15px; font-weight: 800; color: var(--text); }
.cg-card-ops {
    display: flex; gap: 8px; margin-top: 10px; padding-top: 10px;
    border-top: 1px dashed var(--border); align-items: center;
}
.cg-card-ops form { display: inline; }
.btn-danger-text {
    background: none; border: none; color: var(--danger); cursor: pointer;
    font-size: 13px; padding: 5px 10px; font-family: inherit; border-radius: var(--radius-sm);
}
.btn-danger-text:hover { background: var(--danger-soft); }
.cg-empty-card {
    grid-column: 1 / -1; text-align: center; color: var(--muted);
    background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--radius);
    padding: 44px 20px; font-size: 13.5px;
}
@media (max-width: 900px) {
    .cg-layout { flex-direction: column; }
    .cg-sidebar { width: 100%; position: static; max-height: 320px; }
}

/* ---------------- 班级详情 ---------------- */
.cd-crumb { margin-bottom: 12px; }
.cd-banner {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    gap: 20px;
    margin-bottom: 14px;
}
.cd-album {
    width: 190px; flex: none;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #e8f1ff 0%, #f5f8ff 100%);
    position: relative;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
}
.cd-album-icon { font-size: 52px; opacity: .8; }
.cd-album-tag {
    position: absolute; top: -8px; left: -6px;
    background: var(--primary); color: #fff;
    font-size: 11px; padding: 3px 10px; border-radius: var(--radius-sm);
    font-weight: 600;
}
.cd-banner-info { flex: 1; min-width: 0; }
.cd-title { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-pencil { color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: none; padding: 2px 4px; }
.cd-pencil:hover { color: var(--primary); }
.cd-line { font-size: 13.5px; line-height: 2; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.cd-k { color: var(--muted); flex: none; }
.cd-v { color: var(--text); }
.cd-empty-v { color: var(--muted); font-weight: 400; }
.cd-stat-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.cd-chip {
    background: var(--bg); border-radius: 20px; padding: 4px 14px;
    font-size: 13px; color: var(--text-2);
}
.cd-chip b { color: var(--text); font-size: 14px; }
.cd-chip.boy b { color: var(--info); }
.cd-chip.girl b { color: #e6588f; }
.cd-banner-btns { display: flex; gap: 8px; }
.cd-section { margin-bottom: 14px; }
.cd-sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.cd-empty-inline { color: var(--muted); font-size: 13px; padding: 14px 4px; }
/* 教师卡片 */
.cd-t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cd-t-card {
    display: flex; align-items: center; gap: 12px;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 14px;
}
.cd-avatar {
    width: 46px; height: 46px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 18px;
}
.avatar-head { background: linear-gradient(135deg, #f59e0b, #ea7a0c); }
.avatar-boy { background: linear-gradient(135deg, #4277f1, #336ae8); }
.avatar-girl { background: linear-gradient(135deg, #f0719f, #e6588f); }
.cd-t-name { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 6px; }
.cd-t-phone { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.cd-bzr {
    background: rgba(237, 106, 12, .15); color: #ed6a0c;
    font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px;
}
/* 工具条 */
.cd-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cd-search {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 12px; min-width: 240px; flex: 1; max-width: 320px;
}
.cd-search svg { width: 15px; height: 15px; color: var(--muted); }
.cd-search input { border: none; outline: none; background: none; flex: 1; font-size: 13px; font-family: inherit; min-width: 0; }
/* 学生卡片网格 */
.cd-s-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.cd-s-card {
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    transition: border-color .15s, box-shadow .15s;
}
.cd-s-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.cd-s-check {
    position: absolute; top: 8px; right: 8px;
    width: 15px; height: 15px; cursor: pointer;
}
.cd-s-link { display: flex; align-items: center; gap: 10px; color: inherit; }
.cd-s-link .cd-avatar { width: 40px; height: 40px; font-size: 16px; }
.cd-s-name { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 5px; }
.cd-s-no { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cd-cadre {
    background: rgba(237, 106, 12, .15); color: #ed6a0c;
    font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px; flex: none;
}
.cd-batch-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.cd-checkall { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cd-checkall input { width: 15px; height: 15px; }
.cd-class-tree-item.cg-tree-row { cursor: pointer; }
@media (max-width: 700px) {
    .cd-banner { flex-direction: column; }
    .cd-album { width: 100%; aspect-ratio: 16 / 9; }
}

/* ---------------- 视频监控中心 ---------------- */
.cam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
}
/* 分类分组 */
.cam-cat-section { margin-bottom: 22px; }
.cam-cat-section:last-child { margin-bottom: 0; }
.cam-cat-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 2px;
}
.cam-cat-bar {
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: var(--primary);
    flex: none;
}
.cam-cat-name { font-size: 15px; font-weight: 700; color: var(--text); }
.cam-cat-count { font-size: 12.5px; color: var(--muted); }
.cam-cat-manage { margin-left: auto; font-size: 12.5px; }
/* 置顶角标 */
.cam-top-tag {
    position: absolute;
    top: 10px; right: 10px;
    background: rgba(245, 158, 11, .95);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.cam-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.cam-card:hover { box-shadow: var(--shadow); }
.cam-card.offline { opacity: .85; }
.cam-screen {
    position: relative;
    background: #0f1420;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cam-screen img, .cam-screen video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.cam-screen .cam-no-signal {
    text-align: center;
    color: #5b6478;
}
.cam-screen .cam-no-signal svg { width: 44px; height: 44px; opacity: .5; margin-bottom: 8px; }
.cam-screen .cam-no-signal .cs-txt { font-size: 13px; }
.cam-live {
    position: absolute;
    top: 10px; left: 10px;
    background: rgba(234,0,0,.9);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 5px;
}
.cam-live::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: cam-blink 1.2s infinite;
}
@keyframes cam-blink { 0%,100%{opacity:1} 50%{opacity:.3} }
.cam-offline-tag {
    position: absolute;
    top: 10px; left: 10px;
    background: rgba(90,96,110,.9);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}
.cam-info { padding: 12px 14px; }
.cam-name { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.cam-meta { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.cam-meta .cam-loc { color: var(--text-2); }
.cam-ops { display: flex; border-top: 1px solid var(--border); background: var(--bg); }
.cam-ops a, .cam-ops button {
    flex: 1;
    text-align: center;
    padding: 9px 0;
    font-size: 13px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--primary);
    text-decoration: none;
}
.cam-ops a + a, .cam-ops a + button, .cam-ops button + a { border-left: 1px solid var(--border); }
.cam-ops .danger { color: var(--danger); }
.cam-ops a:hover, .cam-ops button:hover { background: var(--primary-soft); }

/* ---------------- 分页 ---------------- */

.pagination { display: flex; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination .current {
    min-width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    font-size: 13px;
    background: #fff;
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.pagination .info { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------------- 登录页 ---------------- */

.login-body {
    background: linear-gradient(135deg, #336ae8 0%, #4277f1 50%, #1c3ca6 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.login-body::before, .login-body::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}
.login-body::before { width: 480px; height: 480px; top: -180px; right: -120px; }
.login-body::after  { width: 360px; height: 360px; bottom: -140px; left: -100px; }

.login-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 18px;
    padding: 38px 36px 30px;
    box-shadow: 0 24px 60px rgba(10, 10, 40, .35);
    position: relative;
    z-index: 2;
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .logo {
    width: 58px; height: 58px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, #6366f1, #4338ca);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(79,70,229,.4);
}
.login-brand .logo svg { width: 30px; height: 30px; }
.login-brand h1 { font-size: 20px; color: var(--text); letter-spacing: 1px; }
.login-brand p { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-card .form-group { margin-bottom: 16px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 11px; font-size: 15px; margin-top: 4px; }
.login-tip {
    margin-top: 20px;
    background: #f8f9fe;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.8;
}

/* ---------------- 选项卡 / 小部件 ---------------- */

.tabs { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs a {
    padding: 9px 18px;
    font-size: 14px;
    color: #909399;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-weight: 700;
    transition: color .15s;
}
.tabs a:hover { color: var(--primary); }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); }

.kv-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; }
.kv-item { display: flex; flex-direction: column; }
.kv-item .k { font-size: 12px; color: var(--muted); }
.kv-item .v { font-size: 14px; font-weight: 600; }

.detail-section { margin-bottom: 22px; }
.detail-section h4 {
    font-size: 13px; color: var(--primary);
    margin-bottom: 10px; padding-left: 10px;
    border-left: 3px solid var(--primary);
}

.reply-box { border-left: 3px solid var(--primary-soft2); padding: 10px 14px; margin-bottom: 12px; background: var(--primary-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.reply-box .meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ---------------- 维修工单（派单 + 移动端） ---------------- */
.assign-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--primary-soft);
    border: 1px dashed var(--primary);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 16px;
}
.assign-label { font-weight: 700; font-size: 14px; color: var(--text); }
.assign-tip { font-size: 12.5px; color: var(--warning); }
.assign-tip-bar {
    background: #fff7ed;
    color: #b45309;
    font-size: 13px;
    padding: 9px 16px;
    border-bottom: 1px solid #fde7c3;
}
/* 维修人员移动端统计条 */
.repair-stat-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.rss-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 6px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.rss-item.on { border-color: var(--primary); background: var(--primary-soft); }
.rss-num { font-size: 26px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; line-height: 1.1; }
.rss-num.amber { color: var(--warning); }
.rss-num.blue { color: var(--info); }
.rss-num.green { color: var(--success); }
.rss-label { font-size: 12.5px; color: var(--text-2); }
/* 工单卡片（移动端友好） */
.repair-card {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 12px;
}
.repair-card.st-2 { border-left-color: var(--info); }
.repair-card.st-3 { border-left-color: var(--success); opacity: .85; }
.rc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.rc-title { font-size: 15.5px; font-weight: 700; color: var(--text); flex: 1; }
.rc-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.rc-desc {
    font-size: 13.5px; color: var(--text-2); line-height: 1.7;
    background: var(--bg); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
}
.rc-contact { font-size: 13.5px; color: var(--text-2); margin-bottom: 12px; }
.rc-call { color: var(--primary); font-weight: 600; margin-left: 6px; }
.rc-actions { display: flex; gap: 10px; align-items: stretch; }
.rc-actions .btn { min-height: 42px; }
@media (max-width: 600px) {
    .repair-stat-strip { gap: 8px; }
    .rss-num { font-size: 22px; }
    .rc-actions { flex-direction: column; }
}

.visit-code {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 6px;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    text-align: center;
    padding: 14px;
    background: var(--primary-soft);
    border: 1.5px dashed var(--primary);
    border-radius: var(--radius);
    margin: 10px 0;
}

.attend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.attend-cell {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #fff;
}
.attend-cell .name { font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.attend-cell .room { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.attend-cell .ops { display: flex; gap: 6px; }
.attend-cell .ops button {
    flex: 1;
    padding: 5px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-2);
}
.attend-cell .ops button.s-in  { background: var(--success-soft); border-color: #bfead9; color: var(--success); font-weight: 600; }
.attend-cell .ops button.s-out { background: var(--danger-soft); border-color: #f5c6c6; color: var(--danger); font-weight: 600; }
.attend-cell.state-in  { border-color: #bfead9; background: #f4fbf8; }
.attend-cell.state-out { border-color: #f5c6c6; background: #fef7f7; }
.attend-cell.state-leave { border-color: #c7d3f5; background: #f6f8ff; }

.checkbox-row { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.checkbox-row input { width: 15px; height: 15px; accent-color: var(--primary); }

.score-pos { color: var(--success); font-weight: 700; }
.score-neg { color: var(--danger); font-weight: 700; }

/* ---------------- 侧抽屉 ---------------- */

.drawer-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, .3);
    opacity: 0; z-index: 1000;
    transition: opacity .28s;
    pointer-events: none;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 640px; max-width: 92vw;
    background: var(--card);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
    display: flex; flex-direction: column;
    box-shadow: -4px 0 16px rgba(0,0,0,.08);
}
.drawer-panel.open { transform: translateX(0); }

.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--card);
}
.drawer-title { font-size: 16px; font-weight: 700; color: var(--text); }
.drawer-close {
    width: 30px; height: 30px;
    border: none; background: none;
    border-radius: var(--radius); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text); font-size: 20px; line-height: 1;
}
.drawer-close:hover { background: var(--bg); }

.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-body .card { box-shadow: none; border: 1px solid var(--border); }
.drawer-body .form-actions { margin-top: 4px; }

.drawer-loading {
    display: flex; align-items: center; justify-content: center;
    padding: 50px; color: var(--muted); font-size: 14px;
}

/* 抽屉内表单紧凑 */
.drawer-body .form-row { flex-wrap: wrap; }
    .drawer-body .form-group { min-width: 200px; }
    .drawer-body table.data th, .drawer-body table.data td { padding: 8px 10px; font-size: 13px; }
    .drawer-body table.data td.td-nowrap { white-space: nowrap; }

/* 页面顶部"新增"按钮 */
.page-add-btn { margin-left: auto; }

/* ---------------- 进度条 ---------------- */

.progress-bar-wrap { margin-top: 4px; }
.progress-bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .5s ease;
    min-width: 2px;
}
.progress-bar-label {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 8px; font-size: 13px;
}
.progress-bar-label .td-sub { font-size: 12px; }

/* ---------------- Tab 选项卡（分段轨道式） ---------------- */

.tab-bar {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    padding: 4px;
    background: #eef2f8;
    border-radius: 999px;
    -webkit-overflow-scrolling: touch;
}
.tab-item {
    padding: 7px 18px;
    font-size: 14px;
    color: var(--text-2);
    cursor: pointer;
    border: none;
    background: none;
    border-radius: 999px;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
    font-weight: 600;
}
.tab-item:hover { color: var(--primary); background: rgba(66,119,241,.08); }
.tab-item.active {
    color: var(--primary);
    font-weight: 700;
    background: #fff;
    box-shadow: 0 2px 8px rgba(66,119,241,.22);
}
.tab-item .pill { margin-left: 6px; font-size: 11px; }
/* 数据切片切换（考勤统计维度 / 监控分类） */
.tab {
    padding: 7px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
    text-decoration: none;
    background: transparent;
    border-radius: 999px;
    transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.tab:hover { color: var(--primary); background: rgba(66,119,241,.08); }
.tab.active {
    color: var(--primary);
    font-weight: 700;
    background: #fff;
    box-shadow: 0 2px 8px rgba(66,119,241,.22);
}
.tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tab-n {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #e3e9f5;
    color: var(--text-2);
    transition: inherit;
}
.tab.active .tab-n { background: var(--primary); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
@media (prefers-reduced-motion: reduce) {
    .tab, .tab-item, .tab-n { transition: none; }
}

/* ---------------- 搜索筛选栏补充 ---------------- */

.filter-bar .form-group { margin-bottom: 0; min-width: auto; }
.filter-bar .form-control { height: 36px; }
.filter-bar .filter-actions { margin-left: auto; }

/* ---------------- 树形展开 ---------------- */

.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border: none;
    background: var(--primary-soft2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--primary);
    font-size: 14px;
    transition: transform .2s ease, background .15s;
    flex-shrink: 0;
    margin-right: 4px;
}
.tree-toggle:hover { background: var(--primary-soft); }
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle.loading { opacity: .5; pointer-events: none; }

.tree-children {
    display: none;
    background: var(--bg);
    border-radius: 0 0 10px 10px;
    margin: 0 -12px -8px;
    padding: 0 12px;
}
.tree-children.open { display: block; }
.tree-children table.data th,
.tree-children table.data td { padding: 8px 12px; font-size: 13px; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
    .sidebar { width: 64px; }
    .brand-text, .menu-group-label, .menu-item span, .sidebar-foot .menu-item span, .menu-arrow { display: none; }
    .topbar-search, .school-name, .topbar-line, .platform-name, .version-tag { display: none; }
    .menu-group-header { justify-content: center; padding: 10px 4px; }
    .menu-group-body { max-height: 0 !important; overflow: hidden !important; }
    .menu-group-wrap.expanded .menu-group-body { max-height: 0 !important; }
    .menu-item { justify-content: center; padding: 10px; }
    .brand { justify-content: center; padding: 16px 8px; }
    .content { padding: 16px; }
    .user-meta { display: none; }
    .drawer-panel { width: 100vw; max-width: 100vw; }
    .tab-bar { overflow-x: auto; flex-wrap: nowrap; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-bar .filter-actions { margin-left: 0; }
    .dash-progress-row { grid-template-columns: 1fr !important; }
    .home-grid { flex-direction: column; }
    .home-left { padding-right: 0; }
    .home-right { width: 100%; }
    .dorm-center { flex-direction: column; }
    .dorm-aside { width: 100%; position: static; max-height: none; }
}

/* ---------------- 学生候选列表（分配住宿抽屉） ---------------- */
.pick-box {
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 8px;
}
.pick-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.pick-item:last-child { border-bottom: none; }
.pick-item:hover { background: var(--primary-soft); }
.pick-item.sel { background: var(--primary-soft); }
.pick-item.sel .pick-name { color: var(--primary); }
.pick-item.dis { opacity: .45; cursor: not-allowed; }
.pick-item.dis:hover { background: transparent; }
.pick-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: #e8f0fe; color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.pick-avatar.girl { background: #fde8f0; color: #db2777; }
.pick-main { flex: 1; min-width: 0; line-height: 1.4; }
.pick-name { font-weight: 600; color: var(--text-1, #303133); }
.pick-meta { color: var(--muted); font-size: 12px; }
.pick-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; flex-shrink: 0; }
.pick-tag.free { background: var(--success-soft); color: var(--success); }
.pick-tag.busy { background: var(--warning-soft); color: var(--warning); }
.pick-tag.here { background: var(--info-soft); color: var(--info); }
.pick-tag.no   { background: var(--danger-soft); color: var(--danger); }
.pick-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.pick-picked {
    margin-top: 12px; padding: 10px 12px;
    background: var(--primary-soft); border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-2);
}
.pick-picked b { color: var(--primary); }
.pick-divider {
    position: relative; text-align: center;
    color: var(--muted); font-size: 12px; margin: 16px 0 12px;
}
.pick-divider::before, .pick-divider::after {
    content: ''; position: absolute; top: 50%; width: 36%;
    height: 1px; background: var(--border);
}
.pick-divider::before { left: 0; }
.pick-divider::after { right: 0; }

/* ---------------- 考勤统计：范围切换 + 日历 ---------------- */
.range-tabs { display: inline-flex; gap: 6px; }
.range-tab {
    padding: 7px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-2);
    background: #fff;
    text-decoration: none;
    white-space: nowrap;
}
.range-tab:hover { color: var(--primary); border-color: var(--primary); }
.range-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}
.cal-week {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    padding: 6px 0;
}
.cal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 0;
    min-height: 58px;
    padding: 5px 1px 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    background: #fff;
    overflow: hidden;
    transition: box-shadow .15s, border-color .15s;
}
.cal-cell:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(66,119,241,.15); }
.cal-cell.empty { border: none; background: transparent; box-shadow: none; }
.cal-cell.future { background: var(--bg); opacity: .55; }
.cal-cell.in-range { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.cal-cell.today { background: var(--primary-soft); border-color: var(--primary); }
.cal-date { font-size: 13px; font-weight: 700; color: var(--text-1, #303133); line-height: 1.2; }
.cal-cell.today .cal-date { color: var(--primary); }
.cal-badge {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: 10px;
    line-height: 1.5;
    padding: 0 3px;
    border-radius: 8px;
    font-weight: 600;
}
.cal-badge.out { background: var(--danger-soft); color: var(--danger); }
.cal-badge.leave { background: var(--warning-soft); color: var(--warning); }
.cal-badge.unset { background: var(--info-soft); color: var(--muted); }

/* 宿舍统计两栏布局：左日历固定宽，右报表可收缩 */
.dorm-stats-grid > * { min-width: 0; }

@media (max-width: 1200px) {
    .dorm-stats-grid { grid-template-columns: 1fr !important; }
}
