:root {
  color-scheme: light;
  --page-blue: #254b86;
  --page-blue-deep: #183b71;
  --banner-blue: #284f8f;
  --banner-blue-soft: #315da0;
  --accent: #3d99f5;
  --accent-dark: #1d74d2;
  --bg: #f7f9fc;
  --panel: #ffffff;
  --panel-soft: #fbfcff;
  --text: #202938;
  --muted: #7a8597;
  --line: #e5eaf2;
  --danger: #d84b43;
  --warning: #c88721;
  --success: #47a447;
  --shadow: 0 8px 24px rgba(29, 55, 92, 0.09);
  --shadow-strong: 0 14px 34px rgba(29, 55, 92, 0.16);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 255, 255, 0.12), transparent 24%),
    linear-gradient(135deg, var(--page-blue-deep) 0%, var(--page-blue) 52%, #2c5596 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

.shell {
  width: min(1240px, calc(100vw - 48px));
  min-height: calc(100vh - 50px);
  margin: 25px auto;
  padding: 20px 20px 34px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(8, 24, 48, 0.2);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(430px, 100%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 22px 70px rgba(8, 24, 48, 0.24);
  padding: 30px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.brand-mark {
  display: none;
}

.brand h1,
.brand p,
.panel-head h2,
.panel-head p,
.section-head h2,
.section-head p {
  margin: 0;
}

.brand h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand p {
  margin-top: 16px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.login-card .brand {
  justify-content: flex-start;
  margin-bottom: 22px;
}

.login-card .brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  border-radius: 12px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  font-weight: 800;
}

.login-card .brand h1 {
  color: var(--text);
  font-size: 24px;
}

.login-card .brand p {
  color: var(--muted);
  margin-top: 4px;
  text-align: left;
  font-weight: 500;
}

.topbar {
  position: relative;
  min-height: 114px;
  padding: 26px 200px 24px;
  margin-bottom: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--banner-blue) 0%, var(--banner-blue-soft) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.topbar-user {
  position: absolute;
  top: 10px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

.user-name {
  line-height: 1.2;
}

.link-btn {
  padding: 0;
  background: transparent;
  color: #75b8ff;
  cursor: pointer;
}

.link-btn:hover {
  color: #fff;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 34px;
}

.summary-card {
  min-height: 116px;
  padding: 22px 18px;
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.summary-card .label {
  color: #3c4656;
  font-size: 15px;
  font-weight: 800;
}

.summary-card .value {
  margin-top: 14px;
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
}

.section-tabs {
  display: flex;
  align-items: flex-end;
  gap: 34px;
  border-bottom: 1px solid #dbe2eb;
  margin-bottom: 32px;
}

.section-tabs button {
  position: relative;
  padding: 8px 0 12px;
  background: transparent;
  color: #1e2733;
  cursor: pointer;
  font-weight: 700;
}

.section-tabs button.active {
  color: var(--accent);
}

.section-tabs button.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.tab-body {
  min-height: 340px;
}

.panel {
  background: var(--panel);
}

.card {
  padding: 0 0 20px;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(29, 55, 92, 0.06);
}

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

.section-head h2,
.panel-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.section-head p,
.panel-head p,
.hint,
.muted {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.create-form {
  width: min(640px, 100%);
  margin: 40px auto 20px;
}

.field,
.field-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field + .field {
  margin-top: 18px;
}

.field-inline {
  flex: 1 1 0;
}

.field-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.advanced-row {
  align-items: stretch;
}

.field label,
.field-inline label {
  color: #526073;
  font-size: 14px;
  font-weight: 700;
}

.input,
textarea,
select {
  width: 100%;
  border: 1px solid #d6dde8;
  background: #fff;
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(61, 153, 245, 0.12);
}

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

.form-actions {
  display: flex;
  justify-content: center;
  margin-top: 28px;
}

.btn,
.toolbar button,
.actions button,
.modal-head button,
.modal-foot button {
  border: 1px solid #d6dde8;
  background: #fff;
  color: #344054;
  border-radius: 4px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.btn.primary {
  min-width: 120px;
  border-color: transparent;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.btn.primary:hover,
.toolbar button:hover,
.actions button:hover,
.modal-head button:hover,
.modal-foot button:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(61, 153, 245, 0.14);
}

.btn.primary:hover {
  background: var(--accent-dark);
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 14px 0 18px;
  margin: 0 20px 16px;
  border-bottom: 1px solid var(--line);
}

.toolbar .grow {
  flex: 1 1 260px;
}

.table-wrap {
  overflow: auto;
  margin: 0 20px;
  background: #fff;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  color: #7b8798;
  font-weight: 800;
}

.mono {
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 4px;
  background: #f1f4f8;
  color: #657286;
  font-size: 12px;
  font-weight: 700;
}

.tag.active {
  background: #eef9e9;
  color: var(--success);
}

.tag.disabled {
  background: #fdeeed;
  color: var(--danger);
}

.tag.warning {
  background: #fff6e4;
  color: var(--warning);
}

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

.actions button {
  padding: 7px 11px;
}

.status {
  min-height: 22px;
  margin: -18px 20px 14px;
  color: var(--muted);
  font-size: 13px;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.empty {
  margin: 0 20px;
  padding: 44px 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #d6dde8;
  border-radius: 4px;
}

.footer {
  margin-top: 54px;
  text-align: center;
  color: #8b94a3;
  font-size: 15px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(11, 28, 56, 0.55);
}

.modal {
  width: min(1100px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(6, 18, 38, 0.34);
}

.modal-head,
.modal-body,
.modal-foot {
  padding: 20px 22px;
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

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

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

.subcard {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
}

.subcard h3,
.modal-head h3 {
  margin: 0 0 12px;
}

.code-block {
  min-height: 90px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  white-space: pre-wrap;
}

@media (max-width: 1080px) {
  .shell {
    width: min(100vw - 28px, 100%);
  }

  .topbar {
    padding: 26px 140px 24px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 16px, 100%);
    margin: 8px auto;
    padding: 12px 12px 24px;
  }

  .topbar {
    min-height: 150px;
    padding: 54px 16px 24px;
  }

  .topbar-user {
    left: 16px;
    right: 16px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .brand h1 {
    font-size: 24px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .section-tabs {
    gap: 22px;
    overflow-x: auto;
  }

  .create-form {
    margin: 24px auto 8px;
  }

  .field-row {
    flex-direction: column;
  }

  .toolbar {
    margin: 0 0 14px;
  }

  .table-wrap,
  .empty {
    margin: 0;
  }

  .status {
    margin-left: 0;
    margin-right: 0;
  }

  .modal-backdrop {
    padding: 10px;
  }
}
