:root {
  color-scheme: dark;
  --ink: #eef6f8;
  --muted: #8fa5af;
  --deep: #071522;
  --deep-2: #0a1c2c;
  --surface: rgba(13, 35, 50, 0.76);
  --surface-solid: #0e2636;
  --line: rgba(169, 205, 214, 0.14);
  --accent: #77e0ca;
  --accent-deep: #0e8879;
  --gold: #e8c980;
  --danger: #ff9b8a;
  --shadow: 0 26px 80px rgba(0, 4, 10, 0.35);
  --radius: 24px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--deep);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -20%, rgba(49, 113, 132, 0.26), transparent 42%),
    linear-gradient(165deg, #071522 0%, #081a28 52%, #06121d 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  opacity: 0.035;
  pointer-events: none;
  content: "";
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.ambient-one {
  top: 16%;
  right: -190px;
  background: rgba(66, 189, 168, 0.16);
}

.ambient-two {
  bottom: 12%;
  left: -220px;
  background: rgba(64, 103, 190, 0.14);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
a.quiet-button {
  font: inherit;
}

.site-header,
main,
footer {
  width: min(100% - 32px, 720px);
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) 0 18px;
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(119, 224, 202, 0.3);
  border-radius: 14px;
  place-items: center;
  background: linear-gradient(145deg, rgba(119, 224, 202, 0.18), rgba(119, 224, 202, 0.04));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.09);
}

.brand-mark svg {
  width: 25px;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.brand small {
  margin-top: 3px;
  color: #6f8995;
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.17em;
}

.live-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: #a8bac1;
  font-size: 0.78rem;
}

.live-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(119, 224, 202, 0.08), 0 0 12px var(--accent);
}

main {
  padding: 48px 0 32px;
}

.control-panel {
  padding: 10px 6px 42px;
  text-align: center;
}

.eyebrow,
.section-label {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 560px;
  margin: 15px auto 13px;
  font-size: clamp(2rem, 8.5vw, 3.3rem);
  font-weight: 620;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.intro {
  max-width: 480px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.run-button {
  position: relative;
  display: inline-flex;
  min-width: 210px;
  min-height: 58px;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
  padding: 0 27px;
  overflow: hidden;
  border: 1px solid rgba(190, 255, 241, 0.35);
  border-radius: 18px;
  color: #04251f;
  background: linear-gradient(135deg, #96ead8, #64cfba 64%, #54bca9);
  box-shadow: 0 15px 40px rgba(50, 178, 155, 0.2), inset 0 1px rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  font-weight: 720;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.run-button:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 50px rgba(50, 178, 155, 0.3), inset 0 1px rgba(255, 255, 255, 0.55);
}

.run-button:not(:disabled):active {
  transform: translateY(0) scale(0.985);
}

.run-button:disabled {
  color: #73958f;
  border-color: rgba(163, 196, 192, 0.12);
  background: #17332f;
  box-shadow: none;
  cursor: not-allowed;
}

.run-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
}

.run-icon svg {
  width: 22px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.run-button.running .run-icon {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(119, 224, 202, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.run-button.running .run-icon svg {
  display: none;
}

.button-shine {
  position: absolute;
  top: -30px;
  left: -70px;
  width: 40px;
  height: 120px;
  background: rgba(255, 255, 255, 0.22);
  filter: blur(4px);
  transform: rotate(24deg);
  transition: left 500ms ease;
}

.run-button:not(:disabled):hover .button-shine {
  left: calc(100% + 40px);
}

.last-run {
  min-height: 20px;
  margin-top: 15px;
  color: #68818c;
  font-size: 0.78rem;
}

.status-card,
.brief-section,
.gallery-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(17, 45, 62, 0.82), rgba(9, 27, 40, 0.82));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(22px);
}

.status-card {
  padding: 23px 21px 22px;
}

.status-topline,
.section-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.status-card h2,
.section-heading h2,
.warning-panel h2 {
  margin: 7px 0 0;
  font-size: 1.18rem;
  font-weight: 640;
  letter-spacing: -0.01em;
}

.status-badge {
  margin-top: 2px;
  padding: 6px 9px;
  border: 1px solid rgba(119, 224, 202, 0.2);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(119, 224, 202, 0.07);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.status-badge.running {
  color: var(--gold);
  border-color: rgba(232, 201, 128, 0.24);
  background: rgba(232, 201, 128, 0.08);
}

.status-badge.failed,
.status-badge.warning {
  color: var(--danger);
  border-color: rgba(255, 155, 138, 0.24);
  background: rgba(255, 155, 138, 0.08);
}

.status-message {
  min-height: 26px;
  margin: 21px 0 22px;
  color: #c2d0d5;
  font-size: 0.92rem;
  line-height: 1.6;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: #8097a1;
  font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
}

.progress-track {
  display: block;
  width: 100%;
  height: 7px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: rgba(3, 12, 19, 0.62);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.22);
}

.progress-track::-webkit-progress-bar {
  border-radius: inherit;
  background: rgba(3, 12, 19, 0.62);
}

.progress-track::-webkit-progress-value,
.progress-track::-moz-progress-bar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), #d1f6e9);
  box-shadow: 0 0 16px rgba(119, 224, 202, 0.35);
}

.warning-panel {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 155, 138, 0.2);
  border-radius: 18px;
  background: rgba(92, 41, 37, 0.18);
}

.warning-symbol {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 155, 138, 0.3);
  border-radius: 10px;
  color: var(--danger);
  place-items: center;
  font-weight: 800;
}

.warning-panel h2 {
  margin-top: 3px;
  color: #ffd4cc;
  font-size: 0.95rem;
}

.warning-panel ul {
  margin: 9px 0 0;
  padding-left: 18px;
  color: #c99f98;
  font-size: 0.82rem;
  line-height: 1.65;
}

.results {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.brief-section,
.gallery-section {
  padding: 22px;
}

.quiet-button {
  display: inline-flex;
  min-height: 44px;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid rgba(152, 188, 198, 0.17);
  border-radius: 13px;
  color: #bdd0d6;
  background: rgba(6, 20, 30, 0.45);
  font-size: 0.8rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.quiet-button:hover {
  color: var(--accent);
  border-color: rgba(119, 224, 202, 0.3);
  background: rgba(21, 54, 64, 0.55);
}

.quiet-button svg {
  width: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brief-box {
  min-height: 148px;
  margin: 18px 0 0;
  padding: 19px;
  overflow: auto;
  border: 1px solid rgba(142, 183, 194, 0.1);
  border-radius: 16px;
  color: #dae8eb;
  background: rgba(3, 13, 21, 0.62);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", monospace;
  font-size: 0.9rem;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 1px 14px rgba(0, 0, 0, 0.18);
}

.gallery-heading {
  align-items: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 19px;
}

.gallery-item {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(157, 194, 202, 0.12);
  border-radius: 16px;
  color: var(--ink);
  background: #091a27;
  text-align: left;
  cursor: zoom-in;
}

.gallery-item::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  pointer-events: none;
  content: "";
}

.gallery-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top;
  background: #102737;
  transition: transform 280ms ease, filter 280ms ease;
}

.gallery-item:hover img {
  filter: brightness(1.07);
  transform: scale(1.025);
}

.gallery-caption {
  display: flex;
  min-height: 58px;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
}

.gallery-caption strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gallery-caption small {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 0.72rem;
}

footer {
  display: flex;
  justify-content: space-between;
  padding: 25px 4px calc(28px + env(safe-area-inset-bottom));
  color: #4f6a76;
  font-size: 0.7rem;
}

.hidden {
  display: none !important;
}

.image-dialog {
  width: min(94vw, 980px);
  max-width: none;
  height: min(92vh, 900px);
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(174, 213, 221, 0.18);
  border-radius: 22px;
  color: var(--ink);
  background: #07131d;
  box-shadow: 0 35px 110px rgba(0, 0, 0, 0.65);
}

.image-dialog::backdrop {
  background: rgba(0, 7, 12, 0.84);
  backdrop-filter: blur(10px);
}

.dialog-toolbar {
  display: flex;
  min-height: 58px;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 18px;
  border-bottom: 1px solid var(--line);
}

.dialog-toolbar strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-toolbar button,
.dialog-nav {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  color: #b8cbd2;
  background: rgba(130, 169, 180, 0.08);
  font-size: 1.7rem;
  place-items: center;
  cursor: pointer;
}

.dialog-stage {
  position: relative;
  display: grid;
  height: calc(100% - 96px);
  overflow: auto;
  place-items: start center;
}

.dialog-stage img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}

.dialog-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  border: 1px solid rgba(201, 226, 232, 0.15);
  background: rgba(6, 19, 29, 0.76);
  backdrop-filter: blur(10px);
}

.dialog-nav.previous {
  left: 4%;
}

.dialog-nav.next {
  right: 4%;
}

.dialog-counter {
  height: 38px;
  color: #718b96;
  font-size: 0.75rem;
  line-height: 38px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 18px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  max-width: calc(100% - 36px);
  padding: 12px 16px;
  border: 1px solid rgba(119, 224, 202, 0.25);
  border-radius: 13px;
  color: #dff9f2;
  background: rgba(13, 40, 46, 0.94);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.38);
  font-size: 0.82rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.copy-fallback {
  position: fixed;
  top: 0;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

:where(button, a, [tabindex]):focus-visible {
  outline: 3px solid rgba(232, 201, 128, 0.9);
  outline-offset: 3px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 640px) {
  main {
    padding-top: 70px;
  }

  .control-panel {
    padding-bottom: 52px;
  }

  .gallery {
    gap: 15px;
  }
}

@media (max-width: 380px) {
  .site-header,
  main,
  footer {
    width: min(100% - 24px, 720px);
  }

  .live-pill {
    display: none;
  }

  main {
    padding-top: 34px;
  }

  .status-card,
  .brief-section,
  .gallery-section {
    padding: 19px 17px;
    border-radius: 21px;
  }

  .gallery {
    gap: 9px;
  }

  .gallery-caption {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
