/* ============================================================
   药物警戒体系文件管理平台 PV-DMS V1.3
   商务蓝主题（浅色）
   ============================================================ */
:root {
  --brand:        #003591;
  --brand-2:      #1a5fb4;
  --brand-3:      #4a8fe0;
  --brand-soft:   #eaf1fb;
  --brand-softer: #f4f8fd;

  --ink:      #1c2430;
  --ink-2:    #4a5566;
  --ink-3:    #7b8698;
  --line:     #dde4ee;
  --line-2:   #eaeff6;
  --bg:       #f2f5f9;
  --card:     #ffffff;

  --ok:       #1a8f5a;
  --ok-soft:  #e6f5ee;
  --warn:     #b8791a;
  --warn-soft:#fdf3e2;
  --danger:   #c8382f;
  --danger-soft:#fdec eb;
  --danger-soft:#fceceb;
  --info:     #1a5fb4;
  --info-soft:#eaf1fb;
  --grey-soft:#f0f2f6;

  --radius:   6px;
  --shadow:   0 1px 3px rgba(20,40,80,.07), 0 1px 2px rgba(20,40,80,.04);
  --shadow-2: 0 6px 24px rgba(20,40,80,.14);
  --font: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #c8d2e0; border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 登录页 ============ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #003591 0%, #1a5fb4 55%, #4a8fe0 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ''; position: absolute; width: 700px; height: 700px; right: -180px; top: -220px;
  background: radial-gradient(circle, rgba(255,255,255,.13) 0%, rgba(255,255,255,0) 68%);
}
.login-card {
  position: relative; width: 920px; max-width: 94vw; background: #fff; border-radius: 10px;
  box-shadow: var(--shadow-2); display: flex; overflow: hidden; min-height: 480px;
}
.login-left {
  flex: 1; padding: 46px 48px; background: linear-gradient(160deg, #003591, #0d47a1);
  color: #fff; display: flex; flex-direction: column; justify-content: center;
}
.login-left h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: 1px; font-weight: 700; }
.login-left .sub { font-size: 13px; opacity: .82; margin-bottom: 26px; }
.login-left ul { list-style: none; padding: 0; margin: 0; font-size: 13px; line-height: 2.05; opacity: .92; }
.login-left li::before { content: '▸'; margin-right: 8px; opacity: .7; }
.login-right { width: 380px; padding: 46px 42px; display: flex; flex-direction: column; justify-content: center; }
.login-right h2 { font-size: 19px; margin: 0 0 22px; color: var(--ink); }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--ink-3); line-height: 1.9; }
.login-hint b { color: var(--brand-2); }

/* ============ 布局 ============ */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: 0 0 216px; background: #0b2c5e; color: #cfe0f5;
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 30;
}
.sidebar .brand {
  padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.09);
  font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .5px; line-height: 1.4;
}
.sidebar .brand small { display: block; font-size: 11px; font-weight: 400; color: #8fb3e0; letter-spacing: .3px; }
.nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav-group { padding: 12px 18px 5px; font-size: 11px; color: #6f95c4; letter-spacing: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 18px; cursor: pointer;
  font-size: 13.5px; border-left: 3px solid transparent; transition: background .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: #7fb2f0; font-weight: 600; }
.nav-item .ico { width: 17px; text-align: center; font-size: 15px; }
.nav-item .badge {
  margin-left: auto; background: #d9534f; color: #fff; border-radius: 9px; padding: 0 6px;
  font-size: 11px; line-height: 17px; min-width: 18px; text-align: center;
}

.main { flex: 1; margin-left: 216px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 54px; background: #fff; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; padding: 0 20px; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 16px; font-weight: 600; color: var(--ink); }
.topbar .crumb { font-size: 12px; color: var(--ink-3); }
.topbar .spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 20px;
  background: var(--brand-soft); cursor: pointer; font-size: 13px;
}
.user-chip .av {
  width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.content { padding: 18px 20px 40px; flex: 1; min-width: 0; }

/* ============ 卡片 / 栅格 ============ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card-head {
  padding: 13px 16px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 16px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 820px)  { .g2,.g3,.g4 { grid-template-columns: 1fr; } }

.stat {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
  border-left: 4px solid var(--brand); display: flex; align-items: center; gap: 14px;
}
.stat .num { font-size: 26px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.stat .lbl { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.stat.ok { border-left-color: var(--ok); } .stat.ok .num { color: var(--ok); }
.stat.warn { border-left-color: var(--warn); } .stat.warn .num { color: var(--warn); }
.stat.danger { border-left-color: var(--danger); } .stat.danger .num { color: var(--danger); }
.stat.info { border-left-color: var(--info); } .stat.info .num { color: var(--info); }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tb th {
  background: var(--brand); color: #fff; font-weight: 600; text-align: left; padding: 9px 11px;
  white-space: nowrap; font-size: 12.5px;
}
table.tb td { padding: 8px 11px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.tb tbody tr:hover { background: var(--brand-softer); }
table.tb tbody tr.overdue { background: #fdeceb; }
table.tb tbody tr.overdue:hover { background: #fbdedc; }
table.tb td.nowrap, table.tb th.nowrap { white-space: nowrap; }
table.tb .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tb.compact td, table.tb.compact th { padding: 6px 9px; }
.empty { padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ============ 按钮 / 表单 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); padding: 6px 13px; border-radius: 4px; cursor: pointer;
  font-size: 13px; font-family: var(--font); transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--brand-3); color: var(--brand-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { opacity: .9; color: #fff; }
.btn.danger { background: #fff; border-color: #e3b3af; color: var(--danger); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn.lg { padding: 9px 22px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.form-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 13px; }
.field { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 5px; }
.field.w100 { flex-basis: 100%; }
.field > label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.field > label .req { color: var(--danger); margin-left: 2px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; font-size: 13px;
  font-family: var(--font); color: var(--ink); background: #fff; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand-3); box-shadow: 0 0 0 2px rgba(74,143,224,.15); }
input[readonly], input:disabled, select:disabled { background: #f6f8fb; color: var(--ink-3); }
textarea { resize: vertical; min-height: 74px; line-height: 1.6; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.chk input { width: 15px; height: 15px; }

/* ============ 标签 / 徽标 ============ */
.tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; line-height: 18px;
  background: var(--grey-soft); color: var(--ink-2); white-space: nowrap;
}
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.tag.ok    { background: var(--ok-soft);    color: var(--ok); }
.tag.warn  { background: var(--warn-soft);  color: var(--warn); }
.tag.danger{ background: var(--danger-soft);color: var(--danger); }
.tag.info  { background: var(--info-soft);  color: var(--info); }
.tag.grey  { background: var(--grey-soft);  color: var(--ink-3); }

.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); } .dot.grey { background: #b9c2d0; }

/* ============ 页面头 / 工具条 ============ */
.page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.page-head .desc { font-size: 12.5px; color: var(--ink-3); }
.page-head .spacer { flex: 1; }
.toolbar {
  display: flex; gap: 9px; align-items: center; flex-wrap: wrap; padding: 11px 16px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px;
}
.toolbar input, .toolbar select { width: auto; min-width: 130px; }

/* ============ 详情页 Tab ============ */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 8px 16px; cursor: pointer; font-size: 13.5px; color: var(--ink-2);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab:hover { color: var(--brand-2); }
.tab.active { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }

/* ============ 描述列表 ============ */
.dl { display: grid; grid-template-columns: 132px 1fr 132px 1fr; gap: 9px 12px; font-size: 13px; }
.dl .k { color: var(--ink-3); }
.dl .v { color: var(--ink); word-break: break-all; }
@media (max-width: 900px) { .dl { grid-template-columns: 110px 1fr; } }

/* ============ 时间线 ============ */
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.timeline li { position: relative; padding-bottom: 16px; }
.timeline li::before {
  content: ''; position: absolute; left: -19px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff; border: 2px solid var(--brand-3);
}
.timeline li.done::before { background: var(--ok); border-color: var(--ok); }
.timeline li.cur::before { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,53,145,.14); }
.timeline .t-head { font-size: 13.5px; font-weight: 600; }
.timeline .t-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.timeline .t-body { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; background: var(--brand-softer);
  border-left: 3px solid var(--brand-3); padding: 7px 10px; border-radius: 0 4px 4px 0; }

/* ============ 弹窗 ============ */
.mask {
  position: fixed; inset: 0; background: rgba(15,30,55,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal {
  background: #fff; border-radius: 8px; box-shadow: var(--shadow-2); width: 620px; max-width: 100%;
  max-height: 88vh; display: flex; flex-direction: column; animation: pop .16s ease-out;
}
.modal.wide { width: 900px; }
.modal.narrow { width: 440px; }
@keyframes pop { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  padding: 13px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center;
  font-size: 15px; font-weight: 600;
}
.modal-head .x { margin-left: auto; cursor: pointer; color: var(--ink-3); font-size: 20px; line-height: 1; }
.modal-head .x:hover { color: var(--danger); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--line-2); display: flex; gap: 9px; justify-content: flex-end;
}

/* 电子签名弹窗 */
.sign-box { background: var(--brand-softer); border: 1px solid #cfdff5; border-radius: 5px; padding: 13px 15px; margin-bottom: 15px; }
.sign-box .meaning { font-size: 14px; font-weight: 600; color: var(--brand); margin-bottom: 5px; }
.sign-box .meta { font-size: 12px; color: var(--ink-2); line-height: 1.8; }
.sign-warn { background: var(--warn-soft); border: 1px solid #f0dcb8; border-radius: 5px; padding: 10px 13px;
  font-size: 12.5px; color: #8a5a10; line-height: 1.75; margin-bottom: 14px; }

/* ============ Toast ============ */
#toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex;
  flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #fff; border-left: 4px solid var(--brand); box-shadow: var(--shadow-2); border-radius: 4px;
  padding: 10px 18px; font-size: 13.5px; max-width: 560px; animation: pop .15s;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

/* ============ 其它 ============ */
.code { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; color: var(--brand); font-weight: 600; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 11.5px; color: var(--ink-3); word-break: break-all; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.b { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mb10 { margin-bottom: 10px; }
.sep { height: 1px; background: var(--line-2); margin: 14px 0; }
.notice {
  border-left: 3px solid var(--brand-3); background: var(--brand-softer); padding: 9px 13px;
  font-size: 12.5px; color: var(--ink-2); border-radius: 0 4px 4px 0; line-height: 1.75;
}
.notice.warn { border-left-color: var(--warn); background: var(--warn-soft); color: #7a5310; }
.notice.danger { border-left-color: var(--danger); background: var(--danger-soft); color: #92271f; }

.preview-pane {
  background: #fbfcfe; border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px;
  font-size: 13px; line-height: 1.95; white-space: pre-wrap; max-height: 460px; overflow-y: auto;
  font-family: "Microsoft YaHei", serif;
}
.step-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.step-bar .step {
  display: flex; align-items: center; gap: 7px; padding: 5px 14px; border-radius: 16px;
  background: var(--grey-soft); font-size: 12.5px; color: var(--ink-3);
}
.step-bar .step.on { background: var(--brand); color: #fff; font-weight: 600; }
.step-bar .step .n {
  width: 17px; height: 17px; border-radius: 50%; background: #fff; color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}
.step-bar .step.on .n { background: rgba(255,255,255,.28); color: #fff; }
.step-bar .arrow { color: var(--ink-3); }
