:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #eef3f8;
  --ink: #1e2732;
  --muted: #637083;
  --line: #dce3ea;
  --blue: #2563eb;
  --green: #168a5b;
  --amber: #b66a00;
  --red: #c24137;
  --teal: #0f766e;
  --shadow: 0 12px 32px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  min-height: 34px;
  padding: 0 12px;
}

button:hover {
  border-color: #aab7c6;
}

button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}

button.danger {
  color: var(--red);
}

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

input,
select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 6px 9px;
}

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

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

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background: #102033;
}

.login-card {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  background: #102033;
  color: #ffffff;
}

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

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand span {
  color: #b8c7d8;
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tabs button {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e8eef7;
}

.tabs button.active {
  background: #ffffff;
  color: #102033;
}

.workspace {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 28px 42px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar label {
  min-width: 220px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.panel-body {
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: end;
}

.form-grid .wide {
  grid-column: span 2;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

.stat strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

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

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

th {
  background: #f3f6fa;
  color: #405064;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

td.compact,
th.compact {
  width: 1%;
  white-space: nowrap;
}

.employee-cell {
  display: grid;
  gap: 2px;
}

.employee-cell small,
.muted {
  color: var(--muted);
}

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

.status-not-opened {
  background: #e8edf3;
  color: #415063;
}

.status-opened {
  background: #fff4dc;
  color: var(--amber);
}

.status-submitted,
.status-admin-done {
  background: #e3f7ef;
  color: var(--green);
}

.status-error {
  background: #ffe7e4;
  color: var(--red);
}

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

.actions select {
  min-width: 118px;
}

.link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.message {
  min-height: 20px;
  color: var(--teal);
  font-size: 13px;
}

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

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

.deploy-grid > div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 12px;
}

code {
  display: block;
  overflow-wrap: anywhere;
  color: #0f4c81;
  background: #eef5fb;
  border-radius: 6px;
  padding: 7px 8px;
}

.gate {
  max-width: 540px;
  margin: 8vh auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gate-header {
  padding: 22px;
  background: #102033;
  color: #ffffff;
}

.gate-header h1 {
  margin: 0;
  font-size: 20px;
}

.gate-body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.start-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 6px;
  background: var(--blue);
  color: #ffffff;
  text-decoration: none;
  padding: 0 16px;
}

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

@media (max-width: 900px) {
  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace {
    padding: 16px;
  }

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

  .form-grid .wide {
    grid-column: span 1;
  }

  .toolbar label {
    min-width: 0;
  }
}
