/* 配电房施工管控 · 工程后台
   配色克制：深蓝灰主色、浅灰底、表格细线。不引外部字体与框架。 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 13px;
  color: #1f2733;
  background: #f4f6f9;
  -webkit-font-smoothing: antialiased;
}

a { color: #1d5f9e; text-decoration: none; }

/* ---------- 登录 ---------- */
.login-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #eef2f7 0%, #e3e9f1 100%);
}
.login-card {
  width: 340px;
  background: #fff;
  border: 1px solid #dfe5ee;
  border-radius: 6px;
  padding: 32px 28px 22px;
  box-shadow: 0 8px 28px rgba(31, 39, 51, .08);
}
.login-brand { font-size: 18px; font-weight: 600; letter-spacing: .5px; }
.login-sub { color: #6b7789; margin: 6px 0 26px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; color: #4a5666; margin-bottom: 6px; font-size: 12px; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #cfd7e3;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  color: inherit;
  background: #fff;
  outline: none;
}
.field textarea { height: auto; min-height: 90px; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #1d5f9e; }
.login-error { color: #b3261e; min-height: 18px; margin: -6px 0 10px; font-size: 12px; }
.login-tip { color: #7c8798; font-size: 12px; line-height: 1.7; margin-top: 18px; border-top: 1px dashed #e2e7ef; padding-top: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 14px;
  border: 1px solid #cfd7e3;
  background: #fff;
  color: #24303f;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #a9b6c8; }
.btn.primary { background: #1d5f9e; border-color: #1d5f9e; color: #fff; }
.btn.primary:hover { background: #17517f; }
.btn.danger { color: #b3261e; border-color: #e3b5b1; }
.btn.danger:hover { background: #fdf3f2; }
.btn.ghost { background: #f7f9fc; }
.btn.link { border: none; background: none; padding: 0 4px; color: #1d5f9e; height: auto; }
.btn.block { width: 100%; height: 36px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.small { height: 26px; padding: 0 10px; font-size: 12px; }

/* ---------- 布局 ---------- */
.app-shell { display: flex; height: 100%; }
.sidebar {
  width: 192px;
  flex: 0 0 192px;
  background: #1f2a38;
  color: #cfd7e3;
  display: flex;
  flex-direction: column;
}
.side-brand {
  padding: 20px 18px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .5px;
  border-bottom: 1px solid #2c3949;
}
.nav { padding: 10px 8px; flex: 1; }
.nav-item {
  display: block;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 4px;
  color: #b9c4d2;
  cursor: pointer;
  font-size: 13px;
}
.nav-item:hover { background: #273444; color: #fff; }
.nav-item.active { background: #1d5f9e; color: #fff; }
.side-foot { padding: 14px 16px 18px; border-top: 1px solid #2c3949; font-size: 12px; }
.side-user { color: #8e9bad; margin-bottom: 8px; line-height: 1.6; }
.side-foot .btn.link { color: #9fc2e2; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 52px;
  flex: 0 0 52px;
  background: #fff;
  border-bottom: 1px solid #e2e7ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
}
.page-title { font-size: 15px; font-weight: 600; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.page { flex: 1; overflow: auto; padding: 18px 22px 40px; }

/* ---------- 卡片与工具条 ---------- */
.card {
  background: #fff;
  border: 1px solid #e2e7ef;
  border-radius: 5px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.card-title { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: #26313f; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar .field { margin: 0; min-width: 120px; }
.toolbar .field span { display: none; }
.toolbar input, .toolbar select { height: 30px; }
.chk { display: inline-flex; align-items: center; gap: 5px; color: #4a5666; cursor: pointer; }
.chk input { margin: 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 18px; }
.hint { color: #7c8798; font-size: 12px; line-height: 1.7; margin-top: 6px; }
.banner {
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.banner.warn { background: #fff8e8; border: 1px solid #f0dcae; color: #7a5a12; }
.banner.info { background: #eef4fb; border: 1px solid #cfe0f2; color: #25527d; }
.banner.danger { background: #fdf2f1; border: 1px solid #eed3d0; color: #9c2b22; }

/* ---------- 表格 ---------- */
.table-wrap { background: #fff; border: 1px solid #e2e7ef; border-radius: 5px; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  font-size: 12.5px;
  white-space: nowrap;
}
th {
  background: #f7f9fc;
  color: #4a5666;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #dfe5ee;
}
tbody tr:hover { background: #f8fafd; }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; }
td.wrap { white-space: normal; min-width: 180px; }
.empty { padding: 36px 10px; text-align: center; color: #8b96a6; }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 3px;
  font-size: 11.5px;
  line-height: 18px;
  border: 1px solid transparent;
}
.tag.gray { background: #f1f4f8; color: #5c6979; border-color: #e1e7ef; }
.tag.blue { background: #eaf2fb; color: #1d5f9e; border-color: #cfe0f2; }
.tag.green { background: #eaf6ee; color: #1f6b38; border-color: #cbe6d4; }
.tag.orange { background: #fdf3e6; color: #8a5a14; border-color: #f0dcc0; }
.tag.red { background: #fdefee; color: #a02a21; border-color: #eed3d0; }

.pager { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #5c6979; font-size: 12px; }

/* ---------- 详情 ---------- */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 18px; }
.kv .k { color: #7c8798; font-size: 12px; }
.kv .v { font-size: 13px; margin-top: 2px; word-break: break-all; }

.section-line { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.file-item {
  border: 1px solid #e2e7ef;
  border-radius: 4px;
  overflow: hidden;
  background: #fbfcfe;
}
.file-item img, .file-item video {
  width: 100%;
  height: 108px;
  object-fit: cover;
  display: block;
  background: #eef1f5;
  cursor: zoom-in;
}
.file-item .cap { padding: 5px 7px; font-size: 11.5px; color: #6b7789; display: flex; justify-content: space-between; gap: 6px; }
.file-item .cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-group { margin-bottom: 14px; }
.file-group-title { font-size: 12px; color: #4a5666; margin-bottom: 8px; }

/* ---------- 弹窗与提示 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 28, 38, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.modal {
  width: min(880px, 92vw);
  max-height: 88vh;
  background: #fff;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px rgba(15, 23, 35, .28);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e6ebf2;
}
.modal-title { font-weight: 600; font-size: 14px; }
.modal-body { padding: 16px 18px 22px; overflow: auto; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: #26313f;
  color: #fff;
  padding: 9px 16px;
  border-radius: 4px;
  font-size: 12.5px;
  box-shadow: 0 8px 22px rgba(15, 23, 35, .25);
  z-index: 40;
  max-width: 70vw;
}
.toast.err { background: #9c2b22; }

.loading { padding: 30px; color: #8b96a6; text-align: center; }

/* ---------- 小屏兜底 ---------- */
@media (max-width: 900px) {
  .sidebar { width: 150px; flex-basis: 150px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
}
