:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #f9fafb;
  --text: #18212f;
  --muted: #667085;
  --line: #d9dee7;
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --green: #0f8a5f;
  --green-soft: #e9f7f0;
  --amber: #b7791f;
  --amber-soft: #fff7e6;
  --red: #c23b3b;
  --red-soft: #fff0f0;
  --slate: #334155;
  --shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(420px, 1fr);
  background: #eef2f7;
}

.login-panel {
  background: var(--panel);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.login-panel h1 {
  margin: 0 0 10px;
  font-size: 30px;
}

.login-panel p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.login-preview {
  padding: 44px;
  display: flex;
  align-items: center;
}

.preview-board {
  width: 100%;
  max-width: 860px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.preview-head {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.preview-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.preview-row {
  border-top: 1px solid var(--line);
  padding: 18px 24px;
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 14px;
  align-items: center;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--slate);
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: var(--blue);
}

.demo-accounts {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.demo-accounts button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  color: var(--slate);
  text-align: left;
  padding: 8px 10px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  background: #101828;
  color: #fff;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  padding: 6px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  padding: 10px 12px;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.5;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
}

.search {
  width: min(520px, 44vw);
  position: relative;
}

.search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.content {
  padding: 24px;
  overflow: auto;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.page-title h2 {
  margin: 0 0 6px;
  font-size: 24px;
}

.page-title p {
  margin: 0;
  color: var(--muted);
}

.btn {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
}

.btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.btn.primary:hover {
  background: var(--blue-strong);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  border-color: #f1b2b2;
  color: var(--red);
  background: var(--red-soft);
}

.btn.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

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

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.panel-body {
  padding: 16px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

th {
  color: var(--muted);
  font-size: 12px;
  background: var(--panel-soft);
  white-space: nowrap;
}

tr:hover td {
  background: #fbfcfe;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.pill.green {
  background: var(--green-soft);
  border-color: #bfe8d4;
  color: var(--green);
}

.pill.amber {
  background: var(--amber-soft);
  border-color: #f5d391;
  color: var(--amber);
}

.pill.red {
  background: var(--red-soft);
  border-color: #efc0c0;
  color: var(--red);
}

.pill.blue {
  background: #eaf1ff;
  border-color: #bfd3ff;
  color: var(--blue-strong);
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.tabs button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--slate);
  padding: 7px 11px;
}

.tabs button.active {
  border-color: var(--blue);
  color: var(--blue);
  background: #eef5ff;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.summary-list {
  display: grid;
  gap: 10px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.summary-item span {
  color: var(--muted);
}

.summary-item strong {
  text-align: right;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.timeline-item h4 {
  margin: 0 0 6px;
  font-size: 14px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.node-list {
  display: grid;
  gap: 10px;
}

.node {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.node h4 {
  margin: 0 0 7px;
}

.node p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
}

.node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.node-actions {
  display: grid;
  gap: 8px;
  align-content: start;
}

.node-actions select {
  min-width: 150px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}

.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  z-index: 20;
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 {
  margin: 0;
}

.modal-body {
  padding: 18px;
}

.modal-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.three-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #101828;
  color: #fff;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 30;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checkline {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.checkline input {
  width: 18px;
  height: 18px;
}

.muted {
  color: var(--muted);
}

.money {
  font-weight: 800;
  color: var(--green);
}

.mobile-menu {
  display: none;
}

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-preview {
    display: none;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .topbar {
    height: auto;
    padding: 12px;
    flex-wrap: wrap;
  }

  .search {
    order: 3;
    width: 100%;
  }

  .content {
    padding: 14px;
  }

  .metric-grid,
  .grid-2,
  .grid-3,
  .detail-layout,
  .two-cols,
  .three-cols {
    grid-template-columns: 1fr;
  }

  .node {
    grid-template-columns: 1fr;
  }
}

.progress {
  height: 9px;
  border-radius: 999px;
  background: #e7ebf2;
  overflow: hidden;
  min-width: 120px;
  display: inline-flex;
  vertical-align: middle;
  margin-right: 8px;
}

.progress div {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  border-radius: inherit;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.mini-check {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px 10px;
  color: var(--slate);
}

.mini-check input {
  width: 16px;
  height: 16px;
}

pre {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

.selected-row td {
  background: #eef5ff !important;
  box-shadow: inset 3px 0 0 var(--blue);
}

.print-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
}

.print-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.print-logo {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.print-sheet .pdf-header {
  display: flex;
  gap: 14px;
  align-items: center;
  border-bottom: 2px solid var(--blue);
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.print-sheet .pdf-logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.soft-disabled {
  opacity: 0.76;
  background: #fbfcfe;
}

.mail-unread td {
  background: #fffaf0;
  font-weight: 700;
}
