:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #686868;
  --line: #dedbd4;
  --panel: #ffffff;
  --soft: #f6f6f1;
  --accent: #ff6b4a;
  --green: #1f9d68;
  --gold: #e4ae2d;
  --blue: #2877d9;
  --violet: #7257d8;
  --shadow: 0 22px 70px rgba(22, 22, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.055) 1px, transparent 1px),
    repeating-linear-gradient(135deg, rgba(255, 107, 74, 0.08) 0 10px, transparent 10px 26px),
    repeating-linear-gradient(45deg, rgba(40, 119, 217, 0.06) 0 8px, transparent 8px 30px),
    var(--soft);
  background-size: 36px 36px, 36px 36px, 100% 100%, 100% 100%, auto;
  overflow-x: hidden;
}

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
}

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

.brand-logo {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand strong {
  font-size: 18px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions,
.button-row,
.section-title,
.metrics {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  min-width: 66px;
  padding: 8px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
  background: var(--green);
  border-radius: 999px;
}

.icon-button {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  gap: 22px;
  align-items: stretch;
  margin-top: 44px;
}

.intro-panel,
.upload-panel,
.admin-shell,
.login-shell {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.intro-panel {
  position: relative;
  display: flex;
  min-height: 500px;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  padding: 36px;
  isolation: isolate;
}

.accent-strip {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 12px;
  background:
    linear-gradient(90deg, var(--accent) 0 28%, var(--gold) 28% 46%, var(--green) 46% 66%, var(--blue) 66% 84%, var(--violet) 84%);
  background-size: 180% 100%;
  animation: colorRail 5s linear infinite;
}

.kinetic-grid {
  position: absolute;
  inset: 12px 0 0;
  opacity: 0.65;
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: perspective(550px) rotateX(58deg) translateY(90px);
  transform-origin: bottom;
  animation: gridDrive 7s linear infinite;
}

.scan-beam {
  position: absolute;
  inset: 12px auto 0 0;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 74, 0.22), transparent);
  mix-blend-mode: multiply;
  animation: scanMove 4.5s ease-in-out infinite;
}

.signal-stack {
  position: absolute;
  top: 36px;
  right: 28px;
  display: grid;
  gap: 8px;
  width: 128px;
}

.signal-stack span {
  display: block;
  height: 8px;
  transform-origin: left;
  background: var(--ink);
  border-radius: 999px;
  animation: pulseBar 1.6s ease-in-out infinite;
}

.signal-stack span:nth-child(2) {
  width: 72%;
  background: var(--accent);
  animation-delay: 0.18s;
}

.signal-stack span:nth-child(3) {
  width: 86%;
  background: var(--blue);
  animation-delay: 0.36s;
}

.signal-stack span:nth-child(4) {
  width: 58%;
  background: var(--green);
  animation-delay: 0.54s;
}

.ticker-rail {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  gap: 10px;
  width: max-content;
  margin-top: 22px;
  animation: tickerSlide 8s linear infinite alternate;
}

.ticker-rail span {
  padding: 8px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: var(--ink);
  border-radius: 6px;
}

.ticker-rail span:nth-child(2) {
  background: var(--green);
}

.ticker-rail span:nth-child(3) {
  background: var(--blue);
}

.ticker-rail span:nth-child(4) {
  background: var(--accent);
}

.eyebrow {
  position: relative;
  z-index: 3;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 8px 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  overflow-wrap: anywhere;
  background: var(--ink);
  border-radius: 6px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.intro-panel h1,
.intro-panel > p:not(.eyebrow),
.metrics,
.ticker-rail {
  position: relative;
  z-index: 3;
}

.intro-panel h1 {
  max-width: 680px;
  margin-bottom: 16px;
  font-size: clamp(44px, 6vw, 80px);
  line-height: 0.96;
  letter-spacing: 0;
}

.intro-panel > p:not(.eyebrow) {
  max-width: 580px;
  margin-bottom: 24px;
  color: #414141;
  font-size: 18px;
  line-height: 1.7;
}

.metrics {
  flex-wrap: wrap;
}

.metrics span {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  background: #f1f0eb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics b {
  color: var(--ink);
}

.upload-panel {
  position: relative;
  display: flex;
  min-height: 500px;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  overflow: hidden;
}

.upload-panel::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -20%;
  width: 80%;
  height: 80%;
  background: repeating-linear-gradient(135deg, rgba(40, 119, 217, 0.14) 0 10px, transparent 10px 22px);
  transform: rotate(12deg);
  animation: stripeDrift 8s linear infinite;
  pointer-events: none;
}

.dropzone {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 34px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 107, 74, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(31, 157, 104, 0.12), transparent 42%),
    #fff;
  border: 2px dashed #bdb6a9;
  border-radius: 8px;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.dropzone.dragging,
.drag-active .dropzone {
  border-color: var(--accent);
  transform: translateY(-2px) scale(1.01);
  box-shadow: inset 0 0 0 8px rgba(255, 107, 74, 0.1), 0 20px 60px rgba(255, 107, 74, 0.18);
}

.drop-frame {
  position: absolute;
  inset: 14px;
  pointer-events: none;
}

.drop-frame span {
  position: absolute;
  width: 42px;
  height: 42px;
  border-color: var(--ink);
}

.drop-frame span:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 4px solid;
  border-left: 4px solid;
}

.drop-frame span:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 4px solid;
  border-right: 4px solid;
}

.drop-frame span:nth-child(3) {
  right: 0;
  bottom: 0;
  border-right: 4px solid;
  border-bottom: 4px solid;
}

.drop-frame span:nth-child(4) {
  bottom: 0;
  left: 0;
  border-bottom: 4px solid;
  border-left: 4px solid;
}

.drop-icon {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  color: #fff;
  background: var(--ink);
  border-radius: 8px;
  animation: iconFloat 2.4s ease-in-out infinite;
}

.drop-icon svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dropzone h2 {
  margin-bottom: 0;
  font-size: 30px;
}

.dropzone p,
.message {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.primary-button,
.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 850;
}

.primary-button {
  color: #fff;
  background: var(--ink);
}

.ghost-button {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.danger-button {
  color: #fff;
  background: #c9342c;
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.uploading .drop-icon {
  animation: iconSpin 0.9s linear infinite;
}

.result-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.result-panel img {
  width: 132px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  background: #ece9e2;
}

.result-content {
  min-width: 0;
}

.result-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

code {
  display: block;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 10px;
  overflow: auto;
  color: #111;
  background: #f3f2ed;
  border-radius: 6px;
}

footer {
  margin-top: 26px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.drag-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(23, 23, 23, 0.78);
  backdrop-filter: blur(6px);
}

.drag-screen[hidden],
[hidden] {
  display: none !important;
}

.drag-screen div {
  display: grid;
  width: min(520px, calc(100% - 40px));
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: #fff;
  text-align: center;
  border: 2px dashed rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 12px, transparent 12px 24px);
}

.drag-screen strong {
  font-size: 34px;
}

.drag-screen span {
  color: rgba(255, 255, 255, 0.75);
}

.simple {
  background: #f7f7f4;
}

.simple .page {
  display: grid;
  min-height: 100vh;
  align-content: center;
  padding: 18px 0;
}

.simple .rich-panel,
.simple .brand small,
.simple footer,
.simple .status-pill {
  display: none;
}

.simple .topbar {
  width: min(760px, 100%);
  margin: 0 auto;
}

.simple .workspace {
  display: block;
  width: min(760px, 100%);
  margin: 24px auto 0;
}

.simple .upload-panel {
  min-height: min(72vh, 620px);
  padding: 14px;
  box-shadow: none;
}

.simple .upload-panel::before {
  display: none;
}

.simple .dropzone {
  min-height: min(66vh, 540px);
  padding: 28px 18px;
  background: #fff;
  border-width: 3px;
}

.simple .drop-icon {
  width: 72px;
  height: 72px;
  animation: none;
}

.simple .dropzone h2 {
  font-size: 24px;
}

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

.simple .result-panel img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

/* Admin */
.admin-page {
  background:
    linear-gradient(90deg, rgba(23, 23, 23, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(23, 23, 23, 0.045) 1px, transparent 1px),
    #f4f4ef;
  background-size: 28px 28px;
}

.admin-layout {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 36px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 40px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.admin-side {
  display: flex;
  flex-direction: column;
  padding: 20px;
  color: #fff;
  background: var(--ink);
}

.admin-side .brand small {
  color: rgba(255, 255, 255, 0.62);
}

.admin-side .brand strong {
  color: #fff;
}

.admin-nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.admin-nav button {
  min-height: 48px;
  color: rgba(255, 255, 255, 0.72);
  text-align: left;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 850;
}

.admin-nav button.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(255, 107, 74, 0.42), rgba(255, 255, 255, 0.1));
  border-color: rgba(255, 255, 255, 0.3);
}

.admin-side-note {
  margin-top: auto;
  padding: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.admin-main {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 24px;
  overflow: auto;
}

.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-toolbar h1 {
  margin-bottom: 6px;
  font-size: 34px;
}

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

.admin-kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 6px 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: var(--ink);
  border-radius: 6px;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-panel h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 4px;
}

.panel-heading h2,
.panel-heading p,
.config-section h3,
.config-section p {
  margin: 0;
}

.panel-heading p,
.inline-help {
  color: var(--muted);
  line-height: 1.6;
}

.config-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fbfbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.config-section h3 {
  font-size: 16px;
}

.inline-help {
  font-size: 13px;
}

.login-shell {
  display: grid;
  width: min(420px, calc(100% - 28px));
  margin: 8vh auto;
  gap: 16px;
  padding: 20px;
}

.login-shell h1 {
  margin-bottom: 0;
}

.login-form,
.settings-form,
.admin-upload {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: #333;
  font-size: 13px;
  font-weight: 850;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--ink);
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #9a9a94;
  font-weight: 650;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.18);
}

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

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

.user-create-grid {
  grid-template-columns: minmax(130px, 1fr) minmax(180px, 1.2fr) minmax(140px, 1fr) minmax(96px, 0.7fr) auto;
  align-items: end;
}

.switch-line {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.switch-line input {
  width: 22px;
  min-height: 22px;
}

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

.segmented label {
  display: grid;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 44px;
  place-items: center;
  color: var(--muted);
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.segmented input:checked + span {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.admin-upload-zone {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: #fbfbf8;
  border: 2px dashed #c9c3b8;
  border-radius: 8px;
}

.admin-upload-zone.dragging,
.admin-upload-zone:hover {
  border-color: var(--accent);
}

.admin-images {
  display: grid;
  gap: 10px;
}

.image-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.image-card img {
  display: block;
  width: 96px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #ece9e2;
  border-radius: 6px;
}

.image-card strong,
.image-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-card small {
  margin-top: 4px;
  color: var(--muted);
}

.message {
  min-height: 20px;
}

.compact {
  min-height: 36px;
  padding-inline: 12px;
  font-size: 13px;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-switch button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 850;
}

.mode-switch button.active {
  color: #fff;
  background: var(--ink);
}

.admin-storage-inline,
.batch-copy,
.captcha-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-storage-inline {
  position: relative;
  z-index: 2;
  justify-content: space-between;
  padding: 10px 12px;
  background: #fbfbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-storage-inline > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.segmented.mini {
  width: 220px;
}

.segmented.mini span {
  min-height: 34px;
}

.queue-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue-list {
  display: grid;
  gap: 8px;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #fbfbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.queue-item strong,
.queue-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-item small {
  margin-top: 3px;
  color: var(--muted);
}

.queue-item.done {
  border-color: rgba(31, 157, 104, 0.45);
}

.queue-item.failed {
  border-color: rgba(201, 52, 44, 0.55);
}

.icon-button.small {
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: 900;
}

.batch-results {
  display: block;
}

.batch-results textarea,
.batch-copy select {
  width: 100%;
}

.batch-results textarea {
  min-height: 132px;
  color: var(--ink);
  background: #f7f7f4;
}

.mode-classic {
  background:
    linear-gradient(90deg, rgba(40, 119, 217, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(31, 157, 104, 0.08) 1px, transparent 1px),
    #f6f7f4;
  background-size: 44px 44px;
}

.mode-classic .workspace {
  grid-template-columns: 1fr;
  width: min(880px, 100%);
  margin: 34px auto 0;
}

.mode-classic .intro-panel {
  min-height: auto;
  padding: 26px;
}

.mode-classic .kinetic-grid,
.mode-classic .scan-beam,
.mode-classic .signal-stack,
.mode-classic .ticker-rail {
  display: none;
}

.mode-classic .intro-panel h1 {
  max-width: 760px;
  font-size: 36px;
  line-height: 1.15;
}

.mode-classic .intro-panel > p:not(.eyebrow) {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: 16px;
}

.mode-classic .upload-panel {
  min-height: auto;
}

.mode-classic .dropzone {
  min-height: 360px;
}

.captcha-row {
  align-items: end;
}

.captcha-box {
  min-height: 42px;
  justify-content: space-between;
  padding: 8px 10px;
  background: #f7f7f4;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.captcha-box strong {
  font-size: 18px;
}

.users-table {
  display: grid;
  gap: 10px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.25fr) minmax(92px, 0.55fr) minmax(90px, 0.65fr) minmax(150px, 1fr) 86px auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #fbfbf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-row small {
  color: var(--muted);
  font-weight: 800;
}

.mini-switch {
  min-height: 42px;
  padding: 8px 10px;
}

.album-grid,
.album-panel {
  display: grid;
  gap: 18px;
}

.album-day {
  display: grid;
  gap: 10px;
}

.album-day-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.album-day-head h3 {
  margin: 0;
  font-size: 19px;
}

.album-day-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.photo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
}

.empty-album {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 26px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(40, 119, 217, 0.06), transparent 38%),
    linear-gradient(315deg, rgba(31, 157, 104, 0.07), transparent 38%),
    var(--field);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.empty-album strong {
  color: var(--ink);
  font-size: 18px;
}

.empty-album p {
  margin: 0;
}

.photo-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #ece9e2;
  border: 0;
  border-radius: 8px;
  cursor: zoom-in;
  isolation: isolate;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.32s ease,
    filter 0.32s ease;
}

.photo-tile:hover img {
  transform: scale(1.08);
  filter: saturate(1.08);
}

.photo-meta,
.tile-delete {
  position: absolute;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.photo-meta {
  right: 6px;
  bottom: 6px;
  left: 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.tile-delete {
  top: 6px;
  right: 6px;
  min-height: 30px;
  padding-inline: 10px;
}

.photo-tile:hover .photo-meta,
.photo-tile:hover .tile-delete {
  opacity: 1;
}

.viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(6, 8, 11, 0.92);
}

.viewer[hidden] {
  display: none !important;
}

.viewer img {
  max-width: 88vw;
  max-height: 82vh;
  user-select: none;
  cursor: grab;
  transform-origin: center;
  will-change: transform;
}

.viewer img:active {
  cursor: grabbing;
}

.viewer-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.viewer-controls {
  position: fixed;
  right: 50%;
  bottom: 22px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(180px, 320px) auto;
  gap: 10px;
  align-items: center;
  width: min(560px, calc(100% - 30px));
  padding: 10px;
  transform: translateX(50%);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  backdrop-filter: blur(14px);
}

.viewer-controls .ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.dashboard-page {
  background:
    linear-gradient(90deg, rgba(40, 119, 217, 0.07) 1px, transparent 1px),
    linear-gradient(rgba(255, 107, 74, 0.07) 1px, transparent 1px),
    #f5f6f2;
  background-size: 34px 34px;
}

.dashboard-shell {
  width: min(1280px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 36px;
}

.dashboard-topbar {
  margin-bottom: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.85fr) minmax(280px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.dashboard-upload {
  align-self: stretch;
}

.dashboard-dropzone {
  min-height: 320px;
}

.profile-panel {
  align-self: start;
}

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

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f2f4f0;
  --muted: #aab0a7;
  --line: #343a34;
  --panel: #151915;
  --soft: #0e110f;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    #0e110f;
}

:root[data-theme="dark"] .intro-panel,
:root[data-theme="dark"] .upload-panel,
:root[data-theme="dark"] .admin-shell,
:root[data-theme="dark"] .login-shell,
:root[data-theme="dark"] .admin-panel,
:root[data-theme="dark"] .queue-panel,
:root[data-theme="dark"] .result-panel,
:root[data-theme="dark"] .image-card,
:root[data-theme="dark"] .mode-switch {
  background: rgba(21, 25, 21, 0.94);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] code,
:root[data-theme="dark"] .dropzone,
:root[data-theme="dark"] .config-section,
:root[data-theme="dark"] .switch-line,
:root[data-theme="dark"] .segmented span,
:root[data-theme="dark"] .queue-item,
:root[data-theme="dark"] .user-row,
:root[data-theme="dark"] .captcha-box,
:root[data-theme="dark"] .admin-storage-inline {
  color: var(--ink);
  background: #101410;
  border-color: var(--line);
}

:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .icon-button {
  color: var(--ink);
  background: #151915;
  border-color: var(--line);
}

:root[data-theme="dark"] .intro-panel > p:not(.eyebrow) {
  color: #c0c7bd;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #f2f4f0;
    --muted: #aab0a7;
    --line: #343a34;
    --panel: #151915;
    --soft: #0e110f;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  }

  :root:not([data-theme="light"]) body {
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
      linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
      #0e110f;
  }

  :root:not([data-theme="light"]) .intro-panel,
  :root:not([data-theme="light"]) .upload-panel,
  :root:not([data-theme="light"]) .admin-shell,
  :root:not([data-theme="light"]) .login-shell,
  :root:not([data-theme="light"]) .admin-panel,
  :root:not([data-theme="light"]) .queue-panel,
  :root:not([data-theme="light"]) .result-panel,
  :root:not([data-theme="light"]) .image-card,
  :root:not([data-theme="light"]) .mode-switch {
    background: rgba(21, 25, 21, 0.94);
  }

  :root:not([data-theme="light"]) input,
  :root:not([data-theme="light"]) textarea,
  :root:not([data-theme="light"]) select,
  :root:not([data-theme="light"]) code,
  :root:not([data-theme="light"]) .dropzone,
  :root:not([data-theme="light"]) .config-section,
  :root:not([data-theme="light"]) .switch-line,
  :root:not([data-theme="light"]) .segmented span,
  :root:not([data-theme="light"]) .queue-item,
  :root:not([data-theme="light"]) .user-row,
  :root:not([data-theme="light"]) .captcha-box,
  :root:not([data-theme="light"]) .admin-storage-inline {
    color: var(--ink);
    background: #101410;
    border-color: var(--line);
  }

  :root:not([data-theme="light"]) .ghost-button,
  :root:not([data-theme="light"]) .icon-button {
    color: var(--ink);
    background: #151915;
    border-color: var(--line);
  }
}

@keyframes colorRail {
  to {
    background-position: 180% 0;
  }
}

@keyframes gridDrive {
  to {
    background-position: 0 56px;
  }
}

@keyframes scanMove {
  0%,
  100% {
    transform: translateX(-40%);
  }
  50% {
    transform: translateX(440%);
  }
}

@keyframes pulseBar {
  0%,
  100% {
    transform: scaleX(0.64);
    opacity: 0.48;
  }
  50% {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes tickerSlide {
  to {
    transform: translateX(-42px);
  }
}

@keyframes stripeDrift {
  to {
    transform: rotate(12deg) translate(80px, 80px);
  }
}

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

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

@media (max-width: 900px) {
  .page {
    width: min(100% - 20px, 760px);
    padding-top: 14px;
  }

  .workspace {
    grid-template-columns: 1fr;
    margin-top: 26px;
  }

  .intro-panel {
    min-height: 380px;
    padding: 28px 22px;
  }

  .intro-panel h1 {
    font-size: 42px;
  }

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

  .result-panel img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-side {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .admin-toolbar,
  .topbar,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

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

  .user-create-grid,
  .user-row {
    grid-template-columns: 1fr 1fr;
  }

  .photo-wall {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  }
}

@media (max-width: 560px) {
  .brand-logo {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .status-pill {
    display: none;
  }

  .dropzone {
    min-height: 420px;
    padding: 22px 14px;
  }

  .button-row {
    width: 100%;
    flex-direction: column;
  }

  .button-row button {
    width: 100%;
  }

  .form-grid,
  .form-grid.three,
  .user-create-grid,
  .image-card {
    grid-template-columns: 1fr;
  }

  .mode-switch,
  .top-actions,
  .admin-storage-inline,
  .viewer-controls,
  .user-row {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .top-actions,
  .admin-storage-inline {
    align-items: stretch;
    flex-direction: column;
  }

  .mode-switch {
    display: grid;
  }

  .segmented.mini {
    width: 100%;
  }

  .viewer-controls {
    display: grid;
  }

  .image-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

/* Feedback pass */
:root {
  --field: #f7f7f4;
  --button-bg: #171717;
  --button-text: #ffffff;
  --page-bg:
    radial-gradient(circle at 12% 8%, rgba(255, 107, 74, 0.12), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(40, 119, 217, 0.12), transparent 26%),
    linear-gradient(180deg, #fbfbf8, #f2f4ef 58%, #eef2ee);
}

body,
.admin-page,
.dashboard-page,
.mode-classic {
  background: var(--page-bg);
  background-size: auto;
}

.primary-button,
.mode-switch button.active,
.segmented input:checked + span,
.drop-icon,
.eyebrow,
.admin-kicker {
  color: var(--button-text);
  background: var(--button-bg);
}

.top-actions {
  flex-wrap: wrap;
}

.top-compact-control {
  display: inline-grid;
  grid-template-columns: auto minmax(104px, auto);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 5px 4px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(10px);
}

.top-compact-control label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.top-compact-control select {
  min-height: 32px;
  padding: 4px 28px 4px 10px;
  font-weight: 850;
  background: var(--panel);
}

.capture-icon {
  display: none;
  position: relative;
  width: 108px;
  height: 82px;
  margin-bottom: 8px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(135deg, #161a17, #29352d);
  border: 1px solid rgba(22, 26, 23, 0.16);
  border-radius: 20px;
  box-shadow: 0 22px 46px rgba(20, 20, 20, 0.16);
}

.capture-icon::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
}

.capture-icon::after {
  content: "";
  position: absolute;
  top: 22px;
  left: 24px;
  width: 16px;
  height: 16px;
  background: #ff6b4a;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(255, 107, 74, 0.18);
}

.capture-icon span {
  position: absolute;
  right: 17px;
  bottom: 17px;
  width: 62px;
  height: 34px;
  background: linear-gradient(135deg, #1f9d68 0 38%, #2877d9 38% 68%, #f6c33d 68%);
  clip-path: polygon(0 100%, 30% 46%, 48% 70%, 68% 30%, 100% 100%);
}

.capture-icon i,
.capture-icon b {
  position: absolute;
  display: block;
  border-radius: 999px;
}

.capture-icon i {
  top: 8px;
  right: 14px;
  width: 44px;
  height: 6px;
  background: linear-gradient(90deg, #ff6b4a, #f6c33d, #1f9d68, #2877d9);
}

.capture-icon b {
  right: 13px;
  bottom: 11px;
  width: 32px;
  height: 6px;
  background: rgba(255, 255, 255, 0.72);
  transform: rotate(-28deg);
}

.capture-icon.small {
  width: 88px;
  height: 68px;
}

.capture-icon.small::before {
  inset: 10px;
}

.capture-icon.small::after {
  top: 18px;
  left: 20px;
  width: 13px;
  height: 13px;
}

.capture-icon.small span {
  right: 14px;
  bottom: 14px;
  width: 50px;
  height: 28px;
}

.capture-icon.small i {
  width: 36px;
}

.capture-icon.tiny {
  display: block;
  width: 70px;
  height: 54px;
  margin: 0;
  border-radius: 14px;
}

.capture-icon.tiny::before {
  inset: 8px;
  border-width: 2px;
  border-radius: 10px;
}

.capture-icon.tiny::after {
  top: 15px;
  left: 17px;
  width: 10px;
  height: 10px;
}

.capture-icon.tiny span {
  right: 10px;
  bottom: 10px;
  width: 42px;
  height: 23px;
}

.capture-icon.tiny i {
  top: 7px;
  right: 10px;
  width: 30px;
  height: 5px;
}

.capture-icon.tiny b {
  right: 9px;
  bottom: 8px;
  width: 24px;
  height: 5px;
}

.mode-classic .page {
  width: min(1320px, calc(100% - 40px));
}

.mode-classic .workspace {
  display: block;
  width: min(1060px, 100%);
  margin: 52px auto 0;
}

.mode-classic .rich-panel {
  display: none;
}

.mode-classic .upload-panel {
  min-height: 0;
  padding: 0;
  overflow: visible;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(40, 119, 217, 0.16);
  border-radius: 8px;
  box-shadow: 0 18px 55px rgba(32, 40, 50, 0.1);
}

.mode-classic .upload-panel::before,
.mode-classic .drop-frame,
.mode-classic .drop-icon {
  display: none;
}

.mode-classic .capture-icon {
  display: block;
}

.dashboard-dropzone .capture-icon {
  display: block;
}

.dashboard-dropzone .drop-icon {
  display: none;
}

.mode-classic .dropzone {
  min-height: 330px;
  padding: 56px 28px 46px;
  background: #fff;
  border: 2px dashed #d5e4ef;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(213, 228, 239, 0.38);
}

.mode-classic .dropzone h2 {
  font-size: 24px;
}

.mode-classic .dropzone p::after {
  content: "  ·  Ctrl+V / Command+V 可直接粘贴上传";
  color: var(--blue);
}

.mode-classic .queue-panel,
.mode-classic .batch-results {
  margin: 12px;
}

.queue-item {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.single-copy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.single-copy .ghost-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.result-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.single-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.single-result strong,
.single-result small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.single-result small {
  margin-top: 3px;
  color: var(--muted);
}

.batch-copy-mini,
.batch-copy {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-copy-mini select,
.batch-copy select {
  width: 128px;
  min-height: 34px;
}

.subtle-row {
  margin-top: 10px;
  justify-content: flex-end;
}

.dashboard-stack {
  display: grid;
  gap: 16px;
}

.dashboard-nav {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  margin: 0 0 16px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dashboard-nav button {
  min-height: 34px;
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 850;
}

.dashboard-nav button.active {
  color: var(--button-text);
  background: var(--button-bg);
}

.dashboard-page-panel {
  min-height: 420px;
}

.profile-panel {
  width: min(620px, 100%);
}

.brand-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.preview-logo {
  width: 64px;
  height: 64px;
}

.logo-upload-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

:root[data-theme="dark"] {
  --ink: #edf4ee;
  --muted: #aeb9b0;
  --line: #34423a;
  --panel: #131a15;
  --soft: #0c120f;
  --field: #111812;
  --button-bg: #e9f1e8;
  --button-text: #0f1511;
  --page-bg:
    radial-gradient(circle at 18% 8%, rgba(31, 157, 104, 0.14), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(40, 119, 217, 0.16), transparent 30%),
    linear-gradient(180deg, #0c120f, #101712 62%, #0b100d);
}

:root[data-theme="dark"] .intro-panel,
:root[data-theme="dark"] .upload-panel,
:root[data-theme="dark"] .admin-shell,
:root[data-theme="dark"] .login-shell,
:root[data-theme="dark"] .admin-panel,
:root[data-theme="dark"] .queue-panel,
:root[data-theme="dark"] .result-panel,
:root[data-theme="dark"] .image-card,
:root[data-theme="dark"] .mode-switch,
:root[data-theme="dark"] .top-compact-control,
:root[data-theme="dark"] .dashboard-nav {
  background: rgba(19, 26, 21, 0.96);
  border-color: var(--line);
}

:root[data-theme="dark"] .dropzone,
:root[data-theme="dark"] .config-section,
:root[data-theme="dark"] .switch-line,
:root[data-theme="dark"] .segmented span,
:root[data-theme="dark"] .queue-item,
:root[data-theme="dark"] .user-row,
:root[data-theme="dark"] .captcha-box,
:root[data-theme="dark"] .admin-storage-inline,
:root[data-theme="dark"] .single-result,
:root[data-theme="dark"] .brand-editor,
:root[data-theme="dark"] .empty-album,
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] code {
  color: var(--ink);
  background: var(--field);
  border-color: var(--line);
}

:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .icon-button {
  color: var(--ink);
  background: #121a15;
  border-color: var(--line);
}

:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .dashboard-nav button.active,
:root[data-theme="dark"] .segmented input:checked + span {
  color: var(--button-text);
  background: var(--button-bg);
}

:root[data-theme="dark"] .mode-classic .dropzone,
:root[data-theme="dark"] .mode-classic .upload-panel {
  background: rgba(19, 26, 21, 0.96);
}

:root[data-theme="dark"] .intro-panel > p:not(.eyebrow),
:root[data-theme="dark"] .dropzone p,
:root[data-theme="dark"] .message,
:root[data-theme="dark"] .inline-help {
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #edf4ee;
    --muted: #aeb9b0;
    --line: #34423a;
    --panel: #131a15;
    --soft: #0c120f;
    --field: #111812;
    --button-bg: #e9f1e8;
    --button-text: #0f1511;
    --page-bg:
      radial-gradient(circle at 18% 8%, rgba(31, 157, 104, 0.14), transparent 28%),
      radial-gradient(circle at 84% 18%, rgba(40, 119, 217, 0.16), transparent 30%),
      linear-gradient(180deg, #0c120f, #101712 62%, #0b100d);
  }

  :root:not([data-theme="light"]) .top-compact-control,
  :root:not([data-theme="light"]) .dashboard-nav,
  :root:not([data-theme="light"]) .single-result,
  :root:not([data-theme="light"]) .brand-editor,
  :root:not([data-theme="light"]) .empty-album {
    background: rgba(19, 26, 21, 0.96);
    border-color: var(--line);
  }

  :root:not([data-theme="light"]) .primary-button,
  :root:not([data-theme="light"]) .dashboard-nav button.active,
  :root:not([data-theme="light"]) .segmented input:checked + span {
    color: var(--button-text);
    background: var(--button-bg);
  }
}

@media (max-width: 900px) {
  .mode-classic .workspace {
    margin-top: 24px;
  }

  .dashboard-nav {
    width: 100%;
  }

  .dashboard-nav button {
    flex: 1;
  }

  .queue-item,
  .single-result {
    grid-template-columns: 1fr;
  }

  .single-copy {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .top-compact-control {
    grid-template-columns: 1fr;
    gap: 3px;
  }

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

  .batch-copy-mini,
  .batch-copy {
    width: 100%;
  }
}
