:root {
  color-scheme: dark;
  --bg: #070a10;
  --bg-2: #111822;
  --panel: rgba(20, 26, 36, 0.72);
  --panel-solid: #131922;
  --panel-strong: rgba(18, 24, 34, 0.94);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f6f3ec;
  --muted: #acb5c0;
  --soft: #778391;
  --gold: #d9b766;
  --gold-2: #f3d98a;
  --teal: #71decb;
  --danger: #ff8585;
  --success: #8deaa8;
  --accent: #f3d98a;
  --accent-2: #71decb;
  --surface-1: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.12);
  --label: #dde3e8;
  --control-bg: rgba(255, 255, 255, 0.065);
  --control-bg-focus: rgba(255, 255, 255, 0.095);
  --control-border: rgba(255, 255, 255, 0.13);
  --control-border-strong: rgba(255, 255, 255, 0.22);
  --placeholder: #6f7b86;
  --secondary-text: #d7dde2;
  --panel-shine: linear-gradient(120deg, rgba(243, 217, 138, 0.12), transparent 32%, rgba(113, 222, 203, 0.08));
  --preview-grid: rgba(255, 255, 255, 0.035);
  --preview-bg: rgba(255, 255, 255, 0.025);
  --image-bg: #0b0f14;
  --toast-bg: rgba(16, 21, 27, 0.96);
  --job-text: #f6f3ec;
  --job-muted: #aeb8c5;
  --job-accent: #f3d98a;
  --job-teal: #71decb;
  --job-bg: linear-gradient(135deg, rgba(10, 14, 20, 0.92), rgba(16, 23, 30, 0.86)), rgba(8, 11, 16, 0.88);
  --radius: 16px;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.38);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f8;
  --bg-2: #f8fafc;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-solid: #ffffff;
  --panel-strong: rgba(255, 255, 255, 0.95);
  --line: rgba(21, 31, 44, 0.12);
  --line-strong: rgba(21, 31, 44, 0.2);
  --text: #1b2430;
  --muted: #5c6a79;
  --soft: #768396;
  --gold: #b88b2d;
  --gold-2: #845b00;
  --teal: #0f8e8f;
  --danger: #cc4f4f;
  --success: #1b8c5b;
  --accent: #c89a33;
  --accent-2: #0f8e8f;
  --surface-1: rgba(255, 255, 255, 0.72);
  --surface-2: rgba(245, 248, 252, 0.92);
  --surface-3: rgba(230, 236, 243, 0.95);
  --label: #344256;
  --control-bg: rgba(255, 255, 255, 0.92);
  --control-bg-focus: #ffffff;
  --control-border: rgba(28, 39, 52, 0.16);
  --control-border-strong: rgba(28, 39, 52, 0.28);
  --placeholder: #7c8a9a;
  --secondary-text: #334155;
  --panel-shine: linear-gradient(120deg, rgba(255, 255, 255, 0.72), transparent 34%, rgba(188, 221, 255, 0.18));
  --preview-grid: rgba(55, 70, 89, 0.07);
  --preview-bg: rgba(246, 248, 251, 0.86);
  --image-bg: #f4f7fb;
  --toast-bg: rgba(255, 255, 255, 0.96);
  --job-text: #1b2430;
  --job-muted: #5c6a79;
  --job-accent: #b88b2d;
  --job-teal: #0f8e8f;
  --job-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(245, 248, 252, 0.9)), rgba(255, 255, 255, 0.88);
  --shadow: 0 18px 42px rgba(33, 44, 58, 0.13);
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 16%, rgba(217, 183, 102, 0.18), transparent 26%),
    radial-gradient(circle at 84% 20%, rgba(113, 222, 203, 0.14), transparent 25%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 54%, var(--bg) 100%);
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 255, 255, 0.05) 48%, transparent 61%),
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 120% 120%, 64px 64px, 64px 64px;
  mask-image: linear-gradient(to bottom, #000, transparent 78%);
  animation: bgSweep 10s ease-in-out infinite alternate;
}

@keyframes bgSweep {
  from {
    transform: translate3d(-2%, -1%, 0);
    opacity: 0.72;
  }
  to {
    transform: translate3d(2%, 1%, 0);
    opacity: 0.95;
  }
}

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

button {
  border: 0;
}

.shell {
  position: relative;
  z-index: 1;
  width: 100vw;
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 9%),
    var(--panel-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(28px);
  overflow: hidden;
}

.shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--pointer-x, 50%) var(--pointer-y, 16%), rgba(243, 217, 138, 0.14), transparent 24%),
    radial-gradient(circle at calc(var(--pointer-x, 50%) + 12%) calc(var(--pointer-y, 16%) + 8%), rgba(113, 222, 203, 0.08), transparent 18%);
  mix-blend-mode: screen;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.topbar,
.view {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 54px;
  padding: 10px 14px 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.window-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.traffic-lights {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.traffic-lights span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
  opacity: 0.98;
}

.traffic-close {
  background: #ff5f57;
}

.traffic-min {
  background: #febc2e;
}

.traffic-max {
  background: #28c840;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 2px;
  border: 1px solid rgba(113, 222, 203, 0.28);
  border-radius: 50%;
  background: rgba(8, 12, 18, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 4px rgba(113, 222, 203, 0.05);
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  object-fit: cover;
}

.brand h1 {
  margin: 0;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.05;
  font-weight: 760;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  max-width: min(440px, 44vw);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
  backdrop-filter: blur(18px);
}

.connection-pill strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
}

.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 14px 0 10px;
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    var(--surface-1);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  backdrop-filter: blur(18px);
  flex: 0 0 auto;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  inset: -35% auto -35% -45%;
  width: 34%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  opacity: 0;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 183, 102, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 14px 30px rgba(0, 0, 0, 0.15);
}

.theme-toggle:hover::before {
  animation: buttonShine 0.85s ease;
}

.theme-toggle:active {
  transform: translateY(0);
}

.theme-icon {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex: 0 0 auto;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.88), rgba(243, 217, 138, 0.96) 52%, rgba(171, 126, 27, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 4px rgba(217, 183, 102, 0.08);
}

.theme-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0.7;
}

.theme-label {
  position: relative;
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.theme-toggle[data-theme="light"] {
  border-color: rgba(134, 176, 224, 0.34);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 245, 250, 0.98)),
    rgba(255, 255, 255, 0.82);
}

.theme-toggle[data-theme="light"]::before {
  background: linear-gradient(90deg, transparent, rgba(134, 176, 224, 0.38), transparent);
}

.theme-toggle[data-theme="light"] .theme-icon {
  transform: rotate(36deg);
  background:
    radial-gradient(circle at 48% 48%, rgba(255, 255, 255, 0.98), rgba(249, 214, 123, 0.96) 58%, rgba(197, 143, 43, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 0 4px rgba(194, 148, 53, 0.09);
}

.theme-toggle[data-theme="light"] .theme-icon::after {
  border-color: rgba(134, 176, 224, 0.12);
}

.theme-toggle[data-theme="light"] .theme-label {
  color: #243245;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--soft);
  box-shadow: 0 0 0 4px rgba(118, 131, 144, 0.12);
  flex: 0 0 auto;
}

.dot.live {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(141, 234, 168, 0.16);
}

.view:not(.active) {
  display: none !important;
}

.config-view {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 430px);
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
  padding: 8px 0 28px;
}

.intro {
  position: relative;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  perspective: 1100px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(217, 183, 102, 0.32);
  border-radius: 999px;
  background: rgba(217, 183, 102, 0.08);
  color: var(--gold-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 760;
}

.intro h2 {
  max-width: 430px;
  margin: 14px 0 8px;
  font-size: clamp(32px, 3.6vw, 46px);
  line-height: 1.08;
  font-weight: 820;
}

.intro-text {
  max-width: 430px;
  margin: 0;
  color: #c6ced5;
  font-size: 15px;
  line-height: 1.72;
}

.hero-visual {
  position: relative;
  width: min(430px, 94%);
  height: 210px;
  margin-top: 20px;
  transform-style: preserve-3d;
  opacity: 0.88;
}

.visual-stack {
  position: absolute;
  inset: 0;
  transform: rotateX(58deg) rotateZ(-30deg) translate3d(18px, 8px, 0);
  transform-style: preserve-3d;
  animation: floatStage 6s ease-in-out infinite;
}

@keyframes floatStage {
  0%,
  100% {
    transform: rotateX(58deg) rotateZ(-30deg) translate3d(18px, 8px, 0);
  }
  50% {
    transform: rotateX(56deg) rotateZ(-28deg) translate3d(18px, -8px, 26px);
  }
}

.visual-card {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(30, 39, 50, 0.96), rgba(12, 16, 22, 0.96));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.visual-card-main {
  left: 60px;
  top: 10px;
  width: 270px;
  height: 188px;
}

.visual-toolbar {
  display: flex;
  gap: 7px;
  padding: 12px;
}

.visual-toolbar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.visual-toolbar span:first-child {
  background: var(--gold);
}

.visual-image {
  position: relative;
  width: calc(100% - 28px);
  height: 100px;
  margin: 0 auto;
  border-radius: 9px;
  background:
    radial-gradient(circle at 30% 25%, rgba(243, 217, 138, 0.85), transparent 22%),
    radial-gradient(circle at 66% 60%, rgba(113, 222, 203, 0.62), transparent 28%),
    linear-gradient(135deg, #1e2632, #090c12);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.visual-shine {
  position: absolute;
  inset: -40% auto -40% -50%;
  width: 40%;
  transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  animation: shine 3.8s ease-in-out infinite;
}

@keyframes shine {
  0% {
    left: -55%;
  }
  52%,
  100% {
    left: 120%;
  }
}

.visual-lines {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
}

.visual-lines span {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.visual-lines span:nth-child(2) {
  width: 72%;
}

.visual-lines span:nth-child(3) {
  width: 48%;
}

.visual-card-side,
.visual-card-float {
  display: grid;
  align-content: center;
  gap: 5px;
  width: 145px;
  height: 78px;
  padding: 14px;
  transform: translateZ(48px);
}

.visual-card-side {
  left: 255px;
  top: 132px;
}

.visual-card-float {
  left: 10px;
  top: 132px;
  transform: translateZ(86px);
  animation: floatChip 4.8s ease-in-out infinite;
}

@keyframes floatChip {
  0%,
  100% {
    transform: translateZ(86px) translateY(0);
  }
  50% {
    transform: translateZ(110px) translateY(-8px);
  }
}

.visual-card strong {
  font-size: 15px;
}

.visual-card span {
  color: var(--muted);
  font-size: 11px;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%),
    var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--panel-shine);
  opacity: 0.45;
}

.config-card {
  width: 100%;
  padding: 22px;
  transform: translateZ(0);
  animation: cardIn 0.7s ease both;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.config-card > *,
.side-panel > *,
.preview-panel > *,
.settings-panel > * {
  position: relative;
  z-index: 1;
}

.panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title h3 {
  margin: 0;
  font-size: 18px;
}

.panel-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.badge {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(113, 222, 203, 0.36);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--teal);
  background: rgba(113, 222, 203, 0.08);
  font-size: 11px;
  font-weight: 760;
}

.form-grid {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.control-label {
  color: var(--label);
  font-size: 12px;
  font-weight: 760;
}

.input-shell {
  position: relative;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background: var(--control-bg);
  color: var(--text);
  outline: none;
  padding: 11px 12px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

textarea {
  min-height: 130px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: var(--placeholder);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(217, 183, 102, 0.76);
  background: var(--control-bg-focus);
  box-shadow: 0 0 0 4px rgba(217, 183, 102, 0.11);
  transform: translateY(-1px);
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 12px) 19px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.native-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.mac-select {
  position: relative;
  width: 100%;
  z-index: 12;
}

.mac-select.open {
  z-index: 200;
}

.mac-select-button {
  position: relative;
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent),
    var(--control-bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 8px 20px rgba(0, 0, 0, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.mac-select-button:hover,
.mac-select.open .mac-select-button {
  border-color: rgba(217, 183, 102, 0.62);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent),
    var(--control-bg-focus);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 4px rgba(217, 183, 102, 0.1),
    0 12px 26px rgba(18, 24, 34, 0.08);
  transform: translateY(-1px);
}

.mac-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mac-select-caret {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(118, 131, 144, 0.1);
}

.mac-select-caret::before,
.mac-select-caret::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 7px;
  height: 2px;
  border-radius: 99px;
  background: var(--muted);
  transition: transform 0.18s ease;
}

.mac-select-caret::before {
  left: 4px;
  transform: rotate(42deg);
}

.mac-select-caret::after {
  right: 4px;
  transform: rotate(-42deg);
}

.mac-select.open .mac-select-caret::before {
  transform: rotate(-42deg);
}

.mac-select.open .mac-select-caret::after {
  transform: rotate(42deg);
}

.mac-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  max-height: min(320px, 52vh);
  padding: 6px;
  border: 1px solid rgba(40, 53, 68, 0.24);
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 22px 54px rgba(22, 31, 43, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  backdrop-filter: none;
  overflow: auto;
  animation: macMenuIn 0.16s ease both;
}

.mac-select.drop-up .mac-select-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

.mac-select-option {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: transparent;
  color: #1f2937;
  cursor: pointer;
  text-align: left;
  font: inherit;
  font-weight: 640;
}

.mac-select-option:hover,
.mac-select-option:focus {
  outline: none;
  background: rgba(0, 122, 255, 0.1);
}

.mac-select-option.selected {
  background: linear-gradient(180deg, #2997ff, #0a84ff);
  color: #ffffff;
}

.mac-select-check {
  position: relative;
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  opacity: 0;
}

.mac-select-option.selected .mac-select-check {
  opacity: 1;
}

.mac-select-check::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 8px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.mac-select-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes macMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

:root:not([data-theme="light"]) .mac-select-menu {
  border-color: rgba(255, 255, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(39, 48, 60, 0.96), rgba(19, 25, 34, 0.94)),
    rgba(18, 24, 34, 0.96);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

:root:not([data-theme="light"]) .mac-select-option {
  color: #edf2f7;
}

:root:not([data-theme="light"]) .mac-select-option:hover,
:root:not([data-theme="light"]) .mac-select-option:focus {
  background: rgba(84, 174, 255, 0.16);
}

option {
  color: #111820;
  background: #f7f2e8;
}

.secret-toggle {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 30px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  cursor: pointer;
}

.secret-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.13);
}

#apiKey {
  padding-right: 50px;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  font-weight: 780;
  overflow: hidden;
  white-space: nowrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -45%;
  width: 34%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  opacity: 0;
}

.btn:hover::after {
  animation: buttonShine 0.9s ease;
}

@keyframes buttonShine {
  from {
    left: -45%;
    opacity: 0.2;
  }
  to {
    left: 118%;
    opacity: 0.65;
  }
}

.btn.primary {
  background: linear-gradient(135deg, #f0d27c 0%, #ba8b34 100%);
  color: #11130f;
  box-shadow: 0 16px 38px rgba(186, 139, 52, 0.28);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(186, 139, 52, 0.35);
}

.btn.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--secondary-text);
}

.btn.secondary:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.09);
}

.btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.config-card .btn.primary {
  width: 100%;
  margin-top: 2px;
}

.hint {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.5;
}

.model-status {
  color: var(--soft);
  font-size: 11px;
  line-height: 1.45;
}

.model-status.ok {
  color: var(--success);
}

.model-status.warn {
  color: var(--gold-2);
}

.model-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 0;
}

.model-suggestion {
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 720;
}

.model-suggestion:hover,
.model-suggestion.active {
  border-color: rgba(217, 183, 102, 0.56);
  background: rgba(217, 183, 102, 0.1);
  color: var(--text);
}

.studio-view {
  display: none;
  grid-template-columns: clamp(300px, 18vw, 360px) minmax(680px, 1fr) clamp(300px, 17vw, 360px);
  gap: 14px;
  min-height: calc(100vh - 82px);
}

.studio-view.active {
  display: grid;
}

.side-panel,
.preview-panel,
.settings-panel {
  min-height: 0;
}

.side-panel,
.settings-panel {
  padding: 16px;
  overflow: visible;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.studio-head {
  padding: 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

.studio-head h2 {
  margin: 0;
  font-size: 17px;
}

.studio-head span {
  color: var(--muted);
  font-size: 12px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-1);
  backdrop-filter: blur(16px);
}

.mode-tab {
  min-height: 36px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 760;
}

.mode-tab.active {
  color: #11130f;
  background: linear-gradient(135deg, #ead08a, #b98f3f);
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  background: var(--surface-1);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
  backdrop-filter: blur(16px);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: rgba(217, 183, 102, 0.74);
  background: rgba(217, 183, 102, 0.075);
  transform: translateY(-2px);
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  position: relative;
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border: 1px solid rgba(217, 183, 102, 0.44);
  border-radius: 8px;
  display: block;
  color: transparent;
  background: rgba(217, 183, 102, 0.08);
  font-size: 0;
  line-height: 0;
}

.drop-icon::before,
.drop-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold-2);
  transform: translate(-50%, -50%);
}

.drop-icon::after {
  width: 2px;
  height: 10px;
}

.dropzone strong {
  display: block;
  margin-bottom: 5px;
}

.dropzone span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-1);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.remove-thumb {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  cursor: pointer;
}

.prompt-tools {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  backdrop-filter: blur(12px);
}

.chip:hover {
  color: var(--text);
  border-color: rgba(217, 183, 102, 0.5);
}

.preview-stage {
  position: relative;
  min-height: calc(100vh - 200px);
  display: grid;
  place-items: center;
  padding: clamp(18px, 2vw, 26px);
  background:
    linear-gradient(90deg, var(--preview-grid) 1px, transparent 1px),
    linear-gradient(var(--preview-grid) 1px, transparent 1px),
    var(--preview-bg);
  background-size: 42px 42px;
  overflow: hidden;
}

.preview-stage.rendering .empty-state,
.preview-stage.rendering .result-grid {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.job-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-content: center;
  gap: 18px;
  justify-self: center;
  align-self: center;
  width: min(920px, calc(100% - 48px));
  max-height: calc(100% - 48px);
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 22px;
  background: var(--job-bg);
  color: var(--job-text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
}

.job-overlay[hidden] {
  display: none;
}

.render-module {
  position: relative;
  --render-progress: 0%;
  width: min(620px, 88%);
  aspect-ratio: 1.35;
  margin: 0 auto 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(217, 183, 102, 0.28), transparent 34%),
    rgba(255, 255, 255, 0.045);
  background-size: 26px 26px, 26px 26px, auto, auto;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 48px rgba(113, 222, 203, 0.08);
}

.render-module::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--render-progress);
  background:
    linear-gradient(90deg, rgba(217, 183, 102, 0.08), rgba(113, 222, 203, 0.16)),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0.7;
  transition: width 0.55s ease;
}

.render-module::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 0 42%, rgba(255, 255, 255, 0.24) 48%, transparent 55%),
    linear-gradient(180deg, transparent 0 38%, rgba(113, 222, 203, 0.18) 45%, transparent 52%);
  background-size: 220% 100%, 100% 220%;
  mix-blend-mode: screen;
  opacity: 0.68;
  animation: renderScanX 2.2s ease-in-out infinite, renderScanY 3.1s ease-in-out infinite;
}

.render-module span {
  position: absolute;
  display: block;
}

.render-core {
  left: 50%;
  top: 50%;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(243, 217, 138, 0.8), rgba(217, 183, 102, 0.2) 42%, transparent 70%);
  filter: blur(1px);
  animation: corePulse 1.6s ease-in-out infinite;
}

.render-orbit {
  left: 18%;
  top: 18%;
  width: 64%;
  height: 64%;
  border-radius: 50%;
  border: 1px solid rgba(113, 222, 203, 0.44);
  transform-origin: 50% 50%;
  animation: orbitSpin 5.5s linear infinite;
}

.render-orbit-b {
  left: 24%;
  top: 24%;
  width: 52%;
  height: 52%;
  border-color: rgba(217, 183, 102, 0.3);
  transform: rotate(58deg);
  animation-duration: 4.2s;
  animation-direction: reverse;
}

.render-tile {
  width: clamp(54px, 7vw, 86px);
  height: clamp(54px, 7vw, 86px);
  border: 1px solid rgba(217, 183, 102, 0.44);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(243, 217, 138, 0.16), rgba(217, 183, 102, 0.04)),
    rgba(217, 183, 102, 0.08);
  box-shadow: 0 0 24px rgba(217, 183, 102, 0.12);
  animation: tileFloat 2.6s ease-in-out infinite;
}

.render-tile::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), transparent 42%);
  opacity: 0.38;
}

.render-tile-a {
  left: 18%;
  top: 22%;
}

.render-tile-b {
  right: 18%;
  top: 30%;
  border-color: rgba(113, 222, 203, 0.42);
  background: rgba(113, 222, 203, 0.08);
  animation-delay: 0.28s;
}

.render-tile-c {
  left: 42%;
  bottom: 18%;
  animation-delay: 0.56s;
}

.render-pixel {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: rgba(243, 217, 138, 0.85);
  box-shadow: 0 0 18px rgba(243, 217, 138, 0.52);
  animation: pixelBuild 1.8s ease-in-out infinite;
}

.render-pixel-1 {
  left: 12%;
  top: 18%;
}

.render-pixel-2 {
  left: 30%;
  top: 14%;
  animation-delay: 0.16s;
}

.render-pixel-3 {
  right: 24%;
  top: 18%;
  animation-delay: 0.32s;
}

.render-pixel-4 {
  right: 12%;
  top: 46%;
  background: rgba(113, 222, 203, 0.86);
  box-shadow: 0 0 18px rgba(113, 222, 203, 0.52);
  animation-delay: 0.48s;
}

.render-pixel-5 {
  left: 14%;
  bottom: 28%;
  animation-delay: 0.64s;
}

.render-pixel-6 {
  left: 36%;
  bottom: 14%;
  background: rgba(113, 222, 203, 0.86);
  box-shadow: 0 0 18px rgba(113, 222, 203, 0.52);
  animation-delay: 0.8s;
}

.render-pixel-7 {
  right: 30%;
  bottom: 18%;
  animation-delay: 0.96s;
}

.render-pixel-8 {
  right: 14%;
  bottom: 34%;
  background: rgba(113, 222, 203, 0.86);
  box-shadow: 0 0 18px rgba(113, 222, 203, 0.52);
  animation-delay: 1.12s;
}

@keyframes renderScanX {
  from {
    background-position: 180% 0, 0 0;
  }
  to {
    background-position: -80% 0, 0 0;
  }
}

@keyframes renderScanY {
  from {
    background-position: 0 0, 0 170%;
  }
  to {
    background-position: 0 0, 0 -70%;
  }
}

@keyframes corePulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(0.78);
    opacity: 0.48;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.16);
    opacity: 0.95;
  }
}

@keyframes orbitSpin {
  from {
    transform: rotate(0deg) scaleX(1.28) scaleY(0.68);
  }
  to {
    transform: rotate(360deg) scaleX(1.28) scaleY(0.68);
  }
}

@keyframes tileFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(3deg);
  }
}

@keyframes pixelBuild {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(0.72);
  }
  45%,
  65% {
    opacity: 1;
    transform: scale(1.25);
  }
}

.job-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(620px, 88%);
  margin: 0 auto;
}

.job-progress-head div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.job-progress-head strong {
  font-size: 16px;
  color: var(--job-text);
  overflow-wrap: anywhere;
}

.job-progress-head span {
  color: var(--job-muted);
  font-size: 12px;
}

.job-progress-head b {
  flex: 0 0 auto;
  color: var(--job-accent);
  font-size: 24px;
}

.progress-track {
  width: min(620px, 88%);
  margin: 0 auto;
  height: 9px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.065);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--job-accent), var(--job-teal));
  box-shadow: 0 0 28px rgba(217, 183, 102, 0.35);
  transition: width 0.55s ease;
}

.job-steps {
  width: min(620px, 88%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.job-steps span {
  min-width: 0;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.job-steps span.active,
.job-steps span.done {
  border-color: rgba(217, 183, 102, 0.46);
  color: var(--job-text);
  background: rgba(217, 183, 102, 0.1);
}

.job-steps span.done {
  border-color: rgba(113, 222, 203, 0.42);
  background: rgba(113, 222, 203, 0.08);
}

.job-overlay.failed {
  border-color: rgba(255, 133, 133, 0.38);
}

.job-overlay.failed .progress-track span {
  background: linear-gradient(90deg, var(--danger), #f2b1b1);
}

.empty-state {
  width: min(480px, 100%);
  text-align: center;
  color: var(--muted);
}

.empty-frame {
  width: min(300px, 68vw);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 35% 30%, rgba(217, 183, 102, 0.26), transparent 28%),
    radial-gradient(circle at 70% 64%, rgba(113, 222, 203, 0.18), transparent 32%),
    rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 24px 55px rgba(0, 0, 0, 0.32);
  animation: emptyFloat 5s ease-in-out infinite;
}

@keyframes emptyFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

.empty-frame span {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(217, 183, 102, 0.4);
  border-radius: 50%;
  color: var(--gold-2);
  font-size: 28px;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 19px;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
}

.result-grid {
  width: min(1320px, 100%);
  display: grid;
  gap: 14px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

.result-card img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 250px);
  object-fit: contain;
  background: var(--image-bg);
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.result-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.result-actions a,
.result-actions button {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 7px;
  background: rgba(217, 183, 102, 0.08);
  color: var(--gold-2);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 740;
}

.result-actions button:hover,
.result-actions a:hover {
  border-color: rgba(217, 183, 102, 0.58);
  background: rgba(217, 183, 102, 0.13);
}

.status-bar {
  min-height: 52px;
  padding: 11px 15px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.status-bar strong {
  color: var(--text);
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid var(--control-border);
  border-top-color: var(--gold-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

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

.settings-section {
  position: relative;
  z-index: 1;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-section.has-open-select {
  z-index: 80;
}

.settings-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.settings-section h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.settings-grid {
  display: grid;
  gap: 11px;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.workspace-actions {
  display: grid;
  gap: 9px;
}

.workspace-actions .btn {
  width: 100%;
}

.error-box {
  display: none;
  margin-top: 11px;
  padding: 11px;
  border: 1px solid rgba(255, 133, 133, 0.32);
  border-radius: var(--radius);
  background: rgba(255, 133, 133, 0.1);
  color: #ffd0d0;
  font-size: 12px;
  line-height: 1.55;
}

.error-box.show {
  display: block;
}

.config-summary {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

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

.summary-row strong {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

:root[data-theme="light"] body::before {
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.72) 50%, transparent 63%),
    linear-gradient(rgba(28, 39, 52, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 39, 52, 0.02) 1px, transparent 1px);
}

:root[data-theme="light"] .shell::after {
  mix-blend-mode: multiply;
  opacity: 0.38;
}

:root[data-theme="light"] .panel {
  box-shadow:
    0 18px 48px rgba(33, 44, 58, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

:root[data-theme="light"] .brand-mark {
  border-color: rgba(15, 142, 143, 0.24);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 0 0 4px rgba(15, 142, 143, 0.05);
}

:root[data-theme="light"] .connection-pill {
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 22px rgba(33, 44, 58, 0.06);
}

:root[data-theme="light"] .intro-text {
  color: var(--muted);
}

:root[data-theme="light"] .btn.secondary,
:root[data-theme="light"] .secret-toggle,
:root[data-theme="light"] .chip,
:root[data-theme="light"] .model-suggestion {
  background: rgba(255, 255, 255, 0.74);
  color: var(--secondary-text);
}

:root[data-theme="light"] .btn.secondary:hover,
:root[data-theme="light"] .secret-toggle:hover,
:root[data-theme="light"] .chip:hover,
:root[data-theme="light"] .model-suggestion:hover {
  background: rgba(255, 255, 255, 0.96);
}

:root[data-theme="light"] .mode-tabs {
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .dropzone {
  border-color: rgba(184, 139, 45, 0.28);
  background: rgba(255, 255, 255, 0.52);
}

:root[data-theme="light"] .dropzone:hover,
:root[data-theme="light"] .dropzone.dragover {
  background: rgba(255, 247, 225, 0.78);
}

:root[data-theme="light"] .job-overlay {
  border-color: rgba(28, 39, 52, 0.14);
  box-shadow:
    0 30px 90px rgba(33, 44, 58, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

:root[data-theme="light"] .progress-track,
:root[data-theme="light"] .job-steps span {
  border-color: rgba(28, 39, 52, 0.14);
  background: rgba(238, 243, 248, 0.82);
}

:root[data-theme="light"] .render-module {
  border-color: rgba(28, 39, 52, 0.12);
  background:
    linear-gradient(90deg, rgba(41, 55, 72, 0.065) 1px, transparent 1px),
    linear-gradient(rgba(41, 55, 72, 0.065) 1px, transparent 1px),
    radial-gradient(circle at 50% 45%, rgba(184, 139, 45, 0.18), transparent 34%),
    rgba(246, 250, 252, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 0 52px rgba(15, 142, 143, 0.08);
}

:root[data-theme="light"] .render-module::before {
  background:
    linear-gradient(90deg, rgba(184, 139, 45, 0.08), rgba(15, 142, 143, 0.14)),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.44), transparent);
}

:root[data-theme="light"] .render-module::after {
  background:
    linear-gradient(90deg, transparent 0 42%, rgba(255, 255, 255, 0.62) 48%, transparent 55%),
    linear-gradient(180deg, transparent 0 38%, rgba(15, 142, 143, 0.12) 45%, transparent 52%);
  mix-blend-mode: normal;
  opacity: 0.78;
}

:root[data-theme="light"] .job-steps span.active,
:root[data-theme="light"] .job-steps span.done {
  color: var(--job-text);
}

:root[data-theme="light"] .render-core {
  background:
    radial-gradient(circle, rgba(184, 139, 45, 0.5), rgba(184, 139, 45, 0.16) 42%, transparent 70%);
}

:root[data-theme="light"] .render-orbit {
  border-color: rgba(15, 142, 143, 0.34);
}

:root[data-theme="light"] .render-orbit-b {
  border-color: rgba(184, 139, 45, 0.26);
}

:root[data-theme="light"] .render-tile {
  border-color: rgba(184, 139, 45, 0.34);
  background:
    linear-gradient(135deg, rgba(184, 139, 45, 0.12), rgba(184, 139, 45, 0.04)),
    rgba(255, 255, 255, 0.46);
  box-shadow: 0 0 24px rgba(184, 139, 45, 0.08);
}

:root[data-theme="light"] .render-tile-b {
  border-color: rgba(15, 142, 143, 0.32);
  background: rgba(15, 142, 143, 0.08);
}

:root[data-theme="light"] .render-pixel {
  background: rgba(184, 139, 45, 0.72);
  box-shadow: 0 0 16px rgba(184, 139, 45, 0.28);
}

:root[data-theme="light"] .render-pixel-4,
:root[data-theme="light"] .render-pixel-6,
:root[data-theme="light"] .render-pixel-8 {
  background: rgba(15, 142, 143, 0.68);
  box-shadow: 0 0 16px rgba(15, 142, 143, 0.28);
}

:root[data-theme="light"] .result-card {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 44px rgba(33, 44, 58, 0.16);
}

:root[data-theme="light"] .error-box {
  color: #8a2424;
  background: rgba(255, 235, 235, 0.9);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  min-height: 40px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--toast-bg);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
  font-size: 12px;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

@media (max-width: 1080px) {
  .config-view {
    grid-template-columns: minmax(0, 0.8fr) minmax(340px, 430px);
    align-items: start;
  }

  .intro {
    min-height: 390px;
    padding-top: 8px;
  }

  .hero-visual {
    height: 185px;
    margin-top: 14px;
  }

  .config-card {
    max-width: 620px;
  }

  .studio-view {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .settings-panel {
    grid-column: 1 / -1;
  }

  .settings-panel .settings-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    background:
      radial-gradient(circle at 40% 0%, rgba(217, 183, 102, 0.17), transparent 32%),
      linear-gradient(145deg, var(--bg), var(--bg-2) 62%, var(--bg));
  }

  .shell {
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
  }

  .window-cluster {
    width: 100%;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand h1 {
    font-size: 19px;
  }

  .brand p {
    max-width: calc(100vw - 86px);
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
  }

  .theme-toggle {
    min-width: 86px;
    min-height: 38px;
    gap: 7px;
    padding: 0 10px 0 9px;
  }

  .theme-icon {
    width: 22px;
    height: 22px;
  }

  .theme-label {
    max-width: 34px;
    font-size: 12px;
    line-height: 1.05;
    white-space: normal;
    word-break: keep-all;
    text-align: center;
  }

  .connection-pill {
    max-width: 100%;
    width: auto;
    min-width: 0;
    justify-content: flex-start;
    overflow: hidden;
  }

  .connection-pill strong {
    min-width: 0;
  }

  .config-view,
  .studio-view.active {
    grid-template-columns: 1fr;
  }

  .config-view {
    gap: 8px;
    padding: 0 0 18px;
  }

  .intro {
    display: grid;
    min-height: 0;
  }

  .eyebrow {
    min-height: 22px;
    padding: 0 8px;
    font-size: 10px;
  }

  .intro h2 {
    max-width: 100%;
    margin: 8px 0 5px;
    font-size: clamp(22px, 7vw, 28px);
    line-height: 1.12;
  }

  .intro-text {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.55;
  }

  .hero-visual {
    display: none;
  }

  .config-card,
  .side-panel,
  .settings-panel,
  .studio-head {
    padding: 14px;
  }

  .panel-title {
    margin-bottom: 14px;
  }

  .panel-title h3 {
    font-size: 17px;
  }

  input,
  select,
  textarea,
  .btn {
    min-height: 42px;
  }

  textarea {
    min-height: 116px;
  }

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

  .studio-head,
  .status-bar,
  .result-meta {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-head .btn {
    width: 100%;
  }

  .preview-stage {
    min-height: 320px;
    padding: 14px;
  }

  .empty-frame {
    width: min(230px, 70vw);
  }

  .mini-grid,
  .thumb-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .shell {
    padding: 10px;
  }

  .topbar {
    padding: 8px 4px 11px;
  }

  .top-actions {
    gap: 7px;
  }

  .theme-toggle {
    min-width: 76px;
    min-height: 36px;
    padding: 0 8px;
    gap: 6px;
  }

  .theme-icon {
    width: 20px;
    height: 20px;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 0 3px rgba(217, 183, 102, 0.08);
  }

  .theme-label {
    max-width: none;
    font-size: 11px;
    white-space: nowrap;
  }

  .connection-pill {
    min-height: 36px;
    padding: 0 10px;
    gap: 7px;
  }

  .brand p {
    display: none;
  }

  .intro h2 {
    font-size: 25px;
  }

  .config-card {
    padding: 13px;
  }

  .panel-title p,
  .hint {
    display: none;
  }

  .mini-grid,
  .thumb-grid {
    grid-template-columns: 1fr;
  }
}


/* 老蹬站AI生图：轻量改版覆盖样式 */
.brand.no-logo {
  gap: 0;
}

.simple-hero {
  width: min(430px, 94%);
  margin: 28px auto 0;
  padding: 24px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(217, 183, 102, 0.26);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(217, 183, 102, 0.16), rgba(113, 222, 203, 0.08)),
    var(--surface-1);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
}

.simple-hero strong {
  font-size: clamp(20px, 2.6vw, 30px);
  color: var(--text);
}

.simple-hero span {
  color: var(--muted);
  line-height: 1.7;
}

input[readonly],
input:disabled {
  cursor: not-allowed;
  opacity: 0.88;
}

.model-suggestion:disabled {
  cursor: default;
  opacity: 0.82;
}

.simple-progress-card {
  aspect-ratio: auto;
  min-height: 138px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.simple-progress-card::after {
  display: none;
}

.simple-progress-card strong,
.simple-progress-card span {
  position: relative;
  z-index: 1;
}

.simple-progress-card strong {
  font-size: clamp(22px, 3vw, 36px);
  color: var(--text);
}

.simple-progress-card span {
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
}

.job-progress-head strong {
  line-height: 1.55;
}

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

/* 性能优化：工作台和进度层降级为轻量静态渲染，避免长时间多动画占用主线程/GPU */
.studio-view .shell::before,
.studio-view .shell::after {
  animation: none !important;
  transform: none !important;
}

.studio-view .panel,
.studio-view .job-overlay,
.studio-view .mac-select-button,
.studio-view .mac-select-menu,
.studio-view .mode-tab,
.studio-view .chip {
  backdrop-filter: none !important;
}

.job-overlay {
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
}

.simple-progress-card,
.simple-progress-card *,
.simple-progress-card::before,
.simple-progress-card::after {
  animation: none !important;
  filter: none !important;
}

.simple-progress-card .render-core,
.simple-progress-card .render-orbit,
.simple-progress-card .render-tile,
.simple-progress-card .render-pixel {
  display: none !important;
}

.simple-progress-card::before {
  transition: width 0.8s ease;
}

@media (max-width: 720px), (prefers-reduced-motion: reduce) {
  .shell::before,
  .shell::after,
  .render-module::after {
    animation: none !important;
    transform: none !important;
  }

  .panel,
  .job-overlay,
  .mac-select-button,
  .mac-select-menu,
  .mode-tab,
  .chip {
    backdrop-filter: none !important;
  }
}


/* 工作台易用性优化：参考图独立卡片 + 快捷 Key 修改 */
.studio-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.btn.compact {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 12px;
}

.reference-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.reference-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.reference-head strong,
.reference-head span {
  display: block;
}

.reference-head strong {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
}

.reference-head span {
  color: var(--soft);
  font-size: 11px;
  line-height: 1.45;
}

.link-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(217, 183, 102, 0.34);
  background: rgba(217, 183, 102, 0.08);
  color: var(--gold-2);
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
}

.link-button:hover {
  border-color: rgba(217, 183, 102, 0.62);
  background: rgba(217, 183, 102, 0.14);
  color: var(--text);
}

.dropzone.is-muted {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.dropzone.is-muted::after {
  content: "生图模式：参考图暂不发送";
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(12, 18, 28, 0.72);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 760;
}

.key-summary-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

@media (max-width: 920px) {
  .studio-head-actions {
    justify-content: flex-start;
  }

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

  .reference-head .link-button {
    width: max-content;
  }
}

/* 成功记录：保存生图/改图历史 */

.success-history {
  display: grid;
  gap: 12px;
}

.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.history-head h3 {
  margin-bottom: 4px;
}

.history-head span {
  display: block;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.45;
}

.history-retention-notice {
  margin: 6px 0 0;
  padding: 7px 9px;
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 12px;
  background: rgba(217, 183, 102, 0.08);
  color: var(--gold-2);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.45;
}

.success-history-list {
  display: grid;
  gap: 10px;
}

.history-empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}

.history-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.history-thumb {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--image-bg);
  color: var(--gold-2);
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.history-body strong,
.history-body span,
.history-body p {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-body strong {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.history-body span {
  color: var(--soft);
  font-size: 11px;
  white-space: nowrap;
}

.history-body p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-actions a,
.history-actions button {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(217, 183, 102, 0.28);
  border-radius: 999px;
  background: rgba(217, 183, 102, 0.08);
  color: var(--gold-2);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 740;
}

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