:root {
  color-scheme: light;
  --ink: #17202a;
  --muted: #657386;
  --line: #d9e0e8;
  --panel: #ffffff;
  --page: #eef3f7;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --shadow: 0 18px 50px rgba(26, 38, 52, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
}

button,
.button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  height: 36px;
  padding: 0 13px;
  border-radius: 7px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

button:hover,
.button:hover {
  transform: translateY(-1px);
  border-color: #a9b8c9;
}

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

.primary {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

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

.muted[aria-disabled="true"] {
  pointer-events: none;
  color: var(--muted);
}

.hiddenFile {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.topbar {
  height: 72px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  font-size: 20px;
  font-weight: 720;
  letter-spacing: 0;
}

.subline {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

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

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.side {
  min-height: 0;
  padding: 18px;
  background: #f7fafc;
  border-right: 1px solid var(--line);
  overflow: auto;
}

.side section {
  padding: 0 0 19px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line);
}

.side section:last-child {
  border-bottom: 0;
}

.commandPane label,
.sectionTitle {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #455466;
}

textarea {
  width: 100%;
  height: 116px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  line-height: 1.5;
  outline: none;
  margin-bottom: 10px;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

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

.chips button {
  height: auto;
  min-height: 32px;
  padding: 6px 9px;
  font-size: 12px;
  justify-content: flex-start;
  text-align: left;
}

.operations {
  display: grid;
  gap: 8px;
}

.operationRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}

.operationRow strong {
  display: block;
  margin-bottom: 3px;
}

.operationRow p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.count {
  color: var(--muted);
}

.log {
  display: grid;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.logItem {
  padding-left: 10px;
  border-left: 2px solid #b8c2cc;
  color: #334155;
}

.logItem.error {
  border-left-color: var(--danger);
  color: var(--danger);
}

.outputWrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 50px minmax(0, 1fr);
}

.outputToolbar {
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.outputPane {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 24px;
  background: #f3f7fa;
}

.outputSection {
  padding: 0 0 22px;
  margin: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.outputSection:last-child {
  border-bottom: 0;
}

.summaryGrid {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  max-width: 760px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fff;
}

.summaryGrid div {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.summaryGrid div:nth-child(odd) {
  color: var(--muted);
  background: #f8fafc;
}

.scriptPreview {
  min-height: 520px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101820;
  color: #d7f7e8;
  font:
    12px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  overflow: auto;
  white-space: pre-wrap;
}

.emptyText {
  color: #263241;
}

.emptyText {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

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

  .side {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
