:root {
  --bg: #f3f5f9;
  --panel: #ffffff;
  --border: #e2e7ef;
  --border-strong: #cfd6e2;
  --text: #1c2733;
  --muted: #68758a;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf0ff;
  --navy: #14263d;
  --navy-2: #1b3453;
  --success: #047857;
  --success-soft: #e7f6ef;
  --warning: #b45309;
  --warning-soft: #fdf3e4;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --gray-soft: #eef1f5;
  --radius: 11px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 10px 26px rgba(16, 24, 40, 0.05);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI",
    system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
h1 { font-size: 24px; letter-spacing: -0.2px; }
h2 { font-size: 17px; }
h3 { font-size: 16px; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
code, .mono { font-family: var(--mono); }

/* ---------- top bar ---------- */
.topbar {
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #e8eef7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 36px;
  padding: 3px 7px;
  background: #fff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.brand-logo img { height: 28px; width: auto; display: block; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: #b9c7d9;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  font-weight: 500;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); text-decoration: none; }
.nav a.active { color: #fff; background: rgba(255, 255, 255, 0.12); }
.user-area {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.user-chip {
  color: #dbe6f5;
  font-size: 13px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}
.topbar .icon-btn {
  color: #cbd7e6;
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
}
.topbar .icon-btn:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.topbar .btn-ghost { color: #cbd7e6; }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.topbar .btn-soft {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
  color: #dbe6f5;
}
.topbar .btn-soft:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

/* ---------- layout ---------- */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 24px 60px;
}
.site-footer {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px 24px 28px;
}
.site-footer img {
  height: 60px;
  width: auto;
  display: block;
  padding: 8px 16px;
  background: #fff;
  border-radius: 11px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 22px rgba(16, 24, 40, 0.07);
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head p { margin-top: 5px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
}
.card + .card { margin-top: 16px; }
.card h2 { margin-bottom: 14px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); }
.spacer { flex: 1; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: #f8fafc; text-decoration: none; }
.btn:focus-visible { outline: 2px solid rgba(37, 99, 235, 0.35); outline-offset: 1px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: #edc5c5; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 6px; }
.icon-btn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: #f3f5f9; color: var(--text); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: #3b4657; }
.input, .select, textarea.input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
textarea.input { resize: vertical; min-height: 84px; }
.input[disabled], .select[disabled] { background: #f5f7fa; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #3b4657; cursor: pointer; }
.check input { accent-color: var(--primary); }

/* ---------- filter bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 13px 16px;
  margin-bottom: 16px;
}
.filter-bar .input { width: 230px; }
.filter-bar .select { width: 150px; }

/* ---------- folders ---------- */
.segmented {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.segmented > * {
  padding: 7px 14px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.2;
}
.segmented > * + * { border-left: 1px solid var(--border); }
.segmented > .is-active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.segmented > button {
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.folder-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.folder-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.folder-card:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.folder-name a { color: var(--text); text-decoration: none; }
.folder-name a:hover { color: var(--primary); }
.folder-card.is-uncategorized { border-style: dashed; }
.folder-card.is-restricted { border-color: #f3d4ae; background: #fffcf7; }
.folder-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.folder-mark {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 38px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.folder-mark::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -5px;
  width: 18px;
  height: 7px;
  border-radius: 4px 4px 0 0;
  background: var(--primary-soft);
}
.folder-info { min-width: 0; }
.folder-name {
  font-weight: 600;
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.folder-meta { font-size: 12.5px; color: #3b4657; margin-top: 3px; }
.folder-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.folder-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fafbfd;
  white-space: nowrap;
}
.table td {
  padding: 11px 12px;
  border-bottom: 1px solid #edf0f5;
  vertical-align: middle;
}
.table tbody tr:hover { background: #f9fbff; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { width: 38px; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn { margin-left: 6px; }
.table .nowrap { white-space: nowrap; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-draft { background: #eef2f8; color: #475569; }
.badge-review { background: var(--warning-soft); color: var(--warning); }
.badge-released { background: var(--success-soft); color: var(--success); }
.badge-superseded { background: #f1f2f4; color: #7b8494; }
.badge-cancelled { background: #f6eaea; color: #8b5a5a; }
.badge-active { background: var(--success-soft); color: var(--success); }
.badge-obsolete { background: var(--danger-soft); color: var(--danger); }
.badge-role { background: var(--primary-soft); color: var(--primary-dark); }
.badge-restricted { background: #fdf2e6; color: #b45309; border: 1px solid #f3d4ae; }
.rev {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ---------- pager ---------- */
.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 4px 2px;
  color: var(--muted);
  font-size: 13px;
}
.pager .spacer { flex: 1; }

/* ---------- empty / loading ---------- */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}
.empty strong { display: block; color: var(--text); margin-bottom: 6px; font-size: 15px; }
.loading { padding: 50px; text-align: center; color: var(--muted); }
.loading::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- detail page ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.meta-list { margin: 0; display: grid; grid-template-columns: 78px 1fr; gap: 9px 10px; }
.meta-list dt { color: var(--muted); font-size: 13px; }
.meta-list dd { margin: 0; word-break: break-word; }
.current-rev-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.current-rev-head .rev-big { font-size: 20px; font-weight: 700; font-family: var(--mono); }
.file-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  background: #fbfcfe;
}
.file-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #475569;
  background: #e9edf3;
  border-radius: 5px;
  padding: 4px 6px;
  min-width: 42px;
  text-align: center;
}
.file-name { font-weight: 500; word-break: break-all; }
.file-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.file-main { flex: 1; min-width: 0; }
.file-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: #e6eaf1;
  border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -22px;
  top: 7px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #aab6c8;
  box-shadow: 0 0 0 3px #fff;
}
.tl-dot.draft { border-color: #94a3b8; }
.tl-dot.in_review { border-color: #d97706; }
.tl-dot.released { border-color: #059669; }
.tl-dot.superseded { border-color: #9ca3af; }
.tl-dot.cancelled { border-color: #b91c1c; }
.rev-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
}
.rev-card.is-current { border-color: #b9d3fb; background: #fbfdff; }
.rev-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.rev-head .rev-code { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.rev-head .time { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.rev-note { margin: 9px 0 0; white-space: pre-wrap; word-break: break-word; }
.rev-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 7px; }
.rev-files { display: flex; flex-direction: column; gap: 6px; margin-top: 11px; }
.mini-file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 9px;
  background: #f7f9fc;
  border-radius: 6px;
}
.mini-file .name { flex: 1; word-break: break-all; }
.mini-file .size { color: var(--muted); font-size: 12px; white-space: nowrap; }
.rev-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--border); }
.rev-actions:empty { display: none; }

/* ---------- alerts ---------- */
.alert {
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
  margin-top: 10px;
}
.alert-warn { background: var(--warning-soft); color: #8a4207; border: 1px solid #f2ddba; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #f1cfcf; }
.alert-info { background: var(--primary-soft); color: var(--primary-dark); border: 1px solid #cfdcfa; }

/* ---------- audit ---------- */
.audit-list { display: flex; flex-direction: column; }
.audit-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f5;
  font-size: 13px;
  align-items: baseline;
}
.audit-row:last-child { border-bottom: none; }
.audit-row .time { color: var(--muted); white-space: nowrap; font-size: 12.5px; min-width: 138px; }
.audit-row .who { color: #3b4657; min-width: 86px; }
.audit-row .what { font-weight: 500; }
.audit-row .detail { color: var(--muted); word-break: break-word; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 18px 30px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  width: 100%;
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  background: #fbfcfe;
}
.modal-body { padding: 18px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}
.confirm-text { font-size: 14.5px; line-height: 1.7; }
.modal .field + .field { margin-top: 14px; }
.modal .grid-2 { margin-top: 14px; }
.modal .alert { margin-top: 14px; }

/* ---------- upload / progress ---------- */
.upload-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 62px;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
}
.upload-row .up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress {
  height: 6px;
  background: #e9edf3;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  transition: width 0.15s;
}
.up-status { color: var(--muted); text-align: right; white-space: nowrap; }
.up-status.done { color: var(--success); }
.up-status.error { color: var(--danger); }

/* ---------- import ---------- */
.import-list { margin-top: 14px; max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 9px; }
.import-list .table td { padding: 8px 10px; }
.import-list .input { padding: 5px 8px; font-size: 12.5px; }
.import-filename { color: var(--muted); font-size: 12px; word-break: break-all; }

/* ---------- export ---------- */
.choice-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  min-width: 220px;
}
.choice:hover { border-color: var(--border-strong); background: #fbfcfe; }
.choice input { margin-top: 3px; accent-color: var(--primary); }
.choice strong { display: block; font-size: 13.5px; }
.choice span { font-size: 12.5px; color: var(--muted); }
.export-select { margin-top: 6px; }
.export-table-wrap { max-height: 380px; overflow: auto; border: 1px solid var(--border); border-radius: 9px; }
.export-table-wrap .table th { position: sticky; top: 0; z-index: 1; }

/* ---------- login ---------- */
.login-wrap {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  align-items: safe center;
  justify-content: center;
  padding: 24px 24px 96px;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(59, 130, 246, 0.2), transparent 60%),
    radial-gradient(700px 450px at 88% 92%, rgba(30, 64, 175, 0.16), transparent 60%),
    linear-gradient(160deg, #14263d 0%, #1b3453 48%, #203d61 100%);
}
.login-footer {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
}
.login-footer img {
  height: 46px;
  width: auto;
  display: block;
  padding: 8px 16px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}
@media (max-width: 640px) {
  .site-footer img { height: 46px; }
  .login-footer img { height: 36px; }
}
.login-card {
  width: 100%;
  max-width: 390px;
  background: #fff;
  border-radius: 16px;
  padding: 32px 30px 28px;
  box-shadow: 0 30px 70px rgba(8, 15, 30, 0.35);
}
.login-logo-wrap { text-align: center; margin-bottom: 14px; }
.login-logo { max-width: 230px; width: 100%; height: auto; }
.login-company {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.login-company-en {
  text-align: center;
  color: #64748b;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  margin-top: 5px;
}
.login-slogan {
  text-align: center;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-top: 10px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.login-brand .brand-mark { width: 40px; height: 40px; }
.login-title { font-size: 20px; font-weight: 700; }
.login-sub { color: var(--muted); font-size: 13px; margin: 12px 0 24px; text-align: center; }
.login-card .field + .field { margin-top: 15px; }
.login-card .btn { width: 100%; margin-top: 22px; padding: 10px; }
.login-error { margin-top: 14px; }
.login-foot { margin-top: 20px; text-align: center; color: #96a1b3; font-size: 12px; }

/* ---------- toast ---------- */
#toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: 420px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 9px;
  padding: 11px 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
  font-size: 13.5px;
  animation: toast-in 0.2s ease-out;
  word-break: break-word;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
.toast.leaving { opacity: 0; transform: translateY(-4px); transition: all 0.25s; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- misc ---------- */
.kv-inline { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.role-tag { font-size: 12px; color: var(--muted); }
.ecn-desc { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.pagination-hint { color: var(--muted); font-size: 12.5px; }
.sha { font-family: var(--mono); font-size: 11px; color: #94a3b8; }

@media (max-width: 980px) {
  .topbar-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; padding-bottom: 2px; }
  .user-area { margin-left: auto; }
  .page { padding: 18px 14px 50px; }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .filter-bar .input { width: 100%; }
  .filter-bar .select { flex: 1; min-width: 120px; }
  .upload-row { grid-template-columns: minmax(0, 1fr) 100px 52px; }
  .audit-row { flex-wrap: wrap; gap: 4px 10px; }
  .audit-row .time { min-width: 0; }
}
