* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #eef1f5; color: #1f2937; }

/* ---- 登录 ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #15263b; }
.login-card { width: 340px; padding: 30px 26px; border-radius: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.brand { text-align: center; color: #1e3a5f; font-size: 19px; font-weight: 700; margin-bottom: 22px; }
.login-card input { width: 100%; padding: 12px 14px; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 15px; }
.login-card .btn { width: 100%; margin-top: 14px; }
.err { color: #dc2626; font-size: 13px; text-align: center; margin-top: 10px; }

/* ---- 布局 ---- */
.app { display: flex; min-height: 100vh; }
.side { width: 246px; background: #15263b; color: #cbd5e1; display: flex; flex-direction: column; padding: 18px 14px; }
.logo { font-size: 16px; font-weight: 700; color: #fff; }
.logo .em { color: #fbbf24; }
.sub { font-size: 12px; color: #7c8aa0; margin: 4px 0 20px; }
.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-item { color: #cbd5e1; text-decoration: none; font-size: 14px; padding: 9px 12px; border-radius: 8px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.nav-item:hover { background: #1d2f47; }
.nav-item.active { background: #1e3a5f; color: #fff; }
.nav-item .ic { width: 20px; text-align: center; }
.nav-item .ct { margin-left: auto; font-size: 12px; background: #0f1d30; border-radius: 10px; padding: 1px 8px; color: #94a3b8; }
.nav-item.active .ct { color: #cbd5e1; }
.side-foot { font-size: 12px; color: #5b6b82; }
.side-foot a { color: #7c8aa0; text-decoration: none; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top { height: 60px; background: #fff; border-bottom: 1px solid #e5e9f0; display: flex; align-items: center; gap: 12px; padding: 0 22px; }
.search { flex: 1; max-width: 520px; position: relative; }
.search input { width: 100%; padding: 10px 14px 10px 38px; border: 1px solid #d7dee9; border-radius: 10px; font-size: 14px; background: #f8fafc; }
.search .si { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.crumb { font-size: 15px; color: #475569; flex: 1; }
.crumb a { color: #1e3a5f; text-decoration: none; }

.content { padding: 22px; overflow: auto; }
.page-title { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: #6b7280; font-size: 13px; margin-bottom: 18px; }

.btn { padding: 9px 14px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; background: #e2e8f0; color: #334155; }
.btn.primary { background: #1e3a5f; color: #fff; }
.btn.ghost { background: #fff; border: 1px solid #cbd5e1; color: #334155; }
.btn.sm { padding: 5px 10px; font-size: 13px; }

/* ---- 统计卡 ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: 14px; padding: 15px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.stat .n { font-size: 25px; font-weight: 800; color: #15263b; }
.stat.accent .n { color: #2563eb; }
.stat .l { font-size: 12px; color: #6b7280; margin-top: 2px; }

/* ---- 筛选 ---- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { font-size: 13px; padding: 6px 13px; border-radius: 999px; background: #fff; border: 1px solid #e2e8f0; color: #475569; cursor: pointer; }
.chip.on { background: #1e3a5f; color: #fff; border-color: #1e3a5f; }
.chip .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ---- 卡片网格 ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.case { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 1px solid #eef1f5; cursor: pointer; transition: box-shadow .15s; }
.case:hover { box-shadow: 0 3px 12px rgba(0,0,0,.1); }
.case.urgent { border: 1px solid #fecaca; box-shadow: 0 0 0 3px rgba(220,38,38,.08); }
.case .top1 { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.case .nm { font-size: 15px; font-weight: 700; color: #15263b; }
.case .no { font-size: 12px; color: #94a3b8; margin-top: 2px; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; color: #fff; white-space: nowrap; }
.badge-urgent { background: #dc2626; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.case .meta { margin-top: 12px; display: grid; grid-template-columns: 72px 1fr; gap: 6px 10px; font-size: 13px; }
.case .meta .k { color: #94a3b8; }
.case .bottom { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f1f5f9; padding-top: 11px; }
.case .docs { font-size: 12px; color: #64748b; }
.due { font-size: 12px; font-weight: 600; }
.due.warn { color: #dc2626; } .due.soon { color: #d97706; } .due.ok { color: #16a34a; }
.empty { text-align: center; color: #94a3b8; padding: 50px; }

/* ---- 详情 ---- */
.detail { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); overflow: hidden; }
.detail .dh { background: #1e3a5f; color: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.detail .dh .t { font-size: 17px; font-weight: 700; flex: 1; }
.detail .body { display: grid; grid-template-columns: 1.2fr 1fr; }
.detail .info { padding: 18px 20px; }
.grp { margin-bottom: 14px; }
.grp h4 { font-size: 12px; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 8px; border-left: 3px solid #1e3a5f; padding-left: 8px; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 7px 12px; font-size: 13px; }
.kv .k { color: #64748b; }
.docs2 { padding: 18px 20px; background: #f8fafc; border-left: 1px solid #eef1f5; }
.docs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.docs-head h4 { font-size: 13px; color: #475569; margin: 0; }
.docs-head select { padding: 5px 8px; border: 1px solid #cbd5e1; border-radius: 7px; font-size: 12px; }
#doc-list { max-height: 60vh; overflow: auto; }
.dr { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef1f5; }
.dr .ico { width: 34px; height: 34px; border-radius: 8px; background: #e0e7ff; color: #4338ca; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.dr .tt { font-size: 13px; }
.dr .mt { font-size: 11px; color: #94a3b8; }
.dr .act { margin-left: auto; font-size: 12px; color: #1e3a5f; background: none; border: none; cursor: pointer; padding: 2px 6px; }
.dr .act.danger { color: #dc2626; }

/* ---- 弹窗 ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 560px; max-width: 100%; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: 680px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid #eef1f5; font-size: 16px; font-weight: 700; display: flex; align-items: center; }
.modal-head .x { margin-left: auto; cursor: pointer; color: #94a3b8; font-size: 20px; line-height: 1; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid #eef1f5; display: flex; gap: 10px; justify-content: flex-end; }
.fld { margin-bottom: 12px; }
.fld label { display: block; font-size: 13px; color: #475569; margin-bottom: 5px; }
.fld input, .fld select, .fld textarea { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; font-family: inherit; }
.fld.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld.row2 > div { margin-bottom: 0; }
.hint { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.drop { border: 2px dashed #cbd5e1; border-radius: 12px; padding: 28px; text-align: center; color: #64748b; cursor: pointer; }
.drop.over { border-color: #1e3a5f; background: #f0f6ff; color: #1e3a5f; }
.drop input { display: none; }
.filelist { margin-top: 12px; max-height: 200px; overflow: auto; }
.filelist .fi { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 13px; border-bottom: 1px solid #f1f5f9; }
.filelist .fi .x { margin-left: auto; color: #dc2626; cursor: pointer; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #15263b; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.toast.err { background: #dc2626; }
/* ---- 移动端底部导航 ---- */
.mobile-nav { display: none; }
.mobile-mask { display: none; }

@media (max-width: 800px) {
  .app { flex-direction: column; }
  /* 侧栏改为抽屉 */
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 120; width: 250px; transform: translateX(-100%); transition: transform .22s ease; }
  .side.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.35); }
  .mobile-mask.show { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 110; }

  .main { width: 100%; }
  .top { height: 54px; padding: 0 12px; gap: 8px; position: sticky; top: 0; z-index: 30; }
  .top .menu-btn { display: flex; }
  .search { max-width: none; }
  .search input { padding: 9px 12px 9px 34px; font-size: 15px; }
  .top .btn { padding: 8px 10px; font-size: 13px; white-space: nowrap; }
  .crumb { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .content { padding: 14px 12px 76px; }
  .page-title { font-size: 17px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat .n { font-size: 20px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .detail .body { grid-template-columns: 1fr; }
  .docs2 { border-left: none; border-top: 1px solid #eef1f5; }
  .detail .dh { padding: 13px 14px; flex-wrap: wrap; }

  /* 底部导航栏 */
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 58px; background: #fff; border-top: 1px solid #e5e9f0; z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
  .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: #94a3b8; text-decoration: none; }
  .mobile-nav a.active { color: #1e3a5f; font-weight: 600; }
  .mobile-nav a .mi { font-size: 18px; line-height: 1; }

  /* 弹窗全屏化 */
  .modal { width: 100% !important; max-height: 92vh; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { border-radius: 16px 16px 0 0; }
  .fld.row2 { grid-template-columns: 1fr; }
  .dr { flex-wrap: wrap; }
  .dr .act { margin-left: 0; }
}

/* 桌面端显示菜单按钮开关（默认隐藏） */
.top .menu-btn { display: none; background: none; border: none; font-size: 22px; cursor: pointer; color: #1e3a5f; padding: 4px 6px; }
