/* ==========================================================================
   银行现金设备维护工单系统 —— 样式表
   设计原则：简洁明快 / 专业克制 / 响应式 / 内容居中 / 输入框文字垂直居中
   ========================================================================== */

:root {
  --primary:        #1d4ed8;
  --primary-hover:  #1a45bd;
  --primary-soft:   #eef3ff;
  --primary-border: #c7d7fb;

  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --border:    #dde4ee;
  --border-2:  #e9eef6;

  --text:      #0f172a;
  --text-2:    #475569;
  --muted:     #7c8798;

  --danger:    #d92d20;
  --danger-bg: #fef3f2;
  --success:   #067647;
  --success-bg:#ecfdf3;
  --warn:      #b54708;
  --warn-bg:   #fffaeb;

  --radius:   10px;
  --radius-sm: 8px;
  --control-h: 38px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow:    0 4px 14px rgba(16, 24, 40, .07);
  --shadow-lg: 0 18px 44px rgba(16, 24, 40, .18);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC",
          "Noto Sans CJK SC", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }

/* ---------------------------------------------------------------- 布局 --- */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 36px;
}

.app-page { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1 1 auto; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 16px 20px 22px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}
.footer-sep { color: var(--border); }

/* --------------------------------------------------------------- 顶栏 --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 60px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark { display: block; width: 30px; height: 30px; color: var(--primary); }
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-text { font-size: 15.5px; font-weight: 600; white-space: nowrap; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }

.nav button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: var(--control-h);
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav button:hover { background: var(--surface-2); color: var(--text); }
.nav button.active { background: var(--primary); color: #fff; }
.nav button.active:hover { background: var(--primary-hover); color: #fff; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
}

.user-box { position: relative; flex: 0 0 auto; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 42px;
  padding: 0 10px 0 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.user-chip:hover { border-color: var(--primary-border); background: var(--primary-soft); }
.avatar {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px; font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta strong { font-size: 13px; font-weight: 600; }
.user-meta em { font-size: 11px; font-style: normal; color: var(--muted); }
.chev { color: var(--muted); }

.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 60;
}
.user-menu button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.user-menu button:hover { background: var(--surface-2); }
.user-menu button.danger { color: var(--danger); }
.user-menu button.danger:hover { background: var(--danger-bg); }

/* --------------------------------------------------------------- 登录 --- */
.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 100vh;
  padding: 28px 20px;
  background:
    radial-gradient(1100px 480px at 50% -14%, #dbe7ff 0%, rgba(219, 231, 255, 0) 68%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 34px 32px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; }
.login-brand .brand-mark { width: 46px; height: 46px; }
.login-brand h1 { font-size: 18px; }
.login-brand p { margin: 2px 0 0; font-size: 11px; color: var(--muted); letter-spacing: .04em; }

.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-error {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #fecdca;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13px;
}
.login-tip { margin: 20px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.login-copyright { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
/* R2：登录界面上的系统版本行 */
.login-version {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  word-break: break-all;
}

/* ------------------------------------------------- R11 密码可见开关 --- */
/* 输入框与右侧「显示 / 隐藏」按钮共用一层定位容器：
   按钮绝对定位在输入框右端，输入框加右内边距，避免文字被按钮压住。 */
.input-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.input-wrap > .input {
  width: 100%;
  padding-right: 56px;
}
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 26px;
  cursor: pointer;
  user-select: none;
}
.pw-toggle:hover { background: var(--surface-2); color: var(--text); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-toggle[aria-pressed="true"] { color: var(--brand); font-weight: 500; }

/* ------------------------------------------------- 服务端版本过期提示 --- */
.stale-banner {
  border-bottom: 1px solid #fedf89;
  background: var(--warn-bg);
}
.stale-inner {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 11px 20px;
}
.stale-icon {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 20px; height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--warn);
  color: #fff;
  font-size: 13px; font-weight: 700;
}
.stale-text { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stale-text strong { color: var(--warn); font-size: 13.5px; }
.stale-text span { color: var(--warn); font-size: 12.5px; line-height: 1.6; }
.stale-text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(181, 71, 8, .1);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* ------------------------------------------------------------- 表单控件 --- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field-label .req { color: var(--danger); margin-left: 2px; }

/* 输入框文字垂直居中 */
.input,
.select,
.textarea {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input, .select { height: var(--control-h); line-height: normal; }
.select { padding-right: 30px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%237c8798' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 15px;
  cursor: pointer;
}
.textarea { padding: 9px 12px; line-height: 1.55; resize: vertical; min-height: 74px; }

.input::placeholder, .textarea::placeholder { color: #a9b2c0; }
.input:hover, .select:hover, .textarea:hover { border-color: #c6d0e0; }
.input:focus, .select:focus, .textarea:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .13);
}
.input[readonly] { background: var(--surface-2); color: var(--text-2); }
.input.invalid, .select.invalid { border-color: var(--danger); }
input[type="date"].input { padding-right: 8px; }
input[type="date"].input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
input[type="date"].input::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* --------------------------------------------------------------- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h);
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
  user-select: none;
}
.btn:hover { background: var(--surface-2); border-color: #c6d0e0; }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-danger { color: var(--danger); border-color: #f8c9c4; background: var(--surface); }
.btn-danger:hover { background: var(--danger-bg); border-color: #f3a9a1; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--text); }

.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 30px; padding: 0; }

.btn-link {
  height: auto; padding: 2px 4px;
  border: 0; background: none;
  color: var(--primary);
  font: inherit; font-size: 13px;
  cursor: pointer; border-radius: 4px;
}
.btn-link:hover { background: var(--primary-soft); text-decoration: none; }
.btn-link.danger { color: var(--danger); }
.btn-link.danger:hover { background: var(--danger-bg); }

/* --------------------------------------------------------------- 卡片 --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-2);
}
.card-title { display: flex; align-items: baseline; gap: 9px; }
.card-title h2 { font-size: 15px; }
.card-title span { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 18px; }
.card-body.tight { padding: 14px 18px; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-2);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* 表单栅格 */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* ------------------------------------------------------------- 自动补全 --- */
.ac { position: relative; }
.ac-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 232px;
  overflow-y: auto;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.ac-item {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-item:hover, .ac-item.active { background: var(--primary-soft); color: var(--primary-hover); }
.ac-item mark { background: transparent; color: var(--primary); font-weight: 600; }
.ac-empty { padding: 8px 10px; color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------------------- 设备列表 --- */
.device-list { display: flex; flex-direction: column; gap: 10px; }
.device-row {
  display: grid;
  grid-template-columns: 24px minmax(140px, 1.1fr) minmax(120px, 1fr) minmax(160px, 1.5fr) 34px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.device-index {
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px; font-weight: 600;
}
.device-head {
  display: grid;
  grid-template-columns: 24px minmax(140px, 1.1fr) minmax(120px, 1fr) minmax(160px, 1.5fr) 34px;
  gap: 10px;
  padding: 0 10px 8px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
}
.device-empty {
  padding: 22px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

/* --------------------------------------------------------------- 表格 --- */
/* 注意：这里必须是纵向可滚动的容器，th 的 position:sticky 才有意义。
   原先只有 overflow-x:auto（按规范会把 overflow-y 计算为 auto），
   容器高度等于内容高度、纵向滚动实际发生在页面上，表头根本不会吸附。 */
.table-wrap {
  width: 100%;
  max-height: min(72vh, 760px);
  overflow: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--border-2);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
table.data th, table.data td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-2);
}
table.data th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
}
table.data tbody tr:hover { background: #f7faff; }
table.data tbody tr.selected { background: var(--primary-soft); }
table.data td.wrap { white-space: normal; min-width: 190px; }
table.data .actions { display: flex; gap: 4px; }

.col-check { width: 40px; }
.checkbox { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; vertical-align: middle; }

.devices-cell { display: flex; flex-direction: column; gap: 5px; white-space: normal; min-width: 230px; }
.device-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.device-line .tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 12px;
  font-weight: 500;
}
.device-line .no { color: var(--text); font-weight: 500; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.device-line .reason { color: var(--text-2); }

.empty {
  padding: 52px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-icon { display: block; line-height: 0; }
.empty-icon svg { opacity: .35; margin-bottom: 10px; }
.empty p { margin: 0; font-size: 13.5px; }

/* --------------------------------------------------------------- 分页 --- */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-top: 1px solid var(--border-2);
}
.pager-info { font-size: 12.5px; color: var(--muted); }
.pager-info b { color: var(--text); font-weight: 600; }
.pager-btns { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-btns button {
  min-width: 32px; height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit; font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.pager-btns button:hover:not(:disabled) { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary-hover); }
.pager-btns button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager-btns button:disabled { opacity: .45; cursor: not-allowed; }
.pager-btns .gap { padding: 0 3px; color: var(--muted); }

/* ------------------------------------------------------------- 工具条 --- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1 1 auto; }

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  gap: 12px;
  align-items: end;
}
.filter-actions { display: flex; gap: 9px; align-items: end; justify-content: flex-end; }

/* --------------------------------------------------------------- 标记 --- */
.tag-role {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}
.tag-admin { background: var(--primary-soft); color: var(--primary-hover); border-color: var(--primary-border); }
.tag-supervisor { background: #f4f0ff; color: #6941c6; border-color: #d9d0f5; }
.tag-user  { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.tag-on    { background: var(--success-bg); color: var(--success); border-color: #abefc6; }
.tag-off   { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.tag-warn  { background: var(--warn-bg); color: var(--warn); border-color: #fedf89; }

/* --------------------------------------------------------------- 弹窗 --- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.modal {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  animation: pop .16s ease-out;
}
.modal.wide { max-width: 620px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-2);
}
.modal-head h3 { font-size: 15px; }
.modal-close {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body p { margin: 0 0 10px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-2);
  background: var(--surface-2);
  border-radius: 0 0 14px 14px;
}

/* --------------------------------------------------------------- 提示 --- */
.toast-root {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
  width: max-content; max-width: min(92vw, 560px);
}
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.success { border-color: #abefc6; background: var(--success-bg); color: var(--success); }
.toast.error   { border-color: #fecdca; background: var(--danger-bg);  color: var(--danger); }
.toast.warn    { border-color: #fedf89; background: var(--warn-bg);    color: var(--warn); }
.toast.info    { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary-hover); }
.toast .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

/* --------------------------------------------------------------- 其它 --- */
.hint { font-size: 12.5px; color: var(--muted); }
.section-hint {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 12.5px;
  margin-bottom: 16px;
}
.hidden-file { display: none; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.text-muted { color: var(--muted); }

/* 卡片底部说明（用户管理用）：靠左、无按钮 */
.card-foot-note {
  justify-content: flex-start;
  line-height: 1.7;
  font-size: 12.5px;
}

/* --------------------------------------------------- 导入结果 / 口令展示 --- */
.report { font-size: 13px; }
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.report-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 13px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.report-label { font-size: 12px; color: var(--muted); }
.report-value { font-size: 17px; font-variant-numeric: tabular-nums; }
.report-note {
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary-hover);
  font-size: 12.5px;
  line-height: 1.7;
}
.report-warn {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #fedf89;
  border-radius: var(--radius-sm);
  background: var(--warn-bg);
  max-height: 300px;
  overflow-y: auto;
}
.report-warn > p { margin: 0 0 8px; color: var(--warn); font-weight: 600; }
.report-errors { display: flex; flex-direction: column; gap: 3px; }
.report-error-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--warn);
  line-height: 1.5;
}
.report-error-row-no { flex: 0 0 auto; font-weight: 600; font-variant-numeric: tabular-nums; }

.credential-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.credential-label { flex: 0 0 66px; font-size: 12.5px; color: var(--muted); }
.credential-value {
  flex: 1 1 auto;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13.5px;
  word-break: break-all;
  user-select: all;
}

/* ---------------------------------------------- 批量口令与操作日志 --- */
/* R5：批量展示一次性口令时的等宽纯文本块，便于整段复制粘贴到 Excel */
.credential-plain {
  margin: 10px 0 0;
  padding: 10px 12px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre;
  user-select: all;
}

/* 弹窗内的横向滚动容器：表格列多时避免把弹窗撑破 */
.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.table-scroll > table { min-width: 760px; }

/* R7：操作日志表格里可截断的长文本列 */
.log-target,
.log-detail {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 结果标签：成功 / 失败 */
.tag-ok {
  background: var(--ok-bg, #e7f6ec);
  color: var(--ok, #16794a);
}
.tag-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

/* ----------------------------------------------------------- 响应式 --- */
@media (max-width: 1024px) {
  .brand-text { display: none; }
}

@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; padding: 8px 14px; row-gap: 8px; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .nav {
    order: 3;
    flex-basis: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    padding-bottom: 4px;
  }
  .nav.open { display: flex; }
  .nav button { justify-content: flex-start; border-radius: var(--radius-sm); height: 40px; }
  .user-box { margin-left: 0; }
  .brand-text { display: block; font-size: 14px; }
  .container { padding: 14px 14px 28px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .device-head { display: none; }
  .device-row { grid-template-columns: 24px minmax(0, 1fr) 34px; }
  .device-row .ac, .device-row .input { grid-column: 2; }
  .device-row .device-del { grid-column: 3; grid-row: 1; }
  .card-body { padding: 14px; }
  .card-head { padding: 12px 14px; }
  .modal-body { padding: 16px; }
  .modal-head { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; }
  /* 窄屏下保持列宽，由容器横向滚动，避免行高被压得过高 */
  table.data { min-width: 900px; }
}

@media (max-width: 560px) {
  .login-card { padding: 26px 20px 22px; }
  .brand-text { display: none; }
  .user-meta { display: none; }
  .user-chip { padding: 0 8px 0 5px; }
  .pager { justify-content: center; }
  .pager-info { text-align: center; width: 100%; }
  .toolbar { gap: 7px; }
  .toolbar .btn { flex: 1 1 auto; }
}
