/* 铁路货代一体化平台 · 统一视觉 */
:root {
  --navy-950: #07182a;
  --navy-900: #0b2239;
  --navy-800: #10304d;
  --navy-700: #17405f;
  --teal: #0e9f8a;
  --teal-700: #0b7f70;
  --teal-100: #e3f6f2;
  --amber: #e0a03a;
  --amber-100: #fdf3e2;
  --bg: #f2f6fa;
  --surface: #ffffff;
  --line: #e1e9f1;
  --line-strong: #cdd9e5;
  --text: #14293d;
  --muted: #667b8f;
  --danger: #d04545;
  --danger-100: #fdecec;
  --ok: #16876f;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(13, 38, 61, .06);
  --shadow: 0 10px 30px -18px rgba(9, 31, 51, .35);
  --shadow-lg: 0 28px 70px -30px rgba(7, 24, 42, .55);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
[hidden] { display: none !important; }

/* ---------- 基础控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap; transition: .16s ease; text-decoration: none;
}
.btn:hover { border-color: #b9cadb; background: #f8fbfd; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-700); border-color: var(--teal-700); }
.btn.dark { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.btn.dark:hover { background: var(--navy-800); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef4f9; color: var(--text); }
.btn.danger { background: #fff; border-color: #efc9c9; color: var(--danger); }
.btn.danger:hover { background: var(--danger-100); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; color: var(--muted); font-weight: 550; }
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: #fbfdff; color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  transition: .16s ease;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); background: #fff; box-shadow: 0 0 0 3px rgba(14, 159, 138, .14); }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
label.check input { accent-color: var(--teal); width: 15px; height: 15px; }
.form-error { background: var(--danger-100); color: #a53737; border: 1px solid #f3cccc; padding: 9px 12px; border-radius: 9px; font-size: 13px; margin-bottom: 12px; }
.form-hint { color: var(--muted); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef4f9; color: var(--muted); }
.badge.teal { background: var(--teal-100); color: var(--teal-700); }
.badge.amber { background: var(--amber-100); color: #9a6a13; }
.badge.red { background: var(--danger-100); color: #a53737; }
.badge.dark { background: var(--navy-900); color: #d8e7f3; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #b7c6d4; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(22, 135, 111, .14); }
.dot.err { background: var(--danger); box-shadow: 0 0 0 3px rgba(208, 69, 69, .14); }
.dot.warn { background: var(--amber); }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.form-muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- 登录 ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--surface); }
.login-hero {
  position: relative; overflow: hidden; padding: 56px 60px; color: #eaf4fb;
  background:
    radial-gradient(circle at 82% 12%, rgba(14, 159, 138, .38), transparent 46%),
    radial-gradient(circle at 8% 92%, rgba(224, 160, 58, .22), transparent 44%),
    linear-gradient(155deg, #0b2239 0%, #0d2d47 55%, #10324b 100%);
  display: flex; flex-direction: column;
}
.login-hero::after {
  content: ""; position: absolute; inset: -20% -20% auto auto; width: 620px; height: 620px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 0 0 90px rgba(255, 255, 255, .025), 0 0 0 180px rgba(255, 255, 255, .02);
}
.login-brand { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 650; letter-spacing: .04em; z-index: 1; }
.login-brand img { width: 38px; height: 38px; border-radius: 10px; }
.login-copy { margin-top: auto; margin-bottom: auto; max-width: 460px; z-index: 1; }
.login-copy .eyebrow { color: #8fd3c9; letter-spacing: .22em; font-size: 11px; font-weight: 700; margin-bottom: 18px; }
.login-copy h1 { font-size: 38px; line-height: 1.24; font-weight: 680; letter-spacing: -.02em; }
.login-copy p { margin-top: 18px; color: #a9c2d6; font-size: 14.5px; line-height: 1.8; }
.login-points { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.login-points div { font-size: 12.5px; color: #9fb8cb; display: flex; align-items: center; gap: 7px; }
.login-points b { color: #fff; font-size: 17px; font-weight: 650; }
.login-hero-foot { z-index: 1; color: #7f9bb2; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 392px; }
.login-card .brand-sm { display: none; }
.login-card h2 { font-size: 25px; margin-bottom: 6px; }
.login-card .lead { color: var(--muted); font-size: 13.5px; margin-bottom: 26px; }
.login-card .btn.primary { height: 44px; font-size: 14.5px; margin-top: 6px; }
.login-meta { margin-top: 26px; display: flex; justify-content: space-between; color: #93a6b7; font-size: 11.5px; }
.login-icp { margin-top: 12px; text-align: center; color: #93a6b7; font-size: 11.5px; }
.login-icp a { color: inherit; }
.login-error { margin-bottom: 12px; }

/* ---------- 门户外壳 ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; grid-template-rows: 60px 1fr; min-height: 100vh; }
.topbar {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: var(--navy-900); color: #dbe9f4; z-index: 20;
}
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; color: #fff; letter-spacing: .02em; }
.topbar .brand img { width: 30px; height: 30px; border-radius: 8px; }
.topbar .brand small { display: block; font-size: 10px; letter-spacing: .18em; color: #7fa0ba; font-weight: 600; }
.topbar-spacer { flex: 1; }
.topbar .nav-link { color: #b9cee0; font-size: 13px; padding: 7px 11px; border-radius: 8px; }
.topbar .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: #eaf4fb; cursor: pointer; border: 1px solid transparent;
}
.user-chip:hover { background: rgba(255, 255, 255, .13); }
.avatar { width: 29px; height: 29px; border-radius: 50%; background: linear-gradient(140deg, var(--teal), #3fb9a5); color: #fff; display: grid; place-items: center; font-weight: 650; font-size: 13px; }
.user-chip .uname { font-size: 13px; font-weight: 550; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { position: absolute; top: 56px; right: 22px; width: 210px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 7px; z-index: 60; }
.user-menu .um-head { padding: 9px 11px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.user-menu .um-head b { display: block; font-size: 13.5px; }
.user-menu .um-head span { color: var(--muted); font-size: 11.5px; }
.user-menu button, .user-menu a { display: flex; width: 100%; align-items: center; gap: 9px; padding: 9px 11px; border: 0; background: none; border-radius: 8px; color: var(--text); font-size: 13px; cursor: pointer; text-align: left; }
.user-menu button:hover, .user-menu a:hover { background: #f1f6fa; text-decoration: none; }
.user-menu svg { width: 16px; height: 16px; color: var(--muted); }

.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 18px 13px; display: flex; flex-direction: column; gap: 6px; }
.side-label { font-size: 10.5px; letter-spacing: .16em; color: #93a6b7; font-weight: 700; padding: 8px 11px 4px; }
.side-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 10px; border: 0; background: none;
  color: #33495d; font-size: 13.5px; cursor: pointer; text-align: left; width: 100%; font-weight: 500;
}
.side-item:hover { background: #f1f6fa; }
.side-item.active { background: var(--teal-100); color: var(--teal-700); font-weight: 650; }
.side-item.active .side-icon { background: var(--teal); color: #fff; }
.side-icon { width: 28px; height: 28px; border-radius: 8px; background: #eef4f9; color: #557086; display: grid; place-items: center; flex: none; }
.side-icon svg { width: 15px; height: 15px; }
.side-item .soon { margin-left: auto; font-size: 10px; color: #9fb0bf; }
.side-foot { margin-top: auto; padding: 12px; border-radius: 10px; background: #f6f9fc; font-size: 11.5px; color: var(--muted); line-height: 1.7; }
.side-foot a { color: #8497a8; }
.side-foot .icp-line { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e1e9f1; }

.main { min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.page { padding: 26px 30px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .eyebrow { color: var(--teal-700); font-size: 10.5px; letter-spacing: .2em; font-weight: 700; margin-bottom: 7px; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--muted); font-size: 13.5px; margin-top: 5px; }

.notice { display: flex; gap: 12px; align-items: flex-start; background: var(--amber-100); border: 1px solid #f2ddb9; color: #7c5716; border-radius: 12px; padding: 12px 15px; font-size: 13px; margin-bottom: 20px; }
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.module-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px;
  box-shadow: var(--shadow-sm); cursor: pointer; transition: .18s ease; overflow: hidden; display: flex; flex-direction: column; min-height: 186px;
}
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c6d8e6; }
.module-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: radial-gradient(circle, rgba(14, 159, 138, .1), transparent 68%); }
.module-card .mc-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--navy-900); color: #9fe0d5; display: grid; place-items: center; margin-bottom: 16px; }
.module-card .mc-icon svg { width: 21px; height: 21px; }
.module-card h3 { font-size: 16.5px; margin-bottom: 6px; }
.module-card p { color: var(--muted); font-size: 12.8px; line-height: 1.7; flex: 1; }
.module-card .mc-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.module-card .go { margin-left: auto; color: var(--teal-700); font-weight: 650; font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.module-card .go svg { width: 14px; height: 14px; }
.module-card.disabled { opacity: .6; cursor: not-allowed; }

.workspace { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.frame-bar { display: flex; align-items: center; gap: 12px; padding: 9px 18px; background: #fff; border-bottom: 1px solid var(--line); }
.frame-bar .crumb { font-size: 12.5px; color: var(--muted); }
.frame-bar .crumb b { color: var(--text); font-weight: 600; }
.frame-bar .spacer { flex: 1; }
.frame-bar .role-badge { font-size: 11px; }
.frame-wrap { flex: 1; min-height: calc(100vh - 60px - 47px); background: #fff; }
.frame-wrap iframe { width: 100%; height: calc(100vh - 107px); border: 0; display: block; background: #fff; }

/* ---------- 通用面板 / 表格 ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 15.5px; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 18px 20px; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; padding: 11px 14px; color: var(--muted); font-weight: 600; font-size: 11.5px; letter-spacing: .04em; background: #f7fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid td { padding: 12px 14px; border-bottom: 1px solid #eef3f7; vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr:hover td { background: #fafcfe; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.empty { padding: 46px 20px; text-align: center; color: #8ba0b2; font-size: 13px; }

/* ---------- 管理台 ---------- */
.admin-head { background: var(--navy-900); color: #dbe9f4; padding: 0 26px; height: 60px; display: flex; align-items: center; gap: 16px; }
.admin-head .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 650; font-size: 15px; }
.admin-head .brand img { width: 30px; height: 30px; border-radius: 8px; }
.admin-head .spacer { flex: 1; }
.admin-head .nav-link { color: #b9cee0; font-size: 13px; padding: 7px 11px; border-radius: 8px; }
.admin-head .nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.admin-body { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 60px); }
.admin-nav { background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; }
.admin-nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 9px; color: #34495d; font-size: 13.5px; cursor: pointer; text-align: left; margin-bottom: 3px; }
.admin-nav button svg { width: 16px; height: 16px; color: #6c8296; }
.admin-nav button:hover { background: #f1f6fa; }
.admin-nav button.active { background: var(--navy-900); color: #fff; font-weight: 600; }
.admin-nav button.active svg { color: #8fd3c9; }
.admin-main { padding: 26px 30px 46px; min-width: 0; }
.admin-main .page-head { margin-bottom: 20px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 24px; font-weight: 680; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }

.matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.matrix th, .matrix td { padding: 10px 12px; border-bottom: 1px solid #eef3f7; text-align: left; }
.matrix th { font-size: 11.5px; color: var(--muted); background: #f7fafc; font-weight: 600; }
.matrix td.center, .matrix th.center { text-align: center; width: 110px; }
.matrix tr.group td { background: #f9fbfd; font-weight: 650; font-size: 12.5px; color: #3d5a72; }
.matrix input[type=checkbox] { accent-color: var(--teal); width: 16px; height: 16px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 9px 13px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--teal); font-weight: 600; }

/* ---------- 弹层 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8, 24, 40, .48); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); max-height: 88vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
.modal-head { padding: 20px 22px 14px; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h2 { font-size: 18px; }
.modal-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.modal-head .x { margin-left: auto; }
.modal-body { padding: 6px 22px 20px; overflow: auto; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: #f4f8fb; color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

.toast-root { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 9px; z-index: 200; }
.toast { background: var(--navy-900); color: #eaf4fb; padding: 11px 16px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow-lg); animation: rise .18s ease; max-width: 380px; }
.toast.ok { background: #10695a; }
.toast.err { background: #9b3535; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.log-box { background: #0b2239; color: #cfe3f1; font-family: var(--mono); font-size: 12px; line-height: 1.65; padding: 16px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; max-height: 52vh; overflow: auto; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-card .brand-sm { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; font-weight: 650; }
  .login-card .brand-sm img { width: 36px; height: 36px; border-radius: 10px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 60px; bottom: 0; left: 0; width: 236px; transform: translateX(-102%); transition: .2s ease; z-index: 30; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: grid !important; }
  .admin-body { grid-template-columns: 1fr; }
  .admin-nav { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .admin-nav button { width: auto; white-space: nowrap; margin: 0; }
}
@media (max-width: 620px) {
  .page, .admin-main { padding: 18px 16px 40px; }
  .module-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .brand small { display: none; }
  .frame-wrap iframe { height: calc(100vh - 107px); }
  .modal { max-height: 92vh; }
  .form-row { grid-template-columns: 1fr !important; }
}
.menu-btn { display: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
