:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  font-weight: 700;
}

h2 {
  font-size: 17px;
  margin-bottom: 12px;
}

.subhead {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e4eaf0;
}

.topbar p,
.section-head p,
.hint {
  color: #687582;
  font-size: 13px;
  margin-top: 4px;
}

.topbar p {
  color: #c7d2dc;
}

.status {
  min-width: 92px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #2d3a45;
  text-align: center;
  font-size: 13px;
}

.status.ok {
  background: #176b50;
}

.status.bad {
  background: #9b2c2c;
}

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

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(520px, 1fr);
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px;
}

.panel {
  background: #fff;
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  padding: 16px;
}

.wide {
  grid-column: 2;
}

.layout > .panel:first-child {
  align-self: start;
}

label {
  display: block;
  color: #3d4a55;
  font-size: 13px;
  margin: 10px 0 6px;
}

input {
  width: 100%;
  min-height: 36px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid #1c6aa5;
  border-radius: 6px;
  background: #2378b8;
  color: #fff;
  padding: 7px 12px;
  font: inherit;
  cursor: pointer;
}

button.secondary {
  border-color: #c0cad4;
  background: #eef3f7;
  color: #23313d;
}

button.danger {
  border-color: #b42318;
  background: #b42318;
}

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

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

.row input {
  flex: 1;
}

.actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.item-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.section-head {
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  gap: 12px;
}

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

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

.checkline input {
  width: auto;
  min-height: auto;
}

.browser,
.projects {
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  overflow: hidden;
}

.browser {
  height: min(52vh, 520px);
  min-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

.item,
.project {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid #edf1f5;
}

.item:last-child,
.project:last-child {
  border-bottom: 0;
}

.item.folder:hover {
  background: #f6f9fb;
}

.name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.meta {
  color: #687582;
  font-size: 12px;
  margin-top: 3px;
}

.project-create {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

pre {
  min-height: 150px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #111820;
  color: #d7e4ee;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f4f6f8;
}

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

.login-panel {
  background: #fff;
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 50px rgba(22, 32, 42, 0.12);
}

.login-panel h1 {
  color: #16202a;
  font-size: 22px;
  margin-bottom: 6px;
}

.login-panel button {
  width: 100%;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .wide {
    grid-column: auto;
  }

  .grid.two,
  .project-create {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    align-items: stretch;
  }
}
