:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --ink: #18202a;
  --muted: #68717d;
  --line: #dce1e7;
  --accent: #0b75b7;
  --accent-strong: #075f95;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button.ghost {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

button.danger {
  background: #fff4f2;
  color: var(--danger);
}

button.icon {
  width: 36px;
  min-height: 36px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
}

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 750;
}

h2 {
  font-size: 18px;
}

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

main {
  padding: 22px 32px 40px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 360px) auto 1fr;
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 117, 183, 0.12);
}

.status {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 247, 248, 0.95)),
    var(--bg);
}

.login-shell {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
}

.login-panel {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 30px;
  box-shadow: 0 20px 64px rgba(20, 28, 36, 0.12);
}

.login-panel h1 {
  margin-bottom: 8px;
}

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

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  background: white;
}

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

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

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #119bd7;
  color: white;
  font-size: 14px;
  font-weight: 750;
}

td {
  max-width: 220px;
  font-size: 14px;
  line-height: 1.45;
}

td.title,
td.desc {
  text-align: left;
}

.row-actions {
  display: inline-flex;
  gap: 8px;
  white-space: nowrap;
}

.row-actions button {
  min-height: 32px;
  padding: 0 10px;
}

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

.logs {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

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

.logs ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
}

dialog {
  width: min(860px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(20, 28, 36, 0.22);
}

dialog::backdrop {
  background: rgba(12, 20, 28, 0.36);
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
}

.wide {
  grid-column: 1 / -1;
}

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  padding: 16px 22px 22px;
}

@media (max-width: 760px) {
  .topbar,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    padding: 20px 16px 16px;
  }

  main {
    padding: 16px;
  }

  .actions,
  .dialog-actions {
    width: 100%;
  }

  .actions button,
  .dialog-actions button {
    flex: 1;
  }

  .status {
    justify-self: start;
  }

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