@font-face {
  font-family: "Material Symbols Rounded";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/assets/fonts/material-symbols-rounded.woff2") format("woff2");
}

.material-symbols-rounded {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

:root {
  --panel-opacity: 0.88;
  --panel-strong-opacity: 0.96;
  --bg: #fff8fb;
  --bg-accent: radial-gradient(circle at top, #ffe1f0 0%, #fff8fb 42%, #fffdf7 100%);
  --panel: rgba(255, 255, 255, 0.88);
  --panel: rgb(255 255 255 / var(--panel-opacity));
  --panel-strong: rgba(255, 255, 255, 0.96);
  --panel-strong: rgb(255 255 255 / var(--panel-strong-opacity));
  --line: rgba(229, 165, 197, 0.36);
  --text: #5f4352;
  --muted: #9f7d8d;
  --primary: #ff7db0;
  --primary-strong: #ff5f98;
  --secondary: #8ccaff;
  --secondary-strong: #629eff;
  --primary-rgb: 255, 125, 176;
  --primary-strong-rgb: 255, 95, 152;
  --secondary-rgb: 140, 202, 255;
  --secondary-strong-rgb: 98, 158, 255;
  --brand-pink: #ff7db0;
  --brand-pink-rgb: 255, 125, 176;
  --danger-rgb: 239, 111, 134;
  --action-gradient: linear-gradient(135deg, var(--primary), var(--primary-strong));
  --secondary-action-gradient: linear-gradient(135deg, var(--secondary), var(--secondary-strong));
  --danger: #ef6f86;
  --shadow: 0 24px 60px rgba(var(--primary-rgb), 0.12);
  --ornament-dot: rgba(203, 112, 164, 0.28);
  --ornament-line: rgba(102, 153, 220, 0.25);
  --ornament-star: rgba(255, 91, 158, 0.7);
  --ornament-glow-primary: rgba(var(--primary-rgb), 0.18);
  --ornament-glow-secondary: rgba(99, 164, 255, 0.16);
  --surface-blur: 18px;
  --surface-saturate: 1;
  --select-option-bg: #fff8fb;
  --select-option-active: #ffe1ef;
  /* 交互浮层不跟随卡片透明度，避免自定义背景干扰菜单和对话框阅读。 */
  --floating-surface-base: rgba(255, 250, 253, 0.95);
  --floating-surface:
    linear-gradient(145deg, rgba(255, 255, 255, 0.64), transparent 44%),
    linear-gradient(325deg, rgba(var(--secondary-rgb), 0.1), transparent 52%),
    linear-gradient(42deg, rgba(var(--primary-rgb), 0.08), transparent 58%),
    var(--floating-surface-base);
  --floating-control: rgba(255, 255, 255, 0.84);
  --floating-border: rgba(174, 94, 135, 0.34);
  --floating-shadow: 0 24px 64px rgba(67, 41, 61, 0.2);
  --floating-hover: rgba(var(--primary-rgb), 0.13);
  --floating-active:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.2), rgba(var(--secondary-rgb), 0.15)),
    rgba(255, 255, 255, 0.72);
  --floating-muted: #765b69;
  --floating-blur: 16px;
  --scrollbar-track-color: rgba(126, 91, 109, 0.11);
  --scrollbar-thumb-color: rgba(218, 105, 157, 0.64);
  --scrollbar-thumb-gradient: linear-gradient(160deg, #ff9ac1, #82bcf2);
  --scrollbar-thumb-hover-gradient: linear-gradient(160deg, #ff72aa, #639fe2);
  --scrollbar-thumb-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

body[data-theme="night"] {
  --bg: #151925;
  --bg-accent: radial-gradient(circle at top, #263659 0%, #1b2031 52%, #151925 100%);
  --panel: rgba(25, 31, 47, 0.86);
  --panel: rgb(25 31 47 / var(--panel-opacity));
  --panel-strong: rgba(18, 23, 36, 0.94);
  --panel-strong: rgb(18 23 36 / var(--panel-strong-opacity));
  --line: rgba(124, 156, 224, 0.24);
  --text: #f7ebf3;
  --muted: #bbaec0;
  --primary: #ff8cb8;
  --primary-strong: #ff6c9c;
  --secondary: #7cb8ff;
  --secondary-strong: #5d98ff;
  --primary-rgb: 255, 140, 184;
  --primary-strong-rgb: 255, 108, 156;
  --secondary-rgb: 124, 184, 255;
  --secondary-strong-rgb: 93, 152, 255;
  --danger-rgb: 255, 131, 150;
  --danger: #ff8396;
  --shadow: 0 24px 60px rgba(3, 6, 15, 0.42);
  --ornament-dot: rgba(157, 184, 238, 0.17);
  --ornament-line: rgba(126, 168, 239, 0.18);
  --ornament-star: rgba(255, 133, 184, 0.64);
  --ornament-glow-primary: rgba(255, 83, 156, 0.14);
  --ornament-glow-secondary: rgba(83, 148, 255, 0.16);
  --select-option-bg: #171d2c;
  --select-option-active: #3b2b46;
  --floating-surface-base: rgba(18, 23, 36, 0.96);
  --floating-surface:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), transparent 42%),
    linear-gradient(325deg, rgba(var(--secondary-rgb), 0.1), transparent 54%),
    linear-gradient(42deg, rgba(var(--primary-rgb), 0.1), transparent 58%),
    var(--floating-surface-base);
  --floating-control: rgba(34, 41, 59, 0.94);
  --floating-border: rgba(148, 174, 229, 0.3);
  --floating-shadow: 0 24px 68px rgba(0, 3, 12, 0.48);
  --floating-hover: rgba(var(--primary-rgb), 0.17);
  --floating-active:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.26), rgba(var(--secondary-rgb), 0.18)),
    rgba(31, 37, 55, 0.92);
  --floating-muted: #c6b7c3;
  --scrollbar-track-color: rgba(4, 7, 15, 0.34);
  --scrollbar-thumb-color: rgba(226, 121, 169, 0.7);
  --scrollbar-thumb-gradient: linear-gradient(160deg, #e67aaa, #719fdf);
  --scrollbar-thumb-hover-gradient: linear-gradient(160deg, #ff8fba, #83b4f4);
  --scrollbar-thumb-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

* {
  box-sizing: border-box;
}

/* Firefox 使用标准属性；限制在 Gecko，避免新版 Chromium 覆盖 WebKit 渐变。 */
@supports (-moz-appearance: none) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-track-color);
  }
}

/* Chromium、Edge 与 Safari 使用可表现主题渐变的滚动条伪元素。 */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  border-radius: 999px;
  background: var(--scrollbar-track-color);
}

*::-webkit-scrollbar-thumb {
  min-width: 40px;
  min-height: 40px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--scrollbar-thumb-gradient) padding-box;
  box-shadow: var(--scrollbar-thumb-shadow);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover-gradient) padding-box;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  background: var(--bg-accent);
}

/* 全局纹理保持在内容层之后，只负责打破大面积纯色背景。 */
body::before,
body::after {
  position: fixed;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle, var(--ornament-dot) 0 1px, transparent 1.35px),
    radial-gradient(circle, var(--ornament-star) 0 1.2px, transparent 1.7px);
  background-position: 0 0, 21px 21px;
  background-size: 42px 42px, 84px 84px;
  opacity: 0.48;
  -webkit-mask-image: linear-gradient(155deg, #000 0%, rgba(0, 0, 0, 0.58) 48%, transparent 92%);
  mask-image: linear-gradient(155deg, #000 0%, rgba(0, 0, 0, 0.58) 48%, transparent 92%);
}

body[data-theme="day"]::before {
  opacity: 0.72;
  -webkit-mask-image: linear-gradient(155deg, #000 0%, rgba(0, 0, 0, 0.76) 58%, rgba(0, 0, 0, 0.24) 100%);
  mask-image: linear-gradient(155deg, #000 0%, rgba(0, 0, 0, 0.76) 58%, rgba(0, 0, 0, 0.24) 100%);
}

body[data-theme="day"] .shell::before,
body[data-theme="day"] .shell::after {
  opacity: 0.88;
}

body[data-theme="day"] .composer-panel::after,
body[data-theme="day"] .asset-panel::after {
  opacity: 0.7;
}

body::after {
  inset: -12vh -8vw;
  background:
    radial-gradient(ellipse at 82% 14%, var(--ornament-glow-secondary), transparent 34%),
    radial-gradient(ellipse at 18% 82%, var(--ornament-glow-primary), transparent 31%),
    radial-gradient(ellipse at 52% 112%, var(--ornament-glow-secondary), transparent 30%);
  opacity: 0.8;
  animation: mew-aurora-drift 20s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes mew-aurora-drift {
  from {
    transform: translate3d(-1.2%, -0.8%, 0) scale(1);
  }

  to {
    transform: translate3d(1.4%, 1%, 0) scale(1.035);
  }
}

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

button {
  border: none;
  cursor: pointer;
}

.shell {
  position: relative;
  z-index: 1;
  isolation: isolate;
  min-height: 100vh;
  padding: 20px;
}

/* 两条低对比星轨主要填充桌面端留白，移动端会自动隐藏。 */
.shell::before,
.shell::after {
  position: fixed;
  z-index: -1;
  width: 620px;
  height: 286px;
  border: 1px solid var(--ornament-line);
  border-radius: 50%;
  background:
    radial-gradient(circle at 17% 24%, var(--ornament-star) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 13%, var(--ornament-dot) 0 2.5px, transparent 3.5px),
    radial-gradient(circle at 87% 66%, var(--ornament-star) 0 1.5px, transparent 2.5px);
  box-shadow:
    inset 0 0 44px rgba(120, 166, 232, 0.025),
    0 0 28px rgba(110, 158, 226, 0.03);
  content: "";
  opacity: 0.72;
  pointer-events: none;
  animation: mew-orbit-float 24s ease-in-out infinite alternate;
}

.shell::before {
  top: 7vh;
  right: -245px;
  transform: rotate(-16deg);
}

.shell::after {
  bottom: -118px;
  left: -280px;
  width: 720px;
  height: 330px;
  transform: rotate(13deg);
  animation-delay: -9s;
}

@keyframes mew-orbit-float {
  from {
    translate: 0 -4px;
  }

  to {
    translate: 0 8px;
  }
}

.shell-single {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(var(--surface-blur)) saturate(var(--surface-saturate));
  backdrop-filter: blur(var(--surface-blur)) saturate(var(--surface-saturate));
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.composer-panel,
.asset-panel {
  position: relative;
}

/* 星座节点只落在大型工作面板边角，避免干扰输入和图片内容。 */
.composer-panel::after,
.asset-panel::after {
  position: absolute;
  right: 18px;
  bottom: 12px;
  z-index: 0;
  width: 220px;
  height: 92px;
  background:
    radial-gradient(circle at 12% 72%, var(--ornament-star) 0 2px, transparent 3px),
    radial-gradient(circle at 46% 29%, var(--ornament-dot) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 61%, var(--ornament-star) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 95% 18%, var(--ornament-dot) 0 2.5px, transparent 3.5px),
    linear-gradient(145deg, transparent 0 26%, var(--ornament-line) 26.4% 26.9%, transparent 27.3%),
    linear-gradient(24deg, transparent 0 53%, var(--ornament-line) 53.4% 53.9%, transparent 54.3%);
  content: "";
  opacity: 0.58;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000);
}

.composer-panel > *,
.asset-panel > * {
  position: relative;
  z-index: 1;
}

.workspace-layout h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}

.workspace-layout h2::after {
  width: 42px;
  height: 9px;
  background:
    radial-gradient(circle at 5px 50%, var(--ornament-star) 0 2px, transparent 3px),
    linear-gradient(90deg, var(--ornament-line), transparent) center / 100% 1px no-repeat;
  content: "";
  opacity: 0.78;
}

.topbar,
.settings-grid,
.split-panel,
.grid,
.compact-grid,
.preview-strip,
.gallery,
.history-actions,
.thumb-actions,
.mode-tabs,
.thread-strip,
.settings-inline {
  display: grid;
  gap: 12px;
}

.topbar {
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand h1,
h2,
h3 {
  margin: 0;
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
}

.brand-inline {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow:
    0 8px 18px rgba(var(--primary-rgb), 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.6);
  animation: mew-logo-glow 6s ease-in-out infinite alternate;
  will-change: filter;
}

@keyframes mew-logo-glow {
  from {
    filter: drop-shadow(0 0 2px transparent);
  }

  to {
    filter: drop-shadow(0 0 7px var(--ornament-glow-primary));
  }
}

.brand-compact h1 {
  font-size: 28px;
}

.brand-inline h1 {
  font-size: 24px;
}

.topbar-actions,
.row,
.thumb-actions,
.history-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.main,
.stack,
.history-list,
.settings-panel,
.composer-panel,
.workspace-main,
.gallery-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main,
.workspace-main {
  gap: 18px;
}

.composer-panel,
.settings-panel,
.split-panel,
.panel {
  padding: 20px;
}

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

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

.split-panel {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

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

.compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preview-strip {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.gallery {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.sidebar-gallery {
  grid-template-columns: 1fr;
}

.gallery-pagination-footer {
  margin-top: auto;
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.gallery-pagination-anchor {
  position: relative;
  display: inline-flex;
  justify-content: center;
}

.gallery-page-dismiss-layer {
  position: fixed;
  inset: 0;
  z-index: 17;
  background: transparent;
  border: none;
  padding: 0;
}

.gallery-pagination-cluster {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body[data-theme="night"] .gallery-pagination-cluster {
  box-shadow: none;
}

.pagination-icon-button {
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 18px;
  flex: 0 0 46px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.1);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body[data-theme="night"] .pagination-icon-button {
  background: rgba(18, 23, 36, 0.72);
  border-color: rgba(124, 156, 224, 0.22);
  box-shadow: 0 10px 24px rgba(3, 6, 15, 0.24);
}

.pagination-page-button {
  min-width: 108px;
  height: 46px;
  padding: 0 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.1);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}

body[data-theme="night"] .pagination-page-button {
  background: rgba(18, 23, 36, 0.72);
  border-color: rgba(124, 156, 224, 0.22);
  box-shadow: 0 10px 24px rgba(3, 6, 15, 0.24);
}

.pagination-icon-button:disabled,
.pagination-page-button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.pagination-icon-button .app-icon,
.pagination-page-button .app-icon {
  font-size: 22px;
}

.pagination-icon-button:not(:disabled):hover,
.pagination-page-button:hover {
  border-color: rgba(var(--primary-rgb), 0.42);
}

body[data-theme="night"] .pagination-icon-button:not(:disabled):hover,
body[data-theme="night"] .pagination-page-button:hover {
  border-color: rgba(124, 156, 224, 0.42);
}

.gallery-page-popover-layer {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  z-index: 18;
}

.gallery-page-popover {
  width: min(152px, calc(100vw - 72px));
  padding: 10px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.gallery-page-popover::after {
  content: "";
  position: absolute;
  left: 50%;
  top: calc(100% - 2px);
  width: 14px;
  height: 14px;
  background: var(--panel-strong);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}

.gallery-page-popover-body {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gallery-page-wheel {
  width: 92px;
  min-width: 92px;
  min-height: 88px;
  padding: 4px 0;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.44);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  outline: none;
}

body[data-theme="night"] .gallery-page-wheel {
  background: rgba(18, 23, 36, 0.44);
}

.gallery-page-wheel-item {
  width: 100%;
  min-height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-weight: 600;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    color 0.18s ease;
}

.gallery-page-wheel-item.is-focused {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  transform: scale(1);
}

.gallery-page-wheel-item.is-near {
  color: var(--text);
  opacity: 0.7;
  font-size: 15px;
  transform: scale(0.86);
}

.gallery-page-wheel-item.is-far {
  opacity: 0.38;
  font-size: 12px;
  transform: scale(0.72);
}

.gallery-page-confirm {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gallery-page-confirm .app-icon {
  font-size: 18px;
}

.mode-tabs {
  grid-template-columns: repeat(auto-fit, minmax(92px, max-content));
}

.thread-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

/* 会话操作条需要浮在后续输入框之上，同时低于服务商快捷菜单。 */
.composer-panel > .thread-strip {
  z-index: 10;
}

.thread-chip {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding-bottom: 2px;
}

.thread-chip::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 128px;
  height: 3px;
  pointer-events: auto;
}

.thread-chip-button {
  width: 100%;
  min-width: 138px;
  max-width: 188px;
  padding-right: 16px;
}

.thread-chip-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-chip-actions {
  position: absolute;
  right: 0;
  top: calc(100% + 1px);
  transform: translateY(-1px);
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 24px rgba(var(--primary-rgb), 0.12);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  z-index: 12;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

body[data-theme="night"] .thread-chip-actions {
  background: rgba(18, 23, 36, 0.78);
  border-color: rgba(124, 156, 224, 0.24);
  box-shadow: 0 10px 24px rgba(3, 6, 15, 0.32);
}

.thread-chip:hover .thread-chip-actions,
.thread-chip:focus-within .thread-chip-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.thread-archive {
  position: relative;
  margin-left: auto;
  flex: 0 0 auto;
}

.thread-archive-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 14px;
}

.thread-archive-dismiss {
  position: fixed;
  inset: 0;
  z-index: 34;
  border: 0;
  background: transparent;
}

.thread-archive-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 35;
  width: min(280px, calc(100vw - 32px));
  max-height: min(360px, calc(100vh - 120px));
  overflow: auto;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(var(--primary-rgb), 0.26);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.1)),
    var(--panel);
  box-shadow: 0 18px 42px rgba(32, 38, 64, 0.18);
}

.thread-archive-item {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.thread-archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 4px;
  align-items: center;
}

.thread-archive-export {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
}

.thread-archive-export:hover,
.thread-archive-export:focus-visible {
  background: rgba(var(--secondary-rgb), 0.15);
  color: var(--text);
}

.thread-archive-item:hover {
  background: rgba(var(--primary-rgb), 0.13);
}

.thread-archive-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-inline {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

/* compact controls in settings line */
.settings-inline .resolution-button {
  flex: 0 0 150px;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.85em;
  white-space: nowrap;
}
.settings-inline .resolution-button,
.settings-inline .compact-select,
.settings-inline .button.compact-toggle,
.composer-title-actions .button.compact-toggle,
.reference-title-actions .button.compact-toggle,
.settings-inline .compact-stepper {
  border-color: rgba(var(--primary-rgb), 0.26);
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.12)),
    var(--panel-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.settings-inline .resolution-button:hover,
.settings-inline .compact-select:hover,
.settings-inline .button.compact-toggle:hover,
.composer-title-actions .button.compact-toggle:hover,
.reference-title-actions .button.compact-toggle:hover,
.settings-inline .compact-stepper:hover {
  border-color: rgba(var(--primary-rgb), 0.42);
  box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.settings-inline .compact-select {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.85em;
  width: auto;
  min-width: 88px;
  max-width: 128px;
}

.settings-inline .button.compact-toggle,
.composer-title-actions .button.compact-toggle,
.reference-title-actions .button.compact-toggle {
  flex: 0 0 auto;
  min-height: 34px;
  height: 34px;
  padding: 6px 10px;
  border-radius: 17px;
  font-size: 0.85em;
  white-space: nowrap;
}

.settings-inline .button.active-compact-toggle,
.composer-title-actions .button.active-compact-toggle,
.reference-title-actions .button.active-compact-toggle {
  border-color: rgba(var(--primary-rgb), 0.48);
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.24), rgba(var(--secondary-rgb), 0.24)),
    var(--panel-strong);
  color: var(--text);
}

.generation-active-count {
  flex: 0 0 auto;
  height: 34px;
  box-sizing: border-box;
  padding: 6px 10px;
  border-color: rgba(var(--primary-rgb), 0.26);
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.12)),
    var(--panel-strong);
  color: var(--muted);
  font-size: 0.85em;
  white-space: nowrap;
}
.settings-inline .compact-field {
  flex: 0 0 52px;
  min-height: 34px;
  padding: 6px 8px;
  font-size: 0.85em;
  width: 52px;
  text-align: center;
}

.settings-inline .compact-stepper {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 34px;
  height: 34px;
  padding: 2px;
  border: 1px solid rgba(var(--primary-rgb), 0.26);
  border-radius: 17px;
  overflow: hidden;
}

.settings-inline .compression-stepper {
  width: 98px;
}

.settings-inline .count-stepper {
  width: 82px;
}

.settings-inline .stepper-button {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  aspect-ratio: 1 / 1;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.22), rgba(var(--secondary-rgb), 0.2));
  color: var(--text);
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.settings-inline .stepper-button:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  transform: translateY(-1px);
}

.settings-inline .stepper-button:active {
  transform: translateY(0);
}

.settings-inline .stepper-value {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.85em;
  font-weight: 700;
  text-align: center;
  outline: none;
}

.settings-inline .stepper-value::-webkit-inner-spin-button,
.settings-inline .stepper-value::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.settings-inline .stepper-value[type="number"] {
  appearance: textfield;
}

.settings-inline .compact-stepper:focus-within {
  border-color: rgba(var(--primary-rgb), 0.55);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.settings-inline .compact-select:nth-of-type(1) {
  min-width: 82px;
}

.settings-inline .compact-select:nth-of-type(2) {
  min-width: 94px;
}

.settings-inline .codex-compat-select {
  flex-basis: 142px;
  width: 142px;
  min-width: 142px;
  max-width: 142px;
  padding-right: 28px;
}

.field,
.text-input,
.select-input,
.prompt-input {
  width: 100%;
  color: var(--text);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
}

.field,
.text-input,
.select-input {
  padding: 10px 12px;
}

select {
  color-scheme: light;
}

body[data-color-scheme="night"] select {
  color-scheme: dark;
}

select option,
select optgroup {
  color: var(--text);
  background-color: var(--select-option-bg);
}

select option:checked {
  color: var(--text);
  background-color: var(--select-option-active);
}

.prompt-input {
  min-height: 180px;
  padding: 16px;
  resize: vertical;
}

.button,
.chip-button {
  padding: 11px 16px;
  border-radius: 16px;
  transition: transform 0.2s ease;
}

.button {
  background: var(--action-gradient);
  color: #fff;
  font-weight: 700;
}

.button.secondary {
  background: var(--secondary-action-gradient);
}

.generation-submit-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-shadow:
    0 10px 26px rgba(var(--primary-strong-rgb), 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.generation-submit-label {
  position: relative;
  z-index: 1;
}

.generation-submit-button::after {
  position: absolute;
  inset: 0 auto 0 -28%;
  z-index: 0;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: skewX(-20deg) translate3d(-120%, 0, 0);
}

.generation-submit-button:hover::after,
.generation-submit-button:focus-visible::after {
  animation: mew-button-shimmer 0.78s cubic-bezier(0.2, 0.72, 0.2, 1);
}

@keyframes mew-button-shimmer {
  0% {
    opacity: 0;
    transform: skewX(-20deg) translate3d(-120%, 0, 0);
  }

  18% {
    opacity: 0.64;
  }

  100% {
    opacity: 0;
    transform: skewX(-20deg) translate3d(660%, 0, 0);
  }
}

.button.save-success {
  background: linear-gradient(135deg, #79d9a2, #47b97b);
}

.generation-cancel-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(135deg, #ff8da8, #e95f7f);
}

.generation-cancel-spinner {
  position: relative;
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
}

.generation-cancel-spinner::before {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  animation: generation-spin 0.8s linear infinite;
}

.generation-cancel-spinner .app-icon {
  position: relative;
  z-index: 1;
  font-size: 16px;
}

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

.button.ghost,
.chip-button {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.button.danger {
  color: var(--danger);
}

.resolution-button {
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(var(--secondary-rgb), 0.18));
  color: var(--text);
  border: 1px solid var(--line);
  text-align: left;
}

.compact-select,
.compact-field {
  min-width: 0;
}

.button:active,
.chip-button:active {
  transform: translateY(1px);
}

.active-chip {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.18), rgba(var(--secondary-rgb), 0.18));
  border-color: rgba(var(--primary-rgb), 0.4);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.18);
  color: var(--muted);
  font-size: 12px;
}

.composer-title-row {
  position: relative;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin-left: auto;
  overflow: visible;
  white-space: nowrap;
}

.reference-title-row {
  justify-content: space-between;
}

.reference-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  white-space: nowrap;
}

.composer-title-row .config-switcher {
  margin-left: 0;
}

/* 标题行需要高于后续输入区，否则服务商菜单会被同级输入框盖住。 */
.composer-title-row {
  z-index: 20;
}

.config-switcher {
  position: relative;
  margin-left: auto;
}

.config-switcher-button {
  cursor: pointer;
  max-width: min(420px, 46vw);
  border-color: rgba(var(--primary-rgb), 0.26);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.config-switcher-button:hover {
  border-color: rgba(var(--primary-rgb), 0.46);
  background: rgba(255, 255, 255, 0.28);
}

.config-switcher-button span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-switcher-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(360px, calc(100vw - 48px));
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 253, 0.96);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.config-switcher-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.config-switcher-item:hover,
.config-switcher-item.is-active {
  background: rgba(var(--primary-rgb), 0.13);
}

.config-switcher-name,
.config-switcher-model {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-switcher-model {
  color: var(--muted);
  font-size: 12px;
}

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

.preset-block,
.mask-panel {
  padding: 16px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.dropzone {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 22px;
  border-radius: 22px;
  text-align: center;
  border: 2px dashed var(--line);
  color: var(--muted);
  background: linear-gradient(135deg, transparent, rgba(var(--secondary-rgb), 0.025));
  outline: none;
  transition:
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease;
}

/* 四角取景框由纯 CSS 绘制，不增加图片资源或鼠标命中区域。 */
.dropzone::before {
  position: absolute;
  inset: 8px;
  z-index: -1;
  background:
    linear-gradient(90deg, var(--ornament-star), var(--ornament-star)) left top / 22px 1px no-repeat,
    linear-gradient(180deg, var(--ornament-star), var(--ornament-star)) left top / 1px 22px no-repeat,
    linear-gradient(90deg, var(--ornament-line), var(--ornament-line)) right top / 22px 1px no-repeat,
    linear-gradient(180deg, var(--ornament-line), var(--ornament-line)) right top / 1px 22px no-repeat,
    linear-gradient(90deg, var(--ornament-line), var(--ornament-line)) left bottom / 22px 1px no-repeat,
    linear-gradient(180deg, var(--ornament-line), var(--ornament-line)) left bottom / 1px 22px no-repeat,
    linear-gradient(90deg, var(--ornament-star), var(--ornament-star)) right bottom / 22px 1px no-repeat,
    linear-gradient(180deg, var(--ornament-star), var(--ornament-star)) right bottom / 1px 22px no-repeat;
  content: "";
  opacity: 0.46;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.dropzone::after {
  position: absolute;
  top: 14%;
  left: 8%;
  z-index: -1;
  width: 84%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ornament-star), var(--ornament-line), transparent);
  box-shadow: 0 0 12px var(--ornament-glow-primary);
  content: "";
  opacity: 0;
  pointer-events: none;
}

.dropzone:hover,
.dropzone:focus,
.dropzone:focus-within {
  border-color: rgba(var(--primary-rgb), 0.42);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.045), rgba(var(--secondary-rgb), 0.055));
  box-shadow: inset 0 0 28px rgba(var(--secondary-rgb), 0.04);
}

.dropzone:hover::before,
.dropzone:focus::before,
.dropzone:focus-within::before {
  opacity: 0.86;
  transform: scale(1.008);
}

.dropzone:hover::after,
.dropzone:focus::after,
.dropzone:focus-within::after {
  animation: mew-dropzone-scan 2.4s ease-in-out infinite;
}

@keyframes mew-dropzone-scan {
  0%,
  100% {
    top: 14%;
    opacity: 0;
  }

  24%,
  72% {
    opacity: 0.55;
  }

  86% {
    top: 86%;
    opacity: 0;
  }
}

.resolution-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 18, 30, 0.34);
}

.local-state-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 14, 28, 0.34);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.local-state-gate-card {
  width: min(520px, calc(100vw - 36px));
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 28px;
  border: 1px solid var(--glass-border-outer, var(--line));
  border-radius: 26px;
  color: var(--text);
  text-align: center;
  background: var(--panel-strong, var(--panel));
  box-shadow: var(--shadow);
}

.local-state-gate-card > .material-symbols-rounded {
  font-size: 36px;
  color: var(--primary);
}

.local-state-gate-card h2,
.local-state-gate-card p {
  margin: 0;
}

.local-state-gate-card p {
  max-width: 440px;
  color: var(--muted);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: start end;
  padding: 84px 20px 20px;
  background: rgba(15, 18, 30, 0.16);
}

.settings-popover {
  width: min(1040px, calc(100vw - 40px));
  padding: 20px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: blur(var(--surface-blur)) saturate(var(--surface-saturate));
  backdrop-filter: blur(var(--surface-blur)) saturate(var(--surface-saturate));
  box-shadow: var(--shadow);
}

.settings-shell {
  min-height: min(620px, calc(100vh - 128px));
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);
  gap: 18px;
}

.settings-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.08)),
    rgba(255, 255, 255, 0.22);
}

.settings-sidebar-main {
  display: grid;
  gap: 8px;
}

.settings-nav-button {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.settings-nav-button:hover,
.settings-nav-button.is-active {
  background: rgba(255, 255, 255, 0.36);
  border-color: rgba(var(--primary-rgb), 0.24);
  transform: translateX(2px);
}

body[data-theme="night"] .settings-nav-button:hover,
body[data-theme="night"] .settings-nav-button.is-active {
  background: rgba(255, 255, 255, 0.08);
}

.settings-about-button {
  margin-top: auto;
}

.settings-content {
  min-width: 0;
  max-height: min(620px, calc(100vh - 128px));
  overflow: auto;
  padding-right: 2px;
}

.settings-form-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--secondary-rgb), 0.08)),
    var(--panel-strong);
}

.auth-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(var(--primary-rgb), 0.08);
}

.auth-mode-button {
  min-height: 36px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.auth-mode-button.is-active {
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.12);
}

.form-hint,
.form-error {
  margin: -4px 0 0;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.45;
}

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

.form-error {
  color: var(--danger);
  font-weight: 700;
}

.auth-action-row {
  align-items: flex-start;
}

.sync-action-control {
  display: flex;
  min-width: 0;
  flex: 1 1 260px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.sync-status-message {
  margin: 0;
  max-width: 100%;
}

.sync-key-settings {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.28);
}

body[data-theme="night"] .sync-key-settings {
  background: rgba(255, 255, 255, 0.04);
}

.sync-key-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.sync-key-toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.sync-key-state {
  margin-left: auto;
  white-space: nowrap;
}

.sync-key-unlock-row {
  flex-wrap: nowrap;
}

.sync-key-unlock-row .text-input {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-bootstrap-block {
  gap: 8px;
}

.settings-about-card {
  min-height: 220px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(var(--primary-rgb), 0.22), transparent 42%),
    radial-gradient(circle at bottom right, rgba(var(--secondary-rgb), 0.2), transparent 46%),
    var(--panel-strong);
}

.settings-about-logo {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  object-fit: cover;
  box-shadow: 0 18px 36px rgba(var(--primary-rgb), 0.2);
}

.settings-about-title {
  justify-content: flex-start;
  gap: 10px;
}

.settings-about-title h2 {
  margin: 0;
}

.settings-version-tag {
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
}

.settings-github-button {
  display: inline-flex;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
}

.github-brand-icon {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.settings-config-actions {
  justify-content: flex-end;
  align-items: center;
}

.settings-config-actions .select-input {
  flex: 1 1 0;
  min-width: 0;
}

.api-key-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px 38px;
  gap: 8px;
  align-items: center;
}

.api-key-tool-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 13px;
}

.api-key-copy-feedback {
  margin-top: -4px;
}

.compact-help {
  margin: -4px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.account-security-card,
.admin-user-list,
.admin-empty {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.08)),
    var(--panel-strong);
}

.account-security-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.account-security-card h3 {
  font-size: 15px;
}

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

.admin-panel-header {
  justify-content: space-between;
}

.admin-user-list {
  display: grid;
  gap: 10px;
  padding: 12px;
  max-height: min(420px, 48vh);
  overflow: auto;
}

.admin-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto minmax(120px, auto) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.26);
  border: 1px solid rgba(var(--primary-rgb), 0.12);
}

body[data-theme="night"] .admin-user-row {
  background: rgba(255, 255, 255, 0.05);
}

.admin-user-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-user-main strong,
.admin-user-main span,
.admin-user-date {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-actions {
  justify-content: flex-end;
  gap: 8px;
}

.admin-user-actions .button {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 13px;
}

.data-management-panel {
  min-height: 520px;
}

.data-management-header,
.cloud-stat-toolbar {
  justify-content: space-between;
  align-items: flex-start;
}

.data-scope-tabs {
  max-width: 360px;
}

.data-scope-content {
  gap: 12px;
}

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

.cloud-stat-grid {
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.data-stat-card {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.1), rgba(var(--secondary-rgb), 0.08));
}

.data-stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.data-stat-card strong {
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-action-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
}

.data-action-card > div:first-child {
  min-width: 0;
}

.data-action-card h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.data-action-buttons {
  justify-content: flex-end;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.data-action-buttons .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 14px;
}

.data-action-buttons .button.danger:not(.ghost) {
  color: #fff;
}

.session-export-card {
  align-items: flex-end;
}

.session-export-controls {
  width: min(420px, 100%);
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.session-export-select {
  min-width: 0;
}

.session-export-controls .button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 13px;
  border-radius: 14px;
  white-space: nowrap;
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  background: linear-gradient(145deg, color-mix(in srgb, var(--danger) 7%, var(--panel-strong)), var(--panel-strong));
}

.data-management-message {
  margin: 0;
  padding: 10px 13px;
  border-radius: 14px;
  color: var(--text);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.11), rgba(var(--secondary-rgb), 0.11));
  font-size: 13px;
  line-height: 1.5;
}

.data-cloud-locked {
  min-height: 240px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
}

.data-cloud-locked .app-icon {
  font-size: 34px;
}

.visually-hidden-file-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.resolution-sheet {
  width: min(720px, 100%);
  min-height: 360px;
  padding: 22px;
  border-radius: 32px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 251, 0.84));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  position: relative;
}

body[data-theme="night"] .resolution-sheet {
  background:
    linear-gradient(145deg, rgba(26, 31, 46, 0.94), rgba(18, 23, 36, 0.92));
}

.resolution-preview {
  display: flex;
  justify-content: center;
}

.resolution-close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 34px;
  min-height: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  z-index: 2;
}

.resolution-close-button:hover,
.resolution-close-button:focus-visible {
  background: rgba(var(--primary-rgb), 0.12);
}

.resolution-content {
  min-height: 210px;
  display: flex;
}

.custom-dimension-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.custom-dimension-separator {
  color: var(--muted);
  font-weight: 700;
  user-select: none;
}

.custom-ratio-editor {
  display: grid;
  gap: 8px;
}

.custom-ratio-editor-hidden {
  display: none;
}

.custom-ratio-editor label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field.invalid-field {
  border-color: color-mix(in srgb, var(--danger) 70%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 12%, transparent);
}

.resolution-effective-card {
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--secondary) 28%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, var(--secondary) 8%, var(--panel-strong));
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.resolution-panel {
  width: 100%;
  min-height: 100%;
  justify-content: center;
}

.thumb-card,
.card {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
}

.thumb-card.is-reference-selected {
  border-color: rgba(var(--primary-rgb), 0.58);
  box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.16);
}

.thumb-card.is-drag-placeholder {
  transform: translateY(-2px);
  border-color: rgba(var(--secondary-strong-rgb), 0.62);
  box-shadow: 0 0 0 2px rgba(var(--secondary-strong-rgb), 0.18);
}

.gallery .card .card-body {
  gap: 10px;
}

.gallery-card-compact {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  height: 160px;
  min-height: 112px;
  max-height: 160px;
  transform-origin: center;
  isolation: isolate;
  box-shadow:
    8px 10px 18px rgba(32, 38, 64, 0.12),
    14px 16px 28px rgba(var(--primary-rgb), 0.08),
    18px 20px 34px rgba(var(--secondary-rgb), 0.06);
  transition:
    transform 0.24s cubic-bezier(0.2, 0.82, 0.2, 1),
    box-shadow 0.24s ease,
    border-color 0.24s ease;
}

.gallery-card-compact::after {
  content: "";
  position: absolute;
  inset: auto 12px -9px 26px;
  height: 18px;
  z-index: -1;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.16), rgba(var(--secondary-rgb), 0.12), transparent 82%);
  filter: blur(6px);
  opacity: 0.56;
  transform: translate3d(8px, 0, 0);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease, filter 0.24s ease;
}

.gallery-card-compact:hover,
.gallery-card-compact:focus-within {
  z-index: 4;
  border-color: rgba(var(--primary-rgb), 0.42);
  transform: translate3d(4px, -4px, 0) scale(1.075);
  box-shadow:
    10px 14px 24px rgba(32, 38, 64, 0.16),
    18px 20px 34px rgba(var(--primary-rgb), 0.12),
    24px 26px 44px rgba(var(--secondary-rgb), 0.09);
}

.gallery-card-compact:hover::after,
.gallery-card-compact:focus-within::after {
  opacity: 1;
  filter: blur(7px);
  transform: translate3d(12px, 3px, 0) scale(1.04);
}

body[data-theme="night"] .gallery-card-compact {
  box-shadow:
    8px 10px 20px rgba(0, 0, 0, 0.28),
    14px 16px 28px rgba(var(--primary-rgb), 0.08),
    18px 20px 34px rgba(var(--secondary-rgb), 0.05);
}

body[data-theme="night"] .gallery-card-compact::after {
  background: linear-gradient(90deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.08), transparent 82%);
  opacity: 0.38;
}

body[data-theme="night"] .gallery-card-compact:hover,
body[data-theme="night"] .gallery-card-compact:focus-within {
  box-shadow:
    10px 14px 26px rgba(0, 0, 0, 0.34),
    18px 20px 34px rgba(var(--primary-rgb), 0.11),
    24px 26px 44px rgba(var(--secondary-rgb), 0.07);
}

body[data-theme="night"] .gallery-card-compact:hover::after,
body[data-theme="night"] .gallery-card-compact:focus-within::after {
  opacity: 0.52;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card-compact {
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
    will-change: auto;
  }

  .gallery-card-compact:hover,
  .gallery-card-compact:focus-within {
    transform: none;
  }
}

/* 顶级主视图导航：收藏按钮保持原来的左侧起始位置，品牌始终按视口居中。 */
.topbar {
  position: relative;
  min-height: 64px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  z-index: 2;
}

.topbar-brand-centered {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  white-space: nowrap;
}

.topbar-brand-centered h1 {
  font-size: 24px;
}

.main-view-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--glass-border, rgba(var(--primary-rgb), 0.2));
  border-radius: 16px;
  background: rgba(var(--primary-rgb), 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.main-view-tab {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 12px;
  border: 0;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.main-view-tab svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.main-view-tab:hover {
  color: var(--text);
  background: rgba(var(--primary-rgb), 0.09);
}

.main-view-tab.is-active {
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 5px 14px rgba(var(--primary-rgb), 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.template-plaza {
  width: 100%;
  padding-bottom: 28px;
}

.template-plaza-hero {
  position: relative;
  z-index: 20;
  overflow: visible;
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(480px, 1.3fr);
  gap: 22px;
  align-items: center;
}

.template-plaza-hero::after {
  content: "";
  position: absolute;
  right: 6%;
  top: -22px;
  width: 220px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(var(--secondary-rgb), 0.18), transparent 68%);
  pointer-events: none;
  filter: blur(10px);
}

.template-plaza-heading,
.template-plaza-tools,
.template-admin-toolbar,
.template-selected-tags,
.template-card-tags,
.template-card-actions,
.template-detail-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.template-plaza-heading {
  align-items: flex-end;
  gap: 8px;
}

.template-plaza-heading h2 {
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.template-card-body p,
.template-detail-header > p {
  margin: 0;
  color: var(--muted);
}

.template-plaza-kicker {
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.template-plaza-tools {
  justify-content: flex-end;
  position: relative;
  z-index: 3;
  flex-wrap: nowrap;
}

.template-search {
  min-width: min(380px, 100%);
  min-height: 42px;
  flex: 1 1 300px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 5px 4px 13px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 15px;
  background: var(--input-bg, var(--panel-strong));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.template-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.template-search-submit.button.icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 34px;
  border-radius: 11px;
  font-size: 20px;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.template-search-submit.is-dirty {
  box-shadow:
    0 0 0 3px rgba(var(--primary-rgb), 0.13),
    0 7px 18px rgba(var(--primary-rgb), 0.2);
}

.template-search-submit:hover {
  transform: translateY(-1px);
}

.template-tag-filter,
.template-sort-filter {
  position: relative;
  flex: 0 0 auto;
}

.template-sort-button.button.icon-button {
  width: 54px;
  min-width: 54px;
  min-height: 42px;
  border-radius: 13px;
}

.template-sort-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 27;
  width: 270px;
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px solid rgba(var(--primary-rgb), 0.23);
  border-radius: 17px;
  background: var(--panel-strong);
  box-shadow: 0 18px 44px rgba(12, 20, 45, 0.24);
  backdrop-filter: blur(var(--glass-blur, 14px));
}

.template-sort-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.template-sort-option:hover,
.template-sort-option.is-active {
  background: rgba(var(--primary-rgb), 0.14);
}

.template-sort-option > span:not(.material-symbols-rounded) {
  display: grid;
  gap: 2px;
}

.template-sort-option small {
  color: var(--muted);
  font-size: 11px;
}

.template-tag-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 25;
  width: min(650px, calc(100vw - 48px));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 1px solid rgba(var(--primary-rgb), 0.23);
  border-radius: 17px;
  background: var(--panel-strong);
  box-shadow: 0 18px 44px rgba(12, 20, 45, 0.24);
  backdrop-filter: blur(var(--glass-blur, 14px));
}

.template-tag-menu-header,
.template-tag-search {
  display: flex;
  align-items: center;
}

.template-tag-menu-header {
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.15);
}

.template-tag-search {
  min-width: 0;
  min-height: 38px;
  flex: 1;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 12px;
  background: var(--input-bg, rgba(var(--primary-rgb), 0.06));
}

.template-tag-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.template-tag-browser {
  min-height: 250px;
  max-height: min(420px, 55vh);
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
}

.template-tag-menu-actions {
  display: flex;
  justify-content: flex-end;
  padding: 10px 12px;
  border-top: 1px solid rgba(var(--primary-rgb), 0.12);
}

.template-tag-menu-actions .button {
  min-height: 36px;
}

.template-tag-categories,
.template-tag-options {
  min-height: 0;
  overflow: auto;
  padding-top: 8px;
}

.template-tag-categories {
  padding-right: 8px;
  border-right: 1px solid rgba(var(--primary-rgb), 0.15);
}

.template-tag-options {
  align-content: start;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  padding-left: 8px;
}

.template-tag-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.template-tag-category:hover,
.template-tag-category.is-active {
  color: var(--primary-strong);
  background: rgba(var(--primary-rgb), 0.14);
}

.template-tag-category small,
.template-tag-option small {
  color: var(--muted);
}

.template-tag-option {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.template-tag-option:hover,
.template-tag-option.is-active {
  background: rgba(var(--primary-rgb), 0.14);
}

.template-tag-empty {
  grid-column: 1 / -1;
  align-self: center;
  margin: 0;
  padding: 28px 14px;
  color: var(--muted);
  text-align: center;
}

.template-selected-tags {
  grid-column: 1 / -1;
}

.template-plaza-notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: min(420px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--glass-border-outer, var(--line));
  border-radius: 16px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 18px 44px rgba(12, 20, 45, 0.24);
  -webkit-backdrop-filter: blur(var(--glass-blur, 14px));
  backdrop-filter: blur(var(--glass-blur, 14px));
}

.template-plaza-notice > span {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.template-plaza-notice .button.icon-button {
  min-width: 34px;
  min-height: 34px;
  font-size: 18px;
}

.template-admin-toolbar {
  flex-wrap: nowrap;
  gap: 6px;
}

.template-admin-toolbar .button.icon-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
  font-size: 21px;
}

.template-admin-toolbar .button.ghost {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.template-admin-toolbar .button.ghost:hover,
.template-admin-toolbar .button.ghost:focus-visible {
  border-color: rgba(var(--primary-rgb), 0.18) !important;
  background: rgba(var(--primary-rgb), 0.1) !important;
}

.template-admin-create {
  color: var(--primary-strong) !important;
}

.template-admin-export,
.template-admin-import {
  color: var(--secondary-strong) !important;
}

.template-card-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.template-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.template-card:hover {
  transform: translateY(-3px);
  border-color: rgba(var(--primary-rgb), 0.38);
  box-shadow: 0 18px 42px rgba(var(--primary-rgb), 0.15);
}

.template-card-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 0;
  color: var(--text);
  background: linear-gradient(145deg, rgba(var(--primary-rgb), 0.15), rgba(var(--secondary-rgb), 0.14));
  cursor: pointer;
}

.template-card-preview img,
.template-editor-asset-grid img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.template-card-preview img {
  transition: transform 0.35s ease;
}

.template-card:hover .template-card-preview img {
  transform: scale(1.025);
}

.template-card-status {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 6px 16px rgba(10, 18, 40, 0.14);
  font-size: 11px;
  font-weight: 700;
}

.template-card-edit.button.icon-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.42) !important;
  color: #fff !important;
  background: rgba(10, 18, 36, 0.58) !important;
  box-shadow: 0 8px 18px rgba(8, 12, 28, 0.2) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.template-card-edit.button.icon-button:hover,
.template-card-edit.button.icon-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.7) !important;
  background: rgba(10, 18, 36, 0.76) !important;
}

.template-empty-preview,
.template-loading,
.template-empty-state {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.template-empty-preview .app-icon {
  width: 2em;
  height: 2em;
  font-size: 34px;
}

.template-card-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 15px;
}

.template-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.template-card-title-row h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-card-body > p {
  min-height: 3.1em;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.55;
}

.template-card .template-card-tags {
  min-height: 29px;
  overflow: hidden;
  flex-wrap: nowrap;
  -webkit-mask-image: linear-gradient(90deg, #000 0 92%, transparent);
  mask-image: linear-gradient(90deg, #000 0 92%, transparent);
}

.template-card .template-card-tags .tag {
  flex: 0 0 auto;
  white-space: nowrap;
}

.template-card-actions {
  min-width: 0;
  flex-wrap: nowrap;
  gap: 5px;
  margin-top: auto;
}

.template-card-actions .button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 13px;
  white-space: nowrap;
}

.template-card-actions .button.icon-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.template-like-button {
  min-width: 52px;
  font-variant-numeric: tabular-nums;
}

.template-like-button .app-icon {
  flex: 0 0 auto;
}

.template-like-button > span:not(.app-icon) {
  min-width: 1.2em;
  text-align: center;
}

.template-card-actions .button.primary {
  margin-left: auto;
}

.template-loading {
  min-height: 90px;
  grid-auto-flow: column;
  justify-content: center;
  gap: 12px;
}

.template-progressive-loader {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.template-empty-state {
  min-height: 260px;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 8, 15, 0.58);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.confirm-dialog {
  width: min(480px, calc(100vw - 32px));
  display: grid;
  gap: 16px;
  padding: 24px;
}

.confirm-dialog > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.confirm-dialog > .row {
  justify-content: flex-end;
}

.template-detail {
  position: relative;
  width: min(1320px, calc(100vw - 48px));
  height: min(820px, calc(100vh - 48px));
  height: min(820px, calc(100dvh - 48px));
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.72fr);
  gap: 0;
  padding: 0;
}

.template-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}

.template-detail-visual {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border-right: 1px solid rgba(var(--primary-rgb), 0.16);
  background:
    radial-gradient(circle at 18% 16%, rgba(var(--primary-rgb), 0.13), transparent 34%),
    radial-gradient(circle at 82% 86%, rgba(var(--secondary-rgb), 0.12), transparent 32%),
    var(--input-bg, var(--panel-strong));
}

.template-detail-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  border-radius: 20px;
  background: rgba(var(--primary-rgb), 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.template-detail-image-button {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: zoom-in;
}

.template-detail-image-button > img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.template-detail-empty-preview {
  display: grid;
  place-items: center;
  gap: 8px;
  color: var(--muted);
}

.template-detail-empty-preview .material-symbols-rounded {
  font-size: 44px;
}

.template-detail-preview-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel-strong);
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.14);
  font-size: 11px;
  font-weight: 800;
}

.template-detail-thumbnails {
  min-width: 0;
  min-height: 68px;
  overflow-x: auto;
  display: flex;
  justify-content: center;
  gap: 9px;
  padding: 2px;
  scrollbar-width: thin;
}

.template-detail-thumbnail {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: rgba(var(--primary-rgb), 0.08);
  opacity: 0.66;
  cursor: pointer;
  transition: opacity 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.template-detail-thumbnail:hover,
.template-detail-thumbnail.is-active {
  border-color: var(--primary);
  opacity: 1;
  transform: translateY(-1px);
}

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

.template-detail-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 14px;
  padding: 26px;
  overscroll-behavior: contain;
}

.template-detail-header {
  min-width: 0;
  gap: 8px;
}

.template-detail-content h2 {
  margin-top: 5px;
  padding-right: 36px;
}

.template-detail-header > p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.55;
}

.template-detail-header .template-card-tags {
  min-width: 0;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.template-detail-header .tag {
  flex: 0 0 auto;
  white-space: nowrap;
}

.template-prompt-box {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 16px;
  background: rgba(var(--primary-rgb), 0.06);
}

.template-prompt-box > strong {
  padding-right: 56px;
}

.template-prompt-box p {
  min-height: 0;
  flex: 1;
  overflow: auto;
  margin: 12px 0 0;
  padding-right: 3px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.template-prompt-copy {
  position: absolute;
  top: 7px;
  right: 9px;
}

.template-detail-fixed-info {
  min-width: 0;
  display: grid;
  gap: 10px;
}

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

.template-reference-strip {
  display: grid;
  gap: 8px;
}

.template-reference-strip > div {
  min-width: 0;
  overflow-x: auto;
  display: flex;
  gap: 7px;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.template-reference-strip img {
  width: 52px;
  flex: 0 0 52px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(var(--primary-rgb), 0.18);
}

.template-inline-confirm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(220, 76, 96, 0.28);
  border-radius: 14px;
  background: rgba(220, 76, 96, 0.08);
}

.template-inline-confirm p {
  margin: 0;
}

.template-parameters div {
  padding: 10px;
  border-radius: 12px;
  background: rgba(var(--secondary-rgb), 0.08);
}

.template-parameters dt {
  color: var(--muted);
  font-size: 11px;
}

.template-parameters dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.template-detail-actions {
  width: 100%;
  align-self: end;
  flex-wrap: nowrap;
}

.template-editor {
  position: relative;
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.template-editor-header {
  padding-right: 52px;
}

.template-editor-header h2 {
  margin-bottom: 0;
}

.template-editor-close.button.icon-button {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
}

.template-editor label,
.template-editor-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.template-editor-prompt {
  min-height: 160px;
}

.template-editor-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(230px, 300px) 126px;
  gap: 10px;
  align-items: end;
}

.template-editor-size-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.template-editor-size-inputs > span {
  color: var(--muted);
  font-size: 15px;
}

.template-editor-size-inputs input {
  min-width: 0;
  padding-inline: 12px;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}

.template-editor-size-inputs input::-webkit-inner-spin-button,
.template-editor-size-inputs input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.template-editor-status-field {
  width: 126px;
}

.template-editor-tags {
  display: grid;
  gap: 8px;
}

.template-transfer-fields {
  display: grid;
  min-width: 0;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.template-export-statuses label,
.template-export-category-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.template-export-category-row .template-tag-category { min-width: 0; }
.template-export-category-row input { flex: 0 0 auto; }
.template-export-selection,
.template-export-summary { overflow-wrap: anywhere; font-size: 13px; color: var(--floating-muted); }
.template-export-dialog input[type="checkbox"] { accent-color: var(--primary); }
body[data-visual-theme][data-color-scheme] .template-export-dialog .button.secondary.is-active,
body[data-visual-theme][data-color-scheme] .template-export-dialog .button.secondary.is-active:hover {
  color: var(--text);
  background: var(--floating-active);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.template-export-dialog .template-tag-option:disabled.is-active { opacity: 1; }
.template-export-dialog footer .button { flex-shrink: 0; }

.template-editor-tags-header,
.template-editor-tag-dialog-header,
.template-editor-tag-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.template-editor-tags-header {
  color: var(--muted);
  font-size: 12px;
}

.template-editor-tags-header small {
  font-variant-numeric: tabular-nums;
}

.template-editor-tag-chips {
  min-height: 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--floating-border);
  border-radius: 16px;
  background: var(--floating-control);
}

.template-editor-tags-empty {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.template-editor-tag-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px 7px 11px;
  border: 1px solid var(--floating-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--floating-active);
  font-size: 12px;
  font-weight: 750;
}

.template-editor-tag-chip:hover,
.template-editor-tag-chip:focus-visible {
  border-color: rgba(var(--primary-rgb), 0.58);
  box-shadow: 0 5px 14px rgba(var(--primary-rgb), 0.15);
}

.template-editor-tag-chip .app-icon {
  width: 16px;
  height: 16px;
  font-size: 16px;
}

.template-editor-add-tag {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
}

.template-editor-tag-backdrop {
  z-index: 110;
  background: rgba(5, 8, 18, 0.64);
}

.template-editor-tag-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow: auto;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--floating-border);
  border-radius: 22px;
  color: var(--text);
  background: var(--floating-surface);
  box-shadow: var(--floating-shadow);
  -webkit-backdrop-filter: blur(var(--floating-blur)) saturate(1.12);
  backdrop-filter: blur(var(--floating-blur)) saturate(1.12);
}

.template-editor-tag-dialog-header h3 {
  margin: 3px 0 0;
}

.template-editor-tag-dialog-header .button.icon-button {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

.template-editor-tag-search {
  flex: none;
}

.template-editor-tag-browser {
  min-height: 220px;
  max-height: min(360px, 42vh);
  border-block: 1px solid var(--floating-border);
}

.template-editor-tag-dialog .template-tag-option:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.template-editor-new-tag {
  display: grid;
  grid-template-columns: minmax(150px, 0.65fr) minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.template-editor-new-tag label {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--floating-muted);
  font-size: 12px;
  font-weight: 700;
}

.template-editor-new-tag :is(input.text-input, textarea.text-input) {
  height: 44px;
  min-height: 44px;
}

.template-editor-new-tag textarea {
  max-height: 44px;
  overflow-y: auto;
  resize: none;
}

.template-editor-new-tag-submit {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.template-editor-tag-note {
  margin: 0;
  padding: 9px 11px;
  border-radius: 11px;
  color: var(--floating-muted);
  background: var(--floating-hover);
  font-size: 12px;
  line-height: 1.5;
}

.template-editor-tag-note.is-error {
  color: var(--danger-text, #b4233f);
  background: rgba(var(--danger-rgb, 214, 72, 101), 0.12);
}

.template-editor-tag-dialog-actions {
  padding-top: 2px;
  color: var(--floating-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.template-editor-assets {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  border-radius: 16px;
  background: rgba(var(--primary-rgb), 0.04);
}

.template-file-button {
  position: relative;
  overflow: hidden;
}

.template-editor label.template-file-button {
  display: inline-flex;
  width: auto;
  min-height: 40px;
  padding: 9px 14px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  white-space: nowrap;
}

.template-file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.template-editor-asset-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 8px;
}

.template-editor-asset-grid > div {
  position: relative;
  aspect-ratio: 1;
}

.template-editor-asset-grid img {
  border-radius: 12px;
}

.template-editor-asset-actions {
  position: absolute;
  right: 4px;
  top: 4px;
  display: flex;
  gap: 3px;
}

.template-editor-asset-grid .template-editor-asset-actions .button {
  position: static;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
}

.template-editor-actions .spacer {
  flex: 1;
}

@media (max-width: 1250px) {
  .template-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
  }

  .topbar-brand-centered {
    position: static;
    transform: none;
    grid-column: 1 / -1;
    grid-row: 1;
    justify-self: center;
  }

  .topbar-left {
    grid-column: 1;
    grid-row: 2;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-end;
  }

  .template-plaza-hero {
    grid-template-columns: 1fr;
  }

  .template-plaza-tools {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .template-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-editor-fields {
    grid-template-columns: minmax(0, 1fr) 120px;
  }

  .template-editor-model-field {
    grid-column: 1 / -1;
  }

  .template-editor-status-field {
    width: 120px;
  }

  .template-editor-asset-grid {
    grid-template-columns: repeat(4, minmax(60px, 1fr));
  }

  .template-tag-browser {
    grid-template-columns: 140px minmax(0, 1fr);
  }

  .template-tag-options {
    grid-template-columns: 1fr;
  }

  .template-detail {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 40%) minmax(0, 1fr);
  }

  .template-detail-visual {
    border-right: 0;
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.16);
  }
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .topbar-left,
  .topbar-actions {
    grid-column: 1;
    justify-content: center;
  }

  .topbar-left {
    width: 100%;
  }

  .main-view-switcher {
    flex: 1;
  }

  .template-card-grid,
  .template-parameters {
    grid-template-columns: 1fr;
  }

  .template-plaza-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px auto;
    width: 100%;
  }

  .template-search {
    min-width: 0;
  }

  .template-tag-menu {
    width: calc(100vw - 32px);
  }

  .template-tag-browser {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .template-plaza-notice {
    right: 16px;
    bottom: 16px;
  }

  .template-detail-backdrop,
  .template-editor-backdrop,
  .template-editor-tag-backdrop {
    padding: 8px;
  }

  .template-editor-tag-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 14px;
    border-radius: 18px;
  }

  .template-editor-tag-browser {
    min-height: 280px;
    max-height: min(440px, 48vh);
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(190px, 1fr);
  }

  .template-editor-tag-browser .template-tag-categories {
    min-height: 0;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 7px 0;
    border-right: 0;
    border-bottom: 1px solid var(--floating-border);
  }

  .template-editor-tag-browser .template-tag-category {
    width: auto;
    flex: 0 0 auto;
  }

  .template-editor-tag-browser .template-tag-options {
    padding: 8px 0 0;
  }

  .template-editor-new-tag {
    grid-template-columns: 1fr;
  }

  .template-editor-new-tag-submit {
    justify-content: center;
  }

  .template-detail {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    height: calc(100dvh - 16px);
    grid-template-rows: minmax(180px, 35%) minmax(0, 1fr);
  }

  .template-detail-visual {
    gap: 8px;
    padding: 10px;
  }

  .template-detail-stage {
    border-radius: 14px;
  }

  .template-detail-content {
    padding: 18px;
  }

  .template-detail .template-parameters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-detail-thumbnails {
    justify-content: flex-start;
  }

  .template-editor-asset-grid {
    grid-template-columns: repeat(3, minmax(56px, 1fr));
  }
}

/* 外观框架：背景资源、主题装饰和页面内容各自占用独立层级。 */
.theme-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.theme-background-image,
.theme-background-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.theme-background-image {
  transform: scale(1.015);
}

.theme-background-overlay {
  background: var(--background-overlay, rgba(255, 248, 251, 0.44));
}

body::before,
body::after {
  z-index: 1;
}

.shell {
  z-index: 2;
}

/* 用户可选择让背景压住装饰；内容始终位于背景图层之上。 */
body[data-background-layer="above-decorations"] .theme-backdrop {
  z-index: 2;
}

body[data-background-layer="above-decorations"] .shell {
  z-index: 3;
}

body[data-color-scheme="day"] {
  color-scheme: light;
  --background-overlay: rgba(255, 248, 251, 0.72);
}

body[data-color-scheme="night"] {
  color-scheme: dark;
  --background-overlay: rgba(10, 14, 25, 0.72);
}

/* 经典主题保留品牌粉蓝，但收起星轨和极光运动，适合偏好安静界面的用户。 */
body[data-visual-theme="classic"] {
  --bg-accent: radial-gradient(circle at 18% 0%, #ffe4f1 0%, #fff8fb 45%, #fffdf8 100%);
  --ornament-dot: rgba(199, 118, 157, 0.2);
  --ornament-line: rgba(122, 172, 220, 0.16);
  --ornament-star: rgba(255, 112, 170, 0.38);
  --ornament-glow-primary: rgba(var(--primary-rgb), 0.1);
  --ornament-glow-secondary: rgba(99, 164, 255, 0.08);
}

body[data-visual-theme="classic"][data-color-scheme="night"] {
  --bg-accent: radial-gradient(circle at 18% 0%, #29283a 0%, #1c2030 48%, #151925 100%);
  --ornament-dot: rgba(184, 166, 205, 0.12);
  --ornament-line: rgba(126, 168, 220, 0.12);
  --ornament-star: rgba(255, 143, 187, 0.28);
}

body[data-visual-theme="classic"]::after,
body[data-visual-theme="classic"] .shell::before,
body[data-visual-theme="classic"] .shell::after,
body[data-visual-theme="classic"] .composer-panel::after,
body[data-visual-theme="classic"] .asset-panel::after {
  display: none;
}

body[data-visual-theme="classic"] .brand-logo {
  animation: none;
}

/* 极光星轨使用高 Alpha 天文仪表材质，与经典粉蓝和液态玻璃明确区分。 */
body[data-visual-theme="aurora"] {
  --bg: #eef6ff;
  --bg-accent:
    radial-gradient(ellipse at 8% 5%, rgba(66, 198, 220, 0.22), transparent 34%),
    radial-gradient(ellipse at 94% 12%, rgba(120, 107, 232, 0.2), transparent 38%),
    radial-gradient(ellipse at 54% 104%, rgba(85, 156, 226, 0.16), transparent 42%),
    linear-gradient(145deg, #f4faff, #edf5ff 48%, #f3efff);
  --panel: rgb(244 249 255 / var(--panel-opacity));
  --panel-strong: rgb(239 247 255 / var(--panel-strong-opacity));
  --line: rgba(69, 112, 165, 0.24);
  --text: #263652;
  --muted: #667690;
  --primary: #786be8;
  --primary-strong: #6254d6;
  --secondary: #42c6dc;
  --secondary-strong: #2ba8c2;
  --primary-rgb: 120, 107, 232;
  --primary-strong-rgb: 98, 84, 214;
  --secondary-rgb: 66, 198, 220;
  --secondary-strong-rgb: 43, 168, 194;
  --brand-pink: #ff78b7;
  --brand-pink-rgb: 255, 120, 183;
  --action-gradient: linear-gradient(135deg, var(--secondary), var(--primary));
  --secondary-action-gradient: linear-gradient(135deg, #70dce9, #409fcf);
  --shadow:
    0 24px 58px rgba(43, 79, 128, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --ornament-dot: rgba(55, 113, 173, 0.38);
  --ornament-line: rgba(62, 133, 194, 0.34);
  --ornament-star: rgba(var(--brand-pink-rgb), 0.72);
  --ornament-glow-primary: rgba(var(--primary-rgb), 0.2);
  --ornament-glow-secondary: rgba(var(--secondary-rgb), 0.2);
  --surface-blur: 18px;
  --surface-saturate: 1.08;
  --select-option-bg: #edf6ff;
  --select-option-active: #dcdcff;
  --background-overlay: rgba(232, 244, 255, 0.68);
  --aurora-panel-line: rgba(89, 137, 190, 0.3);
  --aurora-panel-edge: rgba(255, 255, 255, 0.78);
  --aurora-grid-line: rgba(59, 124, 181, 0.22);
  --floating-surface-base: rgba(238, 247, 255, 0.95);
  --floating-surface:
    linear-gradient(180deg, rgba(var(--secondary-rgb), 0.13), transparent 96px),
    linear-gradient(122deg, rgba(var(--primary-rgb), 0.1), transparent 48%),
    var(--floating-surface-base);
  --floating-control: rgba(249, 252, 255, 0.88);
  --floating-border: rgba(58, 105, 159, 0.38);
  --floating-shadow: 0 24px 66px rgba(30, 66, 111, 0.24);
  --floating-hover: rgba(var(--secondary-rgb), 0.14);
  --floating-active:
    linear-gradient(135deg, rgba(var(--secondary-rgb), 0.2), rgba(var(--primary-rgb), 0.18)),
    rgba(244, 249, 255, 0.84);
  --floating-muted: #586981;
  --floating-blur: 18px;
  --scrollbar-track-color: rgba(47, 91, 137, 0.12);
  --scrollbar-thumb-color: rgba(73, 137, 193, 0.68);
  --scrollbar-thumb-gradient: linear-gradient(160deg, #55d2e3, #8074ed);
  --scrollbar-thumb-hover-gradient: linear-gradient(160deg, #32bdd2, #685ae1);
  --scrollbar-thumb-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

body[data-visual-theme="aurora"][data-color-scheme="night"] {
  --bg: #090f24;
  --bg-accent:
    radial-gradient(ellipse at 8% 4%, rgba(35, 173, 198, 0.2), transparent 36%),
    radial-gradient(ellipse at 92% 10%, rgba(107, 82, 218, 0.24), transparent 40%),
    radial-gradient(ellipse at 48% 108%, rgba(49, 91, 175, 0.18), transparent 44%),
    linear-gradient(145deg, #09132c, #11132f 50%, #1a1032);
  --panel: rgb(15 24 50 / var(--panel-opacity));
  --panel-strong: rgb(10 18 42 / var(--panel-strong-opacity));
  --line: rgba(120, 168, 222, 0.24);
  --text: #edf5ff;
  --muted: #a8b6d2;
  --primary: #9a8cff;
  --primary-strong: #7968ed;
  --secondary: #58d9e8;
  --secondary-strong: #32b9d0;
  --primary-rgb: 154, 140, 255;
  --primary-strong-rgb: 121, 104, 237;
  --secondary-rgb: 88, 217, 232;
  --secondary-strong-rgb: 50, 185, 208;
  --action-gradient: linear-gradient(135deg, var(--secondary), var(--primary));
  --secondary-action-gradient: linear-gradient(135deg, #55c8dc, #407dc8);
  --shadow:
    0 24px 64px rgba(0, 4, 18, 0.46),
    inset 0 1px 0 rgba(193, 226, 255, 0.16);
  --ornament-dot: rgba(146, 194, 240, 0.28);
  --ornament-line: rgba(107, 176, 229, 0.28);
  --ornament-star: rgba(var(--brand-pink-rgb), 0.72);
  --ornament-glow-primary: rgba(var(--primary-rgb), 0.2);
  --ornament-glow-secondary: rgba(var(--secondary-rgb), 0.2);
  --select-option-bg: #101a36;
  --select-option-active: #302b65;
  --background-overlay: rgba(5, 10, 27, 0.68);
  --aurora-panel-line: rgba(123, 177, 230, 0.25);
  --aurora-panel-edge: rgba(192, 226, 255, 0.22);
  --aurora-grid-line: rgba(111, 180, 229, 0.2);
  --floating-surface-base: rgba(9, 17, 40, 0.96);
  --floating-surface:
    linear-gradient(180deg, rgba(var(--secondary-rgb), 0.13), transparent 96px),
    linear-gradient(122deg, rgba(var(--primary-rgb), 0.13), transparent 48%),
    var(--floating-surface-base);
  --floating-control: rgba(24, 35, 66, 0.94);
  --floating-border: rgba(125, 180, 232, 0.34);
  --floating-shadow: 0 26px 72px rgba(0, 3, 18, 0.56);
  --floating-hover: rgba(var(--secondary-rgb), 0.16);
  --floating-active:
    linear-gradient(135deg, rgba(var(--secondary-rgb), 0.23), rgba(var(--primary-rgb), 0.24)),
    rgba(18, 27, 57, 0.92);
  --floating-muted: #bcc9de;
  --scrollbar-track-color: rgba(1, 5, 17, 0.4);
  --scrollbar-thumb-color: rgba(91, 172, 207, 0.72);
  --scrollbar-thumb-gradient: linear-gradient(160deg, #48c9db, #7669e8);
  --scrollbar-thumb-hover-gradient: linear-gradient(160deg, #64e0ed, #9589ff);
  --scrollbar-thumb-shadow: inset 0 1px 0 rgba(224, 243, 255, 0.26);
}

/* 多组互不对齐的星点打破规则点阵，星场本身保持静态。 */
body[data-visual-theme="aurora"]::before {
  background-image:
    radial-gradient(circle at 6% 18%, var(--ornament-star) 0 1.7px, transparent 2.5px),
    radial-gradient(circle at 17% 61%, var(--ornament-dot) 0 1px, transparent 1.8px),
    radial-gradient(circle at 31% 9%, var(--ornament-star) 0 1px, transparent 2px),
    radial-gradient(circle at 48% 74%, var(--ornament-dot) 0 1.4px, transparent 2.2px),
    radial-gradient(circle at 63% 24%, var(--ornament-star) 0 1.2px, transparent 2.1px),
    radial-gradient(circle at 78% 86%, var(--ornament-dot) 0 1px, transparent 1.8px),
    radial-gradient(circle at 91% 47%, var(--ornament-star) 0 1.6px, transparent 2.5px),
    radial-gradient(circle, var(--ornament-dot) 0 0.8px, transparent 1.45px),
    radial-gradient(circle, var(--ornament-star) 0 1px, transparent 1.8px);
  background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 13px 27px, 71px 19px;
  background-size: auto, auto, auto, auto, auto, auto, auto, 137px 113px, 211px 179px;
  opacity: 0.76;
  -webkit-mask-image: linear-gradient(150deg, #000 0%, rgba(0, 0, 0, 0.84) 58%, rgba(0, 0, 0, 0.28) 100%);
  mask-image: linear-gradient(150deg, #000 0%, rgba(0, 0, 0, 0.84) 58%, rgba(0, 0, 0, 0.28) 100%);
}

body[data-visual-theme="aurora"][data-color-scheme="night"]::before {
  opacity: 0.88;
}

/* 唯一的全屏运动层负责两道极光帘，避免在大面积背景上动画滤镜。 */
body[data-visual-theme="aurora"]::after {
  inset: -18vh -12vw;
  background:
    radial-gradient(ellipse 86% 19% at 12% 26%, transparent 32%, rgba(var(--secondary-rgb), 0.2) 38%, rgba(var(--primary-rgb), 0.12) 45%, transparent 54%),
    radial-gradient(ellipse 78% 17% at 86% 64%, transparent 34%, rgba(var(--primary-rgb), 0.17) 40%, rgba(var(--secondary-rgb), 0.1) 46%, transparent 55%),
    radial-gradient(ellipse at 52% 112%, rgba(var(--secondary-rgb), 0.11), transparent 36%);
  opacity: 0.84;
  animation: aurora-curtain-drift 26s ease-in-out infinite alternate;
  will-change: transform;
}

body[data-visual-theme="aurora"][data-color-scheme="night"]::after {
  opacity: 0.92;
}

/* 右上天球仪只保留局部刻度环，避免与液态玻璃的半圆装饰雷同。 */
body[data-visual-theme="aurora"] .shell::before {
  top: -260px;
  right: -190px;
  width: 620px;
  height: 620px;
  border: 0;
  border-radius: 50%;
  background:
    repeating-conic-gradient(from 12deg, var(--ornament-line) 0 0.55deg, transparent 0.8deg 8deg),
    radial-gradient(circle, transparent 0 47%, var(--ornament-star) 47.2% 47.6%, transparent 48% 59%, var(--ornament-line) 59.2% 59.7%, transparent 60.2%);
  box-shadow: none;
  opacity: 0.62;
  -webkit-mask-image: radial-gradient(circle, transparent 0 43%, #000 44% 67%, transparent 68%);
  mask-image: radial-gradient(circle, transparent 0 43%, #000 44% 67%, transparent 68%);
  transform: rotate(-12deg);
  animation: aurora-instrument-drift 30s ease-in-out infinite alternate;
}

/* 左下使用线性流星轨迹，不复制右上的圆形构图。 */
body[data-visual-theme="aurora"] .shell::after {
  bottom: 4vh;
  left: -120px;
  width: 560px;
  height: 190px;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 29% 62%, var(--ornament-star) 0 2.2px, transparent 3.4px),
    radial-gradient(circle at 58% 39%, var(--ornament-dot) 0 1.6px, transparent 2.6px),
    radial-gradient(circle at 84% 21%, var(--ornament-star) 0 1.3px, transparent 2.2px),
    linear-gradient(163deg, transparent 0 40%, var(--ornament-line) 40.3% 40.7%, transparent 41% 54%, rgba(var(--secondary-rgb), 0.22) 54.3% 54.8%, transparent 55.2%);
  box-shadow: none;
  opacity: 0.64;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 86%, transparent);
  transform: rotate(-7deg);
  animation: aurora-meteor-drift 24s ease-in-out infinite alternate;
}

/* 生成面板是星座坐标，画廊面板是极光等高线，避免复制角落纹样。 */
body[data-visual-theme="aurora"] .composer-panel::after {
  right: 16px;
  bottom: 12px;
  width: 230px;
  height: 96px;
  background:
    radial-gradient(circle at 16% 68%, var(--ornament-star) 0 2px, transparent 3px),
    radial-gradient(circle at 48% 30%, var(--ornament-dot) 0 1.8px, transparent 2.8px),
    radial-gradient(circle at 82% 58%, var(--ornament-star) 0 1.4px, transparent 2.4px),
    linear-gradient(145deg, transparent 0 29%, var(--aurora-grid-line) 29.3% 29.8%, transparent 30.1%),
    linear-gradient(24deg, transparent 0 56%, var(--aurora-grid-line) 56.3% 56.8%, transparent 57.1%);
  opacity: 0.58;
}

body[data-visual-theme="aurora"] .asset-panel::after {
  right: 16px;
  bottom: 10px;
  width: 220px;
  height: 100px;
  background:
    radial-gradient(circle at 88% 26%, var(--ornament-star) 0 1.8px, transparent 2.8px),
    repeating-radial-gradient(ellipse at 100% 100%, transparent 0 12px, var(--aurora-grid-line) 13px 13.6px, transparent 14.5px 23px);
  opacity: 0.5;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%, #000);
  mask-image: linear-gradient(90deg, transparent, #000 24%, #000);
}

body[data-visual-theme="aurora"] .workspace-layout h2::after {
  width: 58px;
  height: 10px;
  background:
    radial-gradient(circle at 7px 50%, var(--ornament-star) 0 2.2px, transparent 3.2px),
    linear-gradient(90deg, rgba(var(--secondary-rgb), 0.72), rgba(var(--primary-rgb), 0.36), transparent) center / 100% 1px no-repeat;
  opacity: 0.88;
  transform: skewX(-18deg);
}

/* 高 Alpha 面板使用冷色顶部高光，不套用液态玻璃的低模糊折射材质。 */
body[data-visual-theme="aurora"][data-color-scheme] :is(
  .panel,
  .settings-popover,
  .favorites-popover,
  .reference-menu-shell,
  .mask-modal-shell,
  .preview-shell,
  .resolution-sheet,
  .context-menu,
  .config-switcher-menu,
  .thread-archive-menu,
  .folder-picker-popover,
  .inline-action-popover
) {
  border-color: var(--aurora-panel-line);
  background:
    linear-gradient(180deg, rgba(var(--secondary-rgb), 0.09), transparent 88px),
    linear-gradient(118deg, rgba(var(--primary-rgb), 0.045), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--surface-blur)) saturate(var(--surface-saturate));
  backdrop-filter: blur(var(--surface-blur)) saturate(var(--surface-saturate));
}

body[data-visual-theme="aurora"][data-color-scheme] :is(
  .card,
  .thumb-card,
  .favorite-card,
  .appearance-section,
  .preset-block,
  .mask-panel,
  .data-action-card,
  .data-stat-card,
  .sync-key-settings,
  .admin-user-row,
  .detail-card,
  .preview-prompt-box,
  .preview-ref-card,
  .preview-sidebar,
  .failure-log-text,
  .settings-sidebar
) {
  border-color: var(--aurora-panel-line);
  background:
    linear-gradient(180deg, rgba(var(--secondary-rgb), 0.06), transparent 64px),
    var(--panel-strong);
  box-shadow:
    inset 0 1px 0 var(--aurora-panel-edge),
    0 12px 30px rgba(31, 65, 112, 0.08);
}

body[data-visual-theme="aurora"][data-color-scheme] :is(
  .field,
  .text-input,
  .select-input,
  .prompt-input,
  .compact-select,
  .resolution-button,
  .inline-popover-input,
  .pagination-icon-button,
  .pagination-page-button
) {
  border-color: var(--aurora-panel-line);
  background:
    linear-gradient(145deg, rgba(var(--secondary-rgb), 0.055), transparent 54%),
    var(--panel-strong);
  box-shadow: inset 0 1px 0 var(--aurora-panel-edge);
}

body[data-visual-theme="aurora"][data-color-scheme] :is(
  .field,
  .text-input,
  .select-input,
  .prompt-input,
  .compact-select,
  .inline-popover-input
):focus {
  border-color: rgba(var(--primary-rgb), 0.72);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(var(--primary-rgb), 0.14),
    inset 0 1px 0 var(--aurora-panel-edge);
}

body[data-visual-theme="aurora"] .button:not(.ghost):not(.secondary):not(.danger):not(.save-success):not(.generation-cancel-button) {
  background: var(--action-gradient);
  color: #07182d;
  box-shadow:
    0 10px 26px rgba(var(--primary-rgb), 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

body[data-visual-theme="aurora"] .button.secondary {
  background: var(--secondary-action-gradient);
  color: #07182d;
  box-shadow: 0 9px 22px rgba(var(--secondary-rgb), 0.16);
}

body[data-visual-theme="aurora"] .button.danger:not(.ghost) {
  color: #fff;
  background: linear-gradient(135deg, #ff8da8, #e95f7f);
  box-shadow: 0 9px 22px rgba(var(--danger-rgb), 0.18);
}

body[data-visual-theme="aurora"][data-color-scheme] :is(.button.ghost:not(.danger), .chip-button:not(.danger)) {
  border-color: var(--aurora-panel-line);
  background:
    linear-gradient(135deg, rgba(var(--secondary-rgb), 0.08), rgba(var(--primary-rgb), 0.07)),
    var(--panel-strong);
  box-shadow: inset 0 1px 0 var(--aurora-panel-edge);
}

body[data-visual-theme="aurora"][data-color-scheme] :is(.button.ghost:not(.danger), .chip-button:not(.danger)):hover {
  border-color: rgba(var(--primary-rgb), 0.46);
  background:
    linear-gradient(135deg, rgba(var(--secondary-rgb), 0.16), rgba(var(--primary-rgb), 0.14)),
    var(--panel-strong);
}

body[data-visual-theme="aurora"][data-color-scheme] :is(.button.ghost.danger, .chip-button.danger) {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.28);
  background: rgba(var(--danger-rgb), 0.06);
  box-shadow: none;
}

body[data-visual-theme="aurora"][data-color-scheme] :is(.button.ghost.danger, .chip-button.danger):hover {
  color: var(--danger);
  border-color: rgba(var(--danger-rgb), 0.48);
  background: rgba(var(--danger-rgb), 0.14);
}

body[data-visual-theme="aurora"][data-color-scheme] :is(.settings-nav-button:hover, .settings-nav-button.is-active) {
  border-color: rgba(var(--primary-rgb), 0.38);
  background: linear-gradient(90deg, rgba(var(--secondary-rgb), 0.14), rgba(var(--primary-rgb), 0.1));
  box-shadow: inset 2px 0 0 var(--secondary);
}

body[data-visual-theme="aurora"][data-color-scheme] :is(.pagination-icon-button, .pagination-page-button, .thread-chip-actions) {
  border-color: var(--aurora-panel-line);
  background: var(--panel-strong);
  box-shadow:
    inset 0 1px 0 var(--aurora-panel-edge),
    0 10px 24px rgba(31, 65, 112, 0.1);
}

body[data-visual-theme="aurora"] .brand-logo {
  background: linear-gradient(135deg, var(--brand-pink), #ff95cb);
  box-shadow:
    0 8px 18px rgba(var(--brand-pink-rgb), 0.24),
    0 0 0 1px rgba(255, 255, 255, 0.6);
}

/* 卡片边缘的刻度光迹不覆盖图片内容，也不启用额外背景模糊。 */
body[data-visual-theme="aurora"] .gallery-card-compact::before {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    repeating-linear-gradient(90deg, var(--aurora-grid-line) 0 1px, transparent 1px 12px) top 20px left 24px / 58% 4px no-repeat,
    linear-gradient(90deg, var(--secondary), var(--primary), transparent) top left / 72% 1px no-repeat;
  content: "";
  opacity: 0.34;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

body[data-visual-theme="aurora"] .gallery-card-compact:hover::before,
body[data-visual-theme="aurora"] .gallery-card-compact:focus-within::before {
  opacity: 0.78;
  transform: translateX(6px);
}

@keyframes aurora-curtain-drift {
  from {
    transform: translate3d(-1.2%, -0.7%, 0) scale(1);
  }

  to {
    transform: translate3d(1.4%, 0.9%, 0) scale(1.035);
  }
}

@keyframes aurora-instrument-drift {
  from {
    transform: translate3d(0, -4px, 0) rotate(-12deg);
  }

  to {
    transform: translate3d(-10px, 8px, 0) rotate(-7deg);
  }
}

@keyframes aurora-meteor-drift {
  from {
    transform: translate3d(-8px, 5px, 0) rotate(-7deg);
  }

  to {
    transform: translate3d(13px, -7px, 0) rotate(-5deg);
  }
}

/* 装饰档位只调整非功能视觉，不改变组件尺寸和鼠标命中区域。 */
body[data-decoration="off"]::before,
body[data-decoration="off"]::after,
body[data-decoration="off"] .shell::before,
body[data-decoration="off"] .shell::after,
body[data-decoration="off"] .composer-panel::after,
body[data-decoration="off"] .asset-panel::after,
body[data-decoration="off"] .workspace-layout h2::after,
body[data-decoration="off"] .dropzone::before,
body[data-decoration="off"] .dropzone::after,
body[data-decoration="off"] .gallery-card-compact::before {
  display: none;
}

body[data-decoration="off"] .brand-logo {
  animation: none;
}

body[data-decoration="subtle"]::before {
  opacity: 0.25;
}

body[data-decoration="subtle"]::after {
  opacity: 0.34;
  animation: none;
}

body[data-decoration="subtle"] .shell::before,
body[data-decoration="subtle"] .shell::after {
  opacity: 0.28;
  animation: none;
}

body[data-decoration="subtle"] .composer-panel::after,
body[data-decoration="subtle"] .asset-panel::after,
body[data-decoration="subtle"] .workspace-layout h2::after,
body[data-decoration="subtle"] .gallery-card-compact::before {
  opacity: 0.28;
}

body[data-decoration="subtle"] .brand-logo {
  animation: none;
}

/* Aurora 夜间规则具有更高特异性，柔和档需要显式压低全部装饰。 */
body[data-visual-theme="aurora"][data-decoration="subtle"]::before {
  opacity: 0.25;
}

body[data-visual-theme="aurora"][data-decoration="subtle"]::after {
  opacity: 0.34;
  animation: none;
}

body[data-visual-theme="aurora"][data-decoration="subtle"] .shell::before,
body[data-visual-theme="aurora"][data-decoration="subtle"] .shell::after {
  opacity: 0.28;
  animation: none;
}

body[data-visual-theme="aurora"][data-decoration="subtle"] .composer-panel::after,
body[data-visual-theme="aurora"][data-decoration="subtle"] .asset-panel::after,
body[data-visual-theme="aurora"][data-decoration="subtle"] .workspace-layout h2::after,
body[data-visual-theme="aurora"][data-decoration="subtle"] .gallery-card-compact::before {
  opacity: 0.28;
}

/* 自定义背景位于装饰上方时，隐藏 shell 内无法被 stacking context 盖住的装饰。 */
body[data-visual-theme="aurora"][data-background-layer="above-decorations"] .shell::before,
body[data-visual-theme="aurora"][data-background-layer="above-decorations"] .shell::after,
body[data-visual-theme="aurora"][data-background-layer="above-decorations"] .composer-panel::after,
body[data-visual-theme="aurora"][data-background-layer="above-decorations"] .asset-panel::after,
body[data-visual-theme="aurora"][data-background-layer="above-decorations"] .workspace-layout h2::after,
body[data-visual-theme="aurora"][data-background-layer="above-decorations"] .dropzone::before,
body[data-visual-theme="aurora"][data-background-layer="above-decorations"] .dropzone::after,
body[data-visual-theme="aurora"][data-background-layer="above-decorations"] .gallery-card-compact::before {
  display: none;
}

.appearance-settings {
  gap: 18px;
}

.appearance-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
  background: color-mix(in srgb, var(--panel-strong) 88%, transparent);
}

.appearance-section h3,
.appearance-section p {
  margin: 0;
}

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

.theme-choice-card {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 10px;
  color: var(--text);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.theme-choice-card::after {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 25px;
  height: 25px;
  color: #fff;
  font-family: "Material Symbols Rounded";
  font-size: 18px;
  font-variation-settings: "FILL" 1;
  content: "check";
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 4px 12px var(--ornament-glow-primary);
  opacity: 0;
  place-items: center;
  transform: scale(0.72);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.theme-choice-card:hover,
.theme-choice-card.is-active {
  border-color: var(--primary);
  box-shadow: 0 10px 28px var(--ornament-glow-primary);
  transform: translateY(-1px);
}

.theme-choice-card.is-active {
  outline: 2px solid color-mix(in srgb, var(--primary) 28%, transparent);
  outline-offset: 1px;
}

.theme-choice-card.is-active::after {
  opacity: 1;
  transform: scale(1);
}

.theme-choice-card small {
  color: var(--muted);
}

.theme-choice-preview {
  display: block;
  min-height: 76px;
  border-radius: 12px;
}

.theme-choice-classic .theme-choice-preview {
  background:
    radial-gradient(circle at 20% 18%, rgba(var(--primary-rgb), 0.28) 0 2px, transparent 3px) 0 0 / 26px 26px,
    linear-gradient(135deg, #fff4fa, #eaf5ff);
}

.theme-choice-aurora .theme-choice-preview {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 120, 183, 0.9) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 72% 68%, rgba(88, 217, 232, 0.86) 0 1px, transparent 2px),
    linear-gradient(112deg, rgba(66, 198, 220, 0.22), transparent 42%),
    linear-gradient(104deg, #eef8ff 0 47%, #172044 48% 72%, #25163f 100%);
}

.theme-choice-aurora .theme-choice-preview::after {
  position: absolute;
  top: -30px;
  right: -24px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(120, 107, 232, 0.58);
  border-radius: 50%;
  background:
    repeating-conic-gradient(rgba(66, 198, 220, 0.48) 0 1deg, transparent 1deg 13deg),
    radial-gradient(circle, transparent 0 48%, rgba(255, 120, 183, 0.62) 49% 50%, transparent 51%);
  content: "";
  transform: rotate(-12deg);
}

.theme-choice-liquid-glass .theme-choice-preview {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 76% 20%, rgba(255, 255, 255, 0.88), transparent 18%),
    radial-gradient(ellipse at 18% 82%, rgba(104, 210, 255, 0.56), transparent 44%),
    radial-gradient(ellipse at 86% 88%, rgba(255, 145, 210, 0.42), transparent 42%),
    linear-gradient(145deg, #bfe9ff, #e8ddff 52%, #ffdbea);
}

.theme-choice-liquid-glass .theme-choice-preview::after {
  position: absolute;
  inset: 12px 16px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 18px 12px 20px 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 48%),
    rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(82, 128, 184, 0.16),
    0 10px 24px rgba(66, 100, 160, 0.14);
  transform: rotate(-4deg);
}

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

.appearance-segmented .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.appearance-segmented .button::after {
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: transparent;
  font-family: "Material Symbols Rounded";
  font-size: 15px;
  font-variation-settings: "FILL" 1;
  content: "check";
  border-radius: 50%;
  place-items: center;
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.appearance-segmented .button.active-compact-toggle {
  color: var(--text);
  border-color: var(--primary);
  background: var(--panel-strong);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--primary) 30%, var(--panel-strong)),
      color-mix(in srgb, var(--secondary) 24%, var(--panel-strong))
    );
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--primary) 16%, transparent),
    0 8px 20px var(--ornament-glow-primary),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.appearance-segmented .button.active-compact-toggle::after {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  transform: scale(1.05);
}

.appearance-section-heading {
  align-items: flex-start;
  justify-content: space-between;
}

.theme-background-preview {
  overflow: hidden;
  aspect-ratio: 16 / 5;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--bg);
}

.theme-background-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.appearance-range input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.background-position-picker {
  display: grid;
  grid-template-columns: repeat(3, 24px);
  gap: 5px;
  width: max-content;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.background-position-button {
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-strong);
}

.background-position-button:hover,
.background-position-button.is-active {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--ornament-glow-primary);
}

.appearance-reset {
  align-self: flex-start;
}

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

@media (max-width: 720px) {
  .theme-card-grid,
  .appearance-control-grid {
    grid-template-columns: 1fr;
  }

  .appearance-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

.image-button {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
}

.thumb-card > .image-button {
  position: relative;
  overflow: hidden;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.thumb-card > .image-button {
  position: relative;
  overflow: hidden;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
}

.thumb-card img,
.card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.compact-preview-button,
.compact-preview-fallback {
  position: relative;
  width: 112px;
  height: 100%;
  min-height: 112px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  align-self: center;
  justify-self: start;
  overflow: hidden;
  border-radius: 18px;
}

.gallery-running-preview {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 35%, rgba(var(--primary-rgb), 0.18), transparent 48%),
    rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.preview-waiting-stage {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  width: 100%;
  min-height: 320px;
  padding: 24px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 42%, rgba(var(--primary-rgb), 0.18), transparent 34%),
    transparent;
}

.preview-image-button:disabled {
  cursor: default;
}

.gallery-running-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(var(--primary-rgb), 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: generation-spin 0.8s linear infinite;
}

.gallery-failure-summary {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
  color: #d84f73;
}

.compact-preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 18px;
}

.compact-preview-fallback {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.gallery-image-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: calc(100% - 16px);
}

.gallery-image-overlay-right {
  left: auto;
  right: 8px;
  justify-content: flex-end;
}

.thumb-order-badge-slot {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
}

.gallery-corner-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(10, 12, 20, 0.72);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  backdrop-filter: blur(6px);
}

.reference-order-badge {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.thumb-drag-handle {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  min-width: 28px;
  min-height: 28px;
  padding: 4px 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 20, 0.62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -1px;
  backdrop-filter: blur(6px);
  cursor: grab;
  opacity: 1;
  visibility: visible;
}

.thumb-actions,
.card-body {
  padding: 12px;
}

.compact-card-body {
  justify-content: space-between;
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.gallery-card-compact.is-failed .compact-card-body {
  gap: 4px;
}

.gallery-card-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-meta {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
  overflow: hidden;
}

.gallery-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  max-width: 100%;
  margin-left: auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-actions {
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.mini-action {
  min-height: 30px;
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 10px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.compact-actions .mini-action,
.preview-sidebar .preview-copy-button,
.resolution-close-button {
  border: none;
  box-shadow: none;
  background: transparent;
}

.compact-actions .mini-action {
  padding: 0;
}

.compact-actions .mini-action:hover,
.compact-actions .mini-action:focus-visible {
  background: rgba(var(--primary-rgb), 0.12);
}

.compact-actions .danger:hover,
.compact-actions .danger:focus-visible {
  background: rgba(239, 111, 134, 0.14);
}

.gallery .mini-action {
  min-height: 30px;
  min-width: 30px;
  width: 30px;
  height: 30px;
}

.gallery .gallery-stop-action {
  width: auto;
  min-width: 52px;
  padding: 0 3px 0 0;
  gap: 0;
  white-space: nowrap;
}

.gallery .mini-action.gallery-stop-action .app-icon {
  margin-left: -3px;
  font-size: 15px;
}

.gallery .gallery-stop-action span:last-child {
  white-space: nowrap;
}

.thumb-actions {
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}

.thumb-actions .mini-action {
  width: 30px;
  min-height: 30px;
  height: 30px;
}

.thumb-actions > .button.ghost:first-child {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11px;
  min-height: 30px;
  padding: 6px 8px;
  white-space: nowrap;
}

.icon-action {
  font-weight: 700;
}

.material-symbols-rounded.app-icon {
  font-variation-settings:
    "FILL" 0,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
  font-size: 18px;
  line-height: 1;
  width: 1em;
  height: 1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  user-select: none;
}

.material-symbols-rounded.app-icon.is-filled {
  font-variation-settings:
    "FILL" 1,
    "wght" 500,
    "GRAD" 0,
    "opsz" 24;
  color: var(--primary-strong);
}

.favorite-top-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 14px;
}

.favorites-overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: start center;
  padding: 78px 18px 18px;
  background: rgba(20, 24, 36, 0.18);
}

.favorites-popover {
  width: min(1080px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 96px));
  overflow: visible;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(var(--primary-rgb), 0.24);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.1)),
    var(--panel);
  box-shadow: 0 24px 60px rgba(32, 38, 64, 0.18);
}

.favorites-header,
.favorite-folder-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.favorite-folder-tabs {
  justify-content: flex-start;
  align-content: flex-start;
  flex-wrap: wrap;
  overflow: visible;
  padding-bottom: 4px;
}

.favorite-folder-tab,
.favorite-folder-add,
.folder-picker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.favorite-folder-tab {
  min-height: 34px;
  padding: 0 4px 0 10px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
}

.favorite-folder-tab.is-active {
  border-color: rgba(var(--primary-rgb), 0.48);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2), rgba(var(--secondary-rgb), 0.16));
  color: var(--primary-strong);
}

.favorite-folder-tab-main,
.favorite-folder-rename {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.favorite-folder-tab-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 0;
}

.favorite-folder-rename {
  width: 28px;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.66;
}

.favorite-folder-rename:hover {
  background: rgba(var(--primary-rgb), 0.14);
  opacity: 1;
}

.favorite-folder-rename.danger {
  color: var(--danger);
}

.favorite-folder-rename.danger:hover {
  background: rgba(239, 111, 134, 0.14);
}

.favorite-folder-add {
  width: 34px;
  min-width: 34px;
  height: 34px;
  justify-content: center;
  border-radius: 50%;
}

.favorite-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  overflow: auto;
  align-content: start;
  padding: 2px 2px 8px;
}

.favorite-pagination-footer {
  position: relative;
  z-index: 2;
  padding-top: 0;
}

.favorite-gallery-card {
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 112px;
}

.favorite-gallery-card .compact-preview-button,
.favorite-gallery-card .compact-preview-fallback {
  width: 112px;
  min-height: 112px;
}

.favorite-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: 8px 10px 20px rgba(32, 38, 64, 0.1);
}

.favorite-card-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.favorite-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorite-card-info {
  display: grid;
  gap: 3px;
  padding: 8px;
  font-size: 12px;
}

.favorite-card-info span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorite-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
}

.favorite-empty-thumb {
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
}

.gallery-count-tag {
  margin-left: auto;
}

.gallery-title-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.folder-picker-dismiss {
  position: fixed;
  inset: 0;
  z-index: 91;
  border: 0;
  background: transparent;
}

.folder-picker-popover {
  position: fixed;
  z-index: 92;
  width: min(240px, calc(100vw - 24px));
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid rgba(var(--primary-rgb), 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.1)),
    var(--panel);
  box-shadow: 0 18px 40px rgba(32, 38, 64, 0.16);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.folder-picker-item {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 12px;
  justify-content: flex-start;
}

.folder-picker-item span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-picker-item:hover,
.folder-picker-item.is-active {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: rgba(var(--primary-rgb), 0.14);
}

.folder-picker-cancel {
  margin-top: 4px;
  border-color: rgba(239, 111, 134, 0.28);
  color: var(--danger);
}

.inline-popover-dismiss {
  position: fixed;
  inset: 0;
  z-index: 89;
  border: 0;
  background: transparent;
}

.inline-action-popover {
  position: fixed;
  z-index: 90;
  width: min(280px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(var(--primary-rgb), 0.28);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.14), rgba(var(--secondary-rgb), 0.1)),
    var(--panel);
  box-shadow: 0 18px 42px rgba(32, 38, 64, 0.18);
}

.inline-popover-input {
  min-height: 38px;
  border-radius: 14px;
}

.inline-popover-actions {
  justify-content: flex-end;
  gap: 8px;
}

.inline-popover-actions .button {
  min-height: 34px;
  padding: 8px 12px;
}

.confirm-popover p {
  margin: 0;
  line-height: 1.5;
}

.confirm-popover .button.danger {
  color: #fff;
}

@media (max-width: 980px) {
  .favorite-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .sync-key-unlock-row {
    flex-wrap: wrap;
  }

  .sync-key-unlock-row .button {
    width: 100%;
  }

  .favorite-gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery .mini-action .app-icon {
  font-size: 17px;
}

.thumb-actions .mini-action .app-icon {
  font-size: 16px;
}

.gallery-sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.continuation-banner {
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.12), rgba(var(--secondary-rgb), 0.14));
}

.continuation-thumb {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.mask-stage {
  position: relative;
  width: 100%;
  min-height: min(72vh, 820px);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.18);
}

.mask-base-image,
.mask-overlay {
  display: block;
  width: 100%;
}

.mask-base-image {
  position: relative;
  z-index: 1;
}

.mask-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

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

.mask-data-canvas {
  display: none;
}

.mask-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mask-toolbar-main,
.mask-toolbar-actions,
.reference-menu-actions {
  justify-content: space-between;
}

.mask-size-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 280px;
}

.mask-size-range {
  width: min(280px, 100%);
}

.reference-toggle-button {
  font-size: 12px;
  padding-inline: 10px;
}

.reference-menu-shell,
.mask-modal-shell {
  width: min(920px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  padding: 22px;
  border-radius: 32px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  overflow: auto;
}

.mask-modal-shell {
  width: min(1100px, calc(100vw - 40px));
}

.reference-menu-top {
  align-items: flex-start;
  justify-content: space-between;
}

.reference-menu-preview {
  margin: 12px 0 16px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.18);
}

.reference-menu-preview img {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.preview-overlay,
.context-menu-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.preview-overlay {
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6, 8, 15, 0.72);
  backdrop-filter: blur(14px);
}

.preview-shell {
  position: relative;
  width: min(1240px, 100%);
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 0;
  overflow: hidden;
  border-radius: 32px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 253, 0.96);
  box-shadow: var(--shadow);
}

.failure-log-shell {
  width: min(920px, 100%);
}

.failure-log-text {
  margin: 4px 0 0;
  padding: 14px;
  max-height: min(56vh, 620px);
  overflow: auto;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  white-space: pre-wrap;
  word-break: break-word;
}

.failure-log-top {
  padding-right: 56px;
}

.preview-shell-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(24, 26, 38, 0.08);
}

.preview-stage {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.88), transparent 48%),
    linear-gradient(180deg, rgba(255, 239, 247, 0.92), rgba(247, 250, 255, 0.94));
}

.preview-stage-meta {
  position: absolute;
  top: 18px;
  left: 18px;
  display: flex;
  gap: 10px;
  z-index: 2;
}

.preview-image-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  overflow: hidden;
  cursor: zoom-in;
}

.preview-image {
  max-width: 100%;
  max-height: calc(100vh - 180px);
  border-radius: 20px;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.fullscreen-image-viewer {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.94);
  background:
    radial-gradient(circle at center, rgba(27, 31, 45, 0.72), transparent 58%),
    rgba(3, 5, 10, 0.97);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.fullscreen-image-viewer.is-dragging {
  cursor: grabbing;
}

.fullscreen-image-content {
  display: block;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 32px);
  object-fit: contain;
  transform-origin: center;
  will-change: transform;
  pointer-events: none;
  -webkit-user-drag: none;
  transition: transform 90ms ease-out;
}

.fullscreen-image-content.is-dragging {
  transition: none;
}

.fullscreen-image-toolbar {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(14, 17, 26, 0.76);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px) saturate(1.2);
  cursor: default;
}

.fullscreen-image-toolbar .button {
  color: #fff;
  border-color: transparent;
  background: transparent;
}

.fullscreen-image-toolbar .button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
}

.fullscreen-image-scale {
  width: 54px;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.fullscreen-image-hint {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(9, 11, 18, 0.64);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.26);
  font-size: 12px;
  transform: translateX(-50%);
  pointer-events: none;
}

.preview-sidebar {
  min-height: 0;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 250, 252, 0.96), rgba(255, 246, 250, 0.96));
  overflow: hidden;
}

.preview-sidebar .status,
.preview-sidebar .tag {
  color: var(--muted);
}

.preview-sidebar-top {
  min-height: 96px;
  flex: 1 1 auto;
  align-items: flex-start;
  justify-content: space-between;
}

.preview-sidebar-top > .stack {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.preview-prompt-head {
  align-items: center;
  gap: 4px;
}

.preview-copy-button {
  min-width: 20px;
  min-height: 20px;
  width: 20px;
  height: 20px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border-radius: 0;
  align-self: baseline;
  margin-top: -1px;
  margin-left: -2px;
}

.preview-copy-button .app-icon {
  font-size: 13px;
}

.preview-prompt {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-prompt-box {
  width: 100%;
  max-width: 100%;
  min-height: 72px;
  flex: 1 1 auto;
  margin-top: 2px;
  padding: 12px 14px;
  max-height: none;
  overflow: hidden auto;
  border-radius: 18px;
  border: 1px solid rgba(24, 26, 38, 0.08);
  background: rgba(255, 255, 255, 0.5);
  scrollbar-gutter: stable;
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
}

.preview-copy-button:hover,
.preview-copy-button:focus-visible {
  color: var(--primary-strong);
  background: transparent;
  border: none;
}

.preview-copy-button:disabled,
.preview-copy-button:disabled:hover,
.preview-copy-button:disabled:focus-visible {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  background: transparent;
  border: none;
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

.preview-ref-strip {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.preview-ref-card {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.32);
}

.floating-tip {
  position: fixed;
  z-index: 120;
  max-width: min(220px, calc(100vw - 24px));
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(28, 26, 38, 0.82);
  color: #fff7fb;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: 0.01em;
  box-shadow: 0 14px 30px rgba(24, 18, 32, 0.2);
  backdrop-filter: blur(10px);
  pointer-events: none;
  transform: translate(0, calc(-100% - 4px));
  white-space: nowrap;
}

body[data-theme="day"] .floating-tip {
  background: rgba(255, 247, 252, 0.96);
  color: #5f4566;
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  box-shadow: 0 14px 30px rgba(var(--primary-rgb), 0.16);
}

.preview-ref-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-details-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.preview-details-grid .detail-card.is-wide {
  grid-column: span 3;
}

.preview-details-grid .detail-card.is-inline {
  grid-column: span 2;
  min-height: 48px;
  padding: 9px 10px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
}

.preview-sidebar-fixed {
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-time-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.detail-card {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.detail-card.is-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
}

.detail-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  flex: 0 0 auto;
}

.detail-value {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
  min-width: 0;
}

.detail-card.is-inline .detail-value {
  white-space: nowrap;
}

.detail-value-wrap {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-actions {
  gap: 6px;
  flex-wrap: nowrap;
}

.preview-actions-primary {
  overflow-x: auto;
  scrollbar-width: none;
}

.preview-actions-primary::-webkit-scrollbar {
  display: none;
}

.preview-actions .button {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 8px;
  justify-content: center;
  font-size: 12px;
  white-space: nowrap;
}

.preview-actions-primary .button {
  min-width: max-content;
}

.context-menu {
  position: fixed;
  min-width: 160px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 251, 253, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.context-item {
  width: 100%;
  text-align: left;
}

body[data-theme="night"] .preview-shell {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(17, 19, 28, 0.94);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
}

body[data-theme="night"] .failure-log-text {
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="night"] .preview-stage {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08), transparent 45%),
    rgba(12, 13, 18, 0.96);
}

body[data-theme="night"] .preview-shell-close {
  background: rgba(22, 24, 34, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="night"] .preview-sidebar {
  color: #f4ecf2;
  background:
    linear-gradient(180deg, rgba(26, 28, 36, 0.96), rgba(17, 19, 28, 0.96));
}

body[data-theme="night"] .preview-sidebar .status,
body[data-theme="night"] .preview-sidebar .tag {
  color: rgba(255, 255, 255, 0.72);
}

body[data-theme="night"] .preview-ref-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

body[data-theme="night"] .detail-card {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.06);
}

body[data-theme="night"] .context-menu {
  background: rgba(18, 23, 36, 0.96);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

body[data-theme="night"] .config-switcher-menu {
  background: rgba(18, 23, 36, 0.96);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

/* 详情舞台与浮动控件使用独立冷色材质，覆盖后置的通用夜间规则。 */
body[data-visual-theme="aurora"][data-color-scheme="day"] .preview-stage {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.82), transparent 46%),
    linear-gradient(160deg, rgba(226, 245, 255, 0.96), rgba(235, 236, 255, 0.96));
}

body[data-visual-theme="aurora"][data-color-scheme="night"] .preview-stage {
  background:
    radial-gradient(circle at center, rgba(var(--secondary-rgb), 0.11), transparent 45%),
    linear-gradient(160deg, rgba(7, 17, 39, 0.98), rgba(20, 20, 49, 0.98));
}

body[data-visual-theme="aurora"][data-color-scheme] .preview-shell-close {
  color: var(--text);
  border-color: var(--aurora-panel-line);
  background:
    linear-gradient(135deg, rgba(var(--secondary-rgb), 0.1), rgba(var(--primary-rgb), 0.08)),
    var(--panel-strong);
  box-shadow:
    inset 0 1px 0 var(--aurora-panel-edge),
    0 8px 20px rgba(28, 62, 108, 0.12);
}

body[data-visual-theme="aurora"][data-color-scheme] .preview-sidebar {
  color: var(--text);
}

body[data-visual-theme="aurora"][data-color-scheme] .preview-sidebar .status,
body[data-visual-theme="aurora"][data-color-scheme] .preview-sidebar .tag {
  color: var(--muted);
}

body[data-visual-theme="aurora"][data-color-scheme="day"] .floating-tip {
  color: var(--text);
  border: 1px solid var(--aurora-panel-line);
  background: rgba(235, 247, 255, 0.96);
  box-shadow: 0 14px 30px rgba(var(--primary-rgb), 0.16);
}

body[data-visual-theme="aurora"][data-color-scheme="night"] .floating-tip {
  color: var(--text);
  border: 1px solid var(--aurora-panel-line);
  background: rgba(10, 20, 44, 0.96);
  box-shadow: 0 14px 32px rgba(0, 3, 16, 0.34);
}

/* 液态玻璃主题以低模糊和多层高光代替高 Alpha 磨砂，保证背景仍可辨认。 */
body[data-visual-theme="liquid-glass"] {
  --bg: #d9efff;
  --bg-accent:
    radial-gradient(ellipse at 12% 10%, rgba(103, 211, 255, 0.72), transparent 38%),
    radial-gradient(ellipse at 88% 16%, rgba(255, 151, 211, 0.6), transparent 36%),
    radial-gradient(ellipse at 52% 96%, rgba(142, 127, 255, 0.48), transparent 42%),
    linear-gradient(145deg, #d6f2ff, #eee7ff 52%, #ffe4ef);
  --panel: rgba(242, 250, 255, 0.28);
  --panel: rgb(242 250 255 / var(--panel-opacity));
  --panel-strong: rgba(248, 252, 255, 0.4);
  --panel-strong: rgb(248 252 255 / var(--panel-strong-opacity));
  --line: rgba(255, 255, 255, 0.62);
  --text: #24344e;
  --muted: #5f7088;
  --shadow:
    0 22px 60px rgba(44, 76, 118, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(70, 117, 167, 0.1);
  --surface-blur: 5px;
  --surface-saturate: 1.2;
  --background-overlay: rgba(230, 245, 255, 0.28);
  --glass-line: rgba(255, 255, 255, 0.7);
  --glass-line-soft: rgba(255, 255, 255, 0.38);
  --glass-highlight: rgba(255, 255, 255, 0.46);
  --glass-shade: rgba(50, 103, 158, 0.1);
  --glass-refract-primary: rgba(82, 196, 255, 0.13);
  --glass-refract-secondary: rgba(255, 116, 193, 0.11);
  --glass-decoration-line: rgba(51, 127, 181, 0.28);
  --glass-decoration-highlight: rgba(255, 255, 255, 0.76);
  --glass-decoration-cyan: rgba(27, 169, 224, 0.3);
  --glass-decoration-pink: rgba(221, 73, 158, 0.24);
  --glass-decoration-violet: rgba(105, 83, 212, 0.18);
  --glass-surface:
    linear-gradient(145deg, var(--glass-highlight), transparent 40%),
    linear-gradient(325deg, var(--glass-refract-secondary), transparent 44%),
    linear-gradient(42deg, var(--glass-refract-primary), transparent 52%),
    var(--panel);
  --glass-surface-strong:
    linear-gradient(145deg, rgba(255, 255, 255, 0.58), transparent 38%),
    linear-gradient(325deg, var(--glass-refract-secondary), transparent 46%),
    linear-gradient(42deg, var(--glass-refract-primary), transparent 54%),
    var(--panel-strong);
  --glass-control:
    linear-gradient(145deg, rgba(255, 255, 255, 0.42), transparent 48%),
    rgba(241, 250, 255, 0.18);
  --select-option-bg: #dcecf7;
  --select-option-active: #f3cde3;
  --floating-surface-base: rgba(236, 247, 254, 0.9);
  --floating-surface:
    linear-gradient(145deg, rgba(255, 255, 255, 0.68), transparent 40%),
    linear-gradient(325deg, rgba(255, 116, 193, 0.13), transparent 48%),
    linear-gradient(42deg, rgba(82, 196, 255, 0.16), transparent 56%),
    var(--floating-surface-base);
  --floating-control: rgba(248, 252, 255, 0.82);
  --floating-border: rgba(71, 125, 170, 0.38);
  --floating-shadow:
    0 26px 72px rgba(31, 62, 99, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  --floating-hover: rgba(var(--secondary-rgb), 0.14);
  --floating-active:
    linear-gradient(135deg, rgba(var(--secondary-rgb), 0.2), rgba(var(--primary-rgb), 0.18)),
    rgba(244, 250, 255, 0.8);
  --floating-muted: #53667d;
  --floating-blur: 20px;
  --scrollbar-track-color: rgba(73, 122, 158, 0.11);
  --scrollbar-thumb-color: rgba(55, 148, 190, 0.66);
  --scrollbar-thumb-gradient: linear-gradient(160deg, rgba(50, 184, 229, 0.88), rgba(224, 100, 177, 0.78));
  --scrollbar-thumb-hover-gradient: linear-gradient(160deg, #28b4df, #dc5baa);
  --scrollbar-thumb-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 0 10px rgba(61, 167, 213, 0.14);
}

body[data-visual-theme="liquid-glass"][data-color-scheme="night"] {
  --bg: #0a1427;
  --bg-accent:
    radial-gradient(ellipse at 12% 8%, rgba(41, 166, 220, 0.46), transparent 40%),
    radial-gradient(ellipse at 88% 16%, rgba(206, 70, 170, 0.38), transparent 36%),
    radial-gradient(ellipse at 52% 100%, rgba(92, 76, 218, 0.36), transparent 44%),
    linear-gradient(145deg, #0b1c32, #17182f 54%, #26142b);
  --panel: rgba(16, 34, 55, 0.24);
  --panel: rgb(16 34 55 / var(--panel-opacity));
  --panel-strong: rgba(17, 31, 50, 0.36);
  --panel-strong: rgb(17 31 50 / var(--panel-strong-opacity));
  --line: rgba(196, 231, 255, 0.26);
  --text: #f3f8ff;
  --muted: #b4c3d5;
  --shadow:
    0 24px 64px rgba(0, 5, 20, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -1px 0 rgba(0, 0, 0, 0.16);
  --background-overlay: rgba(4, 11, 25, 0.34);
  --glass-line: rgba(210, 238, 255, 0.32);
  --glass-line-soft: rgba(196, 231, 255, 0.18);
  --glass-highlight: rgba(255, 255, 255, 0.16);
  --glass-shade: rgba(0, 4, 16, 0.2);
  --glass-refract-primary: rgba(55, 188, 255, 0.14);
  --glass-refract-secondary: rgba(255, 91, 194, 0.1);
  --glass-decoration-line: rgba(145, 213, 255, 0.2);
  --glass-decoration-highlight: rgba(255, 255, 255, 0.38);
  --glass-decoration-cyan: rgba(53, 190, 255, 0.2);
  --glass-decoration-pink: rgba(255, 91, 194, 0.17);
  --glass-decoration-violet: rgba(129, 111, 255, 0.16);
  --glass-surface-strong:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 40%),
    linear-gradient(325deg, var(--glass-refract-secondary), transparent 46%),
    linear-gradient(42deg, var(--glass-refract-primary), transparent 54%),
    var(--panel-strong);
  --glass-control:
    linear-gradient(145deg, rgba(255, 255, 255, 0.15), transparent 50%),
    rgba(20, 40, 63, 0.16);
  --select-option-bg: #12263e;
  --select-option-active: #41304f;
  --floating-surface-base: rgba(10, 24, 41, 0.92);
  --floating-surface:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), transparent 40%),
    linear-gradient(325deg, rgba(255, 91, 194, 0.13), transparent 48%),
    linear-gradient(42deg, rgba(55, 188, 255, 0.16), transparent 56%),
    var(--floating-surface-base);
  --floating-control: rgba(22, 42, 63, 0.88);
  --floating-border: rgba(154, 207, 239, 0.34);
  --floating-shadow:
    0 28px 76px rgba(0, 4, 17, 0.58),
    inset 0 1px 0 rgba(224, 243, 255, 0.2);
  --floating-hover: rgba(var(--secondary-rgb), 0.17);
  --floating-active:
    linear-gradient(135deg, rgba(var(--secondary-rgb), 0.22), rgba(var(--primary-rgb), 0.22)),
    rgba(20, 38, 60, 0.86);
  --floating-muted: #c2cfdd;
  --scrollbar-track-color: rgba(0, 5, 15, 0.38);
  --scrollbar-thumb-color: rgba(87, 177, 212, 0.7);
  --scrollbar-thumb-gradient: linear-gradient(160deg, rgba(58, 190, 231, 0.86), rgba(201, 76, 164, 0.78));
  --scrollbar-thumb-hover-gradient: linear-gradient(160deg, #50d1ed, #e16ab7);
  --scrollbar-thumb-shadow:
    inset 0 1px 0 rgba(224, 243, 255, 0.3),
    0 0 12px rgba(55, 188, 255, 0.12);
}

body[data-visual-theme="liquid-glass"]::before {
  background:
    radial-gradient(circle at 7% 19%, var(--glass-decoration-highlight) 0 1.5px, transparent 2.4px),
    radial-gradient(circle at 18% 73%, var(--glass-decoration-cyan) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 9%, var(--glass-decoration-highlight) 0 1px, transparent 2px),
    radial-gradient(circle at 91% 57%, var(--glass-decoration-pink) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 72% 88%, var(--glass-decoration-highlight) 0 1px, transparent 2px),
    linear-gradient(112deg, transparent 0 30%, var(--glass-decoration-line) 30.25%, transparent 30.9% 68%, var(--glass-decoration-cyan) 68.25%, transparent 69%),
    radial-gradient(ellipse 76% 20% at 8% -2%, var(--glass-decoration-highlight), transparent 70%),
    conic-gradient(from 208deg at 88% 14%, transparent 0 12%, var(--glass-decoration-pink) 17%, var(--glass-decoration-highlight) 19%, transparent 25% 100%);
  opacity: 0.72;
  -webkit-mask-image: none;
  mask-image: none;
  animation: liquid-glass-caustic-drift 26s ease-in-out infinite alternate;
}

body[data-visual-theme="liquid-glass"]::after {
  inset: -16vh -12vw;
  background:
    radial-gradient(ellipse at 82% 8%, var(--glass-decoration-highlight), transparent 25%),
    radial-gradient(ellipse at 6% 48%, var(--glass-decoration-cyan), transparent 27%),
    radial-gradient(ellipse at 68% 92%, var(--glass-decoration-pink), transparent 31%),
    radial-gradient(ellipse at 34% 106%, var(--glass-decoration-violet), transparent 29%);
  opacity: 0.8;
  animation: liquid-glass-glow-drift 22s ease-in-out infinite alternate;
}

/* 单个玻璃穹顶占据右上留白，和左下棱镜形成不对称构图。 */
body[data-visual-theme="liquid-glass"] .shell::before {
  top: 0;
  right: -96px;
  width: min(560px, 44vw);
  height: clamp(170px, 21vw, 270px);
  border: 1px solid var(--glass-decoration-line);
  border-top-color: var(--glass-decoration-highlight);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  background:
    radial-gradient(ellipse at 31% 22%, var(--glass-decoration-highlight), transparent 24%),
    linear-gradient(156deg, var(--glass-decoration-cyan), transparent 42%),
    linear-gradient(28deg, var(--glass-decoration-violet), transparent 48%),
    linear-gradient(214deg, var(--glass-decoration-pink), transparent 54%),
    rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 var(--glass-decoration-highlight),
    inset 0 -1px 0 var(--glass-decoration-line),
    0 20px 42px rgba(71, 154, 211, 0.08);
  opacity: 0.7;
  filter: drop-shadow(0 18px 28px rgba(71, 154, 211, 0.1));
  clip-path: none;
  transform: none;
  animation: liquid-glass-dome-drift 24s ease-in-out infinite alternate;
}

body[data-visual-theme="liquid-glass"] .shell::after {
  bottom: -86px;
  left: -72px;
  width: min(520px, 40vw);
  height: 350px;
  border: 0;
  border-radius: 0;
  background:
    conic-gradient(from 218deg at 42% 58%, var(--glass-decoration-highlight), var(--glass-decoration-cyan) 19%, transparent 20% 43%, var(--glass-decoration-pink) 51%, transparent 63%),
    linear-gradient(132deg, var(--glass-decoration-violet), transparent 56%);
  box-shadow: none;
  opacity: 0.58;
  filter: drop-shadow(18px -12px 34px rgba(105, 101, 211, 0.08));
  clip-path: polygon(0 35%, 28% 8%, 54% 30%, 91% 16%, 76% 55%, 100% 82%, 56% 74%, 28% 100%, 14% 68%);
  transform: rotate(5deg);
  animation: liquid-glass-prism-drift 29s ease-in-out infinite alternate;
}

/* 大型面板保持纯净，装饰集中到页面空白处。 */
body[data-visual-theme="liquid-glass"] .composer-panel::after,
body[data-visual-theme="liquid-glass"] .asset-panel::after {
  display: none;
}

body[data-visual-theme="liquid-glass"] .workspace-layout h2::after {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--glass-highlight), var(--glass-refract-primary), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

/* 日间不能只靠白色高光，需要额外的色彩和明暗差才能保持可见。 */
body[data-visual-theme="liquid-glass"][data-color-scheme="day"]::before {
  opacity: 0.94;
}

body[data-visual-theme="liquid-glass"][data-color-scheme="day"]::after {
  opacity: 0.9;
}

body[data-visual-theme="liquid-glass"][data-color-scheme="day"] .shell::before {
  opacity: 0.84;
}

body[data-visual-theme="liquid-glass"][data-color-scheme="day"] .shell::after {
  opacity: 0.76;
}

body[data-visual-theme="liquid-glass"][data-color-scheme="day"] .workspace-layout h2::after {
  background: linear-gradient(90deg, var(--glass-decoration-cyan), var(--glass-decoration-pink), transparent);
}

@keyframes liquid-glass-caustic-drift {
  from {
    transform: translate3d(-0.7%, -0.5%, 0) scale(1);
  }

  to {
    transform: translate3d(0.9%, 0.7%, 0) scale(1.025);
  }
}

@keyframes liquid-glass-glow-drift {
  from {
    transform: translate3d(-1.5%, -1%, 0) scale(1);
  }

  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.04);
  }
}

@keyframes liquid-glass-dome-drift {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-12px, 0, 0);
  }
}

@keyframes liquid-glass-prism-drift {
  from {
    transform: translate3d(-5px, 5px, 0) rotate(5deg);
  }

  to {
    transform: translate3d(12px, -9px, 0) rotate(8deg);
  }
}

body[data-visual-theme="liquid-glass"] .panel,
body[data-visual-theme="liquid-glass"] .settings-popover,
body[data-visual-theme="liquid-glass"] .favorites-popover,
body[data-visual-theme="liquid-glass"] .reference-menu-shell,
body[data-visual-theme="liquid-glass"] .mask-modal-shell,
body[data-visual-theme="liquid-glass"] .preview-shell,
body[data-visual-theme="liquid-glass"] .resolution-sheet,
body[data-visual-theme="liquid-glass"] .context-menu,
body[data-visual-theme="liquid-glass"] .config-switcher-menu,
body[data-visual-theme="liquid-glass"] .folder-picker-popover,
body[data-visual-theme="liquid-glass"] .inline-action-popover {
  border-color: var(--glass-line);
  background: var(--glass-surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(var(--surface-blur)) saturate(var(--surface-saturate));
  backdrop-filter: blur(var(--surface-blur)) saturate(var(--surface-saturate));
}

body[data-visual-theme="liquid-glass"] .card,
body[data-visual-theme="liquid-glass"] .thumb-card,
body[data-visual-theme="liquid-glass"] .favorite-card,
body[data-visual-theme="liquid-glass"] .appearance-section,
body[data-visual-theme="liquid-glass"] .preset-block,
body[data-visual-theme="liquid-glass"] .mask-panel,
body[data-visual-theme="liquid-glass"] .data-action-card,
body[data-visual-theme="liquid-glass"] .data-stat-card,
body[data-visual-theme="liquid-glass"] .sync-key-settings,
body[data-visual-theme="liquid-glass"] .admin-user-row,
body[data-visual-theme="liquid-glass"] .detail-card,
body[data-visual-theme="liquid-glass"] .preview-prompt-box,
body[data-visual-theme="liquid-glass"] .preview-ref-card,
body[data-visual-theme="liquid-glass"] .preview-sidebar,
body[data-visual-theme="liquid-glass"] .failure-log-text,
body[data-visual-theme="liquid-glass"] .settings-sidebar {
  border-color: var(--glass-line-soft);
  background: var(--glass-surface-strong);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    inset 0 -1px 0 var(--glass-shade),
    0 12px 30px rgba(38, 82, 126, 0.08);
}

body[data-visual-theme="liquid-glass"] .field,
body[data-visual-theme="liquid-glass"] .text-input,
body[data-visual-theme="liquid-glass"] .select-input,
body[data-visual-theme="liquid-glass"] .compact-select,
body[data-visual-theme="liquid-glass"] .resolution-button,
body[data-visual-theme="liquid-glass"] .inline-popover-input,
body[data-visual-theme="liquid-glass"] .background-position-picker,
body[data-visual-theme="liquid-glass"] .background-position-button,
body[data-visual-theme="liquid-glass"] .pagination-icon-button,
body[data-visual-theme="liquid-glass"] .pagination-page-button,
body[data-visual-theme="liquid-glass"] .button.ghost,
body[data-visual-theme="liquid-glass"] .chip-button {
  border-color: var(--glass-line-soft);
  background: var(--glass-control);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

body[data-visual-theme="liquid-glass"] .button.ghost:hover,
body[data-visual-theme="liquid-glass"] .chip-button:hover,
body[data-visual-theme="liquid-glass"] .pagination-icon-button:not(:disabled):hover,
body[data-visual-theme="liquid-glass"] .pagination-page-button:hover {
  border-color: var(--glass-line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.34), transparent 46%),
    linear-gradient(135deg, var(--glass-refract-secondary), var(--glass-refract-primary)),
    var(--panel-strong);
}

body[data-visual-theme="liquid-glass"] .background-position-button.is-active {
  display: grid;
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow:
    0 0 0 2px rgba(var(--primary-rgb), 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.46);
  place-items: center;
}

body[data-visual-theme="liquid-glass"] .background-position-button.is-active::after {
  display: block;
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(32, 45, 68, 0.2);
}

body[data-visual-theme="liquid-glass"] .preview-sidebar .preview-copy-button {
  border: none;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

body[data-visual-theme="liquid-glass"] .preview-sidebar .preview-copy-button:hover,
body[data-visual-theme="liquid-glass"] .preview-sidebar .preview-copy-button:focus-visible {
  border: none;
  background: rgba(var(--primary-rgb), 0.12);
  box-shadow: none;
}

/* 主题按钮规则不得把详情页的紧凑复制按钮恢复成硬边矩形。 */
body[data-visual-theme][data-color-scheme] .preview-sidebar .button.ghost.preview-copy-button {
  display: inline-flex;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  outline: none;
  background: transparent;
  box-shadow: none;
}

body[data-visual-theme][data-color-scheme] .preview-sidebar .button.ghost.preview-copy-button:hover,
body[data-visual-theme][data-color-scheme] .preview-sidebar .button.ghost.preview-copy-button:focus-visible {
  border: 0;
  background: rgba(var(--primary-rgb), 0.12);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.12);
}

body[data-visual-theme][data-color-scheme] .preview-sidebar .button.ghost.preview-copy-button:disabled {
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* 提示词复制是框内辅助操作，不应继承主题按钮的实体边框。 */
body[data-visual-theme][data-color-scheme] .template-prompt-box .button.ghost.template-prompt-copy {
  min-width: 0;
  min-height: 26px;
  gap: 3px;
  padding: 3px 5px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 11px;
}

body[data-visual-theme][data-color-scheme] .template-prompt-box .button.ghost.template-prompt-copy .app-icon {
  width: 15px;
  height: 15px;
  font-size: 15px;
}

body[data-visual-theme][data-color-scheme] .template-prompt-box .button.ghost.template-prompt-copy:hover,
body[data-visual-theme][data-color-scheme] .template-prompt-box .button.ghost.template-prompt-copy:focus-visible {
  border: 0;
  color: var(--text);
  background: rgba(var(--primary-rgb), 0.1);
  box-shadow: none;
}

body[data-visual-theme][data-color-scheme] .button.ghost.template-favorite-button.is-active {
  color: var(--primary-strong);
  border-color: rgba(var(--primary-rgb), 0.46);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2), rgba(var(--secondary-rgb), 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

body[data-visual-theme][data-color-scheme] .button.ghost.template-favorite-button.is-active:hover,
body[data-visual-theme][data-color-scheme] .button.ghost.template-favorite-button.is-active:focus-visible {
  border-color: rgba(var(--primary-rgb), 0.62);
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.28), rgba(var(--secondary-rgb), 0.2));
}

/* Windows 原生下拉弹层需要字面深色作为提示，变量和继承色常会被 UA 忽略。 */
body[data-visual-theme="classic"][data-color-scheme="night"] :is(select, select option, select optgroup) {
  color-scheme: dark;
  color: #f7ebf3 !important;
  background-color: #171d2c !important;
}

body[data-visual-theme="classic"][data-color-scheme="night"] select option:checked {
  color: #fff7fb !important;
  background-color: #3b2b46 !important;
}

body[data-visual-theme="aurora"][data-color-scheme="night"] :is(select, select option, select optgroup) {
  color-scheme: dark;
  color: #edf5ff !important;
  background-color: #101a36 !important;
}

body[data-visual-theme="aurora"][data-color-scheme="night"] select option:checked {
  color: #f7fbff !important;
  background-color: #302b65 !important;
}

body[data-visual-theme="liquid-glass"][data-color-scheme="night"] select {
  color-scheme: dark;
  color: #f3f8ff;
  background-color: #12263e;
}

body[data-visual-theme="liquid-glass"][data-color-scheme="night"] select option,
body[data-visual-theme="liquid-glass"][data-color-scheme="night"] select optgroup {
  color: #f3f8ff;
  background-color: #12263e;
}

body[data-visual-theme="liquid-glass"][data-color-scheme="night"] select option:checked {
  color: #f3f8ff;
  background-color: #41304f;
}

body[data-visual-theme="liquid-glass"] .button.active-compact-toggle {
  color: var(--text);
  border-color: var(--primary);
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.28), rgba(var(--secondary-rgb), 0.24)),
    var(--panel-strong);
  box-shadow:
    0 0 0 2px rgba(var(--primary-rgb), 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

body[data-visual-theme="liquid-glass"] .generation-submit-button,
body[data-visual-theme="liquid-glass"] .button:not(.ghost):not(.secondary) {
  box-shadow:
    0 12px 28px rgba(var(--primary-strong-rgb), 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

/* 经典与液态玻璃的实色操作面统一使用白色前景，避免文字和图标融入粉蓝底色。 */
body[data-visual-theme="classic"] .button:not(.ghost),
body[data-visual-theme="liquid-glass"] .button:not(.ghost) {
  color: #fff;
}

body[data-visual-theme="liquid-glass"][data-decoration="subtle"]::before,
body[data-visual-theme="liquid-glass"][data-decoration="subtle"]::after,
body[data-visual-theme="liquid-glass"][data-decoration="subtle"] .shell::before,
body[data-visual-theme="liquid-glass"][data-decoration="subtle"] .shell::after,
body[data-visual-theme="liquid-glass"][data-decoration="subtle"] .composer-panel::after,
body[data-visual-theme="liquid-glass"][data-decoration="subtle"] .asset-panel::after {
  animation: none;
  opacity: 0.26;
}

/*
 * 菜单与模态框属于交互安全层：固定高 Alpha，不继承卡片透明度滑杆。
 * 选择器放在全部主题规则之后，确保主题仍能换色，但不会被主题面板材质覆盖。
 */
body[data-visual-theme][data-color-scheme] :is(
  .template-sort-menu,
  .template-tag-menu,
  .config-switcher-menu,
  .thread-archive-menu,
  .gallery-page-popover,
  .folder-picker-popover,
  .inline-action-popover,
  .context-menu,
  .floating-tip,
  .template-plaza-notice,
  .settings-popover,
  .favorites-popover,
  .resolution-sheet,
  .reference-menu-shell,
  .mask-modal-shell,
  .preview-shell,
  .template-detail,
  .template-editor,
  .template-editor-tag-dialog,
  .confirm-dialog,
  .local-state-gate-card
) {
  color: var(--text);
  border: 1px solid var(--floating-border);
  background: var(--floating-surface);
  box-shadow: var(--floating-shadow);
  -webkit-backdrop-filter: blur(var(--floating-blur)) saturate(1.12);
  backdrop-filter: blur(var(--floating-blur)) saturate(1.12);
}

body[data-visual-theme][data-color-scheme] .gallery-page-popover::after {
  border-color: var(--floating-border);
  background: var(--floating-surface-base);
}

body[data-visual-theme][data-color-scheme] .gallery-page-popover :is(
  .gallery-page-wheel-item.is-focused,
  .gallery-page-wheel-item.is-near
) {
  color: var(--text);
}

body[data-visual-theme][data-color-scheme] :is(
  .template-sort-menu,
  .template-tag-menu,
  .config-switcher-menu,
  .thread-archive-menu,
  .gallery-page-popover,
  .folder-picker-popover,
  .inline-action-popover,
  .context-menu,
  .settings-popover,
  .favorites-popover,
  .resolution-sheet,
  .reference-menu-shell,
  .mask-modal-shell,
  .preview-shell,
  .template-detail,
  .template-editor,
  .template-editor-tag-dialog,
  .confirm-dialog,
  .local-state-gate-card
) :is(
  .field,
  .text-input,
  .select-input,
  .compact-select,
  .inline-popover-input,
  .template-tag-search,
  .gallery-page-wheel
) {
  color: var(--text);
  border-color: var(--floating-border);
  background: var(--floating-control);
}

body[data-visual-theme][data-color-scheme] :is(
  .template-sort-menu,
  .template-tag-menu,
  .config-switcher-menu,
  .thread-archive-menu,
  .gallery-page-popover,
  .folder-picker-popover,
  .inline-action-popover,
  .context-menu,
  .settings-popover,
  .favorites-popover,
  .resolution-sheet,
  .reference-menu-shell,
  .mask-modal-shell,
  .preview-shell,
  .template-detail,
  .template-editor,
  .template-editor-tag-dialog,
  .confirm-dialog,
  .local-state-gate-card
) :is(
  .muted,
  .status,
  small,
  .detail-label,
  .config-switcher-model,
  .template-tag-empty,
  .gallery-page-wheel-item
) {
  color: var(--floating-muted);
}

body[data-visual-theme][data-color-scheme] :is(
  .template-sort-option,
  .template-tag-category,
  .template-tag-option,
  .config-switcher-item,
  .thread-archive-item,
  .thread-archive-export,
  .folder-picker-item,
  .context-item
) {
  color: var(--text);
}

body[data-visual-theme][data-color-scheme] :is(
  .template-sort-option,
  .template-tag-category,
  .template-tag-option,
  .config-switcher-item,
  .thread-archive-item,
  .thread-archive-export,
  .folder-picker-item,
  .context-item
):hover,
body[data-visual-theme][data-color-scheme] :is(
  .template-sort-option,
  .template-tag-category,
  .template-tag-option,
  .config-switcher-item,
  .thread-archive-item,
  .thread-archive-export,
  .folder-picker-item,
  .context-item
):focus-visible {
  background: var(--floating-hover);
}

body[data-visual-theme][data-color-scheme] :is(
  .template-sort-option,
  .template-tag-category,
  .template-tag-option,
  .config-switcher-item,
  .thread-archive-item,
  .folder-picker-item
).is-active,
body[data-visual-theme][data-color-scheme] .favorite-folder-tab.is-active {
  border-color: var(--floating-border);
  color: var(--text);
  background: var(--floating-active);
}

body[data-visual-theme][data-color-scheme] :is(
  .template-tag-menu-header,
  .template-tag-menu-actions,
  .template-tag-categories
) {
  border-color: var(--floating-border);
}

body[data-visual-theme][data-color-scheme] .favorites-popover :is(
  .favorite-folder-tab,
  .favorite-folder-add
) {
  border-color: var(--floating-border);
  background: var(--floating-control);
}

body[data-visual-theme][data-color-scheme] .favorites-popover :is(
  .favorite-folder-tab,
  .favorite-folder-add
):hover,
body[data-visual-theme][data-color-scheme] .settings-popover .settings-nav-button:hover {
  background: var(--floating-hover);
}

body[data-visual-theme][data-color-scheme] .favorites-popover .favorite-folder-tab.is-active,
body[data-visual-theme][data-color-scheme] .settings-popover .settings-nav-button.is-active {
  border-color: var(--floating-border);
  color: var(--text);
  background: var(--floating-active);
}

/* 分辨率弹层包含多组互相关联的参数，选中项使用实色和勾选标记避免误读。 */
body[data-visual-theme][data-color-scheme] .resolution-sheet .chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-weight: 700;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

body[data-visual-theme][data-color-scheme] .resolution-sheet .chip-button:not(.active-chip):hover,
body[data-visual-theme][data-color-scheme] .resolution-sheet .chip-button:not(.active-chip):focus-visible {
  border-color: rgba(var(--primary-rgb), 0.52);
  background: var(--floating-hover);
}

body[data-visual-theme][data-color-scheme] .resolution-sheet .chip-button.active-chip {
  border-color: rgba(var(--primary-strong-rgb), 0.72);
  color: #fff;
  background: var(--action-gradient);
  box-shadow:
    0 0 0 2px var(--floating-surface-base),
    0 0 0 4px rgba(var(--primary-rgb), 0.28),
    0 10px 24px rgba(var(--primary-strong-rgb), 0.24);
  transform: translateY(-1px);
}

body[data-visual-theme][data-color-scheme] .resolution-sheet .chip-button.active-chip::before {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  content: "✓";
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

body[data-visual-theme][data-color-scheme] .resolution-sheet .chip-button.active-chip:hover,
body[data-visual-theme][data-color-scheme] .resolution-sheet .chip-button.active-chip:focus-visible {
  border-color: rgba(var(--primary-strong-rgb), 0.9);
  background: var(--action-gradient);
  filter: none;
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  body[data-visual-theme="liquid-glass"] {
    --panel: rgba(242, 250, 255, 0.7);
    --panel-strong: rgba(248, 252, 255, 0.82);
  }

  body[data-visual-theme="liquid-glass"][data-color-scheme="night"] {
    --panel: rgba(16, 34, 55, 0.68);
    --panel-strong: rgba(17, 31, 50, 0.78);
  }
}

/* 系统强制配色优先保障滚动条可辨认和可操作，不强行保留主题渐变。 */
@media (forced-colors: active) {
  * {
    scrollbar-width: auto;
    scrollbar-color: ButtonText Canvas;
  }

  *::-webkit-scrollbar {
    width: auto;
    height: auto;
  }

  *::-webkit-scrollbar-track {
    background: Canvas;
  }

  *::-webkit-scrollbar-thumb,
  *::-webkit-scrollbar-thumb:hover {
    border-color: Canvas;
    background: ButtonText;
    box-shadow: none;
  }
}

@media (max-width: 1100px) {
  .settings-grid,
  .settings-shell,
  .split-panel,
  .compact-grid,
  .grid,
  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .settings-shell {
    min-height: auto;
  }

  .settings-sidebar {
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
  }

  .settings-sidebar-main {
    display: flex;
    min-width: max-content;
  }

  .settings-nav-button {
    white-space: nowrap;
  }

  .settings-about-button {
    margin-top: 0;
    min-width: max-content;
  }

  .settings-content {
    max-height: min(620px, calc(100vh - 220px));
  }

  .data-action-card {
    align-items: stretch;
    flex-direction: column;
  }

  .data-action-buttons {
    justify-content: flex-start;
  }

  .session-export-controls {
    width: 100%;
  }

  .cloud-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .gallery-sidebar {
    position: static;
    max-height: none;
  }

  .preview-shell {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .preview-stage {
    min-height: 380px;
  }

  .preview-sidebar {
    min-height: auto;
    overflow: visible;
  }

  .preview-sidebar-top {
    min-height: auto;
    flex: 0 0 auto;
  }

  .preview-sidebar-top > .stack {
    height: auto;
  }

  .preview-prompt-box {
    min-height: 96px;
    max-height: min(28vh, 240px);
    flex: 0 0 auto;
  }
}

@media (max-width: 720px) {
  .fullscreen-image-toolbar {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    gap: 4px;
    padding: 4px;
    border-radius: 13px;
  }

  .fullscreen-image-toolbar .icon-button {
    min-width: 36px;
    min-height: 36px;
    font-size: 20px;
  }

  .fullscreen-image-scale {
    width: 42px;
    font-size: 11px;
  }

  .fullscreen-image-hint {
    bottom: max(10px, env(safe-area-inset-bottom));
    font-size: 11px;
  }

  .shell {
    padding: 12px;
  }

  .composer-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .config-switcher,
  .config-switcher-button {
    width: 100%;
    max-width: 100%;
  }

  .config-switcher-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

  .settings-inline {
    grid-template-columns: repeat(auto-fill, minmax(68px, max-content));
    gap: 4px;
  }

  .session-export-controls {
    grid-template-columns: 1fr;
  }

  .session-export-controls .button {
    width: 100%;
  }

  .resolution-sheet,
  .preview-overlay {
    padding: 14px;
  }

  .preview-details-grid {
    gap: 6px;
  }

  .gallery-card-compact {
    grid-template-columns: 88px minmax(0, 1fr);
    min-height: 88px;
  }

  .compact-preview-button,
  .compact-preview-fallback {
    width: 88px;
    min-height: 88px;
  }

  .compact-preview-image {
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 720px) {
  .shell::before,
  .shell::after {
    display: none;
  }

  body::before {
    background-size: 52px 52px, 104px 104px;
    opacity: 0.34;
  }

  body[data-theme="day"]::before {
    opacity: 0.44;
  }

  .composer-panel::after,
  .asset-panel::after {
    width: 150px;
    opacity: 0.34;
  }

  body[data-theme="day"] .composer-panel::after,
  body[data-theme="day"] .asset-panel::after {
    opacity: 0.42;
  }

  body[data-visual-theme="aurora"][data-color-scheme]::before {
    background-size: auto, auto, auto, auto, auto, auto, auto, 97px 83px, 151px 131px;
    opacity: 0.58;
  }

  body[data-visual-theme="aurora"][data-color-scheme]::after {
    opacity: 0.62;
  }

  body[data-visual-theme="aurora"] .composer-panel::after,
  body[data-visual-theme="aurora"] .asset-panel::after {
    width: 142px;
    opacity: 0.28;
  }

  body[data-visual-theme="aurora"][data-decoration="subtle"]::before {
    opacity: 0.25;
  }

  body[data-visual-theme="aurora"][data-decoration="subtle"]::after {
    opacity: 0.34;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-visual-theme="liquid-glass"]::before,
  body::after,
  .shell::before,
  .shell::after,
  .brand-logo {
    animation: none;
    will-change: auto;
  }

  .generation-submit-button:hover::after,
  .generation-submit-button:focus-visible::after,
  .dropzone:hover::after,
  .dropzone:focus::after,
  .dropzone:focus-within::after {
    animation: none;
    opacity: 0;
  }

  body[data-visual-theme="aurora"] .gallery-card-compact::before,
  body[data-visual-theme="aurora"] .gallery-card-compact:hover::before,
  body[data-visual-theme="aurora"] .gallery-card-compact:focus-within::before {
    transition: none;
    transform: none;
  }
}
