/* 德银国际业务管理系统 · 界面样式
   配色取自公司 Logo：藏青 / 橙 / 金 */
:root {
  --navy: #17365d;
  --navy-deep: #112a4a;
  --navy-soft: #e9eff6;
  --orange: #e4792a;
  --orange-soft: #fdf0e6;
  --gold: #c8b57c;
  --bg: #f3f4f6;
  --card: #ffffff;
  --line: #e4e7ec;
  --line-strong: #cfd5de;
  --text: #1c2430;
  --muted: #6b7482;
  --primary: #1f4e79;
  --primary-hover: #173d60;
  --primary-soft: #e9eff6;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warn: #9a5b00;
  --warn-soft: #fff4e0;
  --ok: #176b3f;
  --ok-soft: #e6f4ec;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", -apple-system, sans-serif;
  font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
[v-cloak] { display: none; }
h4 { color: var(--navy); }
code { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12px; background: #f0f2f5; padding: 1px 5px; border-radius: 3px; }

/* 图标 */
.ic { display: inline-flex; width: 16px; height: 16px; vertical-align: -3px; flex-shrink: 0; color: inherit; }
.ic svg { width: 100%; height: 100%; }
.ic.ok { color: var(--ok); }
.ic.muted { color: #b5bcc7; }
.ic.warn { color: var(--warn); }
.btn .ic { width: 14px; height: 14px; margin-right: 2px; }
.ic.chev { transition: transform .15s; color: var(--muted); }
.ic.chev.open { transform: rotate(90deg); }

/* 布局 */
.shell { display: flex; min-height: 100vh; }
.side { width: 216px; background: var(--navy); color: #b9c6d8; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; align-self: flex-start; overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; transition: width .15s; }
.side .side-resizer { position: absolute; top: 0; right: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 2; }
.side .side-resizer:hover { background: rgba(255,255,255,.12); }
.side.collapsed { width: 64px !important; }
.side.collapsed .brand { justify-content: center; padding: 14px 0; }
.side.collapsed .brand > div, .side.collapsed nav .lbl, .side.collapsed .side-foot, .side.collapsed .badge { display: none; }
.side.collapsed nav a { justify-content: center; padding: 12px 0; gap: 0; }
.side.collapsed nav a .ic { width: 20px; height: 20px; }
.side-toggle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); cursor: pointer; padding: 0; }
.side-toggle:hover { color: var(--navy); border-color: var(--line-strong); }
.side-toggle .ic { width: 16px; height: 16px; }
body.resizing { cursor: col-resize; user-select: none; }
.idx { color: var(--muted); width: 1%; text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: inherit; font-size: inherit; }
tr.sub td { background: #f8f9fb; font-size: 13px; }
tr.subhead td { background: #eef2f7; font-weight: 600; color: var(--navy); font-size: 13px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side .brand .mark { width: 36px; height: 36px; border-radius: 8px; background: #fff; object-fit: cover; object-position: left center; flex-shrink: 0; padding: 3px; }
.side .brand b { display: block; color: #fff; font-size: 15px; letter-spacing: 1px; line-height: 1.2; }
.side .brand small { display: block; color: #8fa3bf; font-size: 11px; margin-top: 3px; letter-spacing: .5px; }
.side nav { padding: 10px 0; flex: 1; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 15px; color: #b9c6d8; text-decoration: none; border-left: 3px solid transparent; font-size: 14px; }
.side nav a .ic { width: 17px; height: 17px; opacity: .85; }
.side nav a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.side nav a.on { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--orange); }
.side nav a.on .ic { opacity: 1; }
.side nav .badge { margin-left: auto; }
.side .side-foot { padding: 12px 16px; font-size: 11px; color: #6f85a3; border-top: 1px solid rgba(255,255,255,.08); line-height: 1.4; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 54px; background: var(--card); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 24px; gap: 12px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: 16px; margin: 0; flex: 1; font-weight: 600; color: var(--navy); }
.topbar .user { color: var(--muted); font-size: 13px; display: flex; gap: 14px; align-items: center; }
.topbar .user .name { color: var(--text); }
.menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 4px 6px; color: var(--navy); }
.menu-btn .ic { width: 22px; height: 22px; }
.content { padding: 22px 24px; max-width: 1440px; width: 100%; flex: 1; }
footer.foot { padding: 14px 24px; color: #9aa3b1; font-size: 12px; border-top: 1px solid var(--line); }
.side-mask { display: none; }

@media (max-width: 860px) {
  .side { position: fixed; z-index: 50; top: 0; bottom: 0; left: -236px; transition: left .2s; width: 216px !important; height: auto; }
  .side.collapsed .brand > div, .side.collapsed nav .lbl, .side.collapsed .side-foot, .side.collapsed .badge { display: block; }
  .side.collapsed nav a { justify-content: flex-start; padding: 10px 16px 10px 15px; gap: 10px; }
  .side .side-resizer, .side-toggle { display: none; }
  .side.open { left: 0; }
  .side-mask.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .menu-btn { display: inline-flex; }
  .content { padding: 12px; }
  .topbar { padding: 0 12px; }
  .topbar .user .name { display: none; }
}

/* 卡片与网格 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card h3 .spacer { flex: 1; }
.card h3 a.small { font-weight: 400; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid > * { min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--navy); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi .v { font-size: 22px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.2px; color: var(--text); }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.kpi.danger { border-left-color: var(--danger); }
.kpi.danger .v { color: var(--danger); }
.kpi.warn { border-left-color: var(--orange); }
.kpi.warn .v { color: var(--warn); }
@media (max-width: 960px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } }

/* 表格 */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid #eef0f3; text-align: left; white-space: nowrap; vertical-align: middle; }
th { background: #f7f8fa; color: var(--muted); font-weight: 500; font-size: 13px; letter-spacing: .3px; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 180px; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f6f8fb; }
tfoot td { font-weight: 600; background: #fafbfc; border-top: 1px solid var(--line); }
.empty { color: var(--muted); text-align: center; padding: 28px; }

/* 标签 */
.tag { display: inline-block; padding: 0 8px; border-radius: 3px; font-size: 12px; line-height: 20px; background: #eef1f5; color: #4f5967; white-space: nowrap; font-weight: 500; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.info { background: var(--primary-soft); color: var(--primary); }
.badge { background: var(--orange); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 18px; font-weight: 600; }
.muted { color: var(--muted); }
.red { color: var(--danger); }
.small { font-size: 12px; }

/* 表单与按钮 */
.btn { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); cursor: pointer; font-size: 13px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { background: #f6f8fb; border-color: #b8c2cf; text-decoration: 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: #efc5c0; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.link { border: 0; background: none; color: var(--primary); padding: 0 4px; height: auto; }
.btn.link:hover { background: none; text-decoration: underline; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar .spacer { flex: 1; }
input, select, textarea { font: inherit; border: 1px solid var(--line-strong); border-radius: 4px; padding: 6px 10px; background: #fff; color: var(--text); height: 32px; min-width: 0; }
textarea { height: auto; min-height: 64px; resize: vertical; width: 100%; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(31, 78, 121, .22); border-color: var(--primary); }
input::placeholder, textarea::placeholder { color: #a3abb8; }
select.ok { color: var(--ok); } select.warn { color: var(--warn); } select.danger { color: var(--danger); font-weight: 600; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.form .f { display: flex; flex-direction: column; gap: 4px; }
.form .f.full { grid-column: 1 / -1; }
.form label { font-size: 12px; color: var(--muted); }
.form label .req { color: var(--danger); }
.form input, .form select { width: 100%; }
.form .hint { font-size: 12px; color: var(--muted); }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
.cell-input { height: 28px; width: 120px; padding: 2px 6px; }
.cell-input.num { text-align: right; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(17, 42, 74, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 40px 12px; overflow-y: auto; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 720px; box-shadow: 0 16px 48px rgba(16, 24, 40, .22); }
.modal.wide { max-width: 980px; }
.modal-h { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; font-weight: 600; color: var(--navy); }
.modal-h .x { margin-left: auto; cursor: pointer; color: var(--muted); font-size: 22px; border: 0; background: none; line-height: 1; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: #fafbfc; border-radius: 0 0 8px 8px; }

/* 详情 */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; }
.info-grid > div { display: flex; flex-direction: column; gap: 2px; }
.info-grid > div > span:first-child { font-size: 12px; color: var(--muted); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; text-decoration: none; white-space: nowrap; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--orange); font-weight: 600; }
.bar { height: 6px; background: #e9ecf1; border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--primary); }
.notice { background: var(--warn-soft); color: var(--warn); border-left: 3px solid var(--orange); border-radius: 4px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.notice a { color: inherit; text-decoration: underline; }

/* 登录 */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 16px; position: relative; }
.login::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 240px; background: var(--navy); }
.login .box { position: relative; background: #fff; border-radius: 8px; padding: 36px 36px 28px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(17, 42, 74, .25); border-top: 3px solid var(--orange); }
.login .logo { display: block; height: 54px; margin: 0 auto 22px; }
.login h2 { margin: 0 0 4px; font-size: 20px; color: var(--navy); text-align: center; letter-spacing: 1px; }
.login p { margin: 0 0 24px; color: var(--muted); font-size: 12px; text-align: center; }
.login input { width: 100%; height: 40px; margin-bottom: 12px; }
.login .btn { width: 100%; height: 40px; justify-content: center; font-size: 15px; letter-spacing: 2px; }
.login .foot { margin-top: 18px; text-align: center; color: #a3abb8; font-size: 11px; }
.err { color: var(--danger); font-size: 13px; margin-bottom: 10px; min-height: 18px; }

.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--navy-deep); color: #fff; padding: 10px 18px; border-radius: 4px; z-index: 200; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 90vw; }
.toast.error { background: var(--danger); }

@media (max-width: 600px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; }
  .kpi .v { font-size: 16px; word-break: break-all; }
  .card { padding: 12px; }
  .card h3 { flex-wrap: wrap; }
  .login .box { padding: 28px 22px 22px; }
}

tr.hl td { background: #fff3e0 !important; transition: background 1.5s; }
