/* ============================================================
 * 德力西客运站电子档案管理系统 — 管理后台样式
 * 深藏蓝侧栏 + 浅色办公区 + 鎏金点缀；<768px 切换移动端布局
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #0D2145; --navy2: #122A52; --navy3: #1A3663;
  --gold: #C9A459; --gold2: #E8C97A;
  --bg: #F2F5FA; --card: #FFFFFF; --line: #E1E8F2;
  --tx: #1F2D3D; --tx2: #5E7290; --tx3: #93A3BC;
  --blue: #2F6BD8; --green: #2E9E6B; --amber: #C97A1E; --red: #D24444;
}

html, body { height: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--tx); font-size: 14px;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; }

/* ================= 登录页 ================= */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #16305C 0%, #0D2145 45%, #081527 100%);
  padding: 20px;
}
.login-card {
  width: 400px; max-width: 96vw; background: linear-gradient(170deg, rgba(26,54,99,.92), rgba(13,33,69,.96));
  border: 1px solid rgba(201,164,89,.35); border-radius: 10px; padding: 40px 38px 30px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45); position: relative;
}
.login-card::before, .login-card::after {
  content: ""; position: absolute; width: 14px; height: 14px;
}
.login-card::before { top: -1px; left: -1px; border-top: 2px solid var(--gold); border-left: 2px solid var(--gold); border-radius: 10px 0 0 0; }
.login-card::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--gold); border-right: 2px solid var(--gold); border-radius: 0 0 10px 0; }
.login-logo { text-align: center; margin-bottom: 6px; }
.login-logo .emblem { font-size: 30px; color: var(--gold2); text-shadow: 0 0 14px rgba(201,164,89,.6); }
.login-title { text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 3px;
  background: linear-gradient(180deg,#F4DFAC,#C9A459); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-sub { text-align: center; font-size: 12px; color: #7E93B8; letter-spacing: 4px; margin: 8px 0 26px; }
.login-hr { height: 1px; background: linear-gradient(90deg, transparent, rgba(201,164,89,.5), transparent); margin-bottom: 24px; }
.fld { margin-bottom: 16px; }
.fld label { display: block; font-size: 12px; color: #8FA3C4; margin-bottom: 6px; letter-spacing: 1px; }
.fld input, .fld select {
  width: 100%; height: 42px; background: rgba(10,26,51,.7); border: 1px solid #2A4B84; border-radius: 5px;
  color: #E8EFFB; font-size: 14px; padding: 0 12px; outline: none;
}
.fld input:focus, .fld select:focus { border-color: var(--gold); }
.role-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.role-chip {
  font-size: 12px; color: #9FB4D8; border: 1px solid #2A4B84; border-radius: 14px; padding: 4px 12px;
  cursor: pointer; transition: all .2s; background: transparent;
}
.role-chip.on, .role-chip:hover { color: var(--gold2); border-color: var(--gold); background: rgba(201,164,89,.1); }
.btn-login {
  width: 100%; height: 44px; margin-top: 6px; border: none; border-radius: 5px; cursor: pointer;
  background: linear-gradient(180deg, #D9B569, #B8913F); color: #14264A; font-size: 16px; font-weight: 700; letter-spacing: 6px;
}
.btn-login:hover { filter: brightness(1.07); }
.login-tip { margin-top: 16px; font-size: 11px; color: #5C7399; text-align: center; line-height: 1.8; }
.login-foot { position: fixed; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 11px; color: #3E517A; letter-spacing: 1px; }
.login-mob-link { display: none; margin-top: 14px; text-align: center; font-size: 12px; }

/* ================= 应用框架 ================= */
#frame { display: flex; height: 100vh; overflow: hidden; }

#sidebar {
  width: 218px; flex: none;
  background: linear-gradient(180deg, #132B55, #0D2145); color: #AABDDC;
  display: flex; flex-direction: column; border-right: 1px solid #1D3B6E;
}
.side-brand { flex: none; padding: 18px 16px 14px; border-bottom: 1px solid rgba(201,164,89,.25); }
.side-brand .t1 { font-size: 16px; font-weight: 700; color: var(--gold2); letter-spacing: 1px; }
.side-brand .t2 { font-size: 11px; color: #7E93B8; margin-top: 4px; letter-spacing: 2px; }
.side-search { flex: none; padding: 12px 12px 4px; }
.side-search input {
  width: 100%; height: 34px; background: rgba(10,26,51,.6); border: 1px solid #24457A; border-radius: 4px;
  color: #DCE6F5; padding: 0 10px; font-size: 13px; outline: none;
}
.side-search input:focus { border-color: var(--gold); }
#sideMenu { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
#sideMenu::-webkit-scrollbar { width: 4px; } #sideMenu::-webkit-scrollbar-thumb { background: #24457A; }
.menu-group { margin-top: 10px; }
.menu-group .gt { font-size: 12px; color: #5C7399; padding: 8px 18px 5px; letter-spacing: 2px; }
.mi {
  display: flex; align-items: center; gap: 9px; padding: 10px 18px; font-size: 15px; cursor: pointer;
  color: #AABDDC; border-left: 3px solid transparent;
}
.mi:hover { background: rgba(36,69,122,.35); color: #E8EFFB; }
.mi.on { background: linear-gradient(90deg, rgba(201,164,89,.18), transparent); color: var(--gold2); border-left-color: var(--gold); }
.mi .ic { width: 18px; text-align: center; opacity: .92; font-size: 15px; }
.mi .cnt { margin-left: auto; font-size: 10px; background: rgba(210,68,68,.85); color: #fff; border-radius: 8px; padding: 1px 6px; }
.side-foot { flex: none; padding: 12px 14px; border-top: 1px solid #1D3B6E; font-size: 11px; color: #5C7399; line-height: 1.7; }
.side-foot a { color: var(--gold); }

#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  flex: none; height: 54px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
}
.crumb { font-size: 14px; color: var(--tx2); }
.crumb b { color: var(--tx); font-weight: 600; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.top-search { position: relative; }
.top-search input {
  width: 300px; height: 34px; border: 1px solid var(--line); border-radius: 17px; padding: 0 38px 0 16px;
  font-size: 13px; outline: none; background: var(--bg);
}
.top-search input:focus { border-color: var(--gold); }
.top-search .go {
  position: absolute; right: 4px; top: 4px; width: 26px; height: 26px; border: none; border-radius: 13px;
  background: linear-gradient(180deg, #D9B569, #B8913F); color: #14264A; cursor: pointer; font-size: 13px;
}
.btn-screen { font-size: 12px; color: var(--tx2); border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: 5px 10px; cursor: pointer; }
.btn-screen:hover { color: var(--gold); border-color: var(--gold); }
.top-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx2); }
.top-user .av {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(180deg, #1A3663, #0D2145);
  color: var(--gold2); display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.link-logout { color: var(--tx3); font-size: 12px; cursor: pointer; }
.link-logout:hover { color: var(--red); }

#content { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }

/* ================= 通用组件 ================= */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; }
.card-h { padding: 13px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-h::before { content: ""; width: 4px; height: 16px; background: linear-gradient(180deg, var(--gold2), var(--gold)); border-radius: 2px; }
.card-h .ct { font-size: 15px; font-weight: 700; letter-spacing: 1px; }
.card-h .ce { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.card-b { padding: 16px 18px; }

.btn {
  height: 32px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--tx2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.pri { background: linear-gradient(180deg, #3D7AE8, #2F6BD8); border-color: #2F6BD8; color: #fff; }
.btn.pri:hover { filter: brightness(1.06); }
.btn.gd { background: linear-gradient(180deg, #D9B569, #B8913F); border-color: #B8913F; color: #14264A; font-weight: 600; }
.btn.dgr { color: var(--red); border-color: rgba(210,68,68,.4); }
.btn.dgr:hover { background: rgba(210,68,68,.06); border-color: var(--red); color: var(--red); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=text] {
  height: 32px; width: 220px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; font-size: 13px; outline: none;
}
.toolbar input:focus { border-color: var(--gold); }
.toolbar select { height: 32px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; font-size: 13px; color: var(--tx2); outline: none; background: #fff; }
.toolbar .sp { flex: 1; }

.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.tbl th {
  background: #F7F9FC; color: var(--tx2); font-weight: 600; text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid #EFF3F9; color: var(--tx); max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.tbl tr:hover td { background: #F7FAFF; }
.tbl tr.click { cursor: pointer; }
.tbl .plate { color: #8A6A1E; font-weight: 600; font-family: Bahnschrift, "DIN Alternate", sans-serif; letter-spacing: .5px; }

.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 3px; line-height: 1.5; }
.tag.b { color: var(--blue); background: rgba(47,107,216,.09); border: 1px solid rgba(47,107,216,.25); }
.tag.g { color: var(--green); background: rgba(46,158,107,.09); border: 1px solid rgba(46,158,107,.25); }
.tag.a { color: var(--amber); background: rgba(201,122,30,.09); border: 1px solid rgba(201,122,30,.3); }
.tag.r { color: var(--red); background: rgba(210,68,68,.08); border: 1px solid rgba(210,68,68,.3); }
.tag.n { color: var(--tx2); background: #F0F4FA; border: 1px solid var(--line); }

.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin-top: 14px; font-size: 12px; color: var(--tx2); }
.pager button { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer; color: var(--tx2); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .cur { color: var(--tx); font-weight: 600; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--gold2), var(--gold)); }
.stat-card.blu::after { background: linear-gradient(180deg, #6FA0F2, #2F6BD8); }
.stat-card.red::after { background: linear-gradient(180deg, #EF8A8A, #D24444); }
.stat-card.grn::after { background: linear-gradient(180deg, #6FCFA4, #2E9E6B); }
.stat-card .sl { font-size: 12px; color: var(--tx2); letter-spacing: 1px; }
.stat-card .sv { font-size: 30px; font-weight: 700; margin-top: 6px; font-family: Bahnschrift, "DIN Alternate", sans-serif; }
.stat-card .sv small { font-size: 12px; color: var(--tx3); font-weight: 400; margin-left: 3px; }
.stat-card .se { font-size: 11px; color: var(--tx3); margin-top: 5px; }

/* 弹窗 */
.mask { position: fixed; inset: 0; background: rgba(13,33,69,.55); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 8px; width: 560px; max-width: 96vw; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: 900px; }
.modal-h { flex: none; padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-h .mt { font-size: 15px; font-weight: 700; }
.modal-h .mx { margin-left: auto; border: none; background: none; font-size: 18px; color: var(--tx3); cursor: pointer; }
.modal-b { flex: 1; overflow-y: auto; padding: 18px 20px; }
.modal-f { flex: none; padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.fi label { display: block; font-size: 12px; color: var(--tx2); margin-bottom: 5px; }
.fi label .req { color: var(--red); margin-left: 2px; }
.fi input, .fi select, .fi textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; font-size: 13px;
  font-family: inherit; outline: none; background: #FBFCFE;
}
.fi input:focus, .fi select:focus, .fi textarea:focus { border-color: var(--gold); background: #fff; }
.fi textarea { min-height: 64px; resize: vertical; }
.fi.full { grid-column: 1 / -1; }
.fi.err input, .fi.err select, .fi.err textarea { border-color: var(--red); background: #FFF7F7; }
.fi .emsg { font-size: 11px; color: var(--red); margin-top: 4px; display: none; }
.fi.err .emsg { display: block; }

/* 抽屉（详情） */
.drawer-mask { position: fixed; inset: 0; background: rgba(13,33,69,.35); z-index: 890; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 94vw; background: #fff; z-index: 895; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(13,33,69,.18); }
.drawer-h { flex: none; padding: 15px 20px; background: linear-gradient(135deg, #16305C, #0D2145); color: #fff; display: flex; align-items: center; }
.drawer-h .dt { font-size: 15px; font-weight: 700; color: var(--gold2); }
.drawer-h .dx { margin-left: auto; border: none; background: none; color: #8FA3C4; font-size: 18px; cursor: pointer; }
.drawer-b { flex: 1; overflow-y: auto; padding: 16px 20px; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.kv { border-bottom: 1px dashed #E7EDF5; padding-bottom: 7px; }
.kv .k { font-size: 11px; color: var(--tx3); margin-bottom: 3px; }
.kv .v { font-size: 13px; color: var(--tx); word-break: break-all; }
.kv.full { grid-column: 1 / -1; }
.sec-t { font-size: 13px; font-weight: 700; color: var(--tx); margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.sec-t::before { content: ""; width: 3px; height: 13px; background: var(--gold); border-radius: 2px; }

/* 附件 */
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.att-row .fi-ic { width: 30px; height: 30px; border-radius: 5px; background: #F0F4FA; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.att-row .fn { font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-row .fs { font-size: 11px; color: var(--tx3); flex: none; }
.att-empty { font-size: 12px; color: var(--tx3); padding: 10px; text-align: center; background: #F8FAFD; border-radius: 6px; }
.upload-area { border: 1.5px dashed #C6D3E6; border-radius: 8px; padding: 18px; text-align: center; color: var(--tx3); font-size: 12px; cursor: pointer; background: #FBFCFE; }
.upload-area:hover { border-color: var(--gold); color: var(--gold); }

/* Toast */
#toastBox { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #16305C; color: #fff; font-size: 13px; padding: 9px 22px; border-radius: 20px; box-shadow: 0 6px 24px rgba(13,33,69,.35); animation: tstIn .3s; border: 1px solid rgba(201,164,89,.4); }
.toast.ok::before { content: "✓ "; color: #7DE2BC; }
.toast.warn::before { content: "⚠ "; color: #FFC069; }
@keyframes tstIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

/* 时间线（360视图） */
.tl { position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: #E1E8F2; }
.tl-item { position: relative; padding: 0 0 18px 8px; }
.tl-item::before { content: ""; position: absolute; left: -21px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2.5px solid var(--blue); }
.tl-item.r::before { border-color: var(--red); } .tl-item.a::before { border-color: var(--amber); } .tl-item.g::before { border-color: var(--green); }
.tl-date { font-size: 11px; color: var(--tx3); font-family: Bahnschrift, sans-serif; }
.tl-tit { font-size: 13.5px; font-weight: 600; margin: 2px 0; }
.tl-desc { font-size: 12px; color: var(--tx2); line-height: 1.6; }
.tl-link { font-size: 12px; cursor: pointer; }

/* 简单图表容器 */
.chart-row { display: flex; gap: 16px; flex-wrap: wrap; }
.chart-box { flex: 1; min-width: 320px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.chart-box .cb-t { font-size: 13px; font-weight: 700; margin-bottom: 10px; color: var(--tx); }
.hbar-row { display: grid; grid-template-columns: 88px 1fr 40px; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 12px; color: var(--tx2); }
.hbar-track { height: 10px; background: #EEF2F8; border-radius: 5px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #B8913F, var(--gold)); }
.hbar-row b { color: var(--tx); text-align: right; }

/* 导入向导 */
.wiz-steps { display: flex; margin-bottom: 20px; }
.wiz-step { flex: 1; text-align: center; font-size: 12px; color: var(--tx3); position: relative; }
.wiz-step .dot { width: 26px; height: 26px; line-height: 24px; border-radius: 50%; border: 2px solid var(--line); margin: 0 auto 6px; background: #fff; font-size: 12px; }
.wiz-step.on { color: var(--gold); font-weight: 600; }
.wiz-step.on .dot { border-color: var(--gold); background: var(--gold); color: #fff; }
.wiz-step.done { color: var(--green); }
.wiz-step.done .dot { border-color: var(--green); background: var(--green); color: #fff; }
.wiz-step::after { content: ""; position: absolute; top: 13px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; background: var(--line); }
.wiz-step:last-child::after { display: none; }
.wiz-step.done::after { background: var(--green); }
.map-tbl td, .map-tbl th { font-size: 12.5px; }
.result-ok { color: var(--green); } .result-fail { color: var(--red); } .result-skip { color: var(--amber); }

/* 空状态 */
.empty { text-align: center; color: var(--tx3); font-size: 13px; padding: 42px 0; }
.empty .e-ic { font-size: 34px; margin-bottom: 10px; opacity: .5; }

/* 徽标计数 */
.dot-num { display: inline-flex; min-width: 18px; height: 18px; align-items: center; justify-content: center; background: var(--red); color: #fff; font-size: 10.5px; border-radius: 9px; padding: 0 5px; }

/* ================= 移动端 (<768px) ================= */
.m-tabbar { display: none; }
@media (max-width: 768px) {
  #frame { flex-direction: column; }
  #sidebar { display: none; }
  #topbar { height: 50px; padding: 0 12px; gap: 8px; }
  .crumb { font-size: 13px; }
  .top-search input { width: 130px; padding-right: 34px; }
  .btn-screen { display: none; }
  .top-user .un { display: none; }
  #content { padding: 12px 12px 80px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card .sv { font-size: 22px; }
  .drawer { width: 100vw; max-width: 100vw; }
  .modal { width: 96vw; }
  .login-mob-link { display: block; }
  .login-mob-link a { color: var(--gold); }
  .toolbar input[type=text] { width: 130px; }
  #mTabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px; z-index: 800;
    background: linear-gradient(180deg, #132B55, #0D2145); border-top: 1px solid rgba(201,164,89,.35);
    justify-content: space-around; align-items: center;
  }
  .mtb { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #8FA3C4; font-size: 10.5px; cursor: pointer; padding: 6px 10px; border: none; background: none; }
  .mtb .mi-ic { font-size: 18px; }
  .mtb.on { color: var(--gold2); }
  .chart-row { flex-direction: column; }
  /* 移动端表格允许换行，避免内容贴边截断 */
  table.tbl { white-space: normal; }
  .tbl td { max-width: none; padding: 8px 10px; }
  .top-search input { width: 118px; }
}
