:root {
  color-scheme: dark;
  --bg: #0e1014;
  --panel: #191c22;
  --panel-soft: #20242c;
  --text: #f3f7fb;
  --muted: #8e98a8;
  --line: #2b303a;
  --accent: #11d8ef;
  --danger: #ff6b6b;
  --shadow: rgba(0, 0, 0, 0.28);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f7;
  --panel: #ffffff;
  --panel-soft: #f6f8fb;
  --text: #17202b;
  --muted: #66778a;
  --line: #d5e0eb;
  --accent: #2563eb;
  --danger: #c2410c;
  --shadow: rgba(23, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.loginScreen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 88%, #000 12%);
}

.loginScreen[hidden] {
  display: none;
}

.loginCard {
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--panel);
  box-shadow: 0 24px 80px var(--shadow);
  display: grid;
  gap: 14px;
}

.loginLogo {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
}

.loginCard h1 {
  margin: 0;
}

.loginCard p {
  margin: 0;
  color: var(--muted);
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 96px;
  padding: 24px 14px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, #000 12%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  z-index: 10;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 12px 30px var(--shadow);
}

.sideNav {
  display: grid;
  gap: 14px;
  width: 100%;
}

.navButton {
  padding: 10px 6px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.navButton:hover,
.navButton.active {
  background: var(--panel-soft);
  color: var(--text);
}

.app {
  width: min(1240px, calc(100vw - 160px));
  margin: 0 auto;
  transform: translateX(48px);
  padding: 28px 24px 48px;
  display: grid;
  gap: 24px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 24px;
}

.hero {
  min-height: 156px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 32px;
  box-shadow: 0 18px 45px var(--shadow);
}

.topActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.userPill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 700;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.hero h1,
.sectionHeader h2,
.settingsPanel h2 {
  margin: 0;
  line-height: 1.25;
}

.hero h1 {
  font-size: 34px;
}

.hero p,
.sectionHeader p,
.settingsPanel p,
#historyMeta {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.adminForm {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr 150px auto;
  gap: 10px;
}

.passwordForm {
  width: min(560px, 100%);
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.passwordForm button {
  justify-self: start;
}

.statsGrid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.adminConfigPanel {
  margin-top: 22px;
}

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

.settingsForm button {
  justify-self: start;
}

.adminTools {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.statCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}

.statCard span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.statCard strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.userTable {
  margin-top: 18px;
  overflow-x: auto;
}

.userTable table {
  width: 100%;
  border-collapse: collapse;
}

.userTable th,
.userTable td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
}

.userTable th {
  color: var(--muted);
  font-size: 13px;
}

.userTable td:last-child {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.userTable td:last-child button {
  padding: 8px 10px;
}

.adminContentGrid {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.adminContentBlock {
  min-width: 0;
}

.compactHeader h2 {
  font-size: 20px;
}

.adminMiniGallery {
  margin-top: 12px;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.adminContentCard {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
}

.adminContentCard img {
  width: 96px;
  height: 96px;
  object-fit: cover;
}

.adminContentBody {
  min-width: 0;
  padding: 10px;
}

.adminContentBody p {
  margin: 6px 0 8px;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.adminContentBody a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.miniPagination {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.miniPagination button {
  padding: 8px 10px;
}

.miniPagination button:disabled {
  opacity: 0.5;
  cursor: default;
}

.composer,
.resultPanel,
.library,
.settingsPanel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
  box-shadow: 0 18px 45px var(--shadow);
}

.composerBox {
  display: grid;
  gap: 14px;
}

.composerBox textarea {
  min-height: 150px;
  resize: vertical;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
  color: var(--text);
}

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

button,
.uploadButton {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  background: var(--accent);
  color: #061114;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.secondaryButton {
  background: var(--panel-soft);
  color: var(--text);
}

.dangerButton {
  background: color-mix(in srgb, var(--danger) 20%, var(--panel-soft));
  color: var(--danger);
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--accent);
  line-height: 1.5;
}

.uploadButton {
  position: relative;
  display: inline-grid;
  place-items: center;
  white-space: nowrap;
}

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

.composerTools {
  display: grid;
  grid-template-columns: auto 170px auto;
  gap: 10px;
  align-items: center;
}

.uploadPreview {
  min-height: 112px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  color: var(--muted);
  background: var(--panel-soft);
}

.uploadThumb {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.uploadThumb span {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  z-index: 1;
}

.uploadThumb img,
.workImage img,
.referenceStrip img {
  display: block;
  width: 100%;
  object-fit: cover;
}

.uploadThumb img {
  aspect-ratio: 1 / 1;
}

.uploadControls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 7px;
}

.uploadControls button {
  min-width: 0;
  padding: 5px 4px;
  background: var(--panel-soft);
  color: var(--text);
  font-size: 12px;
}

.sectionHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.sectionHeader a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.preview {
  margin-top: 18px;
  min-height: 420px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--panel-soft);
  text-align: center;
  overflow: hidden;
}

.preview img {
  display: block;
  max-width: 100%;
  max-height: 720px;
  object-fit: contain;
}

.previewGrid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  padding: 16px;
}

.jobBoard {
  align-items: stretch;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 16px;
  text-align: left;
}

.resultGallery {
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
  text-align: left;
}

.jobCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.jobTitle {
  color: var(--text);
  font-weight: 800;
}

.jobStatus {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.jobImages {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.resultWorkCard .workBody {
  min-height: 72px;
}

.loadingCard {
  min-height: 260px;
  display: grid;
  place-items: center;
}

.loadingSlot {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.loadingSlot span {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loadingSlot p {
  margin: 0;
}

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

.resultItem {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.resultItem img {
  width: 100%;
  max-height: 360px;
  border-radius: 8px;
  background: var(--panel);
}

.resultItem a,
.workActions a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.historyActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.searchInput {
  width: 260px;
  padding: 10px 12px;
}

.gallery {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  color: var(--muted);
}

.workCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel-soft);
}

.workImage {
  position: relative;
  display: block;
  margin: 0;
}

.workImage img {
  aspect-ratio: 4 / 3;
}


.batchHeader {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.batchHeader strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batchDownload {
  flex-shrink: 0;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}
.upscalePair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 180px;
  background: var(--panel);
}

.upscalePair img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.upscalePair img + img {
  border-left: 1px solid var(--line);
}

.upscalePlaceholder {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-left: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel-soft);
  font-weight: 800;
}

.historyCheckbox {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 18px;
  height: 18px;
  z-index: 1;
}

.workBody {
  padding: 12px;
}

.workMeta {
  color: var(--muted);
  font-size: 13px;
}

.referenceStrip {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.referenceStrip div {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.referenceStrip img {
  aspect-ratio: 1 / 1;
}

.referenceStrip span {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
}

.workBody p {
  margin: 10px 0 12px;
  color: var(--text);
  line-height: 1.5;
}

.workActions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.previewButton {
  padding: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
}

.materialButton {
  padding: 6px 10px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
}

.materialButton.active {
  background: color-mix(in srgb, var(--accent) 18%, var(--panel));
  color: var(--accent);
}

.materialBadge {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: default;
}

.modalOpen {
  overflow: hidden;
}

.imageModal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 8, 14, 0.78);
}

.imageModal[hidden] {
  display: none;
}

.imageModalPanel {
  width: min(1120px, 100%);
  max-height: calc(100vh - 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

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

.imageModalToolbar strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imageModalActions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.imageModalActions a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.imageModalActions button {
  padding: 8px 12px;
}

.imageModal img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 112px);
  margin: auto;
  object-fit: contain;
  background: var(--panel-soft);
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 16px;
  }

  .sideNav {
    display: flex;
    overflow-x: auto;
  }

  .app {
    width: calc(100% - 32px);
    margin: 0 auto;
    transform: none;
    padding: 16px 0 32px;
  }

  .hero,
  .sectionHeader,
  .composerTools {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

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

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

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

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

  .settingsForm button {
    width: 100%;
  }

  .passwordForm button {
    width: 100%;
  }

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

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

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

  .searchInput,
  .historyActions {
    width: 100%;
  }
}

.historyTabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.historyTab {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
}

.historyTab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}


/* Visual polish v4: clean sunny theme */
:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #1b1b1b;
  --panel-soft: #262626;
  --text: #f7f7f3;
  --muted: #b8b8ad;
  --line: #3a3a36;
  --accent: #ffd12f;
  --accent-2: #ffffff;
  --danger: #ff7466;
  --shadow: rgba(0, 0, 0, 0.34);
  --ring: rgba(255, 209, 47, 0.34);
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --panel-soft: #f3f3ee;
  --text: #202018;
  --muted: #6f6f65;
  --line: #deded4;
  --accent: #ffcf2f;
  --accent-2: #ffffff;
  --danger: #c85245;
  --shadow: rgba(40, 40, 32, 0.1);
  --ring: rgba(255, 207, 47, 0.28);
}

body {
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

.loginScreen {
  background: var(--bg);
}

.loginCard,
.hero,
.composer,
.resultPanel,
.library,
.settingsPanel,
.imageModalPanel {
  border-color: var(--line);
  background: var(--panel);
  box-shadow: 0 18px 44px var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.loginCard,
.hero,
.composer,
.resultPanel,
.library,
.settingsPanel {
  border-radius: 8px;
}

.sidebar {
  width: 108px;
  padding: 22px 12px;
  background: #0f0f0f;
  border-right-color: var(--line);
  box-shadow: 10px 0 28px var(--shadow);
}

body[data-theme="light"] .sidebar {
  background: #ffffff;
}

.logo,
.loginLogo {
  border: 2px solid var(--accent);
  box-shadow: 0 12px 26px var(--shadow);
}

.logo {
  width: 46px;
  height: 46px;
}

.sideNav {
  gap: 10px;
}

.navButton {
  position: relative;
  min-height: 42px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.navButton:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, var(--panel) 82%);
}

.navButton.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #22200f;
  box-shadow: inset 3px 0 0 #ffffff, 0 10px 22px color-mix(in srgb, var(--accent) 26%, transparent);
}

.navButton:not(.active) {
  border-color: var(--line);
  background: #0f0f0f;
  color: var(--muted);
}

body[data-theme="light"] .navButton:not(.active) {
  border-color: var(--line);
  background: #ffffff;
  color: #5f5b45;
}

.app {
  width: min(1280px, calc(100vw - 164px));
  gap: 22px;
}

.hero {
  min-height: 148px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 28px 0 28px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  pointer-events: none;
}

.eyebrow {
  color: color-mix(in srgb, var(--accent) 82%, var(--text) 18%);
  letter-spacing: 0;
}

body[data-theme="light"] .eyebrow {
  color: #7a6400;
}

.hero h1 {
  font-size: 32px;
  max-width: 780px;
}

.hero p,
.sectionHeader p,
.settingsPanel p,
#historyMeta {
  color: var(--muted);
}

.userPill,
.statCard,
.batchHeader,
.materialBadge {
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

input,
textarea,
select {
  border-color: var(--line);
  background: var(--panel-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

body[data-theme="light"] input,
body[data-theme="light"] textarea,
body[data-theme="light"] select,
body[data-theme="light"] .uploadPreview,
body[data-theme="light"] .preview {
  background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

button,
.uploadButton {
  border: 1px solid color-mix(in srgb, var(--accent) 82%, #fff 18%);
  color: #22200f;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover,
.uploadButton:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px color-mix(in srgb, var(--accent) 28%, transparent);
}

.secondaryButton,
.materialButton,
.uploadControls button {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--text);
  box-shadow: none;
}

body[data-theme="light"] .secondaryButton,
body[data-theme="light"] .materialButton,
body[data-theme="light"] .uploadControls button {
  background: #ffffff;
  color: var(--text);
}

.dangerButton {
  border-color: color-mix(in srgb, var(--danger) 54%, var(--line) 46%);
  background: color-mix(in srgb, var(--danger) 14%, var(--panel-soft) 86%);
  color: var(--danger);
  box-shadow: none;
}

.message {
  color: color-mix(in srgb, var(--accent) 72%, var(--text) 28%);
}

body[data-theme="light"] .message {
  color: #806500;
}

.uploadPreview,
.preview {
  border-color: color-mix(in srgb, var(--line) 70%, var(--accent) 30%);
  background: var(--panel-soft);
}

.uploadPreview {
  min-height: 124px;
}

.uploadThumb,
.workCard,
.jobCard,
.adminContentCard {
  border-color: var(--line);
  background: var(--panel-soft);
  box-shadow: 0 12px 32px rgba(40, 40, 32, 0.1);
  transition: transform 170ms ease, box-shadow 170ms ease, border-color 170ms ease;
}

body[data-theme="light"] .uploadThumb,
body[data-theme="light"] .workCard,
body[data-theme="light"] .jobCard,
body[data-theme="light"] .adminContentCard {
  background: #ffffff;
}

.workCard:hover,
.uploadThumb:hover,
.jobCard:hover,
.adminContentCard:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 18px 42px var(--shadow);
}

.workImage img,
.upscalePair img,
.referenceStrip img,
.preview img,
.resultItem img {
  background: var(--panel-soft);
}

.workBody {
  padding: 13px;
}

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

.workActions a,
.resultItem a,
.sectionHeader a,
.imageModalActions a,
.batchDownload,
.previewButton {
  color: color-mix(in srgb, var(--accent) 72%, var(--text) 28%);
}

body[data-theme="light"] .workActions a,
body[data-theme="light"] .resultItem a,
body[data-theme="light"] .sectionHeader a,
body[data-theme="light"] .imageModalActions a,
body[data-theme="light"] .batchDownload,
body[data-theme="light"] .previewButton {
  color: #735c00;
}

.previewButton:hover,
.workActions a:hover,
.resultItem a:hover,
.batchDownload:hover {
  color: var(--accent);
}

.historyTab {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--muted);
}

body[data-theme="light"] .historyTab {
  background: #ffffff;
}

.historyTab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #22200f;
  box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 24%, transparent);
}

.pagination span,
#resultPageInfo,
#pageInfo,
#materialPageInfo,
#adminWorksPageInfo {
  min-width: 92px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
}

.imageModal {
  background: rgba(16, 16, 16, 0.78);
  backdrop-filter: blur(8px);
}

.imageModalPanel {
  border-radius: 8px;
}

.imageModalToolbar {
  background: var(--panel);
}

.loadingSlot span {
  border-top-color: var(--accent);
}

@media (max-width: 900px) {
  .sidebar {
    width: auto;
    box-shadow: none;
  }

  .app {
    width: calc(100% - 28px);
  }

  .hero h1 {
    font-size: 26px;
  }
}
