:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee8;
  --surface: #ffffff;
  --page: #f4f6f8;
  --nav: #182231;
  --blue: #245b91;
  --green: #1f8a5b;
  --yellow: #b7791f;
  --orange: #c05621;
  --red: #c53030;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 220px;
  background: var(--nav);
  color: white;
  padding: 22px 16px;
}

.brand {
  display: grid;
  gap: 5px;
  padding: 8px 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand strong {
  font-size: 22px;
}

.brand span {
  color: #b9c4d0;
}

nav {
  display: grid;
  gap: 6px;
  padding-top: 18px;
}

nav a {
  color: #e8eef5;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 6px;
}

nav a:hover,
nav a.active {
  background: rgba(255, 255, 255, 0.1);
}

nav a.active {
  color: #ffffff;
  font-weight: 800;
  box-shadow: inset 3px 0 0 #76b7ff;
}

.workspace {
  margin-left: 220px;
  padding: 28px;
}

.topbar,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.topbar h1,
h2 {
  margin: 0;
}

.topbar h1 {
  font-size: 28px;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-weight: 800;
}

.login-strip,
.inline-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.panel,
.table-panel,
.metric,
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel,
.table-panel {
  padding: 20px;
  margin-bottom: 18px;
}

.module-section {
  display: none;
}

.module-section.active {
  display: block;
}

.module-section.active.metric-grid {
  display: grid;
}

.notice {
  padding: 14px 16px;
  margin-bottom: 18px;
  border-left: 4px solid var(--blue);
  color: #184a78;
  font-weight: 800;
}

.notice.error {
  border-left-color: var(--red);
  color: var(--red);
}

.notice.success {
  border-left-color: var(--green);
  color: var(--green);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-panel {
  grid-column: span 3;
}

.metric {
  padding: 18px;
  display: grid;
  gap: 10px;
}

.metric span,
.muted,
small {
  color: var(--muted);
}

.metric strong {
  font-size: 30px;
}

.metric.danger strong {
  color: var(--red);
}

.metric.orange strong {
  color: var(--orange);
}

.metric.yellow strong {
  color: var(--yellow);
}

.metric.green strong {
  color: var(--green);
}

.upload-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.mini-form {
  display: grid;
  grid-template-columns: 120px 150px 90px 100px minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.summary-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

label span {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: white;
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 72px;
  resize: vertical;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--blue);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.secondary {
  background: #667085;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
}

.check input {
  width: auto;
}

.check span {
  margin: 0;
  font-weight: 400;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

table.compact {
  min-width: 720px;
}

.dashboard-panel table.compact {
  min-width: 0;
}

.hint-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hint-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  background: #f8fafc;
  color: var(--muted);
}
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  vertical-align: top;
  text-align: left;
  font-size: 14px;
}

th {
  background: #eef2f6;
  color: #344054;
  font-weight: 800;
}

td p {
  margin: 0 0 7px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 34px;
  height: 28px;
  border-radius: 999px;
  color: white;
  font-weight: 900;
}

.level-绿 {
  background: var(--green);
}

.level-黄 {
  background: var(--yellow);
}

.level-橙 {
  background: var(--orange);
}

.level-红 {
  background: var(--red);
}

.confirm-form {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.inline-edit {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.rule-editor {
  min-width: 360px;
}

.settings-list {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}

.settings-list dt {
  color: var(--muted);
  font-weight: 800;
}

.settings-list dd {
  margin: 0;
  word-break: break-word;
}

@media (max-width: 1080px) {
  .sidebar {
    position: static;
    width: auto;
  }

  .workspace {
    margin-left: 0;
    padding: 18px;
  }

  nav,
  .metric-grid,
  .upload-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-panel {
    grid-column: auto;
  }

  .topbar,
  .section-head,
  .login-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .mini-form {
    grid-template-columns: 1fr;
  }
}
