/* 司法鉴定业务管理系统 — 复刻样式（Element UI 风格） */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Helvetica Neue", "PingFang SC", "Microsoft YaHei", Arial, sans-serif; font-size: 14px; color: #303133; background: #f0f2f5; }
a { color: #3a6fd8; text-decoration: none; }
a:hover { color: #5b8def; }

/* ---------- 登录 ---------- */
.login-wrap { position: fixed; inset: 0; background: linear-gradient(135deg, #2b3a67 0%, #1f2c52 100%); display: flex; align-items: center; justify-content: center; }
.login-box { width: 380px; background: #fff; border-radius: 8px; padding: 36px 36px 24px; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.login-title { font-size: 22px; font-weight: 600; text-align: center; color: #2b3a67; }
.login-sub { text-align: center; color: #909399; font-size: 12px; margin: 6px 0 24px; }
.login-box label { display: block; margin: 12px 0 6px; color: #606266; font-size: 13px; }
.login-box input { width: 100%; height: 38px; border: 1px solid #dcdfe6; border-radius: 4px; padding: 0 12px; font-size: 14px; }
.login-box input:focus { outline: none; border-color: #3a6fd8; }
.login-tip { margin-top: 16px; font-size: 12px; color: #909399; text-align: center; line-height: 1.6; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 216px; background: #2b3a67; color: #c5cbe0; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .logo { height: 56px; line-height: 56px; text-align: center; font-size: 16px; font-weight: 600; color: #fff; background: #24325a; letter-spacing: 1px; }
.menu { flex: 1; overflow-y: auto; padding: 8px 0; }
.menu-item { display: block; padding: 12px 20px; color: #c5cbe0; cursor: pointer; font-size: 14px; border-left: 3px solid transparent; }
.menu-item:hover { background: #354677; color: #fff; }
.menu-item.active { background: #3a6fd8; color: #fff; border-left-color: #7aa2f0; }
.menu-group-title { padding: 10px 20px 4px; font-size: 12px; color: #7d89ad; }
.menu-sub { display: block; padding: 9px 20px 9px 36px; color: #c5cbe0; cursor: pointer; font-size: 13px; border-left: 3px solid transparent; }
.menu-sub:hover { background: #354677; color: #fff; }
.menu-sub.active { background: #3a6fd8; color: #fff; border-left-color: #7aa2f0; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 56px; background: #fff; box-shadow: 0 1px 4px rgba(0,21,41,.08); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; z-index: 10; }
.topbar-title { font-size: 16px; font-weight: 600; color: #303133; }
.topbar-right { display: flex; align-items: center; gap: 18px; }
.user-name { color: #606266; }
.logout { color: #f56c6c; }
.msg-bell { cursor: pointer; color: #606266; position: relative; }
.badge { position: absolute; top: -8px; left: 26px; background: #f56c6c; color: #fff; font-size: 10px; border-radius: 8px; padding: 1px 5px; }
.content { flex: 1; padding: 16px 20px; overflow-y: auto; }

/* ---------- 通用组件 ---------- */
.card { background: #fff; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,21,41,.06); padding: 16px 18px; margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: #2b3a67; border-left: 3px solid #3a6fd8; padding-left: 8px; }
.btn { display: inline-block; padding: 7px 14px; border-radius: 4px; border: 1px solid #dcdfe6; background: #fff; color: #606266; font-size: 13px; cursor: pointer; line-height: 1.2; }
.btn:hover { color: #3a6fd8; border-color: #3a6fd8; }
.btn-primary { background: #3a6fd8; border-color: #3a6fd8; color: #fff; }
.btn-primary:hover { background: #5b8def; border-color: #5b8def; color: #fff; }
.btn-danger { background: #f56c6c; border-color: #f56c6c; color: #fff; }
.btn-danger:hover { background: #f78989; border-color: #f78989; color: #fff; }
.btn-success { background: #67c23a; border-color: #67c23a; color: #fff; }
.btn-warning { background: #e6a23c; border-color: #e6a23c; color: #fff; }
.btn-small { padding: 3px 9px; font-size: 12px; margin: 1px 2px; }
.btn-block { width: 100%; margin-top: 20px; height: 40px; font-size: 15px; }
.toolbar { margin-bottom: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .spacer { flex: 1; }

/* 查询区 */
.query-bar { background: #fff; border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,21,41,.06); display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.query-item { display: flex; flex-direction: column; gap: 4px; }
.query-item label { font-size: 12px; color: #909399; }
.query-item input, .query-item select { height: 32px; border: 1px solid #dcdfe6; border-radius: 4px; padding: 0 10px; font-size: 13px; width: 150px; background: #fff; }
.query-item input:focus, .query-item select:focus { outline: none; border-color: #3a6fd8; }

/* 表格 */
table.grid { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
table.grid th { background: #f5f7fa; color: #606266; padding: 9px 10px; border: 1px solid #ebeef5; text-align: left; font-weight: 600; white-space: nowrap; }
table.grid td { padding: 8px 10px; border: 1px solid #ebeef5; color: #606266; }
table.grid tr:hover td { background: #f5f9ff; }
table.grid .num { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 12px; white-space: nowrap; }
.tag-blue { background: #ecf5ff; color: #3a6fd8; }
.tag-green { background: #f0f9eb; color: #67c23a; }
.tag-orange { background: #fdf6ec; color: #e6a23c; }
.tag-red { background: #fef0f0; color: #f56c6c; }
.tag-gray { background: #f4f4f5; color: #909399; }
tr.row-red td { color: #f56c6c; }
tr.row-red td:first-child { border-left: 3px solid #f56c6c; }
td.cell-red { color: #f56c6c !important; font-weight: 600; }
td.cell-orange { color: #e6a23c !important; font-weight: 600; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 12px 4px 2px; font-size: 13px; color: #606266; }
.pager button { min-width: 30px; height: 30px; border: 1px solid #dcdfe6; background: #fff; border-radius: 4px; cursor: pointer; color: #606266; }
.pager button.cur { background: #3a6fd8; color: #fff; border-color: #3a6fd8; }
.pager button:disabled { opacity: .4; cursor: default; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 16px; }
.form-grid .span2 { grid-column: span 2; }
.form-grid .span4 { grid-column: span 4; }
.form-item { display: flex; flex-direction: column; gap: 4px; }
.form-item label { font-size: 12px; color: #606266; }
.form-item label .req { color: #f56c6c; }
.form-item input:not([type=radio]):not([type=checkbox]), .form-item select, .form-item textarea { border: 1px solid #dcdfe6; border-radius: 4px; padding: 7px 10px; font-size: 13px; width: 100%; font-family: inherit; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { outline: none; border-color: #3a6fd8; }
.form-item textarea { resize: vertical; min-height: 72px; }
.form-section { margin-bottom: 18px; }
.form-section h4 { font-size: 14px; color: #2b3a67; margin-bottom: 10px; border-bottom: 1px solid #ebeef5; padding-bottom: 6px; }
.radio-row { display: flex; gap: 14px; align-items: center; height: 33px; flex-wrap: nowrap; }
.radio-row label { display: flex; align-items: center; gap: 4px; font-size: 13px; color: #606266; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.radio-row input[type=radio], .radio-row input[type=checkbox] { width: auto; height: auto; flex: none; margin: 0; padding: 0; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px; }
.modal-box { background: #fff; border-radius: 6px; width: 640px; max-width: 96vw; box-shadow: 0 6px 30px rgba(0,0,0,.25); }
.modal-box.modal-lg { width: 980px; }
.modal-box.modal-xl { width: 1180px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid #ebeef5; }
.modal-head .t { font-size: 15px; font-weight: 600; color: #303133; }
.modal-close { cursor: pointer; color: #909399; font-size: 18px; line-height: 1; }
.modal-body { padding: 16px 18px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid #ebeef5; text-align: right; display: flex; justify-content: flex-end; gap: 8px; }

/* toast */
#toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 300; }
.toast { background: #fff; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.2); padding: 10px 20px; margin-bottom: 8px; font-size: 14px; border-left: 3px solid #67c23a; animation: slidein .2s; }
.toast.err { border-left-color: #f56c6c; color: #f56c6c; }
@keyframes slidein { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; } }

/* 面板 */
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 6px; padding: 16px; box-shadow: 0 1px 4px rgba(0,21,41,.06); }
.stat-card .n { font-size: 26px; font-weight: 700; color: #2b3a67; }
.stat-card .l { font-size: 13px; color: #909399; margin-top: 4px; }
.task-item { display: flex; justify-content: space-between; padding: 8px 4px; border-bottom: 1px dashed #ebeef5; font-size: 13px; align-items: center; }
.msg-item { padding: 8px 4px; border-bottom: 1px dashed #ebeef5; font-size: 13px; color: #606266; }
.msg-item .time { color: #b3b9c7; font-size: 12px; margin-left: 8px; }
.remind-item { padding: 6px 4px; font-size: 13px; color: #e6a23c; }

/* CSS 柱状图 */
.bar-chart { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding: 10px 6px 0; border-bottom: 1px solid #dcdfe6; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; flex: 1; max-width: 70px; }
.bar-val { font-size: 11px; color: #606266; margin-bottom: 3px; }
.bar { width: 60%; background: #3a6fd8; border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s; }
.bar-label { font-size: 12px; color: #606266; margin-top: 6px; text-align: center; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.hbar-row .lb { width: 110px; text-align: right; color: #606266; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { flex: 1; background: #f0f2f5; border-radius: 3px; height: 16px; }
.hbar-fill { background: #3a6fd8; height: 100%; border-radius: 3px; }
.hbar-row .v { width: 90px; color: #606266; }

/* 打印 */
.print-page { white-space: pre-wrap; font-family: "SimSun", "Songti SC", serif; font-size: 14px; line-height: 1.9; color: #000; padding: 8px; }
.print-toolbar { margin-bottom: 10px; text-align: right; }
@media print { .no-print { display: none !important; } .print-page { padding: 0; } }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #ebeef5; margin-bottom: 14px; flex-wrap: wrap; }
.tab { padding: 8px 16px; cursor: pointer; font-size: 14px; color: #606266; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: #3a6fd8; border-bottom-color: #3a6fd8; font-weight: 600; }

/* 流程图 */
.flow-steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.flow-step { padding: 5px 10px; border-radius: 4px; font-size: 12px; background: #f4f4f5; color: #909399; }
.flow-step.done { background: #f0f9eb; color: #67c23a; }
.flow-step.cur { background: #3a6fd8; color: #fff; }
.flow-arrow { color: #c0c4cc; font-size: 12px; }
.empty-tip { color: #909399; text-align: center; padding: 30px 0; font-size: 13px; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 12px; }
.detail-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; font-size: 13px; }
.detail-kv .kv { display: flex; gap: 6px; }
.detail-kv .k { color: #909399; white-space: nowrap; }
.detail-kv .v { color: #303133; }

/* ---------- 追加：案件详情智能视图 / 字段溯源 / 八环节进度 ---------- */
.smart-view { background:#f0f5ff; border:1px solid #d6e4ff; border-radius:4px; padding:6px 10px; }
.smart-view .sv-label { font-size:12px; color:#3a6fd8; font-weight:600; margin-right:2px; }
.stage8-box { padding:10px 14px; }
.stage8-head { display:flex; align-items:center; gap:8px; cursor:pointer; user-select:none; }
.stage8-head .stage8-arrow { color:#3a6fd8; font-size:12px; width:14px; }
.stage8-head .stage8-title { font-size:14px; font-weight:600; color:#2b3a67; }
.stage8-head .stage8-cur { font-size:12px; color:#909399; }
.stage8-body { margin-top:10px; }
.prov-foot { margin-top:12px; border-top:1px dashed #ebeef5; padding-top:10px; display:flex; flex-wrap:wrap; gap:6px 18px; font-size:12px; color:#909399; }
.prov-foot b { color:#606266; font-weight:600; }
table.grid tr.row-click td { cursor:pointer; }

/* ---------- 移动端适配 ---------- */
.menu-toggle { display: none; }
#sb-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 190; }
#sb-mask.hidden { display: none; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; font-size: 17px; border: 1px solid #dcdfe6; border-radius: 4px; cursor: pointer; color: #606266; flex-shrink: 0; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 24px rgba(0,0,0,.3); }
  .sidebar.open { transform: translateX(0); }
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 6px 12px; gap: 4px 10px; }
  .topbar-title { display: flex; align-items: center; gap: 10px; font-size: 15px; min-width: 0; white-space: nowrap; flex-shrink: 0; }
  .topbar-right { flex-wrap: wrap; row-gap: 4px; margin-left: auto; align-items: center; }
  .content { padding: 12px 14px; }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span4 { grid-column: span 2; }
  .stat-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.grid { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.grid th, table.grid td { white-space: nowrap; }
  .query-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .query-item { width: 100%; }
  .query-item input, .query-item select { width: 100%; }
  .pager { flex-wrap: wrap; justify-content: flex-start; }
  .flow-steps { gap: 4px; }
  .modal-mask { padding: 0; align-items: stretch; }
  .modal-box, .modal-box.modal-lg, .modal-box.modal-xl { width: 100%; max-width: 100vw; height: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .modal-body { max-height: none; flex: 1; }
  .login-box { width: min(380px, 92vw); padding: 28px 22px 18px; }
}

@media (max-width: 640px) {
  .topbar-right { flex: 1 1 100%; order: 3; justify-content: flex-start; margin-left: 0; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span2, .form-grid .span4 { grid-column: span 1; }
  .stat-cards { grid-template-columns: minmax(0, 1fr); }
  .detail-kv { grid-template-columns: minmax(0, 1fr); }
  .toolbar { gap: 6px; }
  .btn { padding: 7px 10px; font-size: 12px; }
}
