/* ============================================================================
   统一门户 · 样式
   设计取向：安静的浅色底 + 一个深绿主色，信息密度中等偏松。
   不用渐变、不用阴影堆层次，靠留白和细线分隔 —— 一天要看八小时的东西，
   越少装饰越好。数字统一等宽，方便对账时竖着扫。
   ========================================================================== */

:root {
  --bg: #F3F5F2;
  --card: #FFFFFF;
  --line: #E1E4DE;
  --line-2: #EDEFEA;
  --ink: #18201C;
  --ink-2: #3A4640;
  --muted: #6B766F;
  --muted-2: #99A39B;
  --accent: #0F6E56;
  --accent-2: #0B5745;
  --accent-soft: #E3F2EC;
  --warn: #9C6F14;
  --warn-soft: #FBF1DD;
  --danger: #B0452E;
  --danger-soft: #FBEDE9;
  --blue: #1F5C99;
  --blue-soft: #E7EFF7;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --rail: 252px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }

/* ============================================================ 登录页
   左边一块深绿，写着这是什么、有几个工作台；右边一个白卡填账号。
   手机上左块收成一条窄的抬头，不占空间。 */
.login-wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}

.login-side {
  position: relative;
  padding: 52px 56px;
  color: #EAF3EF;
  background: #0C2A22;
  background-image:
    radial-gradient(900px 480px at 12% 4%, rgba(28, 122, 96, .55), transparent 62%),
    radial-gradient(620px 400px at 88% 92%, rgba(19, 92, 74, .4), transparent 60%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.login-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 30% 30%, #000 30%, transparent 100%);
  pointer-events: none;
}

.login-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.login-brand .mk {
  width: 42px; height: 42px; border-radius: 11px;
  background: #EAF3EF; color: #0C2A22;
  display: grid; place-items: center;
  font-weight: 700; font-size: 19px; letter-spacing: -.02em;
}
.login-brand b { font-size: 16px; font-weight: 600; letter-spacing: .01em; }
.login-brand span { display: block; font-size: 11.5px; color: #8FB3A7; letter-spacing: .12em; }

.login-hero { margin: auto 0; position: relative; z-index: 1; max-width: 430px; }
.login-hero h1 {
  font-size: 33px;
  line-height: 1.35;
  font-weight: 600;
  margin: 0 0 16px;
  letter-spacing: -.01em;
  color: #FFFFFF;
}
.login-hero p { margin: 0; color: #A9C6BB; font-size: 14px; line-height: 1.9; }
.login-depts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.login-depts i {
  font-style: normal; font-size: 12.5px; padding: 5px 11px;
  border: 1px solid rgba(234, 243, 239, .22); border-radius: 100px;
  color: #CFE3DA;
}
.login-depts i.on { background: rgba(234, 243, 239, .13); border-color: rgba(234, 243, 239, .38); color: #fff; }

.login-foot { position: relative; z-index: 1; font-size: 11.5px; color: #6E9287; letter-spacing: .02em; }

.login-main {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--bg);
}
.login-card { width: 100%; max-width: 356px; }
.login-card h2 { font-size: 21px; margin: 0 0 6px; font-weight: 600; letter-spacing: -.01em; }
.login-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 26px; }

.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 12.5px; color: var(--ink-2);
  margin-bottom: 6px; font-weight: 500;
}
.field input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 110, 86, .1);
}
.btn-block { width: 100%; height: 43px; font-size: 14px; margin-top: 6px; }
.login-err {
  min-height: 20px;
  font-size: 12.5px;
  color: var(--danger);
  margin: 10px 0 0;
}
.login-tip {
  margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted-2); line-height: 1.9;
}

/* ============================================================ 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s;
}
.btn:hover { background: #FAFBF9; border-color: #D3D8D1; }
.btn:active { transform: translateY(.5px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #EBEEE9; color: var(--ink); }
.btn.sm { height: 29px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { color: var(--danger); border-color: #E7CFC8; }
.btn.danger:hover { background: var(--danger-soft); }

/* ============================================================ 外壳 */
.app {
  display: flex;
  min-height: 100vh;
}

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  background: #FFFFFF;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.rail-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 17px 18px 15px;
}
.rail-brand .mk {
  width: 32px; height: 32px; border-radius: 9px;
  background: #0C2A22; color: #EAF3EF;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
  flex: 0 0 auto;
}
.rail-brand b { font-size: 13.5px; font-weight: 600; display: block; line-height: 1.3; }
.rail-brand span { font-size: 10.5px; color: var(--muted-2); letter-spacing: .1em; }

/* 工作台切换器：整个门户的「当前在哪个部门」就靠这一块 */
.ws-switch {
  margin: 0 12px 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #FBFCFA;
  cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  transition: border-color .14s, background .14s;
  position: relative;
}
.ws-switch:hover { border-color: #CBD3CA; background: #fff; }
.ws-switch .dot {
  width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto;
  background: var(--accent);
}
.ws-switch .txt { min-width: 0; flex: 1; }
.ws-switch .t1 {
  font-size: 13px; font-weight: 600; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-switch .t2 { font-size: 11px; color: var(--muted-2); line-height: 1.4; }
.ws-switch .chev { color: var(--muted-2); flex: 0 0 auto; }
.ws-switch .chev svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.ws-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 10px 28px rgba(20, 35, 28, .13);
  padding: 5px;
  z-index: 60;
  display: none;
}
.ws-pop.on { display: block; }
.ws-pop a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: 6px;
  color: var(--ink-2); font-size: 13px;
}
.ws-pop a:hover { background: #F1F4EF; }
.ws-pop a.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.ws-pop a .st {
  margin-left: auto; font-size: 10.5px; color: var(--muted-2);
  background: #F1F3EF; padding: 1px 6px; border-radius: 100px;
}
.ws-pop a .st.up { background: var(--accent-soft); color: var(--accent); }
.ws-pop .sep { height: 1px; background: var(--line-2); margin: 5px 4px; }

.rail-nav {
  flex: 1;
  overflow-y: auto;
  padding: 2px 10px 14px;
  scrollbar-width: thin;
}
.rail-nav::-webkit-scrollbar { width: 6px; }
.rail-nav::-webkit-scrollbar-thumb { background: #DCE0D9; border-radius: 3px; }

.nav-g {
  font-size: 10.5px; color: var(--muted-2);
  letter-spacing: .1em; font-weight: 600;
  padding: 13px 9px 5px;
}
.nav-i {
  display: flex; align-items: center; gap: 9px;
  padding: 7.5px 9px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 13.2px;
  cursor: pointer;
  border: 0; background: transparent;
  width: 100%; text-align: left;
  transition: background .12s, color .12s;
}
.nav-i:hover { background: #F2F5F0; color: var(--ink); }
.nav-i.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.nav-i .ico { width: 16px; flex: 0 0 auto; opacity: .75; display: grid; place-items: center; }
.nav-i .ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-i .tag {
  margin-left: auto; font-size: 10px; padding: 0 5px; border-radius: 4px;
  background: #F3EEDD; color: var(--warn); font-weight: 600;
}
/* 菜单右边的数字：有数才出现，没有就彻底不占地方 */
.nav-i .nbadge {
  margin-left: auto; display: none;
  min-width: 18px; height: 17px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 17px; text-align: center;
  letter-spacing: 0;
}
.nav-i .nbadge.on { display: inline-block; }

.rail-foot {
  border-top: 1px solid var(--line-2);
  padding: 11px 13px;
  display: flex; align-items: center; gap: 9px;
  position: relative;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #E8EDE7; color: var(--ink-2);
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600; flex: 0 0 auto;
}
.rail-foot .who { min-width: 0; flex: 1; }
.rail-foot .who b { font-size: 12.8px; display: block; line-height: 1.3; font-weight: 600; }
.rail-foot .who span { font-size: 11px; color: var(--muted-2); }
.icon-btn {
  width: 26px; height: 26px; border: 0; background: transparent;
  border-radius: 5px; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { background: #EFF2ED; color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* 用户菜单 */
.umenu {
  position: absolute; right: 10px; bottom: calc(100% + 4px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 10px 26px rgba(20, 35, 28, .14);
  padding: 5px; min-width: 170px; display: none; z-index: 60;
}
.umenu.on { display: block; }
.umenu button {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; background: transparent;
  border-radius: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.umenu button:hover { background: #F2F5F0; }
.umenu .sep { height: 1px; background: var(--line-2); margin: 4px; }

/* ============================================================ 内容区 */
.body {
  flex: 1;
  min-width: 0;
  margin-left: var(--rail);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 54px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 245, 242, .88);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 12px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 30;
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); min-width: 0; }
.crumb b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.crumb .sl { color: var(--muted-2); }
.topbar .spacer { flex: 1; }

.st-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  background: #fff; border: 1px solid var(--line);
  padding: 4px 9px; border-radius: 100px;
}
.st-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); display: block; }
.st-pill i.up { background: #1E9B72; box-shadow: 0 0 0 3px rgba(30, 155, 114, .14); }
.st-pill i.down { background: #C0803C; }

.view { flex: 1; padding: 24px 26px 40px; min-width: 0; }
.view.flush { padding: 0; display: flex; flex-direction: column; }

/* 手机上的抽屉按钮与遮罩 */
.rail-toggle { display: none; }
.mask {
  display: none; position: fixed; inset: 0;
  background: rgba(14, 24, 20, .38); z-index: 35;
}
.mask.on { display: block; }

/* ============================================================ 首页 */
.greet { margin-bottom: 22px; }
.greet h1 {
  font-size: 23px; font-weight: 600; margin: 0 0 5px;
  letter-spacing: -.015em;
}
.greet .sub { color: var(--muted); font-size: 13px; }
.greet .sub em {
  font-style: normal; color: var(--ink-2);
  border-bottom: 1px dashed #C9D2C7; padding-bottom: 1px;
}

.sec-h {
  display: flex; align-items: baseline; gap: 10px;
  margin: 26px 0 12px;
}
.sec-h h2 { font-size: 14.5px; margin: 0; font-weight: 600; letter-spacing: -.005em; }
.sec-h span { font-size: 12px; color: var(--muted-2); }
.sec-h .r { margin-left: auto; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 12px;
}

.ws-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 17px 17px 15px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative;
  overflow: hidden;
  text-align: left;
  display: block;
  width: 100%;
  font-family: inherit;
}
.ws-card:hover {
  border-color: #C6CFC4;
  box-shadow: 0 6px 20px rgba(20, 35, 28, .07);
  transform: translateY(-1px);
}
.ws-card .bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
  opacity: .9;
}
.ws-card.off { cursor: pointer; }
.ws-card.off:hover { transform: none; box-shadow: 0 4px 14px rgba(20,35,28,.05); border-color: #CFD6CC; }
.ws-card.off .bar { opacity: .25; }

.ws-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.ws-ico {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-2);
  flex: 0 0 auto;
}
.ws-title { min-width: 0; flex: 1; }
.ws-title b { font-size: 14.5px; font-weight: 600; display: block; line-height: 1.35; }
.ws-title span { font-size: 11.5px; color: var(--muted-2); }
.ws-badge {
  font-size: 10.5px; padding: 1.5px 7px; border-radius: 100px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  white-space: nowrap;
}
.ws-badge.wait { background: #F2F1E8; color: var(--warn); }
.ws-badge.err { background: var(--warn-soft); color: var(--warn); }
.ws-desc { font-size: 12.5px; color: var(--muted); line-height: 1.7; min-height: 2.2em; }
.ws-meta {
  display: flex; align-items: center; gap: 10px;
  margin-top: 13px; padding-top: 11px;
  border-top: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--muted-2);
}
.ws-meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); display: inline-block; margin-right: 5px; }
.ws-meta i.up { background: #1E9B72; }
.ws-meta i.down { background: #C0803C; }
.ws-meta .go {
  margin-left: auto; color: var(--accent); font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
  white-space: nowrap; flex: 0 0 auto;
}
/* 卡片里的图标不给尺寸会按 SVG 默认的 300×150 撑开，把「进入」挤成竖排 */
.ws-meta svg, .ws-card svg { width: 13px; height: 13px; flex: 0 0 auto; }
.ws-meta > span { white-space: nowrap; }
.ws-meta .go svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.plan-strip {
  margin-top: 8px;
  font-size: 12px; color: var(--muted);
  line-height: 1.65;
}

/* 公司 / 状态 两栏 */
.two-col {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.panel-h {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.panel-h span { font-size: 11.5px; color: var(--muted-2); font-weight: 400; }
.panel-b { padding: 14px 16px; }

.co-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.co-row:last-child { border-bottom: 0; }
.co-mk {
  width: 28px; height: 28px; border-radius: 8px;
  background: #F2F4F0; color: var(--ink-2);
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600; flex: 0 0 auto;
}
.co-row b { font-size: 13px; font-weight: 500; display: block; line-height: 1.4; }
.co-row span { font-size: 11.5px; color: var(--muted-2); }

.svc-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 0; border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
}
.svc-row:last-child { border-bottom: 0; }
.svc-row .nm { color: var(--ink-2); }
.svc-row .pt { font-size: 11.5px; color: var(--muted-2); }
.svc-row .nm { min-width: 0; }
.svc-row .right { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }

/* ============================================================ 模块容器 */
.mod-head {
  height: 46px; flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.mod-head .nm { font-size: 13.5px; font-weight: 600; }
.mod-head .dp { font-size: 11.5px; color: var(--muted-2); }
.mod-head .spacer { flex: 1; }

.frame-wrap { flex: 1; position: relative; background: #fff; }
.frame-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
.frame-load {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--muted);
  font-size: 13px;
  gap: 10px;
  background: #fff;
  text-align: center;
  padding: 20px;
}
.spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid #DDE2DA; border-top-color: var(--accent);
  animation: sp .7s linear infinite;
  margin: 0 auto 10px;
}
@keyframes sp { to { transform: rotate(360deg); } }

.frame-err {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
  background: #fff;
}
.frame-err .box {
  max-width: 430px; text-align: center;
}
.frame-err .mk {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--warn-soft); color: var(--warn);
  display: grid; place-items: center; margin: 0 auto 14px;
  font-size: 20px; font-weight: 700;
}
.frame-err h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.frame-err p { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.8; }

/* ============================================================ 待开发模块 */
.planned { max-width: 880px; }
.planned-h {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 8px;
}
.planned-h .ws-ico { width: 44px; height: 44px; border-radius: 12px; font-size: 18px; }
.planned-h h1 { font-size: 21px; margin: 0 0 3px; font-weight: 600; letter-spacing: -.01em; }
.planned-h .meta { font-size: 12.5px; color: var(--muted); }

.why-box {
  margin: 18px 0 4px;
  padding: 14px 16px;
  background: #FBFBF7;
  border: 1px solid var(--line);
  border-left: 3px solid #C9B67E;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 13px; line-height: 1.85; color: var(--ink-2);
}
.why-box b { font-weight: 600; }

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.plan-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 15px;
  position: relative;
}
.plan-card .n {
  font-family: var(--font-num);
  font-size: 11px; color: var(--muted-2);
  letter-spacing: .04em;
}
.plan-card b { display: block; font-size: 13.5px; font-weight: 600; margin: 3px 0 5px; }
.plan-card p { margin: 0; font-size: 12.3px; color: var(--muted); line-height: 1.7; }
.plan-card::after {
  content: "";
  position: absolute; right: 14px; top: 15px;
  width: 6px; height: 6px; border-radius: 50%;
  background: #DFE3DC;
}

.note-bar {
  margin-top: 26px;
  padding: 13px 15px;
  border: 1px dashed #CFD6CC;
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.85;
}
.note-bar b { color: var(--ink-2); font-weight: 600; }
.note-bar code {
  font-family: var(--font-num);
  background: #F2F4EF; padding: 1px 5px; border-radius: 4px;
  font-size: 11.5px; color: var(--ink-2);
}

/* ============================================================ 表格 / 管理 */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.card-h {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line-2);
}
.card-h h2 { margin: 0; font-size: 14px; font-weight: 600; }
.card-h .r { margin-left: auto; display: flex; gap: 8px; }

.tb-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--muted);
  padding: 9px 12px;
  background: #FAFBF8;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tb td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
table.tb tbody tr:last-child td { border-bottom: 0; }
table.tb tbody tr:hover td { background: #FCFDFB; }
table.tb .num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
table.tb .right { text-align: right; }

.chip {
  display: inline-block;
  font-size: 11px; padding: 1.5px 7px;
  border-radius: 100px;
  background: #F1F3EF; color: var(--muted);
  white-space: nowrap;
}
.chip.on { background: var(--accent-soft); color: var(--accent); }
.chip.off { background: #F3F0E7; color: var(--warn); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }

/* ============================================================ 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(14, 24, 20, .34);
  display: grid; place-items: center;
  padding: 20px;
}
.modal {
  width: 100%; max-width: 480px;
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: 0 22px 60px rgba(14, 24, 20, .24);
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-h {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center;
}
.modal-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.modal-b { padding: 16px 18px; overflow-y: auto; }
.modal-f {
  padding: 12px 18px 16px;
  display: flex; gap: 9px; justify-content: flex-end;
}

.form-row { margin-bottom: 13px; }
.form-row label {
  display: block; font-size: 12.5px; color: var(--ink-2);
  margin-bottom: 5px; font-weight: 500;
}
.form-row input[type=text],
.form-row input[type=password],
.form-row select {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13.5px; font-family: inherit; color: var(--ink);
  background: #fff;
}
.form-row input:focus, .form-row select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 110, 86, .1);
}
.form-row .hint { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; line-height: 1.6; }

.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.check {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-2);
  padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px;
  cursor: pointer;
}
.check:hover { background: #FAFBF8; }
.check input { margin: 0; accent-color: var(--accent); }
.check.on { border-color: #BFDACF; background: var(--accent-soft); }

.alert {
  padding: 10px 13px; border-radius: var(--r-sm);
  font-size: 12.5px; line-height: 1.75;
  margin-bottom: 13px;
}
.alert.warn { background: var(--warn-soft); color: #7C5710; }
.alert.err { background: var(--danger-soft); color: var(--danger); }
.alert.ok { background: var(--accent-soft); color: var(--accent-2); }
.alert code {
  font-family: var(--font-num); background: rgba(0, 0, 0, .05);
  padding: 1px 5px; border-radius: 4px;
}

.empty {
  padding: 46px 20px; text-align: center; color: var(--muted-2); font-size: 13px;
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  background: #17231E; color: #F0F5F2;
  padding: 10px 17px; border-radius: 100px;
  font-size: 13px; z-index: 120;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 26px rgba(10, 20, 15, .28);
  max-width: 80vw;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: #6E2216; }

/* ============================================================ 响应式 */
@media (max-width: 1080px) {
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  :root { --rail: 268px; }

  .rail {
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(10, 20, 15, .2);
  }
  .rail.open { transform: none; }

  .body { margin-left: 0; }

  .rail-toggle {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border: 1px solid var(--line); background: #fff;
    border-radius: var(--r-sm); color: var(--ink-2);
    cursor: pointer; flex: 0 0 auto;
  }
  .rail-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }

  .topbar { padding: 0 14px; height: 50px; }
  .view { padding: 18px 15px 32px; }
  .view.flush { padding: 0; }
  .greet h1 { font-size: 19px; }
  .cards { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-side { padding: 26px 22px 30px; min-height: 0; }
  .login-hero { margin: 24px 0 0; }
  .login-hero h1 { font-size: 24px; }
  .login-hero p { font-size: 13px; }
  .login-foot { margin-top: 22px; }
  .login-main { padding: 26px 20px 40px; align-items: start; }
  .login-card { max-width: 100%; }
  .mod-head { padding: 0 12px; height: 44px; }
  .check-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .ws-meta { flex-wrap: wrap; gap: 6px; }
  .plan-grid { gap: 8px; }
}

/* 窄屏顶栏：标题不换行，隐藏部门与状态胶囊，只留刷新/新窗口 —— 否则「库存管理」会被挤成两行 */
@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .crumb { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .crumb .sl,
  .crumb .sl + span { display: none; }
  .topbar .st-pill { display: none; }
  #top-right { display: flex; gap: 6px; flex: 0 0 auto; }
  #top-right .btn { padding: 4px 8px; font-size: 11.5px; }
}
