:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef4f1;
  --text: #20242a;
  --muted: #66717f;
  --line: #d9dee5;
  --accent: #117a65;
  --accent-strong: #0a5e4d;
  --danger: #b42318;
  --warning: #a15c07;
  --ok: #17803c;
  --focus: #7dc7b2;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  min-height: 38px;
  padding: 8px 14px;
  transition: background 0.16s ease, border 0.16s ease, color 0.16s ease;
}

a.secondary {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 14px;
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

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

input:focus,
select:focus,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: #f0f3f6;
  color: #3b4652;
  font-size: 13px;
  font-weight: 700;
}

td {
  font-size: 14px;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 18px;
}

.brand {
  display: grid;
  gap: 2px;
}

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

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 18px 44px;
}

.login-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 420px));
  justify-content: center;
  gap: 18px;
  padding-top: 8vh;
}

.login-layout.single-column {
  grid-template-columns: minmax(0, 420px);
}

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

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  margin: 0;
  font-size: 18px;
}

.panel-note {
  color: var(--muted);
  margin: 0 0 14px;
}

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

.filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  align-items: end;
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.secondary:hover:not(:disabled) {
  background: #f3f6f8;
}

.danger {
  background: #fff;
  border-color: #f0c9c6;
  color: var(--danger);
}

.danger:hover:not(:disabled) {
  background: #fff1f0;
}

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

.tab-button {
  background: #fff;
  border-color: var(--line);
  color: var(--muted);
}

.tab-button[aria-selected="true"] {
  background: var(--accent);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  gap: 16px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.status.ok {
  background: #eaf7ee;
  color: var(--ok);
}

.status.warn {
  background: #fff4df;
  color: var(--warning);
}

.status.danger {
  background: #fff0ef;
  color: var(--danger);
}

.radio-row,
.check-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.radio-row label,
.check-row label {
  display: inline-flex;
  align-items: center;
  grid-template-columns: unset;
  gap: 6px;
  color: var(--text);
  font-size: 14px;
}

.radio-row input,
.check-row input {
  width: auto;
  min-height: auto;
}

.message {
  min-height: 22px;
  color: var(--muted);
}

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

.message.success {
  color: var(--ok);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

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

.modal {
  border: 0;
  border-radius: 8px;
  max-width: 460px;
  width: calc(100% - 28px);
  padding: 0;
  box-shadow: 0 24px 60px rgba(20, 30, 40, 0.28);
}

.modal::backdrop {
  background: rgba(32, 36, 42, 0.5);
}

.modal-body {
  padding: 18px;
}

.modal h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  min-width: 240px;
  max-width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(20, 30, 40, 0.16);
  padding: 12px 14px;
  display: none;
}

.toast.show {
  display: block;
}

.toast.error {
  border-color: #f0c9c6;
  color: var(--danger);
}

.toast.success {
  border-color: #b9dfc3;
  color: var(--ok);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .login-layout,
  .filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 14px 12px 32px;
  }

  .panel {
    padding: 14px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .quick-actions {
    width: 100%;
  }

  button {
    width: 100%;
  }

  .button-row button,
  .quick-actions button,
  .tabs button,
  .topbar-actions button {
    width: auto;
  }
}
