: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);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(255,255,255,.12), transparent 24%),
    linear-gradient(135deg, var(--page-blue-deep) 0%, var(--page-blue) 52%, #2c5596 100%);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { border: 0; }

.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, .24);
  padding: 30px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.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;
}
.brand h1 { margin: 0; font-size: 24px; line-height: 1.2; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.shell {
  width: min(1240px, calc(100vw - 48px));
  min-height: calc(100vh - 50px);
  margin: 25px auto;
  padding: 20px 20px 34px;
  background: rgba(255,255,255,.98);
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(8, 24, 48, .2);
}
.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%);
}
.topbar .brand { justify-content: center; color: #fff; }
.topbar .brand-mark { display: none; }
.topbar h1 { color: #fff; font-size: 30px; }
.topbar p { color: rgba(255,255,255,.82); font-weight: 700; text-align: center; }
.topbar-user {
  position: absolute;
  top: 12px;
  right: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: rgba(255,255,255,.78);
  font-size: 14px;
}
.link-btn { padding: 0; background: transparent; color: #75b8ff; cursor: pointer; }
.link-btn:hover { color: #fff; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.summary-card {
  min-height: 104px;
  padding: 20px 16px;
  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: 14px; font-weight: 800; }
.summary-card .value { margin-top: 12px; color: var(--accent); font-size: 25px; line-height: 1; font-weight: 800; }

.panel { background: var(--panel); border-radius: 4px; box-shadow: 0 6px 20px rgba(29,55,92,.06); padding-bottom: 20px; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.section-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
.section-head p, .hint, .muted { margin: 6px 0 0; color: var(--muted); font-size: 13px; }

.create-form { width: min(820px, 100%); margin: 26px auto 12px; }
.field, .field-inline { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: 18px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.field-inline { flex: 1 1 0; }
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;
}
.input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(61,153,245,.12); }
textarea { min-height: 84px; resize: vertical; }
.form-actions { display: flex; justify-content: center; margin-top: 24px; }
.btn, .toolbar button, .actions button, .modal-foot button, .modal-head button {
  border: 1px solid #d6dde8;
  background: #fff;
  color: #344054;
  border-radius: 4px;
  padding: 9px 16px;
  cursor: pointer;
}
.btn.primary { min-width: 120px; border-color: transparent; background: var(--accent); color: #fff; font-weight: 800; }
.btn.primary:hover { background: var(--accent-dark); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px 18px; 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", Consolas, monospace; font-size: 12px; word-break: break-all; }
.tag { display: inline-flex; align-items: center; 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: 14px 20px; 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; }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(11,28,56,.55); }
.modal { width: min(1040px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 8px; background: #fff; box-shadow: 0 30px 80px rgba(6,18,38,.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; gap: 18px; }
.code-block { min-height: 86px; padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-soft); white-space: pre-wrap; }

@media (max-width: 1080px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar { padding: 26px 140px 24px; }
}
@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; }
  .summary-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
}
