:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #172026;
  --muted: #68737d;
  --line: #d9e0e5;
  --accent: #177568;
  --accent-strong: #0f5f54;
  --soft: #eaf3f1;
  --warn: #9b5b13;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.workbench,
.side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
  margin-bottom: 12px;
}

p {
  color: var(--muted);
  margin-top: 5px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(26, 38, 49, 0.06);
}

form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.access-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.field-hint {
  font-size: 12px;
  line-height: 1.45;
  margin-top: 7px;
}

.access-code {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--accent-strong);
  padding: 3px 8px;
  font-weight: 700;
}

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

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

label span {
  font-size: 13px;
  color: var(--muted);
}

select,
input,
textarea,
button {
  font: inherit;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  outline: none;
}

textarea {
  resize: vertical;
}

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

.primary {
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
}

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

.secondary {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  padding: 9px 11px;
  cursor: pointer;
  font-weight: 700;
}

.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--soft);
}

.secondary:disabled {
  cursor: default;
  opacity: 0.62;
}

.secondary.compact {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 13px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.preview,
.result-box,
.job-list {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.preview strong,
.result-box strong,
.job-card strong {
  color: var(--text);
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.download-title {
  margin-top: 12px;
  font-weight: 700;
  color: var(--text);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.download-row a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--accent-strong);
  text-decoration: none;
  padding: 6px 10px;
}

.download-row a.download-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.download-row a.download-primary:hover {
  background: var(--accent-strong);
}

.download-row a.download-secondary {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--accent-strong);
}

.download-row a.compact {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 13px;
}

.job-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.job-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfc;
}

.job-card code {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.notice {
  color: var(--warn);
}

.progress-line {
  margin-top: 8px;
  color: var(--muted);
}

.progress-bar {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe7e5;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
  }

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

  .access-panel {
    grid-template-columns: 1fr;
  }

  .access-actions {
    justify-content: stretch;
  }

  .access-actions button {
    flex: 1 1 140px;
  }
}
