:root {
  --bg: #F3F3F1; --panel: #fff; --text: #1F2328; --muted: #6B7076; --line: #E2E2DE;
  --accent: #2F6F4F; --warn: #B45309; --bad: #B42318;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 5px 12px; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; background: #fff;
}
textarea { resize: vertical; }

.top { display: flex; gap: 14px; align-items: center; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.top h1 { font-size: 16px; margin: 0; }
.spacer { flex: 1; }
.layout { display: grid; grid-template-columns: 180px 1fr; min-height: calc(100vh - 49px); }
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 12px 0; }
.nav .group { font-size: 12px; color: var(--muted); padding: 14px 20px 4px; }
.nav a { display: block; padding: 9px 20px; color: var(--text); }
.nav a.on { background: #EEF3EF; color: var(--accent); font-weight: 600; border-right: 3px solid var(--accent); }
.content { padding: 20px 24px 60px; min-width: 0; }
.content h2 { font-size: 18px; margin: 0 0 4px; display: flex; align-items: center; gap: 12px; }
.content .desc { color: var(--muted); margin: 0 0 16px; font-size: 13px; }

.tablewrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 13px; }
th { background: #FAFAF8; color: var(--muted); font-weight: 500; }
tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; max-width: 360px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 10px; background: #EEF3EF; color: var(--accent); }
.tag.off { background: #F1F1EF; color: var(--muted); }
.tag.bad { background: #FDECEC; color: var(--bad); }
.tag.plan { background: #FDF3E7; color: var(--warn); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.card b { display: block; margin-bottom: 4px; }
.card small { color: var(--muted); }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; place-items: center; z-index: 5; padding: 16px; }
.modal.show { display: grid; }
.box { background: #fff; border-radius: 10px; padding: 18px 22px; width: min(720px, 100%); max-height: 92vh; overflow: auto; }
.box h3 { margin: 0 0 8px; }
.field { margin-top: 12px; }
.field > label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1F2328; color: #fff;
  padding: 8px 14px; border-radius: 6px; font-size: 13px; display: none; z-index: 9; max-width: 80vw; }
.toast.show { display: block; }

@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  .nav { display: flex; overflow-x: auto; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav a { white-space: nowrap; padding: 10px 14px; }
  .nav a.on { border-right: 0; border-bottom: 3px solid var(--accent); }
  .nav .group { display: none; }
  .content { padding: 16px; }
}
