:root {
  --app-color-scheme: dark;
  --app-bg: #0c0d0f;
  --app-bg-2: #101715;
  --app-panel: rgba(213, 229, 237, 0.06);
  --app-panel-strong: rgba(18, 35, 32, 0.92);
  --app-border: rgba(213, 229, 237, 0.08);
  --app-border-strong: rgba(213, 229, 237, 0.16);
  --app-text-primary: #f7fbff;
  --app-text-secondary: #c8d8e2;
  --app-text-muted: #7f919d;
  --app-accent: #21fe84;
  --app-accent-hover: #7bf5ca;
  --app-accent-alt: #4ad6fd;
  --app-accent-soft: rgba(33, 254, 132, 0.12);
  --app-accent-soft-strong: rgba(33, 254, 132, 0.28);
  --app-danger: #ff5d7f;
  --app-success: #21fe84;
  --app-warning: #ffd27c;
  --app-shadow: rgba(0, 0, 0, 0.42);
  --app-sidebar-hover: rgba(213, 229, 237, 0.08);
  --app-sidebar-active-bg: rgba(33, 254, 132, 0.12);
  --app-titlebar-bg: #080e0d;
  --app-tab-hover-bg: rgba(213, 229, 237, 0.10);
  --app-tab-active-bg: rgba(213, 229, 237, 0.13);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  color-scheme: var(--app-color-scheme);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--app-bg);
  color: var(--app-text-primary);
}

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

button {
  border: 0;
}

.lamp-auth {
  --shade-hue: 42;
  --on: 0;
  --lamp-ink: #f4f0e8;
  --lamp-muted: #8fa0ae;
  --lamp-accent: hsl(var(--shade-hue) 92% 62%);
  min-height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(18, 25, 33, 0.94), rgba(10, 15, 21, 0.98)),
    #121921;
  color: var(--lamp-ink);
}

.lamp-auth::before {
  content: "";
  position: fixed;
  inset: -18% -10% 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 40% 44%, hsla(var(--shade-hue), 95%, 64%, 0.20), transparent 28%),
    radial-gradient(circle at 64% 57%, hsla(var(--shade-hue), 90%, 58%, 0.10), transparent 32%);
  opacity: var(--on);
  transition: opacity 420ms ease, background 420ms ease;
}

.lamp-auth::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, transparent, black 18%, black 80%, transparent);
}

.lamp-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(28px, 7vw, 92px);
  padding: clamp(28px, 7vw, 82px) 22px 24px;
}

.lamp-wrap {
  width: min(430px, 92vw);
  display: grid;
  place-items: center;
}

.lamp-svg {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.36));
  transition: filter 420ms ease;
}

.lamp-on .lamp-svg {
  filter: drop-shadow(0 0 26px hsla(var(--shade-hue), 92%, 62%, 0.24)) drop-shadow(0 26px 40px rgba(0, 0, 0, 0.38));
}

.light-beam {
  fill: hsla(var(--shade-hue), 92%, 62%, 0.18);
  opacity: var(--on);
  transition: opacity 420ms ease, fill 420ms ease;
}

.light-pool {
  fill: hsla(var(--shade-hue), 92%, 62%, 0.22);
  opacity: var(--on);
  transition: opacity 420ms ease, fill 420ms ease;
}

.bulb-glow {
  fill: hsla(var(--shade-hue), 96%, 68%, 0.7);
  filter: url(#softGlow);
  opacity: var(--on);
  transition: opacity 420ms ease, fill 420ms ease;
}

.lamp-metal {
  fill: #1f2b35;
  stroke: rgba(234, 238, 240, 0.12);
  stroke-width: 2;
}

.lamp-metal-light {
  fill: #293947;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 2;
}

.shade {
  fill: #273440;
  stroke: hsla(var(--shade-hue), 78%, 62%, 0.46);
  stroke-width: 2;
  transition: fill 360ms ease, stroke 360ms ease;
}

.lamp-on .shade {
  fill: hsl(var(--shade-hue) 38% 27%);
  stroke: hsla(var(--shade-hue), 92%, 68%, 0.86);
}

.shade-rim {
  fill: #0e151c;
  stroke: hsla(var(--shade-hue), 86%, 62%, 0.5);
  stroke-width: 2;
  transition: stroke 360ms ease;
}

.lamp-on .shade-rim {
  stroke: hsla(var(--shade-hue), 96%, 70%, 0.86);
}

.bulb-core {
  fill: #59616a;
  transition: fill 360ms ease;
}

.lamp-on .bulb-core {
  fill: hsl(var(--shade-hue) 98% 76%);
}

.eye-mark {
  fill: none;
  stroke: #f6efe2;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cord {
  fill: none;
  stroke: rgba(235, 236, 229, 0.78);
  stroke-width: 4;
  stroke-linecap: round;
}

.pull-knob circle:first-child {
  fill: #d6d0c6;
  stroke: rgba(255, 255, 255, 0.58);
  stroke-width: 2;
}

.pull-knob circle:last-child {
  fill: var(--lamp-accent);
  opacity: 0.56;
}

.pull-knob {
  cursor: grab;
  touch-action: none;
  outline: none;
}

.pull-knob:active {
  cursor: grabbing;
}

.lamp-hint {
  margin-top: -18px;
  color: rgba(234, 239, 242, 0.62);
  font-size: 13px;
}

.lamp-card {
  width: min(420px, 100%);
  padding: clamp(26px, 4vw, 36px);
  border: 1px solid hsla(var(--shade-hue), 92%, 62%, 0.62);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(21, 31, 40, 0.86), rgba(10, 15, 21, 0.88)),
    rgba(14, 22, 30, 0.78);
  box-shadow: 0 0 34px hsla(var(--shade-hue), 92%, 62%, 0.26), 0 28px 72px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.86);
  transform-origin: 50% 58%;
  transition: opacity 420ms ease, transform 720ms cubic-bezier(0.16, 1.22, 0.28, 1), border-color 360ms ease, box-shadow 360ms ease;
}

.lamp-on .lamp-card {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  border-color: hsla(var(--shade-hue), 92%, 62%, 0.62);
  box-shadow: 0 0 34px hsla(var(--shade-hue), 92%, 62%, 0.26), 0 28px 72px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.lamp-card-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.lamp-brand {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #121921;
  background: var(--lamp-accent);
  font-weight: 900;
}

.lamp-kicker {
  margin: 0 0 8px;
  color: var(--lamp-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.lamp-card h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  color: #fff8ed;
}

.lamp-card-head span:not(.lamp-brand) {
  color: rgba(226, 232, 237, 0.68);
  line-height: 1.65;
  font-size: 13px;
}

.lamp-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid rgba(141, 160, 174, 0.18);
  border-radius: 8px;
  background: rgba(7, 12, 17, 0.38);
}

.lamp-tabs button {
  min-height: 36px;
  border-radius: 6px;
  color: rgba(234, 239, 242, 0.7);
  background: transparent;
  cursor: pointer;
}

.lamp-tabs button.active {
  color: #111820;
  background: var(--lamp-accent);
  font-weight: 800;
}

.lamp-form {
  display: grid;
  gap: 15px;
}

.lamp-field {
  display: grid;
  gap: 8px;
  color: rgba(226, 232, 237, 0.74);
  font-size: 13px;
}

.lamp-input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(141, 160, 174, 0.26);
  border-radius: 6px;
  outline: 0;
  background: rgba(7, 12, 17, 0.62);
  color: #fffaf0;
}

.lamp-input:focus {
  border-color: var(--lamp-accent);
  background: rgba(8, 14, 19, 0.86);
  box-shadow: 0 0 0 3px hsla(var(--shade-hue), 92%, 62%, 0.18), 0 0 22px hsla(var(--shade-hue), 92%, 62%, 0.28);
}

.lamp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.lamp-button {
  min-width: 132px;
  min-height: 48px;
  border-radius: 6px;
  background: var(--lamp-accent);
  color: #111820;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px hsla(var(--shade-hue), 92%, 62%, 0.3);
}

.lamp-link {
  color: rgba(234, 239, 242, 0.74);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.lamp-link:hover {
  color: var(--lamp-accent);
}

.lamp-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 0 24px 24px;
  color: rgba(211, 220, 228, 0.56);
  font-size: 13px;
}

.lamp-footer span + span::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 16px;
  border-radius: 50%;
  vertical-align: middle;
  background: hsla(var(--shade-hue), 92%, 62%, 0.62);
}

.login-screen {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  background:
    linear-gradient(90deg, rgba(4, 8, 12, 0.26), rgba(4, 8, 12, 0.78)),
    var(--app-bg);
}

.login-art {
  position: relative;
  overflow: hidden;
  padding: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-covers {
  display: flex;
  gap: 22px;
  align-items: center;
  transform: translateY(8px);
}

.login-covers img,
.home-cover img {
  width: min(24vw, 260px);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 18px;
  padding: 7px;
  background: linear-gradient(180deg, rgba(213, 229, 237, 0.10), rgba(213, 229, 237, 0.04));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42);
}

.login-covers img:nth-child(1),
.home-cover:nth-child(1) {
  transform: translateY(18px);
}

.login-covers img:nth-child(3),
.home-cover:nth-child(3) {
  transform: translateY(-18px);
}

.login-panel {
  min-height: 100%;
  padding: 42px 34px;
  background: rgba(9, 17, 24, 0.86);
  border-left: 1px solid var(--app-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--app-accent), var(--app-accent-hover));
  color: #041014;
  font-weight: 900;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 8px;
  color: var(--app-text-muted);
  line-height: 1.7;
  font-size: 13px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--app-border);
  background: rgba(213, 229, 237, 0.045);
}

.auth-tab {
  height: 34px;
  border-radius: 7px;
  color: var(--app-text-muted);
  background: transparent;
  cursor: pointer;
}

.auth-tab.active {
  color: #041014;
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent-hover));
  font-weight: 800;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label,
.field-label {
  font-size: 12px;
  color: var(--app-text-muted);
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--app-border);
  background: rgba(213, 229, 237, 0.06);
  color: var(--app-text-primary);
  border-radius: 10px;
  outline: 0;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.input,
.select {
  height: 38px;
  padding: 0 12px;
}

.textarea {
  min-height: 148px;
  resize: vertical;
  padding: 12px;
  line-height: 1.65;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--app-accent);
  box-shadow: 0 0 0 3px rgba(74, 214, 253, 0.12);
}

.select option {
  background: #111b24;
  color: #f7fbff;
}

.btn {
  min-height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  color: var(--app-text-secondary);
  background: rgba(213, 229, 237, 0.08);
  border: 1px solid var(--app-border);
  cursor: pointer;
  transition: transform 0.16s, background 0.16s, color 0.16s, border-color 0.16s;
  white-space: nowrap;
}

.btn:hover {
  color: var(--app-text-primary);
  background: rgba(213, 229, 237, 0.12);
  border-color: var(--app-border-strong);
  transform: translateY(-1px);
}

.btn.primary {
  color: #041014;
  background: linear-gradient(135deg, var(--app-accent), var(--app-accent-hover));
  border-color: transparent;
  font-weight: 700;
}

.btn.danger {
  color: #fff;
  background: rgba(255, 93, 127, 0.16);
  border-color: rgba(255, 93, 127, 0.24);
}

.btn.ghost {
  background: transparent;
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  flex: 0 0 auto;
}

.app-root {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100%;
  overflow: hidden;
  background: color-mix(in srgb, var(--app-bg) 92%, #000);
}

.titlebar {
  height: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8, 15, 21, 0.78);
  border-bottom: 1px solid rgba(213, 229, 237, 0.06);
  padding: 0 8px 0 12px;
  user-select: none;
  z-index: 5;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  min-width: 0;
  max-width: 72%;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 16px 0 0;
  border-radius: 10px;
  color: var(--app-text-primary);
  background: transparent;
  cursor: pointer;
}

.app-brand:hover {
  background: var(--app-panel);
}

.brand-mark--tiny {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 12px;
}

.app-logo-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
  border-radius: 4px;
}

.app-brand-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.title-tabs {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 4px;
  padding: 0 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.title-tabs::-webkit-scrollbar {
  display: none;
}

.title-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  max-width: 180px;
  padding: 0 10px;
  border-radius: 7px;
  background: var(--app-panel);
  color: var(--app-text-muted);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.15s;
}

.title-tab:hover {
  background: rgba(213, 229, 237, 0.1);
  color: var(--app-text-secondary);
}

.title-tab.active {
  background: rgba(213, 229, 237, 0.13);
  color: var(--app-text-primary);
}

.tab-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 500;
}

.tab-close {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(213, 229, 237, 0.06);
  color: var(--app-text-muted);
  font-size: 10px;
}

.tab-indicator {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 0;
  height: 2px;
  border-radius: 1px;
  background: transparent;
}

.title-tab.active .tab-indicator {
  background: var(--app-accent);
  box-shadow: 0 0 6px var(--app-accent-soft-strong);
}

.titlebar-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.ctrl-btn {
  width: 36px;
  height: 28px;
  border-radius: 4px;
  background: transparent;
  color: var(--app-text-muted);
  cursor: default;
  font-size: 12px;
}

.ctrl-btn:hover {
  background: var(--app-panel);
  color: var(--app-text-primary);
}

.ctrl-close:hover {
  background: #ff3c74;
  color: #fff;
}

.app-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 205px;
  min-width: 205px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  border-right: 1px solid var(--app-border);
  background:
    radial-gradient(circle at 12% 18%, rgba(68, 136, 205, 0.16), transparent 34%),
    rgba(8, 15, 21, 0.74);
  backdrop-filter: blur(18px);
}

.sidebar-head {
  padding: 18px 16px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.sidebar-title {
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-sub {
  margin-top: 2px;
  color: var(--app-text-muted);
  font-size: 11px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 0 16px 10px;
  border-radius: 10px;
  background: var(--app-panel);
  border: 1px solid var(--app-border);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--app-accent-soft);
  color: var(--app-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.user-info {
  min-width: 0;
  flex: 1;
}

.user-name,
.user-role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
}

.user-role {
  color: var(--app-text-muted);
  font-size: 11px;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  overflow-y: auto;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  cursor: pointer;
  color: var(--app-text-muted);
  border-radius: 0 10px 10px 0;
  margin: 4px 10px 4px 0;
  transition: all 0.2s;
}

.nav-item:hover {
  color: var(--app-text-secondary);
  background: var(--app-sidebar-hover);
  transform: translateX(2px);
}

.nav-item.active {
  color: var(--app-accent);
  background: var(--app-sidebar-active-bg);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  bottom: 20%;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--app-accent), var(--app-accent-hover));
}

.nav-label {
  font-size: 14px;
}

.sidebar-footer {
  padding: 12px 16px 16px;
  color: var(--app-text-muted);
  font-size: 11px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-titlebar {
  height: 46px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--app-border);
  background: rgba(9, 17, 24, 0.42);
}

.page-titlebar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.page-titlebar .status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--app-text-muted);
  font-size: 12px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--app-success);
  box-shadow: 0 0 10px var(--app-success);
}

.workspace {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 20px 20px;
}

.leyi-hero {
  position: relative;
  min-height: 174px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(213, 229, 237, 0.10);
  padding: 24px 28px;
  background:
    linear-gradient(90deg, rgba(16, 38, 30, 0.72), rgba(7, 22, 27, 0.42)),
    url("/assets/home-three-column-reference.png") center / cover no-repeat;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 20px 48px rgba(0, 0, 0, 0.26);
}

.leyi-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 12, 16, 0.72), rgba(7, 12, 16, 0.26) 58%, rgba(7, 12, 16, 0.54));
  pointer-events: none;
}

.hero-copy,
.hero-status {
  position: relative;
  z-index: 1;
}

.hero-pill {
  display: inline-flex;
  height: 30px;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(213, 229, 237, 0.10);
  color: rgba(247, 251, 255, 0.58);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.hero-copy h2 {
  margin: 16px 0 8px;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy p {
  margin: 0;
  max-width: 720px;
  color: rgba(213, 229, 237, 0.72);
  font-size: 14px;
}

.hero-status {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}

.cover-section {
  border-radius: 18px;
  border: 1px solid rgba(213, 229, 237, 0.08);
  padding: 22px 20px 24px;
  background:
    linear-gradient(180deg, rgba(213, 229, 237, 0.05), rgba(213, 229, 237, 0.025)),
    rgba(8, 15, 21, 0.46);
}

.cover-section-title {
  margin-bottom: 14px;
  font-size: 16px;
  font-weight: 800;
  color: var(--app-text-primary);
}

.reference-covers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.reference-covers img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: 12px;
  background: rgba(213, 229, 237, 0.06);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.26);
}

.home-view {
  height: 100%;
  min-height: 620px;
  position: relative;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--app-border) 92%, transparent);
  background:
    radial-gradient(circle at 16% 22%, color-mix(in srgb, var(--app-accent-hover) 16%, transparent), transparent 18%),
    radial-gradient(circle at 86% 16%, color-mix(in srgb, var(--app-accent) 18%, transparent), transparent 22%),
    linear-gradient(180deg, color-mix(in srgb, var(--app-panel-strong) 96%, var(--app-bg)) 0%, color-mix(in srgb, var(--app-bg) 96%, #000) 100%);
  padding: 26px 30px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 24px 60px rgba(0, 0, 0, 0.38);
}

.home-grid {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
}

.home-covers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
}

.home-cover {
  max-width: 250px;
}

.home-cover img {
  width: 100%;
}

.home-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.kicker {
  color: var(--app-accent);
  font-size: 12px;
  letter-spacing: 1.4px;
}

.home-title {
  margin: 0;
  font-size: 34px;
  line-height: 1.18;
}

.home-text {
  margin: 0;
  color: var(--app-text-secondary);
  line-height: 1.8;
  font-size: 14px;
}

.quick-actions,
.toolbar,
.row-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
}

.section-desc {
  margin-top: 6px;
  color: var(--app-text-muted);
  font-size: 12px;
}

.panel {
  background: color-mix(in srgb, var(--app-panel) 88%, transparent);
  border: 1px solid var(--app-border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.82fr);
  gap: 16px;
  align-items: start;
}

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

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

.channel-source-note {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  background: rgba(213, 229, 237, 0.045);
  color: var(--app-text-muted);
  font-size: 12px;
}

.channel-source-note strong {
  color: var(--app-text-primary);
  font-size: 13px;
  font-weight: 750;
  margin-right: auto;
}

.mode-tabs,
.ratio-tabs,
.category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab {
  height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  background: rgba(213, 229, 237, 0.06);
  color: var(--app-text-muted);
  border: 1px solid transparent;
  cursor: pointer;
}

.tab.active {
  color: var(--app-text-primary);
  background: var(--app-accent-soft);
  border-color: color-mix(in srgb, var(--app-accent) 42%, transparent);
}

.result-preview {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed var(--app-border-strong);
  overflow: hidden;
}

.result-preview img,
.result-preview video {
  max-width: 100%;
  max-height: 520px;
  display: block;
}

.result-text {
  width: 100%;
  min-height: 260px;
  padding: 14px;
  white-space: pre-wrap;
  color: var(--app-text-secondary);
  line-height: 1.8;
}

.empty {
  color: var(--app-text-muted);
  font-size: 13px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(214px, 214px));
  gap: 14px;
  align-items: start;
}

.project-card,
.asset-card,
.task-card,
.stat-card {
  background: rgba(213, 229, 237, 0.06);
  border: 1px solid rgba(213, 229, 237, 0.08);
  border-radius: 12px;
  padding: 10px;
  min-width: 0;
}

.project-cards {
  display: flex;
  flex-wrap: wrap;
}

.project-card {
  width: 214px;
  height: 264px;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

.project-thumb,
.asset-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(213, 229, 237, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--app-text-muted);
}

.project-thumb {
  width: 194px;
  height: 194px;
  flex: 0 0 auto;
}

.project-thumb img,
.asset-thumb img,
.asset-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.assets-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.assets-grid .asset-card {
  width: 110px;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 4px;
  background: var(--app-bg-2);
}

.assets-grid .asset-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
}

.assets-grid .card-title {
  margin: 4px 0 1px;
  padding: 0 2px;
  text-align: center;
  font-size: 11px;
}

.assets-grid .card-meta {
  text-align: center;
  font-size: 10px;
}

.storyboard-panel {
  position: relative;
  min-height: 460px;
}

.storyboard-panel::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 24px;
  bottom: 18px;
  height: 54px;
  border-radius: 999px;
  background: rgba(12, 13, 15, 0.78);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(213, 229, 237, 0.04);
  pointer-events: none;
  transform: translateX(-50%);
  opacity: 0.46;
}

.settings-container {
  position: relative;
  min-height: 100%;
}

.settings-container::before {
  content: "";
  position: absolute;
  inset: -14px -20px;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(213, 229, 237, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(213, 229, 237, 0.045) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.55;
}

.settings-container > * {
  position: relative;
  z-index: 1;
}

.card-title {
  margin-top: 8px;
  color: var(--app-text-primary);
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  margin-top: 3px;
  color: var(--app-text-muted);
  font-size: 11px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--app-border);
  padding: 10px 8px;
  text-align: left;
  color: var(--app-text-secondary);
  vertical-align: top;
}

.table th {
  color: var(--app-text-muted);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  background: rgba(213, 229, 237, 0.08);
  color: var(--app-text-secondary);
  font-size: 11px;
}

.badge.ok {
  color: var(--app-success);
  background: rgba(33, 254, 132, 0.10);
}

.badge.failed {
  color: var(--app-danger);
  background: rgba(255, 93, 127, 0.10);
}

.badge.warning {
  color: var(--app-warning);
  background: rgba(255, 210, 124, 0.10);
}

.mono {
  font-family: "Cascadia Mono", "Consolas", monospace;
  color: var(--app-text-muted);
}

.compact-input {
  height: 32px;
  min-width: 128px;
  border-radius: 8px;
}

.inline-select {
  width: auto;
  min-width: 118px;
  height: 32px;
  border-radius: 8px;
}

.notice {
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--app-text-secondary);
  background: rgba(74, 214, 253, 0.08);
  border: 1px solid rgba(74, 214, 253, 0.14);
  line-height: 1.6;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  min-width: 240px;
  max-width: 460px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(9, 17, 24, 0.94);
  border: 1px solid var(--app-border-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
  color: var(--app-text-secondary);
}

.loading {
  opacity: 0.72;
  pointer-events: none;
}

/* Software parity skin */
.app-root {
  height: 100vh;
  background: var(--app-bg);
}

.titlebar {
  background: var(--app-titlebar-bg);
  border-bottom: 0;
  padding: 0 12px 0 16px;
}

.app-brand {
  gap: 10px;
  padding: 0 16px 0 4px;
}

.title-tab:hover {
  background: var(--app-tab-hover-bg);
}

.title-tab.active {
  background: var(--app-tab-active-bg);
}

.app-body {
  background: var(--app-bg);
}

.sidebar {
  width: 240px;
  min-width: 240px;
  border-right: 1px solid rgba(213, 229, 237, 0.045);
  background: #080f0e;
  backdrop-filter: none;
}

.user-card {
  margin: 12px 16px 10px;
  cursor: default;
}

.sidebar-nav {
  padding: 12px 0;
}

.nav-item {
  gap: 16px;
  padding: 14px 20px;
  margin: 4px 10px 4px 0;
}

.nav-item.active .icon {
  filter: drop-shadow(0 0 6px var(--app-accent-soft-strong));
}

.sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
}

.main {
  background: var(--app-bg);
}

.page-titlebar {
  display: none;
}

.workspace {
  padding: 20px 24px;
  background: var(--app-bg);
}

.home-view {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.showcase-panel {
  height: 100%;
  position: relative;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--app-border) 92%, transparent);
  background:
    radial-gradient(circle at 16% 22%, color-mix(in srgb, var(--app-accent-alt) 18%, transparent), transparent 18%),
    radial-gradient(circle at 86% 16%, color-mix(in srgb, var(--app-accent) 16%, transparent), transparent 22%),
    linear-gradient(180deg, color-mix(in srgb, var(--app-panel-strong) 96%, var(--app-bg)) 0%, color-mix(in srgb, var(--app-bg) 96%, #000) 100%);
  padding: 26px 30px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 4%, transparent), 0 24px 60px rgba(0, 0, 0, 0.38);
}

.showcase-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.showcase-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  filter: blur(32px);
  opacity: 0.55;
}

.showcase-glow--left {
  left: -28px;
  top: 28px;
  background: color-mix(in srgb, var(--app-accent-alt) 24%, transparent);
}

.showcase-glow--right {
  right: -18px;
  top: 36px;
  background: color-mix(in srgb, var(--app-accent) 20%, transparent);
}

.cover-grid {
  height: 100%;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.cover-card {
  width: 100%;
  max-width: 250px;
  background: transparent;
}

.cover-card-inner {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(213, 229, 237, 0.10), rgba(213, 229, 237, 0.03));
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.40), 0 0 0 1px color-mix(in srgb, var(--app-border) 90%, transparent);
}

.cover-card-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 22px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #fff 5%, transparent);
}

.cover-image {
  width: 100%;
  aspect-ratio: 9 / 16;
  display: block;
  object-fit: cover;
  border-radius: 16px;
  background: color-mix(in srgb, var(--app-panel-strong) 96%, #000);
}

@media (max-width: 980px) {
  .lamp-stage {
    align-items: flex-start;
    gap: 18px;
    padding-top: 36px;
  }
  .lamp-wrap {
    width: min(350px, 94vw);
  }
  .lamp-card {
    padding: 24px;
  }
  .lamp-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .lamp-button {
    width: 100%;
  }
  .lamp-link {
    align-self: center;
  }
  .login-screen {
    grid-template-columns: 1fr;
  }
  .login-art {
    min-height: 42vh;
  }
  .login-panel {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--app-border);
  }
  .app-body {
    flex-direction: column;
  }
  .titlebar-left {
    max-width: calc(100% - 112px);
  }
  .app-brand-name {
    display: none;
  }
  .hero-status {
    align-items: flex-start;
  }
  .leyi-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .reference-covers {
    grid-template-columns: 1fr;
  }
  .sidebar {
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: 230px;
  }
  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 6px 10px;
  }
  .nav-item {
    border-radius: 10px;
    margin: 0;
    flex: 0 0 auto;
  }
  .workspace {
    padding: 14px;
  }
  .showcase-panel {
    min-height: 520px;
    padding: 18px;
    border-radius: 18px;
  }
  .cover-grid {
    gap: 14px;
    align-items: center;
  }
  .cover-card {
    max-width: min(29vw, 170px);
  }
  .cover-card-inner {
    border-radius: 16px;
    padding: 5px;
  }
  .cover-image {
    border-radius: 12px;
  }
  .home-grid,
  .grid-2,
  .grid-3,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .home-view {
    min-height: auto;
  }
  .home-covers {
    flex-direction: column;
  }
  .home-cover {
    max-width: 320px;
  }
}

@media (max-width: 560px) {
  .title-tabs {
    padding: 0;
  }
  .title-tab {
    max-width: 94px;
    padding: 0 8px;
  }
  .tab-close {
    display: none;
  }
  .user-card {
    margin: 10px 10px 6px;
  }
  .nav-item {
    padding: 12px 14px;
  }
  .showcase-panel {
    min-height: 620px;
  }
  .cover-grid {
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 12px;
    overflow: auto;
  }
  .cover-card {
    width: min(62vw, 220px);
    max-width: none;
  }
}

.channel-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.channel-panel-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--app-text-secondary);
}

.channel-config-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.channel-config-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--app-border);
  color: var(--app-text-secondary);
  background: rgba(213, 229, 237, 0.055);
  text-align: left;
  cursor: pointer;
}

.channel-config-btn:hover {
  color: var(--app-text-primary);
  border-color: var(--app-accent-soft-strong);
  background: var(--app-accent-soft);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.channel-modal {
  width: min(980px, 100%);
  max-height: min(820px, 92vh);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--app-border-strong);
  border-radius: 12px;
  background: #0b1211;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.api-modal {
  width: min(1180px, 100%);
}

.service-channel-modal {
  width: min(900px, 100%);
}

.channel-modal-head,
.channel-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--app-border);
  background: rgba(213, 229, 237, 0.045);
}

.channel-modal-foot {
  border-top: 1px solid var(--app-border);
  border-bottom: 0;
  color: var(--app-text-muted);
  font-size: 12px;
}

.channel-modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--app-text-muted);
  background: rgba(213, 229, 237, 0.06);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--app-text-primary);
  background: rgba(213, 229, 237, 0.12);
}

.channel-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.channel-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.summary-chip,
.mini-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--app-border);
  color: var(--app-text-muted);
  background: rgba(213, 229, 237, 0.055);
  font-size: 12px;
}

.summary-chip.ok,
.mini-tag.ok {
  color: var(--app-success);
  border-color: var(--app-accent-soft-strong);
  background: var(--app-accent-soft);
}

.mini-tag.failed {
  color: var(--app-danger);
}

.mini-tag.warning {
  color: var(--app-warning);
}

.channel-tabs,
.api-model-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.channel-tab {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--app-text-muted);
  background: rgba(213, 229, 237, 0.055);
  border: 1px solid var(--app-border);
  cursor: pointer;
}

.channel-tab.active,
.channel-tab:hover {
  color: #041014;
  background: var(--app-accent);
  border-color: transparent;
}

.channel-toolbar,
.channel-import-actions,
.channel-bulk-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.channel-search {
  max-width: 360px;
}

.channel-progress {
  height: 7px;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: 999px;
  background: rgba(213, 229, 237, 0.08);
}

.channel-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--app-accent), var(--app-accent-alt));
}

.channel-bulk-line {
  color: var(--app-text-muted);
  font-size: 12px;
}

.channel-bulk-line button {
  color: var(--app-text-secondary);
  background: transparent;
  cursor: pointer;
}

.channel-bulk-line button:hover {
  color: var(--app-accent);
}

.channel-bulk-line.spacious {
  margin-top: 16px;
}

.channel-account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.channel-account {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: rgba(213, 229, 237, 0.045);
}

.channel-account.current {
  border-color: var(--app-accent-soft-strong);
  background: var(--app-accent-soft);
}

.channel-account.used {
  opacity: 0.72;
}

.channel-account-index {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--app-accent);
  background: rgba(33, 254, 132, 0.10);
  font-weight: 800;
}

.channel-account-main {
  min-width: 0;
}

.channel-account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 7px;
}

.channel-account-meta code {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--app-text-muted);
}

.channel-account-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.btn.tiny {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: var(--app-danger);
  border-color: rgba(255, 93, 127, 0.32);
}

.btn:disabled,
.channel-tab:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.channel-empty,
.empty {
  padding: 18px;
  border: 1px dashed var(--app-border);
  border-radius: 10px;
  color: var(--app-text-muted);
  text-align: center;
}

.modal-hint,
.secret-mask {
  color: var(--app-text-muted);
  font-size: 12px;
  line-height: 1.7;
}

.channel-import-text {
  min-height: 240px;
  font-family: Consolas, "Microsoft YaHei", monospace;
}

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

.service-channel-hero {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: rgba(213, 229, 237, 0.045);
}

.service-channel-hero p {
  margin: 0 0 12px;
  color: var(--app-text-secondary);
  line-height: 1.7;
}

.service-field,
.service-setting-row {
  min-width: 0;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: rgba(213, 229, 237, 0.045);
}

.setting-row strong {
  font-size: 13px;
}

.setting-row p {
  margin: 4px 0 0;
  color: var(--app-text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(213, 229, 237, 0.14);
  border: 1px solid var(--app-border);
  cursor: pointer;
}

.switch span::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: var(--app-text-muted);
  transition: transform 0.18s, background 0.18s;
}

.switch input:checked + span {
  background: var(--app-accent-soft-strong);
  border-color: var(--app-accent);
}

.switch input:checked + span::after {
  transform: translateX(20px);
  background: var(--app-accent);
}

.api-universal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  margin-bottom: 16px;
}

.api-side-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.api-provider-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  color: var(--app-text-secondary);
  background: rgba(213, 229, 237, 0.045);
  text-align: left;
  cursor: pointer;
}

.api-provider-row span {
  color: var(--app-text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-provider-row.active,
.api-provider-row:hover {
  border-color: var(--app-accent-soft-strong);
  background: var(--app-accent-soft);
}

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

.api-model-group {
  min-width: 0;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: rgba(213, 229, 237, 0.045);
}

.api-model-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--app-border);
  color: var(--app-text-secondary);
}

.api-model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.model-chip {
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--app-text-secondary);
  background: rgba(213, 229, 237, 0.07);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--app-text-secondary);
}

@media (max-width: 760px) {
  .modal-backdrop {
    padding: 10px;
  }
  .channel-modal {
    max-height: 94vh;
  }
  .channel-modal-head,
  .channel-modal-foot,
  .channel-toolbar,
  .channel-import-actions {
    align-items: flex-start;
    flex-direction: column;
  }
  .channel-search {
    max-width: none;
  }
  .channel-account {
    grid-template-columns: 28px minmax(0, 1fr);
  }
  .channel-account-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .channel-settings-view,
  .service-channel-grid,
  .api-universal-grid,
  .api-model-groups {
    grid-template-columns: 1fr;
  }
}

.canvas-view {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.canvas-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex: 0 0 auto;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.canvas-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 270px;
  gap: 12px;
}

.canvas-palette,
.canvas-inspector {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(8, 15, 21, 0.72);
}

.canvas-palette {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.canvas-inspector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.canvas-panel-title {
  color: var(--app-text-secondary);
  font-size: 12px;
  font-weight: 800;
}

.canvas-type-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--app-border);
  background: rgba(213, 229, 237, 0.045);
  color: var(--app-text-secondary);
  cursor: pointer;
  text-align: left;
}

.canvas-type-btn:hover {
  border-color: var(--app-accent-soft-strong);
  background: var(--app-accent-soft);
  color: var(--app-text-primary);
}

.canvas-type-btn span {
  font-size: 13px;
  font-weight: 750;
}

.canvas-type-btn small {
  color: var(--app-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

.canvas-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.canvas-swatch,
.canvas-color-input {
  width: 100%;
  aspect-ratio: 1;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--app-border);
  background: var(--swatch);
  cursor: pointer;
}

.canvas-swatch.active {
  outline: 2px solid var(--app-text-primary);
  outline-offset: 2px;
}

.canvas-color-input {
  padding: 0;
  overflow: hidden;
}

.canvas-stats {
  display: grid;
  gap: 7px;
  color: var(--app-text-muted);
  font-size: 12px;
}

.canvas-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background:
    linear-gradient(rgba(213, 229, 237, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(213, 229, 237, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 16% 12%, rgba(74, 214, 253, 0.12), transparent 24%),
    #0b0f12;
  background-size: 48px 48px, 48px 48px, auto, auto;
  cursor: grab;
  touch-action: none;
}

.canvas-stage:active {
  cursor: grabbing;
}

.canvas-plane {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  z-index: 2;
}

.canvas-lines {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: visible;
  pointer-events: none;
}

.canvas-edge {
  fill: none;
  stroke: var(--edge-color, var(--app-accent-alt));
  stroke-width: 2.4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(74, 214, 253, 0.32));
  pointer-events: stroke;
  cursor: pointer;
}

.canvas-edge.selected {
  stroke-width: 4;
  stroke: var(--app-warning);
}

.canvas-group {
  position: absolute;
  z-index: 1;
  border: 1px dashed color-mix(in srgb, var(--node-color) 72%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--node-color) 10%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.canvas-group.selected {
  border-style: solid;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--node-color) 44%, transparent);
}

.canvas-group-title {
  position: absolute;
  left: 10px;
  top: 8px;
  max-width: calc(100% - 46px);
  color: var(--app-text-secondary);
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-group-delete,
.canvas-node-delete {
  position: absolute;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(8, 15, 21, 0.78);
  color: var(--app-text-muted);
  border: 1px solid var(--app-border);
  cursor: pointer;
}

.canvas-group-delete {
  right: 8px;
  top: 7px;
}

.canvas-node {
  position: absolute;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--node-color) 54%, var(--app-border));
  border-radius: 12px;
  padding: 10px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--node-color) 14%, transparent), transparent 34%),
    rgba(13, 20, 22, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  cursor: move;
}

.canvas-node.selected {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--node-color) 72%, transparent), 0 18px 42px rgba(0, 0, 0, 0.42);
}

.canvas-node-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.canvas-node-type {
  color: color-mix(in srgb, var(--node-color) 76%, var(--app-text-primary));
  font-size: 11px;
  font-weight: 800;
}

.canvas-port {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--node-color);
  background: rgba(8, 15, 21, 0.86);
  cursor: crosshair;
}

.canvas-port.active {
  background: var(--node-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--node-color) 22%, transparent);
}

.canvas-node-title {
  color: var(--app-text-primary);
  font-size: 15px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.canvas-node-content {
  min-height: 0;
  color: var(--app-text-secondary);
  font-size: 12px;
  line-height: 1.55;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.canvas-node-image {
  width: 100%;
  min-height: 72px;
  flex: 1;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(213, 229, 237, 0.05);
}

.canvas-image-empty {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 80px;
  border: 1px dashed var(--app-border);
  border-radius: 8px;
  color: var(--app-text-muted);
  font-size: 12px;
  text-align: center;
}

.canvas-task-status {
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--node-color) 16%, transparent);
  color: color-mix(in srgb, var(--node-color) 76%, var(--app-text-primary));
  font-size: 11px;
}

.canvas-node-delete {
  right: 8px;
  bottom: 8px;
}

.canvas-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
}

.canvas-resize-handle::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 8px;
  height: 8px;
  border-right: 2px solid color-mix(in srgb, var(--node-color) 76%, transparent);
  border-bottom: 2px solid color-mix(in srgb, var(--node-color) 76%, transparent);
}

.canvas-minimap {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 5;
  width: 148px;
  height: 112px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: rgba(8, 15, 21, 0.78);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.mini-node,
.mini-group {
  position: absolute;
  border-radius: 3px;
}

.mini-node {
  background: var(--app-accent-alt);
}

.mini-group {
  border: 1px dashed var(--app-accent);
  background: rgba(33, 254, 132, 0.08);
}

.canvas-selection-box {
  position: absolute;
  z-index: 6;
  border: 1px solid var(--app-accent-alt);
  background: rgba(74, 214, 253, 0.10);
  pointer-events: none;
}

.canvas-inspector .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.canvas-inspector .field span {
  color: var(--app-text-muted);
  font-size: 12px;
}

.canvas-inspector-text {
  min-height: 130px;
}

.canvas-file-input {
  display: none;
}

@media (max-width: 1120px) {
  .canvas-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .canvas-inspector {
    grid-column: 1 / -1;
    min-height: 180px;
  }
}

@media (max-width: 760px) {
  .canvas-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .canvas-toolbar {
    justify-content: flex-start;
  }
  .canvas-shell {
    grid-template-columns: 1fr;
  }
  .canvas-palette {
    max-height: 220px;
  }
  .canvas-stage {
    min-height: 520px;
  }
  .canvas-minimap {
    display: none;
  }
}
