/* Lite PM — 单文件样式，无构建链 */
* { box-sizing: border-box; }
body {
  margin: 0; color: #1f2430; background: #f5f6f8;
  font: 15px/1.55 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: #1a5fb4; text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 12px; }
h1 small { font-size: 13px; color: #8a91a0; font-weight: normal; }
h2 { font-size: 16px; margin: 22px 0 8px; border-left: 3px solid #1a5fb4; padding-left: 8px; }
code, .mono { font-family: Consolas, "Courier New", monospace; }

.topbar { background: #1f2430; padding: 0 16px; }
.topbar nav { display: flex; gap: 4px; align-items: center; height: 44px; }
.topbar .nav-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.logout-form { display: inline; }
.topbar .link { color: #cfd4de; padding: 6px 12px; font-size: 14px; }
.topbar .link:hover { color: #fff; text-decoration: none; }

/* 登录页 */
.login-wrap { display: flex; justify-content: center; padding-top: 12vh; }
.login-card { width: 340px; display: flex; flex-direction: column; gap: 12px; }
.login-brand { text-align: center; font-size: 20px; margin: 4px 0 8px; }
.login-card button { width: 100%; }
.topbar a { color: #cfd4de; padding: 6px 12px; border-radius: 6px; }
.topbar a:hover { background: #333a4a; text-decoration: none; }
.topbar a.active { background: #1a5fb4; color: #fff; }
.topbar .brand { color: #fff; font-weight: 700; margin-right: 12px; }

main { max-width: 1080px; margin: 0 auto; padding: 18px 16px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* 统计条 */
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 6px; }
.stat {
  background: #fff; border: 1px solid #e3e6ec; border-radius: 10px;
  padding: 10px 18px; min-width: 92px; text-align: center; color: #1f2430;
}
.stat:hover { text-decoration: none; border-color: #1a5fb4; }
.stat b { display: block; font-size: 24px; }
.stat span { font-size: 12px; color: #6b7280; }
.stat.hot b { color: #c01c28; }

.card { background: #fff; border: 1px solid #e3e6ec; border-radius: 10px; padding: 14px 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; }
.banner { border-radius: 8px; padding: 8px 12px; margin: 10px 0; background: #fff7e6; border: 1px solid #f0c36d; }
.banner.error { background: #fdecec; border-color: #e59494; color: #a12622; }
.error { color: #c01c28; font-size: 13px; margin-top: 4px; }
.muted { color: #8a91a0; font-size: 13px; }
.empty { color: #8a91a0; }

/* 表格 */
table.items { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3e6ec; border-radius: 8px; overflow: hidden; }
table.items th, table.items td { padding: 7px 10px; border-bottom: 1px solid #eef0f4; text-align: left; vertical-align: top; font-size: 14px; }
table.items thead th { background: #fafbfc; color: #6b7280; font-weight: 600; font-size: 13px; }
table.items tbody tr:hover { background: #f7faff; }
td.text { max-width: 220px; white-space: pre-wrap; }
td.empty { text-align: center; padding: 14px; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #eef0f4; color: #4b5563; margin-left: 6px; }
.tag.warn { background: #fde8e8; color: #c01c28; }
.tag.st { background: #e8f0fe; color: #1a5fb4; margin-left: 0; }

/* 表单 */
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #4b5563; }
input, select, textarea {
  font: inherit; padding: 6px 8px; border: 1px solid #cfd4de; border-radius: 6px; background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #bcd3f7; border-color: #1a5fb4; }
form.card, .filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 10px 0; }
form.card > label { min-width: 180px; flex: 1 1 30%; }
form.card > label.full { flex-basis: 100%; }
form.card label.check { flex-direction: row; align-items: center; gap: 6px; flex: 0 0 auto; }
form.card details { border: 1px dashed #cfd4de; border-radius: 8px; padding: 8px 12px; }
form.card details summary { cursor: pointer; color: #6b7280; font-size: 13px; }
form.card details[open] { display: flex; flex-wrap: wrap; gap: 10px 14px; }
form.card details[open] > summary { width: 100%; }
form.card details > label { min-width: 180px; flex: 1 1 30%; }
form.card details > label.full { flex-basis: 100%; }
form.card details > label.check { flex-direction: row; align-items: center; gap: 6px; flex: 0 0 auto; }
.actions { display: flex; gap: 10px; }
.filters label { flex-direction: column; }

button, .btn {
  font: inherit; padding: 6px 14px; border-radius: 6px; border: 1px solid #cfd4de;
  background: #fff; cursor: pointer; color: #1f2430; display: inline-block;
}
button:hover, .btn:hover { border-color: #1a5fb4; text-decoration: none; }
button.primary, .btn.primary { background: #1a5fb4; border-color: #1a5fb4; color: #fff; }
button.link { border: none; background: none; color: #1a5fb4; padding: 0; font-size: 13px; }
button.link:hover { text-decoration: underline; }

/* 筛选 chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.chip { padding: 3px 12px; border-radius: 999px; background: #fff; border: 1px solid #e3e6ec; font-size: 13px; color: #4b5563; }
.chip.active { background: #1a5fb4; border-color: #1a5fb4; color: #fff; }
.chip:hover { text-decoration: none; border-color: #1a5fb4; }

/* 行内快改 */
.inline-block { margin: 6px 0; }
.inline-form { display: flex; gap: 8px; align-items: flex-start; }
.inline-form .lbl { flex: 0 0 64px; padding-top: 7px; font-size: 13px; color: #4b5563; }
.inline-form textarea { flex: 1; }
.inline-form select { min-width: 120px; }
.conclusion { margin: 8px 0; font-size: 14px; }
.conclusion .lbl { font-weight: 600; margin-right: 8px; color: #4b5563; }

/* 设备现状卡 */
table.current { width: 100%; border-collapse: collapse; }
table.current th, table.current td { padding: 7px 12px; text-align: left; border-bottom: 1px solid #eef0f4; font-size: 14px; }
table.current th { color: #6b7280; width: 110px; font-weight: 600; }
table.current td.conflict { color: #c01c28; font-weight: 600; }
table.current tr.conflict-detail td { background: #fdf6f6; padding: 6px 12px 10px; }
table.current .cand { padding: 2px 0; }
.ev-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ev-body { display: flex; gap: 6px 12px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.ev-ops { margin-top: 6px; }
.ev-ops input { font-size: 13px; padding: 3px 8px; width: 240px; }

/* 历史 */
.timeline { list-style: none; margin: 8px 0; padding: 0; }
.timeline li { background: #fff; border: 1px solid #e3e6ec; border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; }
.timeline details { margin-top: 4px; }
.timeline summary { cursor: pointer; font-size: 13px; color: #6b7280; }
table.diff { margin-top: 6px; border-collapse: collapse; }
table.diff th, table.diff td { border: 1px solid #eef0f4; padding: 3px 10px; font-size: 13px; text-align: left; vertical-align: top; }
table.diff th { background: #fafbfc; color: #6b7280; white-space: nowrap; }
table.diff .old { color: #a12622; background: #fdf6f6; max-width: 320px; white-space: pre-wrap; }
table.diff .new { color: #1a7f37; background: #f6fbf7; max-width: 320px; white-space: pre-wrap; }
table.diff .arrow { color: #8a91a0; border: none; background: none; }
