:root {
  color-scheme: light;
  --orange: #f29b22;
  --orange-dark: #d9820f;
  --teal: #28a6a6;
  --bg: #eef3f7;
  --panel: #ffffff;
  --line: #cfd8e3;
  --line-soft: #e8edf3;
  --text: #1d2733;
  --muted: #657487;
  --green: #168a4a;
  --amber: #a66a00;
  --red: #b42318;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 13px;
}

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

button {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #b8c4d2;
  border-radius: 3px;
  background: linear-gradient(#fff, #edf2f6);
  color: #26313f;
  cursor: pointer;
}

button:hover { border-color: var(--orange); color: var(--orange-dark); }

button.orange, .orange {
  background: linear-gradient(#ffb64b, #ed9217);
  border-color: #cf7a0b;
  color: #fff;
  font-weight: 700;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 58px 1fr;
}

.window-bar {
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  background: linear-gradient(#fff, #f6f1e8);
  border-bottom: 3px solid var(--orange);
  box-shadow: 0 1px 6px rgba(31, 41, 55, .12);
}

.app-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-title strong, .app-title small { display: block; }
.app-title small { color: var(--muted); margin-top: 2px; }

.lion-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: #fff;
  border-radius: 5px;
  font-weight: 800;
}

.quick-tabs {
  display: flex;
  gap: 6px;
  overflow: auto;
}

.quick-tabs button {
  min-width: 82px;
  background: #fff8ec;
  border-color: #e4bd7c;
}

.quick-tabs button.active {
  background: var(--orange);
  color: #fff;
}

.window-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.window-actions span {
  color: var(--muted);
  font-family: Consolas, monospace;
}

.workbench {
  display: grid;
  grid-template-columns: 190px 1fr;
  min-height: 0;
}

.left-menu {
  background: #f9fbfd;
  border-right: 1px solid var(--line);
  padding: 8px 0;
  overflow: auto;
}

.left-menu section {
  border-bottom: 1px solid var(--line-soft);
  padding: 7px 8px 10px;
}

.left-menu h3 {
  margin: 0 0 5px;
  padding: 6px 8px;
  color: #374151;
  font-size: 13px;
  background: #edf2f7;
  border-left: 3px solid var(--teal);
}

.left-menu button {
  width: 100%;
  margin-top: 4px;
  text-align: left;
  border: 0;
  background: transparent;
  min-height: 27px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.left-menu button.active,
.left-menu button:hover {
  background: #fff3db;
  color: var(--orange-dark);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9aa7b6;
}

.left-menu button.active .dot { background: var(--orange); }

.content {
  padding: 10px;
  min-width: 0;
  overflow: auto;
}

.toolbar, .notice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 10px;
}

.toolbar {
  border-bottom: 0;
}

.crumbs { color: #475467; }
.tool-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.notice-strip {
  margin-bottom: 10px;
  background: #fffaf0;
  border-color: #ecd2a4;
}

.notice-strip span {
  padding: 2px 8px;
  background: #fff;
  border: 1px solid #f0d19c;
}

.notice-strip strong {
  margin-left: auto;
  color: #8a5100;
  font-weight: 600;
}

.view { display: none; }
.view.active { display: block; }

.desk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr);
  gap: 10px;
}

.desk-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}

.desk-panel.wide { min-width: 0; }

.panel-title {
  min-height: 36px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#fbfcfd, #edf2f6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title strong {
  font-size: 14px;
}

.panel-title span {
  color: var(--muted);
}

.table-wrap { overflow: auto; }

.dense-table {
  width: 100%;
  min-width: 930px;
  border-collapse: collapse;
  background: #fff;
}

.dense-table th,
.dense-table td {
  border: 1px solid var(--line-soft);
  padding: 7px 8px;
  text-align: left;
  vertical-align: middle;
}

.dense-table th {
  background: #f2f6fa;
  color: #334155;
  font-weight: 700;
}

.dense-table tr:hover td { background: #fffaf0; }

.actions {
  white-space: nowrap;
}

.actions button {
  margin-right: 3px;
}

.path-cell {
  max-width: 360px;
  word-break: break-all;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #334155;
  white-space: nowrap;
}

.badge.running,
.badge.normal {
  background: #dcfce7;
  color: var(--green);
}

.badge.paused,
.badge.queued {
  background: #fff2c7;
  color: var(--amber);
}

.badge.failed,
.badge.stopped {
  background: #fee4e2;
  color: var(--red);
}

.progress {
  width: 82px;
  height: 7px;
  border: 1px solid #c5d0dc;
  background: #edf2f7;
}

.progress span {
  display: block;
  height: 100%;
  background: var(--teal);
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: grid;
  gap: 6px;
  max-height: 460px;
  overflow: auto;
}

.log-list li {
  display: grid;
  grid-template-columns: 132px 44px 1fr;
  gap: 7px;
  align-items: start;
  padding: 6px;
  background: #f8fafc;
  border-left: 3px solid var(--teal);
}

.log-list li.warn { border-color: var(--amber); }
.log-list li.error { border-color: var(--red); }
.log-list time { color: var(--muted); }

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

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

label {
  display: grid;
  gap: 5px;
}

label.full { grid-column: 1 / -1; }

label span, h4, p { margin: 0; }
label span { color: #475467; }

input, select, textarea {
  width: 100%;
  border: 1px solid #b9c5d3;
  border-radius: 2px;
  background: #fff;
  min-height: 28px;
  padding: 4px 7px;
}

textarea { resize: vertical; }

.button-row {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.button-row.compact-buttons {
  padding: 8px 0 0;
  flex-wrap: wrap;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
}

.api-card,
.folder-card,
.file-pane {
  border: 1px solid var(--line);
  background: #f8fafc;
  padding: 12px;
}

.api-card h4,
.folder-card h4 {
  margin: 0 0 8px;
  color: #26313f;
}

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

.folder-card ul {
  margin: 0 0 10px;
  padding-left: 18px;
}

.result-search {
  margin: 10px 12px 12px;
  width: calc(100% - 24px);
}

.step-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
}

.step-strip div {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #fff7e8;
  border: 1px solid #f0d19c;
}

.step-strip b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
}

.folder-sim {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px 12px;
}

.file-pane p {
  margin: 8px 0 0;
  color: #475467;
  font-family: Consolas, monospace;
}

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

.filter-grid label:has(textarea) {
  grid-row: span 2;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .35);
  z-index: 20;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  width: min(760px, calc(100vw - 40px));
  background: #fff;
  border: 1px solid #8ea1b6;
  box-shadow: 0 22px 60px rgba(15, 23, 42, .25);
}

.modal header,
.modal footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: linear-gradient(#fff, #edf2f6);
  border-bottom: 1px solid var(--line);
}

.modal footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
  gap: 8px;
}

.modal header button {
  min-width: 28px;
  padding: 0;
  font-size: 18px;
}

@media (max-width: 760px) {
  .window-bar {
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px;
  }
  .workbench,
  .desk-grid,
  .two-col,
  .folder-sim,
  .filter-grid,
  .compact-form {
    grid-template-columns: 1fr;
  }
  .left-menu { display: none; }
  .notice-strip, .toolbar { flex-direction: column; align-items: stretch; }
}
