/* ==========================================================================
   弘成电缆 · 运营后台样式
   设计基调：工业蓝 + 大面积留白，表格信息密度高但不拥挤。
   ========================================================================== */

:root {
  --brand: #1e4b8f;
  --brand-dark: #16325c;
  --brand-deep: #12294b;
  --brand-light: #eaf1fb;
  --brand-line: #c9dcf5;
  --accent: #f97316;
  --accent-light: #fff4ec;
  --ok: #16a34a;
  --ok-light: #eafaf0;
  --warn: #d97706;
  --warn-light: #fff8ea;
  --danger: #dc2626;
  --danger-light: #fdeeee;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --line: #e5e7eb;
  --line-2: #f1f3f6;
  --bg: #f4f6f9;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 10px 32px rgba(16, 24, 40, 0.14);
  --sidebar-w: 216px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ---------- 启动占位 ---------- */
.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh; gap: 12px; }
.boot-logo { font-size: 22px; font-weight: 700; color: var(--brand-dark); letter-spacing: 3px; }
.boot-text { color: var(--text-3); font-size: 13px; }

/* ==========================================================================
   登录页
   ========================================================================== */
.login-wrap { display: flex; min-height: 100vh; }

.login-left {
  flex: 1.1;
  background: linear-gradient(150deg, var(--brand-deep) 0%, var(--brand) 58%, #2f68b8 100%);
  color: #fff;
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-left::after {
  content: "";
  position: absolute;
  right: -140px; bottom: -160px;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
}
.login-brand { font-size: 26px; font-weight: 700; letter-spacing: 4px; }
.login-brand small { display: block; font-size: 12px; letter-spacing: 2px; opacity: 0.62; font-weight: 400; margin-top: 8px; }
.login-pitch { position: relative; z-index: 1; }
.login-pitch h2 { font-size: 30px; font-weight: 600; line-height: 1.45; letter-spacing: 1px; }
.login-pitch p { margin-top: 14px; opacity: 0.78; font-size: 14px; max-width: 400px; }
.login-feats { margin-top: 32px; display: flex; flex-direction: column; gap: 12px; }
.login-feat { display: flex; align-items: center; gap: 10px; font-size: 13.5px; opacity: 0.9; }
.login-feat i {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 12px; flex: none;
}
.login-foot { font-size: 12px; opacity: 0.5; position: relative; z-index: 1; }

.login-right {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); padding: 40px;
}
.login-box { width: 100%; max-width: 348px; }
.login-box h1 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.login-box .sub { color: var(--text-2); font-size: 13px; margin-bottom: 26px; }
.login-box .field { margin-bottom: 16px; }
.login-box label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.login-box .input { width: 100%; height: 44px; }
.login-box .btn { width: 100%; height: 44px; margin-top: 8px; }
.login-err {
  background: var(--danger-light); color: var(--danger);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}
.login-tip {
  margin-top: 22px; padding: 12px 14px;
  background: var(--brand-light); border-radius: 8px;
  font-size: 12.5px; color: var(--brand-dark); line-height: 1.8;
}
.login-tip b { font-weight: 600; }

/* ==========================================================================
   主框架
   ========================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: none;
  background: linear-gradient(180deg, var(--brand-deep), var(--brand-dark));
  color: #cfdcf0;
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
  z-index: 30;
}
.side-head { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.09); }
.side-logo { font-size: 17px; font-weight: 700; color: #fff; letter-spacing: 2px; }
.side-logo span { font-size: 11px; font-weight: 400; opacity: 0.55; letter-spacing: 1px; display: block; margin-top: 3px; }
.side-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.side-group { padding: 14px 10px 6px; font-size: 11px; letter-spacing: 1px; color: rgba(255, 255, 255, 0.34); }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  cursor: pointer; font-size: 13.5px;
  transition: background 0.14s, color 0.14s;
  user-select: none;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav-item.on { background: rgba(255, 255, 255, 0.14); color: #fff; font-weight: 500; }
.nav-item .ni { width: 16px; text-align: center; font-style: normal; opacity: 0.85; font-size: 13px; flex: none; }
.nav-item .nb {
  margin-left: auto; background: var(--accent); color: #fff;
  font-size: 11px; padding: 0 6px; border-radius: 9px; line-height: 17px; font-weight: 500;
}
.side-foot { padding: 12px 16px; border-top: 1px solid rgba(255, 255, 255, 0.09); font-size: 12px; }
.side-user { display: flex; align-items: center; gap: 9px; }
.side-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, 0.16); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.side-uname { color: #fff; font-size: 13px; line-height: 1.3; }
.side-urole { font-size: 11px; opacity: 0.5; }
.side-logout {
  margin-left: auto; cursor: pointer; opacity: 0.55; font-size: 12px;
  padding: 4px 6px; border-radius: 6px;
}
.side-logout:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px; flex: none;
  background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16.5px; font-weight: 600; }
.topbar .crumb { color: var(--text-3); font-size: 12.5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.content { padding: 20px 24px 40px; flex: 1; }

/* 简易/演示模式提示条 */
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; border-radius: 8px; margin-bottom: 16px;
}
.banner.demo { background: var(--accent-light); color: #9a4a05; border: 1px solid #fcd9b6; }
.banner.warn { background: var(--warn-light); color: #8a5200; border: 1px solid #f5e0b8; }
.banner.ok { background: var(--ok-light, #e8f5ee); color: #1a6b3c; border: 1px solid #bfe3cf; }
.banner.ok b { color: #14532d; }

/* 通知正文预览：把有换行的 markdown 原样展示，不撑破表格 */
.preview {
  white-space: pre-wrap; word-break: break-word;
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
  max-height: 132px; overflow: hidden;
}
.banner b { font-weight: 600; }
.banner .bx { margin-left: auto; cursor: pointer; opacity: 0.6; }
.banner .bx:hover { opacity: 1; }

/* ==========================================================================
   通用组件
   ========================================================================== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--line-2);
  margin-bottom: 16px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-head .hint { font-size: 12.5px; color: var(--text-3); }
.card-head .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 18px; }
.card-body.tight { padding: 12px 18px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; cursor: pointer; font-size: 13.5px;
  transition: all 0.14s; white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #1a417c; border-color: #1a417c; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #ea6a0d; border-color: #ea6a0d; }
.btn-danger { background: var(--card); border-color: #f3c6c6; color: var(--danger); }
.btn-danger:hover { background: var(--danger-light); border-color: #e9a8a8; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--line-2); color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn-link { border: none; background: none; color: var(--brand); padding: 0 4px; height: auto; cursor: pointer; font-size: 13px; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--danger); }

/* 表单 */
.input, .select, .textarea {
  height: 34px; padding: 0 10px; width: 100%;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); outline: none; transition: border 0.14s, box-shadow 0.14s;
}
.textarea { height: auto; padding: 8px 10px; line-height: 1.6; resize: vertical; min-height: 72px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30, 75, 143, 0.1); }
.input[readonly] { background: #f8fafc; color: var(--text-2); }
.input.sm, .select.sm { height: 30px; font-size: 13px; }
.select { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.field .tip { font-size: 11.5px; color: var(--text-3); margin-top: 4px; line-height: 1.6; }
.field.req label::after { content: " *"; color: var(--danger); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.span4 { grid-column: span 4; }

/* 行内筛选条 */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters .input, .filters .select { width: auto; min-width: 140px; }
.filters .input.search { min-width: 220px; }
.filters .sep { width: 1px; height: 22px; background: var(--line); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  text-align: left; font-weight: 500; color: var(--text-2); font-size: 12.5px;
  padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tb td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tb tbody tr:hover { background: #fafcfe; }
table.tb tbody tr.sel { background: var(--brand-light); }
table.tb .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb .mono { font-family: "SF Mono", Consolas, Monaco, monospace; font-size: 12.5px; }
table.tb .nowrap { white-space: nowrap; }
table.tb .muted { color: var(--text-3); }
table.tb td .sub-line { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
table.tb input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--brand); }
.price-cell { font-weight: 600; color: var(--brand-dark); }
.price-cell .unit { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.old-price { text-decoration: line-through; color: var(--text-3); font-size: 12px; }

/* 标签 */
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  font-size: 11.5px; line-height: 18px; white-space: nowrap;
}
.tag.gray { background: var(--line-2); color: var(--text-2); }
.tag.blue { background: var(--brand-light); color: var(--brand-dark); }
.tag.green { background: var(--ok-light); color: var(--ok); }
.tag.orange { background: var(--accent-light); color: #b45309; }
.tag.red { background: var(--danger-light); color: var(--danger); }
.tag.warn { background: var(--warn-light); color: var(--warn); }

/* 统计卡 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow); border: 1px solid var(--line-2);
}
.stat .k { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 25px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.stat .v small { font-size: 13px; font-weight: 400; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.stat .d { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.stat.alert { border-color: #f3d5a5; background: linear-gradient(180deg, #fffdf8, var(--card)); }
.stat.alert .v { color: var(--warn); }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line-2); font-size: 13px; }
.pager .info { color: var(--text-2); }
.pager .sp { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pager button {
  height: 28px; min-width: 28px; padding: 0 8px;
  border: 1px solid var(--line); background: var(--card); border-radius: 7px; cursor: pointer;
}
.pager button:hover:not([disabled]) { border-color: var(--brand); color: var(--brand); }
.pager button[disabled] { opacity: 0.4; cursor: not-allowed; }
.pager button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 空状态 */
.empty { padding: 52px 20px; text-align: center; color: var(--text-3); }
.empty .ei { font-size: 34px; opacity: 0.3; margin-bottom: 10px; }
.empty .et { font-size: 13.5px; }
.empty .eb { margin-top: 14px; }

.loading { padding: 44px; text-align: center; color: var(--text-3); font-size: 13px; }
.spin {
  display: inline-block; width: 15px; height: 15px; border: 2px solid var(--line);
  border-top-color: var(--brand); border-radius: 50%; animation: sp 0.7s linear infinite;
  vertical-align: -2px; margin-right: 7px;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ==========================================================================
   模态框
   ========================================================================== */
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.46);
  z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; animation: pop 0.16s ease-out;
}
.modal.wide { max-width: 860px; }
.modal.xwide { max-width: 1080px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.99); } }
.modal-head {
  display: flex; align-items: center; padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
}
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-head .mx { margin-left: auto; cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; padding: 0 4px; }
.modal-head .mx:hover { color: var(--text); }
.modal-body { padding: 20px; max-height: calc(100vh - 230px); overflow-y: auto; }
.modal-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--line-2); background: #fcfdfe;
  border-radius: 0 0 12px 12px;
}
.modal-foot .sp { margin-left: auto; display: flex; gap: 10px; }
.modal-foot .lft { font-size: 12.5px; color: var(--text-3); }

/* 表单分区（商品编辑用） */
.form-sec { margin-bottom: 22px; }
.form-sec:last-child { margin-bottom: 0; }
.form-sec > .sec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--brand-dark);
  padding-bottom: 9px; margin-bottom: 14px; border-bottom: 1px solid var(--line-2);
}
.form-sec > .sec-title .sn {
  width: 18px; height: 18px; border-radius: 5px; background: var(--brand-light);
  color: var(--brand); font-size: 11px; display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.form-sec > .sec-title .sh { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-weight: 400; }

/* 价格联动块 */
.price-box {
  background: linear-gradient(180deg, #f8fbff, #f3f8ff);
  border: 1px solid var(--brand-line); border-radius: 9px; padding: 14px;
}
.price-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.price-mini { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 18px; font-size: 12.5px; color: var(--text-2); }
.price-mini b { color: var(--brand-dark); font-variant-numeric: tabular-nums; }
.price-mini .g { color: var(--ok); }
.price-mini .r { color: var(--danger); }

/* 颜色选择 chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 4px 11px; border: 1px solid var(--line); border-radius: 20px;
  cursor: pointer; font-size: 12.5px; background: var(--card); user-select: none;
  transition: all 0.12s;
}
.chip:hover { border-color: var(--brand-line); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 导入预览 */
.imp-step { display: flex; gap: 8px; margin-bottom: 16px; }
.imp-step .s {
  flex: 1; text-align: center; font-size: 12.5px; padding: 7px 4px;
  border-radius: 8px; background: var(--line-2); color: var(--text-3);
}
.imp-step .s.on { background: var(--brand-light); color: var(--brand-dark); font-weight: 500; }
.imp-step .s.done { background: var(--ok-light); color: var(--ok); }
.imp-textarea { min-height: 200px; font-family: "SF Mono", Consolas, Monaco, monospace; font-size: 12px; white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.imp-sum { display: flex; gap: 16px; padding: 12px 14px; background: #f8fafc; border-radius: 8px; font-size: 13px; margin-bottom: 14px; flex-wrap: wrap; }
.imp-sum b { font-variant-numeric: tabular-nums; }
.imp-sum .c { color: var(--ok); }
.imp-sum .u { color: var(--brand); }
.imp-sum .k { color: var(--text-3); }
.imp-sum .e { color: var(--danger); }
.err-list { max-height: 160px; overflow-y: auto; font-size: 12.5px; }
.err-list .er { padding: 4px 0; border-bottom: 1px dashed var(--line-2); color: var(--danger); }
.err-list .er b { color: var(--text-2); font-weight: 500; }

/* 调价结果 */
.chg-arrow { color: var(--text-3); padding: 0 4px; }
.chg-up { color: var(--danger); font-weight: 600; }
.chg-down { color: var(--ok); font-weight: 600; }
.chg-flat { color: var(--text-3); }

/* 提示条 toast */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #1f2937; color: #fff; padding: 9px 16px; border-radius: 9px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: tin 0.18s ease-out;
  max-width: 460px;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #b45309; }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } }

/* 详情键值 */
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 14px; font-size: 13px; }
.kv .k { color: var(--text-3); }
.kv .v { word-break: break-all; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab {
  padding: 8px 14px; cursor: pointer; font-size: 13.5px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

/* 品类树 */
.cat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.cat-list { max-height: 620px; overflow-y: auto; }
.cat-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.cat-row:hover { background: #fafcfe; }
.cat-row.on { background: var(--brand-light); }
.cat-row .ci {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--brand-light); color: var(--brand-dark);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600;
}
.cat-row .cn { flex: 1; min-width: 0; }
.cat-row .cn .n { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row .cn .c { font-size: 11.5px; color: var(--text-3); }
.cat-row .cc { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 角色权限说明 */
.role-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.role-matrix th, .role-matrix td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: left; }
.role-matrix th { color: var(--text-2); font-weight: 500; font-size: 12.5px; background: #fafbfc; }
.role-matrix .yes { color: var(--ok); }
.role-matrix .no { color: var(--text-3); }

@media (max-width: 1080px) {
  .cat-layout { grid-template-columns: 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 62px; }
  .side-logo span, .side-uname, .side-urole, .nav-item span:not(.ni), .side-group { display: none; }
  .nav-item { justify-content: center; }
  .login-left { display: none; }
  .grid2, .grid3, .grid4 { grid-template-columns: 1fr; }
  .span2, .span3, .span4 { grid-column: span 1; }
}
@media print { .sidebar, .topbar, .filters, .pager { display: none; } .main { margin-left: 0; } }

/* ==================== 企业微信登录 ==================== */

/* 用企微的品牌蓝，和主色的深蓝拉开距离 —— 让人一眼看出这是另一条登录通道 */
.btn-wecom {
  background: #2f7dff;
  border-color: #2f7dff;
  color: #fff;
  font-weight: 500;
}
.btn-wecom:hover { background: #1d6bea; border-color: #1d6bea; }
.btn-wecom[disabled] { opacity: 0.7; cursor: wait; }

.wecom-sub {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 8px;
}

/* 「或使用账号密码」分隔线 */
.login-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 18px;
  color: #9aa5b1;
  font-size: 12px;
}
.login-sep::before,
.login-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

/* 「还没登记」页里展示的那串企微 userid —— 必须一眼看清、一键复制 */
.wecom-id-label {
  font-size: 13px;
  color: var(--text-2);
  margin: 18px 0 8px;
}
.wecom-id-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f4f6f9;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
}
.wecom-id-box code {
  flex: 1;
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.4px;
  word-break: break-all;
  color: #16325c;
}
.wecom-id-box .btn {
  width: auto;
  height: 32px;
  margin: 0;
  padding: 0 14px;
  font-size: 12.5px;
  flex: none;
}

.wecom-found {
  background: var(--warn-light, #fdf6e8);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #8a5200;
  margin-bottom: 4px;
}

/* 换 code 时的转圈 */
.spin {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border: 3px solid #e2e8f0;
  border-top-color: #2f7dff;
  border-radius: 50%;
  animation: hc-spin 0.8s linear infinite;
}
@keyframes hc-spin {
  to { transform: rotate(360deg); }
}
