:root {
  --navy: #1e3a5f;
  --navy-2: #2f5d8c;
  --blue: #355f8f;
  --gold: #d9a441;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e3e8ef;
  --ok: #2f7a56;
  --warn: #b4791f;
  --danger: #b3261e;
  --shadow: 0 2px 10px rgba(30, 58, 95, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
input, select, textarea, button { font-family: inherit; font-size: 15px; }
a { color: var(--navy-2); }

/* ========== 登录 ========== */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 15% 0%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(140deg, #16283f 0%, #1e3a5f 45%, #2f5d8c 100%);
}
.login-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 14px;
  padding: 32px 28px 26px; box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand-mark {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px;
  background: linear-gradient(145deg, #1e3a5f, #2f5d8c);
  color: #fff; font-weight: 700; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.brand-mark.small { width: 28px; height: 28px; flex-basis: 28px; font-size: 12px; border-radius: 7px; }
.brand h1 { font-size: 21px; letter-spacing: .5px; }
.brand p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
form label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(47,93,140,.12);
}
textarea { min-height: 88px; resize: vertical; line-height: 1.6; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: 1px solid transparent; border-radius: 8px;
  background: var(--navy); color: #fff; font-weight: 600; cursor: pointer;
  transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn.primary { background: linear-gradient(140deg, #1e3a5f, #2f5d8c); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .85; }
.btn.line { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.ok { background: var(--ok); }
.btn.danger { background: var(--danger); }
.btn.warn { background: var(--warn); }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; padding: 12px; font-size: 16px; margin-top: 22px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 14px; text-align: center; }

/* ========== 主框架 ========== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(120deg, #16283f, #1e3a5f 60%, #2f5d8c);
  color: #fff; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(16,32,52,.18);
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.topbar-title { font-weight: 600; letter-spacing: .5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip { font-size: 13px; opacity: .92; }

.tabs {
  position: sticky; top: 48px; z-index: 15;
  display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px;
  background: #fff; border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 7px 14px; border-radius: 20px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; position: relative;
}
.tab.active { background: rgba(30,58,95,.08); color: var(--navy); font-weight: 600; border-color: rgba(30,58,95,.14); }
.badge {
  display: inline-block; min-width: 17px; height: 17px; line-height: 17px; padding: 0 5px;
  margin-left: 4px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-style: normal; text-align: center; vertical-align: 1px;
}

.view { flex: 1; padding: 16px 16px 40px; max-width: 1240px; width: 100%; margin: 0 auto; }
.foot { text-align: center; color: #9aa4b2; font-size: 12px; padding: 14px 0 22px; }

/* ========== 通用卡片/标题 ========== */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 4px 0 12px;
}
.section-title h3 { font-size: 17px; font-weight: 600; letter-spacing: .3px; }
.section-title .sub { font-size: 12.5px; color: var(--muted); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 12px; }
.grid.kpi { grid-template-columns: repeat(2, 1fr); }
.grid.two { grid-template-columns: 1fr; }
.grid.three { grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid.kpi { grid-template-columns: repeat(4, 1fr); }
  .grid.two { grid-template-columns: 1fr 1fr; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
}

.kpi-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.kpi-card .label { font-size: 12.5px; color: var(--muted); }
.kpi-card .value { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.25; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-card .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi-card .foot-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi-card.alert .value { color: var(--danger); }

/* ========== 列表/表格 ========== */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #f7f9fc; color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f9fbfd; }
td.title-cell { max-width: 280px; }
td .no { color: var(--muted); font-size: 12px; display: block; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px;
  background: #eef2f7; color: var(--navy); white-space: nowrap;
}
.st-待审核 { background: #fdf3e3; color: #9a6412; }
.st-整改中 { background: #e8f0fa; color: #2a5587; }
.st-待复查 { background: #e9f4f1; color: #26695a; }
.st-已关闭 { background: #e9f3ec; color: #2a6b46; }
.st-已驳回 { background: #f1f2f4; color: #6b7280; }
.sev-低 { background: #eef2f7; color: #44536b; }
.sev-中 { background: #fdf3e3; color: #96601a; }
.sev-高 { background: #fdecea; color: #a6332c; }
.sev-重大 { background: #8f1d17; color: #fff; }
.overdue { color: var(--danger); font-weight: 600; }

.filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.filters .full { grid-column: 1 / -1; }
@media (min-width: 720px) { .filters { grid-template-columns: repeat(5, 1fr); } }

/* ========== 提交表单 ========== */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; box-shadow: var(--shadow); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field label b { color: var(--danger); font-weight: 500; margin-left: 2px; }
.field .tip { font-size: 11.5px; color: #93a0b1; margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

.photo-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-add {
  width: 92px; height: 92px; border: 1.5px dashed #b9c6d6; border-radius: 10px;
  background: #fbfcfe; color: #77869a; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer; font-size: 12.5px; gap: 2px;
}
.photo-add span { font-size: 22px; line-height: 1; color: #9aa9bb; }
.photo-thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb button {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; cursor: pointer;
}

/* ========== 详情 ========== */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; font-size: 13.5px; margin-bottom: 14px; }
.info-grid .k { color: var(--muted); }
.info-grid .v { color: var(--text); word-break: break-word; }
.info-grid .full { grid-column: 1 / -1; }
.desc-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; white-space: pre-wrap; }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.photo-strip a { display: block; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo-strip a img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-strip .label-tag { font-size: 11px; color: var(--muted); text-align: center; margin-top: 2px; }
.timeline { list-style: none; margin: 10px 0 4px; padding-left: 4px; }
.timeline li { position: relative; padding: 0 0 14px 20px; border-left: 2px solid #e6ecf3; font-size: 13px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--navy-2); border: 2px solid #fff; box-shadow: 0 0 0 1px #d7e0ea;
}
.timeline .when { color: var(--muted); font-size: 12px; }
.timeline .what { font-weight: 600; }
.timeline .cmt { color: #4b5563; font-size: 12.5px; white-space: pre-wrap; }

.action-box { border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 14px; }
.action-box h4 { font-size: 14.5px; margin-bottom: 10px; color: var(--navy); }

/* ========== 图表（纯 CSS 条形） ========== */
.bar-row { display: grid; grid-template-columns: 118px 1fr 78px; gap: 8px; align-items: center; margin-bottom: 7px; font-size: 12.5px; }
.bar-row .name { color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: #eef2f7; border-radius: 5px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #2f5d8c, #1e3a5f); }
.bar-fill.warn { background: linear-gradient(90deg, #c98a2e, #a06a17); }
.bar-fill.danger { background: linear-gradient(90deg, #c4493f, #8f1d17); }
.bar-row .num { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.trend { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.trend .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.trend .bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, #4a7bb0, #1e3a5f); border-radius: 3px 3px 0 0; min-height: 2px; }
.trend .lbl { font-size: 10px; color: #9aa4b2; margin-top: 4px; white-space: nowrap; }

/* ========== 弹窗 ========== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-mask { position: absolute; inset: 0; background: rgba(17, 28, 42, .55); backdrop-filter: blur(2px); }
.modal-card {
  position: relative; width: 100%; max-width: 780px; max-height: 88vh; background: #fff;
  border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.modal-head h2 { font-size: 16.5px; font-weight: 600; }
.modal-body { padding: 16px 18px 22px; overflow-y: auto; }

/* ========== 提示 ========== */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(30, 42, 58, .94); color: #fff; padding: 10px 18px; border-radius: 22px;
  font-size: 13.5px; z-index: 200; max-width: 86vw; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
}
.toast.err { background: rgba(150, 30, 24, .95); }
.empty { text-align: center; color: #93a0b1; padding: 40px 16px; font-size: 13.5px; }
.empty .big { font-size: 34px; display: block; margin-bottom: 8px; opacity: .5; }
.notice { background: #fbf7ee; border: 1px solid #f0e2c6; color: #7a5a1e; border-radius: 8px; padding: 10px 12px; font-size: 13px; }

/* ========== 用户管理 / 钉钉配置 ========== */
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.btn.line.danger { background: #fff; color: var(--danger); border-color: #e6bcb9; }
table td.act { white-space: nowrap; }
table td.act .btn { margin: 2px 4px 2px 0; padding: 4px 9px; font-size: 12px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.notify-list { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.notify-title { font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.notify-item { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.notify-item .dot { width: 8px; height: 8px; border-radius: 50%; background: #c7d0da; display: inline-block; flex: none; }
.notify-item .dot.ok { background: var(--ok); }
.notify-item .dot.bad { background: var(--danger); }

.lan-box { background: #f7f9fc; border: 1px solid var(--line); border-left: 3px solid var(--navy-2);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; color: #44536b; line-height: 1.8; }
.lan-box a { color: var(--navy-2); text-decoration: none; border-bottom: 1px dashed #b9c8db; }
.lan-box span { color: var(--muted); font-size: 12px; }
