/* 品鸿培训师工作台 PipeLine · 样式 */
:root {
  --brand: #1466f5;
  --brand-soft: #e8f0ff;
  --brand-2: #0aa5ff;
  --ink: #101c30;
  --ink-2: #0b1424;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #e4e9f2;
  --line-strong: #d3dbe9;
  --txt: #111a2c;
  --sub: #6b7789;
  --sub-2: #93a0b4;
  --green: #0f9d6b;
  --green-soft: #e6f7f0;
  --amber: #d98400;
  --amber-soft: #fff5e0;
  --red: #e5484d;
  --red-soft: #feecec;
  --purple: #6d5bd0;
  --purple-soft: #efecfb;
  --gap: 14px;
  --row: 34px;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 28, 48, .05);
  --shadow: 0 2px 6px rgba(16, 28, 48, .05), 0 10px 24px rgba(16, 28, 48, .05);
  --shadow-lg: 0 18px 44px rgba(16, 28, 48, .16);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* 关键：作者样式里的 display 会盖掉浏览器默认的 [hidden]{display:none} */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
::selection { background: #cfe0ff; }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; background: var(--bg); color: var(--sub);
}
.boot-logo {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(160deg, var(--brand), #0a3fb0);
  color: #fff; font-size: 24px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 12px 26px rgba(20, 102, 245, .3);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ---------- 登录 / 改密 ---------- */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(1100px 500px at 12% 0%, #12233c 0%, transparent 60%),
    radial-gradient(900px 480px at 100% 100%, #0d2a4a 0%, transparent 55%),
    #0b1424;
}
.gate-card {
  width: min(920px, 100%);
  display: grid; grid-template-columns: 1.05fr .95fr;
  background: var(--card); border-radius: 26px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(4, 12, 26, .5);
}
.gate-side {
  padding: 40px 36px;
  background: linear-gradient(165deg, #14243c, #0e1a2c 70%);
  color: #e9f0fb; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
}
.gate-brand { display: flex; align-items: center; gap: 12px; }
.gate-brand .mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--brand), #0a3fb0); color: #fff; font-weight: 700; font-size: 20px;
}
.gate-brand strong { display: block; font-size: 15px; letter-spacing: .3px; }
.gate-brand span { font-size: 11px; color: #8fa6c6; letter-spacing: 2px; text-transform: uppercase; }
.gate-side h2 { margin: 0; font-size: 24px; line-height: 1.4; font-weight: 600; }
.gate-side h2 em { font-style: normal; color: #6fb2ff; }
.gate-side p { margin: 10px 0 0; font-size: 13px; color: #96abc8; line-height: 1.8; }
.gate-bullets { display: grid; gap: 10px; font-size: 12.5px; color: #a9bcd6; }
.gate-bullets div { display: flex; gap: 8px; align-items: flex-start; }
.gate-bullets i { color: #4d8dff; font-style: normal; }
.gate-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.gate-form h3 { margin: 0 0 6px; font-size: 20px; }
.gate-form .hint { margin: 0 0 22px; color: var(--sub); font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12.5px; color: var(--sub); margin-bottom: 6px; }
.field input {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: #fbfcfe; transition: .18s;
}
.field input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.gate-form .primary-btn { width: 100%; margin-top: 4px; }
.gate-err { min-height: 20px; font-size: 12.5px; color: var(--red); margin-bottom: 6px; }
.gate-ok { color: var(--green); }
.primary-btn {
  height: 44px; border: none; border-radius: 11px; color: #fff; font-weight: 600; letter-spacing: .3px;
  background: linear-gradient(180deg, #2b7bff, var(--brand)); box-shadow: 0 8px 20px rgba(20, 102, 245, .28);
  transition: .18s;
}
.primary-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-btn:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.gate-foot { margin-top: 18px; font-size: 12px; color: var(--sub-2); text-align: center; }
.meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 8px 0 14px; }
.meter i { display: block; height: 100%; width: 0; background: var(--red); transition: .25s; }

/* ---------- 布局 ---------- */
.app {
  display: grid; grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- 左侧栏 ---------- */
.sidebar {
  background: linear-gradient(180deg, #12203a 0%, var(--ink-2) 100%);
  color: #dce6f5;
  padding: 22px 18px 18px;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 3px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 4px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(160deg, #3b8bff, #0a3fb0); color: #fff; font-weight: 700; font-size: 19px;
  box-shadow: 0 8px 18px rgba(20, 102, 245, .35);
}
.brand-text strong { display: block; font-size: 13.5px; letter-spacing: .2px; color: #f2f7ff; }
.brand-text span { display: block; font-size: 10.5px; letter-spacing: 2.6px; color: #7f97ba; text-transform: uppercase; }

.me-card {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 16px; padding: 16px; text-align: center;
}
.avatar {
  border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(160deg, #2f74d0, #164a95); color: #fff;
  font-weight: 600; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 62px; height: 62px; font-size: 24px; margin: 0 auto 10px; border: 2px solid rgba(255,255,255,.22); }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-xs { width: 24px; height: 24px; font-size: 11px; }
.me-name { font-size: 16px; font-weight: 600; color: #fff; }
.me-post { font-size: 12px; color: #9db2ce; margin-top: 2px; }
.me-regions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.me-scope { font-size: 11px; color: #7c93b2; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 11.5px; font-weight: 500; background: var(--brand-soft); color: #14509f; white-space: nowrap;
}
.sidebar .chip { background: rgba(79, 141, 255, .16); color: #a8c6f5; }
.chip.green { background: var(--green-soft); color: #0a7a53; }
.chip.amber { background: var(--amber-soft); color: #a46800; }
.chip.red { background: var(--red-soft); color: #b3282d; }
.chip.gray { background: #eef1f6; color: #5a6678; }
.chip.purple { background: var(--purple-soft); color: #5244a8; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label { font-size: 10.5px; letter-spacing: 1.6px; color: #6c82a1; padding: 10px 10px 4px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 11px;
  color: #c3d2e6; background: transparent; border: none; text-align: left; width: 100%;
  font-size: 13px; transition: .16s; position: relative;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(58, 132, 255, .18); color: #fff; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 2px;
  background: #4d8dff;
}
.nav-item .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; display: grid; place-items: center;
}
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.ghost-btn {
  height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04); color: #c3d2e6; font-size: 12.5px; transition: .16s;
}
.ghost-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.brand-foot { text-align: center; font-size: 10.5px; color: #55708f; padding-top: 4px; }

/* ---------- 主区域 ---------- */
.main { padding: 22px 26px 12px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.topbar-title h1 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.2px; }
.topbar-title h1 .pipe {
  font-weight: 500; color: var(--brand); letter-spacing: .4px;
  background: var(--brand-soft); padding: 1px 9px; border-radius: 8px; font-size: 15px; margin-left: 4px;
  vertical-align: 2px;
}
.topbar-title p { margin: 5px 0 0; color: var(--sub); font-size: 12.5px; }
.topbar-side { display: flex; align-items: center; gap: 10px; }
.clock { text-align: right; font-size: 12px; color: var(--sub); line-height: 1.35; }
.clock b { display: block; font-size: 15px; color: var(--txt); font-weight: 600; font-variant-numeric: tabular-nums; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; color: var(--sub); transition: .16s;
}
.icon-btn:hover { color: var(--brand); border-color: #b9cdf4; background: #f7faff; }
.icon-btn.spin svg { animation: rotate .8s linear infinite; }
@keyframes rotate { to { transform: rotate(360deg); } }
.topbar-user {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 4px;
  border-radius: 18px; background: #fff; border: 1px solid var(--line); font-size: 12.5px;
}
.topbar-user b { font-weight: 600; }

/* ---------- 磁贴网格 ---------- */
.board {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: var(--row); gap: var(--gap);
  position: relative; padding-bottom: 36px;
}
.tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  min-width: 0; min-height: 0; overflow: hidden; position: relative;
  transition: box-shadow .18s, border-color .18s;
}
.tile:hover { box-shadow: var(--shadow); }
.tile-head {
  display: flex; align-items: center; gap: 9px; padding: 0 14px; height: 46px; flex: none;
  border-bottom: 1px solid #f0f3f8;
}
.tile-head.draggable { cursor: grab; touch-action: none; }
.tile-head.draggable:active { cursor: grabbing; }
.tile-title { font-weight: 600; font-size: 13.5px; letter-spacing: .2px; }
.tile-title .count { color: var(--sub-2); font-weight: 500; margin-left: 6px; font-size: 12px; }
.tile-head .spacer { flex: 1; }
.tile-actions { display: flex; align-items: center; gap: 4px; }
.tile-body { flex: 1; min-height: 0; overflow: auto; padding: 12px 14px 14px; }
.tile-body.flush { padding: 0; }
.tile-body::-webkit-scrollbar { width: 6px; height: 6px; }
.tile-body::-webkit-scrollbar-thumb { background: #dbe2ee; border-radius: 3px; }
.tile-ico { color: var(--brand); display: grid; place-items: center; }

.tile.dragging {
  z-index: 40; box-shadow: 0 24px 48px rgba(16, 28, 48, .22); border-color: #b7ccf7;
  transition: none; opacity: .97; pointer-events: none;
}
.ghost {
  position: absolute; z-index: 5; border-radius: var(--radius);
  border: 2px dashed #7fa8ff; background: rgba(20, 102, 245, .06);
  pointer-events: none; transition: left .12s ease, top .12s ease, width .12s ease, height .12s ease;
}
.board.compact {
  display: flex; flex-direction: column; gap: 12px;
  grid-template-columns: none; grid-auto-rows: auto;
}
.board.compact .tile { width: 100%; min-height: 260px; }
.board.compact .tile[data-module="links"] { min-height: 200px; }
.board.compact .tile[data-module="profile"] { min-height: 240px; }
.board.compact .tile-head.draggable { cursor: default; }
.tile-order { display: none; gap: 2px; }
.board.compact .tile-order { display: flex; }

.mini-btn {
  height: 26px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--sub); font-size: 12px; display: inline-flex; align-items: center; gap: 4px;
  transition: .14s; white-space: nowrap;
}
.mini-btn:hover { color: var(--brand); border-color: #bcd0f6; background: #f7faff; }
.mini-btn.solid { background: var(--brand); border-color: var(--brand); color: #fff; }
.mini-btn.solid:hover { filter: brightness(1.06); color: #fff; }
.mini-btn.danger:hover { color: var(--red); border-color: #f3c2c3; background: #fff7f7; }
.mini-btn:disabled { opacity: .45; cursor: not-allowed; }
.link-btn { border: none; background: none; color: var(--brand); font-size: 12px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.link-btn.muted { color: var(--sub); }

/* ---------- 看板入口 ---------- */
.links-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; height: 100%; }
.link-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px;
  border: 1px solid var(--line); background: linear-gradient(180deg, #fbfdff, #f6f9ff);
  transition: .18s; position: relative; overflow: hidden; min-height: 0;
}
.link-card:hover { transform: translateY(-2px); border-color: #b9cff8; box-shadow: 0 10px 22px rgba(20, 102, 245, .1); }
.link-card .lc-top { display: flex; align-items: center; justify-content: space-between; }
.link-card .lc-ico {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.link-card .lc-arrow { color: var(--sub-2); }
.link-card h4 { margin: 0; font-size: 13.5px; font-weight: 600; }
.link-card p { margin: 0; font-size: 11.5px; color: var(--sub); line-height: 1.5; }
.link-card .lc-meta { margin-top: auto; font-size: 11px; color: var(--sub-2); display: flex; gap: 6px; align-items: center; }

/* ---------- 待办 ---------- */
.todo-compose { display: flex; gap: 8px; margin-bottom: 10px; }
.todo-compose input {
  flex: 1; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong);
  padding: 0 11px; background: #fbfcfe; transition: .16s; font-size: 13px;
}
.todo-compose input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
.todo-compose .add {
  width: 36px; height: 36px; border-radius: 10px; border: none; color: #fff;
  background: var(--brand); display: grid; place-items: center; flex: none;
}
.todo-group-label {
  font-size: 11px; color: var(--sub-2); letter-spacing: 1px; margin: 14px 2px 6px;
  display: flex; align-items: center; gap: 6px;
}
.todo-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 2px; min-height: 44px;
  border-bottom: 1px solid #f2f5fa; position: relative; transition: opacity .3s;
}
.todo-item:last-child { border-bottom: none; }
.todo-check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid #c9d3e3; flex: none;
  background: #fff; display: grid; place-items: center; margin-top: 3px; transition: .18s;
}
.todo-check:hover { border-color: var(--brand); }
.todo-check svg { width: 12px; height: 12px; color: #fff; }
.todo-check svg path { stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset .2s ease; }
.todo-item.done .todo-check { background: var(--brand); border-color: var(--brand); }
.todo-item.done .todo-check path { stroke-dashoffset: 0; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 13.5px; line-height: 1.45; word-break: break-word; transition: color .2s; }
.todo-title::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.todo-title.line { color: var(--sub-2); position: relative; }
.todo-title.line::after { transform: scaleX(1); }
.todo-item.done { opacity: .55; }
.todo-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 3px; font-size: 11px; color: var(--sub); }
.todo-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.todo-item:hover .todo-actions { opacity: 1; }
.todo-empty { color: var(--sub-2); font-size: 12.5px; text-align: center; padding: 26px 8px; line-height: 1.8; }
.due-over { color: var(--red); }
.share-hint {
  margin-top: 4px; font-size: 11px; color: var(--purple); background: var(--purple-soft);
  border-radius: 6px; padding: 2px 7px; display: inline-flex; gap: 5px; align-items: center;
}

/* ---------- 协作 ---------- */
.tabs { display: flex; gap: 4px; background: #f2f5fa; border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.tabs button {
  flex: 1; height: 30px; border: none; background: transparent; border-radius: 8px;
  font-size: 12.5px; color: var(--sub); transition: .16s;
}
.tabs button.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm); }
.share-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; margin-bottom: 9px; }
.share-item .si-head { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sub); }
.share-item .si-title { font-size: 13.5px; font-weight: 500; margin: 4px 0 3px; }
.share-item .si-msg { font-size: 12px; color: var(--sub); background: #f7f9fc; border-radius: 8px; padding: 6px 8px; margin: 6px 0; }
.share-item .si-foot { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ---------- 日历 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 600; font-size: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-dow { text-align: center; font-size: 10.5px; color: var(--sub-2); padding: 3px 0; }
.cal-cell {
  aspect-ratio: 1 / 1; border-radius: 8px; border: 1px solid transparent; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--txt); position: relative; padding: 0;
}
.cal-cell:hover { background: #f3f7fe; }
.cal-cell.dim { color: #c3ccdb; }
.cal-cell.today { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.cal-cell.sel { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 2px var(--brand-soft); }
.cal-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--brand); }
.cal-dot.region { background: var(--purple); }
.cal-dot.all { background: var(--amber); }
.cal-list { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.cal-ev { display: flex; gap: 8px; align-items: flex-start; padding: 6px 2px; font-size: 12.5px; border-bottom: 1px solid #f2f5fa; }
.cal-ev:last-child { border-bottom: none; }
.cal-ev .time { color: var(--sub); font-variant-numeric: tabular-nums; flex: none; width: 42px; }
.cal-ev .t { flex: 1; min-width: 0; }
.cal-ev .own { color: var(--sub-2); font-size: 11px; }
.empty-hint { font-size: 12px; color: var(--sub-2); text-align: center; padding: 14px 0; }

/* ---------- 我的信息 ---------- */
.profile { display: flex; gap: 12px; align-items: flex-start; }
.profile .avatar-xl { width: 64px; height: 64px; font-size: 25px; border-radius: 20px; }
.profile-main { flex: 1; min-width: 0; }
.profile-name { font-size: 16px; font-weight: 650; }
.profile-post { font-size: 12px; color: var(--sub); margin: 1px 0 6px; }
.kv { display: grid; grid-template-columns: 62px 1fr; gap: 4px 8px; font-size: 12.5px; margin-top: 10px; }
.kv dt { color: var(--sub-2); }
.kv dd { margin: 0; }
.profile-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- 管理台 ---------- */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.admin-tabs button { height: 28px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 12px; color: var(--sub); }
.admin-tabs button.active { background: var(--brand-soft); color: var(--brand); border-color: #bed3fa; font-weight: 600; }
.utable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.utable th { text-align: left; font-weight: 500; color: var(--sub-2); font-size: 11.5px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.utable td { padding: 8px; border-bottom: 1px solid #f2f5fa; vertical-align: middle; }
.utable tr:last-child td { border-bottom: none; }
.utable .who { display: flex; align-items: center; gap: 7px; }
.utable .uname { color: var(--sub-2); font-size: 11px; }
.row-actions { display: flex; gap: 4px; }
.audit-row { display: flex; gap: 8px; font-size: 12px; padding: 6px 2px; border-bottom: 1px solid #f2f5fa; }
.audit-row time { color: var(--sub-2); font-variant-numeric: tabular-nums; flex: none; }
.module-toggle { display: flex; align-items: center; justify-content: space-between; padding: 9px 2px; border-bottom: 1px solid #f2f5fa; font-size: 13px; }
.switch { width: 40px; height: 22px; border-radius: 11px; background: #dbe2ee; border: none; position: relative; transition: .18s; flex: none; }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .18s;
}
.switch.on { background: var(--brand); }
.switch.on::after { left: 20px; }
.switch:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 70; background: rgba(11, 20, 36, .5);
  display: grid; place-items: center; padding: 20px; backdrop-filter: blur(2px);
  animation: fadein .16s ease;
}
@keyframes fadein { from { opacity: 0; } }
.modal {
  width: min(460px, 100%); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: .6; } }
.modal.wide { width: min(680px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 16px 18px; max-height: 62vh; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.modal-foot .primary-btn { height: 38px; padding: 0 18px; }
.sub-btn { height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fff; font-size: 13px; }
.sub-btn:hover { background: #f7f9fc; }
textarea { width: 100%; min-height: 74px; border-radius: 10px; border: 1px solid var(--line-strong); padding: 9px 11px; resize: vertical; background: #fbfcfe; }
textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
select { height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: #fbfcfe; padding: 0 9px; width: 100%; }
select:focus { outline: none; border-color: var(--brand); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.person-pick { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.person {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px; border: 1px solid transparent;
  background: #fbfcfe; text-align: left; font-size: 13px;
}
.person:hover { background: #f3f7ff; }
.person.sel { border-color: #bcd1f7; background: var(--brand-soft); }
.person .p-meta { color: var(--sub); font-size: 11px; }
.person .p-main { flex: 1; min-width: 0; }
.person .p-name { font-weight: 500; }

/* ---------- toast ---------- */
.toast-stack { position: fixed; right: 20px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast {
  min-width: 200px; max-width: 360px; padding: 10px 14px; border-radius: 11px; font-size: 12.5px;
  background: #16233a; color: #eaf1fb; box-shadow: 0 12px 30px rgba(11, 20, 36, .3);
  transform: translateY(8px); opacity: 0; transition: .2s;
}
.toast.show { transform: none; opacity: 1; }
.toast.err { background: #7d1f24; }
.toast.ok { background: #0d5f45; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: 240px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 12px; }
  .brand { flex: none; }
  .brand-text strong { font-size: 13px; }
  .brand-text span, .brand-foot, .me-scope, .me-post, .me-regions, #btnTidy { display: none; }
  .me-card {
    display: flex; align-items: center; gap: 8px; padding: 0 4px; text-align: left;
    flex: 1 1 auto; min-width: 0; border: none; background: transparent;
  }
  .avatar-lg { width: 34px; height: 34px; font-size: 14px; margin: 0; border-width: 1px; }
  .me-name { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav { flex-direction: row; overflow-x: auto; width: 100%; order: 3; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-label { display: none; }
  .nav-item { flex: none; padding: 7px 10px; font-size: 12.5px; }
  .sidebar-foot { flex: none; margin-left: auto; flex-direction: row; }
  .ghost-btn { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 9px; }
  .main { padding: 16px 14px 8px; }
  .topbar { flex-direction: column; gap: 10px; }
  .topbar-side { width: 100%; justify-content: space-between; }
  .topbar-user { display: none; }
  .clock { text-align: left; }
  .board { display: flex; flex-direction: column; gap: 12px; }
  .board .tile { width: 100%; }
  .links-grid { grid-template-columns: minmax(0, 1fr); }
  .link-card:last-child { grid-column: auto; }
  .gate-card { grid-template-columns: 1fr; }
  .gate-side { display: none; }
  .gate-form { padding: 30px 24px; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar-title h1 { font-size: 18px; }
  .profile { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
