/* ============ 直播间排班系统 · 样式 ============ */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --border: #e4e8f0;
  --border-strong: #d3d9e4;
  --text: #1e2733;
  --text-2: #5a6474;
  --muted: #8b95a5;
  --primary: #2f6bff;
  --primary-dark: #1f52d6;
  --primary-soft: #eef3ff;
  --success: #12a150;
  --success-soft: #e8f7ee;
  --warn: #e8930c;
  --warn-soft: #fdf4e3;
  --danger: #e03131;
  --danger-soft: #fdeeee;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 8px 40px rgba(16, 24, 40, .14);
  --sidebar-w: 208px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd6e2; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b6bfd0; background-clip: content-box; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 15% -10%, #e7efff 0%, transparent 60%),
              radial-gradient(900px 500px at 90% 110%, #e6f7f0 0%, transparent 55%), #f4f6fa;
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px; background: var(--panel); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 36px 34px 30px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-logo {
  width: 36px; height: 36px; border-radius: 9px; background: linear-gradient(135deg, #2f6bff, #5b8dff);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 17px;
}
.login-title { font-size: 19px; font-weight: 650; letter-spacing: .3px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px 46px; }
.login-card .field { margin-bottom: 14px; }
.login-btn { width: 100%; margin-top: 8px; height: 42px; font-size: 15px; }

/* 登录页：密码显示 / 隐藏 */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 42px; }
.pwd-toggle { position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; background: none; cursor: pointer; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0; }
.pwd-toggle:hover { color: var(--text); background: var(--panel-2); }
.pwd-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pwd-toggle svg { fill: currentColor; }
.pwd-toggle .eye-off { display: none; }
.pwd-toggle.on .eye-on { display: none; }
.pwd-toggle.on .eye-off { display: block; }

/* 登录页：仅钉钉登录时的说明 */
.login-dt-only { margin-top: 14px; }
.login-dt-only p { margin: 0 0 6px; font-size: 12.5px; line-height: 1.7; text-align: center; color: var(--muted); }
.login-dt-only a { color: var(--primary); text-decoration: none; }
.login-dt-only a:hover { text-decoration: underline; }
.login-dt-only .dt-loading { color: var(--text-2); font-size: 13px; }
.login-dt-only .dt-loading[hidden] { display: none; }
.login-dt-only .dt-loading:not([hidden])::after {
  content: ''; display: inline-block; width: 12px; height: 12px; margin-left: 7px;
  border: 2px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%;
  vertical-align: -2px; animation: dt-spin .8s linear infinite;
}
@keyframes dt-spin { to { transform: rotate(360deg); } }

/* 登录页：钉钉扫码登录入口 */
.login-dt { margin-top: 18px; }
.login-dt-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.login-dt-sep::before, .login-dt-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.login-dt-btn { width: 100%; height: 42px; font-size: 14.5px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; background: #fff; border: 1px solid var(--border-strong); color: var(--text); }
.login-dt-btn:hover { border-color: #1677ff; color: #1677ff; background: #f5f9ff; }
.login-dt-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: #101a2b; color: #c7d2e3;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30;
}
.sidebar-brand {
  height: var(--topbar-h); display: flex; align-items: center; gap: 9px; padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07); font-weight: 650; color: #fff; font-size: 15px;
}
.sidebar-logo {
  width: 28px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #2f6bff, #5b8dff);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 8px; }
.nav-group-title { font-size: 11px; color: #6b7a94; padding: 12px 10px 6px; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 8px;
  cursor: pointer; color: #c7d2e3; font-size: 13.5px; margin-bottom: 2px; user-select: none;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 500; }
.nav-item .ico { width: 17px; text-align: center; font-size: 15px; opacity: .9; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: 12px; color: #6b7a94; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); background: var(--panel); 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-title { font-size: 16px; font-weight: 620; }
.topbar-right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-2); }
.user-chip {
  display: flex; align-items: center; gap: 7px; background: var(--primary-soft); color: var(--primary-dark);
  padding: 5px 11px; border-radius: 20px; font-size: 13px; font-weight: 500;
}
.user-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.content { padding: 18px 20px 40px; flex: 1; min-width: 0; }

/* ---------- 通用组件 ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 620; }
.card-head .desc { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.card-body { padding: 16px; }
.card-body.tight { padding: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); font-size: 13.5px; cursor: pointer; white-space: nowrap;
  transition: all .15s; font-family: inherit;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
/* 主按钮禁用时改成灰色，避免蓝色按钮看起来还能点 */
.btn-primary:disabled, .btn-danger:disabled {
  background: var(--muted); border-color: var(--muted); color: #fff; opacity: .7;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: #fff; border-color: #f1b5b5; color: var(--danger); }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 38px; padding: 0 20px; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--panel-2); border-color: var(--border); }
.btn-link { border: none; background: none; color: var(--primary); padding: 0 4px; height: auto; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

.input, .select, textarea.input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--text); font-size: 13.5px; font-family: inherit; outline: none; transition: all .15s;
}
textarea.input { height: auto; padding: 7px 10px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.input:disabled, .select:disabled { background: #f4f5f8; color: var(--muted); }
.input.err { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(224, 49, 49, .1); }
select.select { appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%238b95a5' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center; }
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
.field .req { color: var(--danger); margin-right: 2px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.field-inline { display: flex; align-items: center; gap: 8px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* 表格 */
.table-wrap { overflow: auto; border-radius: 0 0 var(--radius) var(--radius); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.tbl th {
  background: var(--panel-2); color: var(--text-2); font-weight: 600; text-align: left;
  padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
table.tbl td { padding: 9px 12px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
table.tbl tbody tr:hover { background: #f8faff; }
table.tbl tbody tr.sel { background: var(--primary-soft); }
table.tbl td.nowrap, table.tbl th.nowrap { white-space: nowrap; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty .big { font-size: 34px; opacity: .35; display: block; margin-bottom: 8px; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 4px;
  font-size: 12px; background: #eef1f6; color: var(--text-2); white-space: nowrap;
}
.tag.blue { background: var(--primary-soft); color: var(--primary-dark); }
.tag.green { background: var(--success-soft); color: var(--success); }
.tag.orange { background: var(--warn-soft); color: var(--warn); }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.ghost { background: transparent; border: 1px solid var(--border-strong); }

/* 人员管理：角色按钮（点击切换；彩色＝该角色已激活） */
.role-btn {
  display: inline-block; min-width: 44px; text-align: center;
  padding: 3px 9px; margin-right: 5px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  font-size: 12px; color: var(--muted); background: var(--panel);
  cursor: pointer; user-select: none; transition: all .15s;
}
.role-btn:hover { border-color: var(--primary); color: var(--primary); }
.role-btn.anchor.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.role-btn.assistant.on { background: var(--success-soft); border-color: var(--success); color: var(--success); font-weight: 600; }
.role-btn.controller.on { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); font-weight: 600; }

/* 人员管理：工号重复 / 登录账号状态 */
.emp-dup { color: var(--danger); font-weight: 600; }
.emp-dup i { font-style: normal; font-size: 11px; background: var(--danger-soft); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.acc-ok { font-size: 12.5px; color: var(--text); }
.acc-warn { font-size: 12.5px; color: var(--warn); border-bottom: 1px dashed var(--warn); cursor: help; }
.dt-dot { display: inline-block; margin-left: 5px; font-size: 10px; line-height: 14px; padding: 0 4px;
  border-radius: 3px; background: var(--primary-soft); color: var(--primary-dark); vertical-align: 1px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.pager .info { font-size: 12.5px; color: var(--muted); }
.pager .pages { display: flex; align-items: center; gap: 4px; }
.pg-btn {
  min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--border-strong); background: #fff;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text);
}
.pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.pg-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg-btn:disabled { opacity: .45; cursor: not-allowed; }

/* 复选 */
.chk { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

/* Toast */
#toast-box { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1e2733; color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13.5px;
  box-shadow: var(--shadow-lg); animation: toast-in .22s ease; max-width: 80vw;
}
.toast.ok { background: #12a150; }
.toast.err { background: #e03131; }
.toast.warn { background: #e8930c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* Modal */
.mask { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column; animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 400px; }
.modal-head { padding: 15px 18px; border-bottom: 1px solid var(--border); font-size: 15px; font-weight: 620; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; background: none; border: none; }
.modal-close:hover { color: var(--text); }
.confirm-text { font-size: 14px; line-height: 1.7; }
.confirm-text .hl { color: var(--danger); font-weight: 600; }

/* 富选择器 */
.rs { position: relative; }
.rs-control {
  min-height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff;
  display: flex; align-items: center; gap: 5px; padding: 3px 26px 3px 7px; cursor: pointer; flex-wrap: wrap;
  position: relative; transition: all .15s;
}
.rs-control:focus-within, .rs.open .rs-control { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.rs-arrow { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 11px; pointer-events: none; }
.rs-ph { color: var(--muted); font-size: 13.5px; padding: 2px 0; }
.rs-chip {
  display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 4px; padding: 2px 6px; font-size: 12.5px; max-width: 100%;
}
.rs-chip .x { cursor: pointer; opacity: .6; font-size: 13px; line-height: 1; }
.rs-chip .x:hover { opacity: 1; }
.rs-search { flex: 1; min-width: 60px; border: none; outline: none; font-size: 13.5px; font-family: inherit; background: transparent; padding: 2px 0; }
.rs-menu {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-lg); z-index: 100; max-height: 280px;
  display: flex; flex-direction: column; overflow: hidden; padding: 0;
}
/* 搜索框常驻顶部，仅选项区滚动 —— 避免中文输入法候选被滚动打断 */
.rs-menu > .rs-search-row { flex: none; }
.rs-menu > .rs-create-box { flex: none; padding: 0 4px 4px; }
.rs-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 4px; }
.rs-clear { margin-left: auto; margin-right: 4px; opacity: .45; cursor: pointer; font-size: 14px; line-height: 1; }
.rs-clear:hover { opacity: 1; color: var(--danger); }
/* 筛选联动：条件不适用时置灰禁用 */
.rs.disabled { opacity: .5; pointer-events: none; background: var(--panel-2); }
.rs-opt { padding: 7px 9px; border-radius: 5px; cursor: pointer; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.rs-opt:hover { background: var(--primary-soft); }
.rs-opt.sel { background: var(--primary-soft); color: var(--primary-dark); font-weight: 500; }
.rs-opt.create { color: var(--primary); border-top: 1px dashed var(--border); margin-top: 3px; padding-top: 8px; }
.rs-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.rs-multi-actions { display: flex; gap: 6px; padding: 5px 6px; border-bottom: 1px solid var(--border); margin-bottom: 3px; }
/* 选项分组：有角色（深色靠前）与无角色（浅色靠后） */
.rs-group { padding: 6px 9px 3px; font-size: 11.5px; color: var(--muted); letter-spacing: .3px; }
.rs-group:first-child { padding-top: 4px; }
.rs-opt.dim { opacity: .55; }

/* 记录编辑：平台卡片 */
.plat-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2); padding: 12px; position: relative; }
.plat-item + .plat-item { margin-top: 10px; }
.plat-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.plat-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13.5px; }
.plat-badge .idx { width: 20px; height: 20px; border-radius: 5px; background: var(--primary); color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.shop-box {
  background: #fff; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 13px; color: var(--text-2); min-height: 34px; display: flex; align-items: center;
}
.shop-box .k { color: var(--muted); margin-right: 6px; }
.duration-box {
  display: flex; align-items: baseline; gap: 5px; background: #eef3ff; border-radius: 6px; padding: 6px 12px; color: var(--primary-dark);
}
.duration-box .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 平铺选择（ChipGroup）：点一下即选，替代部分下拉 */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  height: 32px; padding: 0 14px; border-radius: 16px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text-2); font-size: 13.5px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; transition: all .12s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.chip.on:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.chip .chip-tip { font-size: 11.5px; opacity: .72; }
.chip-add { border-style: dashed; color: var(--primary); }

/* 平台卡片：5 个字段一行 */
.plat-grid {
  display: grid; gap: 10px; align-items: start;
  grid-template-columns: minmax(160px, 1.7fr) minmax(120px, 1.3fr) minmax(200px, 1.5fr) minmax(130px, 1fr) 90px;
}
.plat-grid > div > label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.plat-grid .shop-box { min-height: 34px; display: flex; align-items: center; }
.time-pair { display: flex; gap: 6px; align-items: center; }
.time-pair .input[type="date"] { flex: 1 1 auto; min-width: 0; }
.time-pair .input[type="time"] { flex: 1 1 auto; min-width: 0; }
.time-pair .next-day {
  flex: 0 0 auto; font-size: 11px; color: var(--warn); background: var(--warn-soft);
  border: 1px solid #f5ddaf; border-radius: 4px; padding: 2px 5px; white-space: nowrap;
}
@media (max-width: 1100px) {
  .plat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 用户权限勾选 */
.perm-box { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--panel-2); }
.perm-item { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.perm-item span { display: flex; flex-direction: column; line-height: 1.4; }
.perm-item b { font-size: 13px; font-weight: 600; }
.perm-item i { font-style: normal; font-size: 11.5px; color: var(--muted); }
@media (max-width: 720px) { .perm-box { grid-template-columns: 1fr; } }

/* 下拉：单选清空小叉 */
.rs-control .x {
  cursor: pointer; opacity: .5; font-size: 15px; line-height: 1; margin-left: 6px; padding: 0 2px;
}
.rs-control .x:hover { opacity: 1; color: var(--danger); }

/* 主播行 */
.anchor-row { display: grid; grid-template-columns: 34px 1fr 140px; gap: 10px; align-items: center; margin-bottom: 8px; }
.anchor-row .idx {
  width: 26px; height: 26px; border-radius: 50%; background: #eef1f6; color: var(--text-2);
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600;
}
@media (max-width: 640px) { .anchor-row { grid-template-columns: 26px 1fr; } .anchor-row .ratio { grid-column: 2; } }
.ratio-wrap { position: relative; }
.ratio-wrap .suffix { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12.5px; }
.ratio-wrap .input { padding-right: 26px; text-align: right; }
.ratio-sum { font-size: 13px; padding: 8px 12px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border); display: inline-flex; gap: 8px; align-items: center; }
.ratio-sum.bad { background: var(--danger-soft); border-color: #f3c6c6; color: var(--danger); }
.ratio-sum.good { background: var(--success-soft); border-color: #c3e9d2; color: var(--success); }

/* 冲突提示 */
.alert { border-radius: 8px; padding: 11px 14px; font-size: 13px; line-height: 1.7; margin-bottom: 14px; }
.alert.err { background: var(--danger-soft); border: 1px solid #f3c6c6; color: #a52222; }
.alert.warn { background: var(--warn-soft); border: 1px solid #f5ddaf; color: #8a5a06; }
.alert.info { background: var(--primary-soft); border: 1px solid #cddcff; color: var(--primary-dark); }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-card .k { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .v { font-size: 25px; font-weight: 680; margin-top: 5px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.stat-card .u { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-card .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1000px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-box { height: 300px; }
.chart-box.tall { height: 340px; }

/* 筛选条 */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px 14px; align-items: end; }
.filter-item label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 视图切换 */
.view { display: none; }
.view.active { display: block; animation: fade .18s ease; }

/* 其他 */
.row-actions { display: flex; gap: 4px; }
.muted { color: var(--muted); }
.right { text-align: right; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.flex { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.loading-mask { position: fixed; inset: 0; background: rgba(255,255,255,.55); z-index: 9500; display: flex; align-items: center; justify-content: center; }
.spinner { width: 30px; height: 30px; border: 3px solid #dde3ee; border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 时间校验红字提醒（每个平台卡片内） */
.time-warn { margin-top: 8px; }
.warn-line { font-size: 12.5px; line-height: 1.6; }
.warn-line.err { color: var(--danger); font-weight: 500; }
.warn-line.long { color: var(--warn); font-weight: 500; }
.warn-line.failed { color: var(--warn); font-weight: 500; }
.shop-box .long { color: var(--warn); font-weight: 600; }

/* 按钮组（平铺选择/批量操作） */
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.btn-group.sep { margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--border); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 13.5px; }
.kv .k { color: var(--muted); }
.detail-sec { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.detail-sec h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }

/* ============ 排班日历 ============ */
.cal-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.cal-title { font-size: 15px; font-weight: 640; min-width: 108px; text-align: center; font-variant-numeric: tabular-nums; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; font-size: 12.5px; color: var(--text-2); }
.cal-lg { display: inline-flex; align-items: center; gap: 6px; }
.cal-lg i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.cal-lg.muted { color: var(--muted); }

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.cal-week-cell { background: var(--panel-2); padding: 8px 10px; font-size: 12.5px; color: var(--text-2); font-weight: 600; text-align: center; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.cal-grid > .cal-loading { grid-column: 1 / -1; background: var(--panel); padding: 40px; text-align: center; color: var(--muted); }

.cal-cell { background: var(--panel); min-height: 118px; padding: 6px 7px 7px; display: flex; flex-direction: column;
  cursor: pointer; transition: background .12s; position: relative; }
.cal-cell:hover { background: #f7f9ff; }
.cal-cell.is-other { background: var(--panel-2); cursor: default; }
.cal-cell.is-other:hover { background: var(--panel-2); }
.cal-cell.is-other .num { color: var(--muted); opacity: .55; }
.cal-cell.is-today { box-shadow: inset 0 0 0 2px var(--primary); }
.cal-cell.is-today .num { color: var(--primary); font-weight: 700; }

.cal-cell-hd { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.cal-cell-hd .num { font-size: 13px; font-weight: 640; font-variant-numeric: tabular-nums; }
.cal-cell-hd .cnt { font-size: 11.5px; color: var(--primary); background: var(--primary-soft); border-radius: 20px;
  padding: 1px 7px; cursor: pointer; }
.cal-cell-hd .cnt:hover { background: #dfe9ff; }
.cal-cell-hd .add { margin-left: auto; color: var(--muted); font-size: 14px; line-height: 1; width: 18px; height: 18px;
  border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; }
.cal-cell:hover .cal-cell-hd .add { opacity: 1; }
.cal-cell-hd .add:hover { background: var(--primary-soft); color: var(--primary); }

.cal-items { display: flex; flex-direction: column; gap: 3px; }
.cal-item { display: flex; align-items: center; gap: 5px; padding: 3px 5px; border-radius: var(--radius-sm);
  font-size: 11.5px; background: var(--panel-2); border: 1px solid transparent; min-width: 0; }
.cal-item:hover { background: #fff; border-color: var(--border-strong); }
.cal-item .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cal-item .pn { color: var(--text); font-weight: 560; white-space: nowrap; }
.cal-item .pc { color: var(--primary); background: var(--primary-soft); border-radius: 10px; padding: 0 5px; flex: none; font-size: 10.5px; }
.cal-item .pt { color: var(--muted); margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-more { font-size: 11.5px; color: var(--muted); padding: 2px 5px; cursor: pointer; }
.cal-more:hover { color: var(--primary); }

/* 当天明细弹窗 */
.cal-detail-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-detail-hd .d { font-size: 15px; font-weight: 640; font-variant-numeric: tabular-nums; }
.cal-detail-hd .w { color: var(--muted); font-size: 13px; }
.cal-detail-hd .tag { color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 20px; }
.cal-detail-hd .sum { margin-left: auto; color: var(--text-2); font-size: 12.5px; }
.cal-detail-list { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow: auto; }
.cal-row { display: grid; grid-template-columns: 320px minmax(150px, 1fr) 104px 46px; gap: 12px; align-items: center;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: var(--panel-2); }
.cal-row:hover { border-color: var(--primary); background: var(--panel); }
.cal-row .c1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cal-row .c1 > div { min-width: 0; }
.cal-row .c1 .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cal-row .c1 .t { font-size: 13px; font-weight: 580; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal-row .c1 .t .nd { font-size: 11px; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 0 4px; margin-left: 5px; }
.cal-row .c1 .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-row .c2 { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-row .c3 { text-align: right; }
.cal-row .c3 .hrs { display: block; font-size: 12.5px; font-weight: 580; }
.cal-row .c3 .sub { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-row .c4 { text-align: right; color: var(--muted); font-size: 12px; white-space: nowrap; }
.cal-row:hover .c4 { color: var(--primary); }
.cal-row .muted { color: var(--muted); }
