:root {
  --bg: #07110f;
  --panel: rgba(14, 29, 25, 0.88);
  --panel-strong: #10251f;
  --border: rgba(173, 231, 207, 0.16);
  --border-bright: rgba(173, 231, 207, 0.34);
  --text: #eaf7f1;
  --muted: #8fa9a0;
  --accent: #7ef0bd;
  --accent-strong: #34d399;
  --accent-dark: #123d2f;
  --error: #ff8c8c;
  --warning: #ffd27d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(43, 121, 91, 0.2), transparent 36rem),
    linear-gradient(145deg, #06100e 0%, #081713 50%, #06100e 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.ambient {
  position: fixed;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
}

.ambient-one {
  top: 10%;
  right: -7rem;
  background: #36d399;
}

.ambient-two {
  bottom: 5%;
  left: -8rem;
  background: #2b8f71;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 40px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.2em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

h2 {
  margin: 0;
  font-size: 1.18rem;
}

.subtitle {
  max-width: 710px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.runtime-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 230px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 18, 15, 0.78);
}

.runtime-card div {
  display: grid;
  flex: 1;
  gap: 3px;
}

.runtime-card strong,
.runtime-card .muted {
  font-size: 0.82rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: var(--error);
  box-shadow: 0 0 0 4px rgba(255, 140, 140, 0.1);
}

.status-dot.loading {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(255, 210, 125, 0.1);
  animation: pulse 1.4s ease-in-out infinite;
}

.status-dot.ready {
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.1);
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

.icon-button,
.text-button {
  border: 0;
  color: var(--muted);
  background: transparent;
}

.icon-button {
  padding: 7px;
  font-size: 1.15rem;
}

.icon-button:hover,
.text-button:hover {
  color: var(--accent);
}

.notice {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
  padding: 15px 18px;
  border: 1px solid rgba(126, 240, 189, 0.2);
  border-radius: 16px;
  background: rgba(18, 61, 47, 0.35);
}

.notice-icon {
  color: var(--accent);
  font-size: 1.25rem;
}

.notice p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.panel {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 11px;
}

.step {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 750;
}

.capability-badge {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
}

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

.folder-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(6, 18, 14, 0.52);
}

.folder-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.folder-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.folder-number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 99px;
  color: var(--accent);
  background: var(--accent-dark);
  font-size: 0.72rem;
}

.folder-value {
  min-height: 1.45em;
  margin-bottom: 7px;
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  min-height: 2.7em;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.secondary-button,
.primary-button {
  border: 1px solid var(--border-bright);
  border-radius: 11px;
  font-weight: 720;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    transform 120ms ease;
}

.secondary-button {
  width: 100%;
  padding: 10px 13px;
  color: var(--text);
  background: rgba(27, 61, 49, 0.45);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(39, 91, 70, 0.55);
}

.output-mode-button {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 4px;
  font-size: 0.76rem;
}

.primary-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 17px;
  border-color: transparent;
  color: #052018;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.list-actions,
.run-meta,
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-actions {
  margin-bottom: 10px;
}

.check-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-strong);
}

.book-list {
  max-height: 390px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(4, 14, 11, 0.5);
}

.book-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.book-row:last-child {
  border-bottom: 0;
}

.book-details {
  min-width: 0;
}

.book-name,
.book-path {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.book-name {
  margin-bottom: 3px;
  font-size: 0.9rem;
  font-weight: 650;
}

.book-path,
.book-size {
  color: var(--muted);
  font-size: 0.74rem;
}

.empty-state {
  display: grid;
  min-height: 128px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.progress-track {
  height: 7px;
  margin: 5px 0 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(126, 240, 189, 0.09);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  transition: width 180ms ease;
}

.run-meta {
  margin-bottom: 20px;
  font-size: 0.82rem;
}

.log-header {
  margin-bottom: 8px;
  font-size: 0.82rem;
  font-weight: 700;
}

.log-output {
  min-height: 180px;
  max-height: 320px;
  margin: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  color: #cce9dc;
  background: #04100d;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

footer {
  padding: 24px 6px 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

footer p {
  margin-bottom: 5px;
}

code {
  color: var(--accent);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 680px);
    padding-top: 28px;
  }

  .hero {
    align-items: stretch;
    flex-direction: column;
  }

  .runtime-card {
    min-width: 0;
  }

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

  .panel {
    padding: 17px;
    border-radius: 16px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading .muted,
  .capability-badge {
    max-width: 46%;
    text-align: right;
  }

  .book-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .book-size {
    display: none;
  }
}
