/* ==========================================================================
   拼图 · 黑白描边极简样式
   首页（生成端）+ 查看页共用。白底、黑边、黑字，无渐变无玻璃。
   ========================================================================== */

:root {
  --paper: #ffffff;
  --ink: #111111;
  --muted: #6a6a6a;
  --soft: #f6f6f6;
  --soft-2: #ececec;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
  border: 0;
  background: none;
}

a {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #111;
  color: #fff;
}

/* ---------- 顶栏 ---------- */
.topbar {
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 24px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-mark svg {
  width: 34px;
  height: 34px;
  display: block;
  border-radius: 9px;
}

.brand-name {
  font-size: 17px;
}

.topbar-note {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ---------- 主容器 ---------- */
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px 30px;
}

.hero {
  text-align: center;
  padding: 40px 8px 28px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.04em;
  font-weight: 750;
}

.hero h1 em {
  font-style: normal;
  display: inline-block;
  padding: 0 8px;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  transform: translateY(-2px);
}

.hero p {
  margin: 0 auto;
  max-width: 540px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  text-wrap: balance;
}

/* ---------- 拖拽上传区 ---------- */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 52px 24px;
  border-radius: 20px;
  border: 2px dashed var(--ink);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.25s var(--ease);
}

.dropzone:hover {
  background: var(--soft);
}

.dropzone:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.25);
  outline-offset: 4px;
}

.dropzone.is-drag {
  border-style: solid;
  background: var(--soft-2);
  transform: scale(0.995);
}

.dz-icon {
  width: 62px;
  height: 62px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  transition: transform 0.3s var(--ease);
}

.dropzone:hover .dz-icon {
  transform: translateY(-2px);
}

.dz-icon svg {
  width: 30px;
  height: 30px;
}

.dz-title {
  margin: 9px 0 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.dz-sub {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
}

.dz-badge {
  margin-top: 12px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  font-size: 11.5px;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0.01em;
}

/* ---------- 面板 ---------- */
.panel {
  margin-top: 18px;
  padding: 20px;
  border-radius: 18px;
  border: 2px solid var(--ink);
  background: var(--paper);
  animation: rise 0.4s var(--ease) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  color: var(--muted);
}

.panel-title strong {
  color: var(--ink);
  font-size: 16px;
  letter-spacing: -0.01em;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.head-actions {
  display: flex;
  gap: 8px;
}

/* ---------- 缩略图 ---------- */
.queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid var(--ink);
  background: var(--soft);
  animation: pop 0.28s var(--ease) both;
  transition: transform 0.2s var(--ease), opacity 0.2s;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

.thumb.is-dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.thumb .idx {
  position: absolute;
  top: 6px;
  left: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
}

.thumb .remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.2s, transform 0.2s var(--ease), background 0.2s, color 0.2s;
}

.thumb .remove:hover {
  background: var(--ink);
  color: #fff;
}

.thumb .remove svg {
  width: 12px;
  height: 12px;
}

.thumb .move {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  padding: 6px;
  opacity: 0;
  transition: opacity 0.22s;
}

.thumb .move button {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
  transition: transform 0.15s, background 0.2s;
}

.thumb .move button:hover {
  background: var(--soft-2);
}

.thumb .move button:active {
  transform: scale(0.9);
}

.thumb .move button:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.thumb .move svg {
  width: 14px;
  height: 14px;
}

.thumb:hover .remove,
.thumb:hover .move,
.thumb:focus-within .remove,
.thumb:focus-within .move {
  opacity: 1;
  transform: none;
}

@media (hover: none), (max-width: 640px) {
  .thumb .remove,
  .thumb .move {
    opacity: 1;
    transform: none;
  }
}

.queue-hint {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 标题输入 ---------- */
.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.title-label {
  flex: none;
  font-size: 13px;
  color: var(--muted);
}

.title-input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: box-shadow 0.18s;
}

.title-input::placeholder {
  color: #9a9a9a;
}

.title-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

.title-input:disabled {
  opacity: 0.5;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  background: #fff;
  transition: background 0.18s, color 0.18s, transform 0.16s var(--ease);
}

.btn > svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.btn:hover {
  background: var(--soft);
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.25);
  outline-offset: 3px;
}

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

.btn.primary:hover {
  background: #2b2b2b;
}

.btn.ghost {
  color: var(--ink);
  background: #fff;
}

.btn.tiny {
  padding: 7px 12px;
  border-radius: 8px;
  border-width: 1.5px;
  font-size: 12.5px;
}

.btn.danger-ghost {
  color: #b3261e;
  border-color: #b3261e;
  background: #fff;
}

.btn.danger-ghost:hover {
  color: #fff;
  background: #b3261e;
}

.btn.big {
  padding: 14px 26px;
  border-radius: 12px;
  font-size: 15.5px;
}

.btn.wide {
  width: 100%;
}

.btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

#uploadBtn {
  min-width: 190px;
}

/* ---------- 上传进度 ---------- */
.upload-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}

.btn.is-loading .spinner {
  display: block;
}

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

.progress {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: #fff;
  overflow: hidden;
}

.progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
  transition: width 0.25s var(--ease);
}

.progress.is-indeterminate span {
  width: 34% !important;
  animation: indeterminate 1.15s var(--ease) infinite;
}

@keyframes indeterminate {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(330%);
  }
}

/* ---------- 结果 ---------- */
.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ok-badge {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--ink);
  animation: pop 0.35s var(--ease) both;
}

.ok-badge svg {
  width: 20px;
  height: 20px;
}

.result-title {
  flex: 1;
  min-width: 0;
}

.result-title h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.result-title p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.result-title .result-subtitle {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  word-break: break-word;
}

.result-body {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.result-preview-wrap {
  position: relative;
}

.result-preview {
  border-radius: 12px;
  overflow: auto;
  max-height: 440px;
  border: 1.5px solid var(--ink);
  background: #fff;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.result-preview img {
  width: 100%;
  height: auto;
}

.preview-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
  color: #fff;
  background: var(--ink);
  pointer-events: none;
  animation: rise 0.4s var(--ease) both;
}

.result-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qr-card {
  padding: 14px;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  text-align: center;
  background: #fff;
}

.qr-card img {
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 0 auto;
  border-radius: 4px;
}

.qr-card p {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
}

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

.result-url {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--muted);
  word-break: break-all;
}

/* ---------- 特性 ---------- */
.features {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.feature {
  padding: 18px;
  border-radius: 14px;
  border: 1.5px solid var(--ink);
  background: #fff;
}

.feature-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 9px;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
}

.feature-icon svg {
  width: 20px;
  height: 20px;
}

.feature h3 {
  margin: 0 0 4px;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 页脚 ---------- */
.foot {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 24px calc(26px + env(safe-area-inset-bottom));
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------- 轻提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: #fff;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.35s var(--ease);
}

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

.toast.error {
  background: #b3261e;
}

/* ==========================================================================
   查看页：纯图片铺满 + 底部白底黑边分享按钮
   ========================================================================== */

.viewer-page {
  background: var(--paper);
}

.viewer-main {
  width: 100%;
}

.shot-holder {
  position: relative;
  width: 100%;
  min-height: 180px;
}

.shot {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
}

.shot.is-in {
  opacity: 1;
}

.shot-skeleton {
  padding: 0;
}

.shot-skeleton .shimmer {
  display: block;
  width: 100%;
  height: 72vh;
  background: linear-gradient(
    100deg,
    #ededed 20%,
    #f7f7f7 38%,
    #ededed 56%
  );
  background-size: 220% 100%;
  animation: shimmer 1.35s linear infinite;
}

@keyframes shimmer {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -120% 0;
  }
}

.shot-skeleton p {
  margin: 14px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.viewer-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 28px 18px calc(46px + env(safe-area-inset-bottom));
}

.viewer-title {
  margin: 0;
  max-width: 680px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  word-break: break-word;
  color: var(--ink);
}

.share-btn {
  width: 100%;
  max-width: 360px;
  padding: 15px 24px;
  border-radius: 10px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  box-shadow: none;
}

.share-btn:hover {
  background: var(--soft);
}

.share-btn svg {
  width: 18px;
  height: 18px;
}

.empty-state {
  min-height: 100vh;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--paper);
}

.empty-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
  border-radius: 16px;
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
}

.empty-icon svg {
  width: 28px;
  height: 28px;
}

.empty-state h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.empty-state p {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 分享面板 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s var(--ease), visibility 0.24s;
}

.sheet-mask.is-open {
  opacity: 1;
  visibility: visible;
}

.sheet {
  width: 100%;
  max-width: 480px;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  border: 2px solid var(--ink);
  border-bottom: 0;
  background: #fff;
  transform: translateY(106%);
  transition: transform 0.4s cubic-bezier(0.22, 1.1, 0.36, 1);
}

.sheet-mask.is-open .sheet {
  transform: none;
}

.sheet:focus {
  outline: none;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 4px auto 14px;
  border-radius: 99px;
  background: #d4d4d4;
}

.sheet-title {
  margin: 0;
  font-size: 17px;
  text-align: center;
  letter-spacing: -0.01em;
}

.sheet-sub {
  margin: 5px 0 16px;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sheet-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: #fff;
  text-align: left;
  transition: background 0.18s, transform 0.16s var(--ease);
}

.sheet-action:hover {
  background: var(--soft);
}

.sheet-action:active {
  transform: scale(0.99);
}

.sheet-icon {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 9px;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  color: var(--ink);
  background: #fff;
}

.sheet-icon svg {
  width: 20px;
  height: 20px;
}

.sheet-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sheet-text strong {
  font-size: 14.5px;
  font-weight: 650;
}

.sheet-text small {
  font-size: 12px;
  color: var(--muted);
}

.sheet-chevron {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--ink);
}

#sheetClose {
  margin-top: 12px;
}

/* ==========================================================================
   响应式
   ========================================================================== */

@media (min-width: 760px) {
  .features {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .result-body {
    grid-template-columns: minmax(0, 1fr) 268px;
    align-items: start;
  }

  .result-preview {
    max-height: 500px;
  }
}

@media (min-width: 720px) {
  .sheet-mask {
    align-items: center;
  }

  .sheet {
    padding: 16px 18px 18px;
    border-radius: 18px;
    border-bottom: 2px solid var(--ink);
    transform: translateY(18px) scale(0.97);
    opacity: 0;
    transition: transform 0.32s var(--ease), opacity 0.24s;
  }

  .sheet-mask.is-open .sheet {
    transform: none;
    opacity: 1;
  }

  .sheet-handle {
    display: none;
  }

  .sheet-title {
    margin-top: 4px;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding: 18px 18px 4px;
  }

  .topbar-note {
    display: none;
  }

  .page {
    padding: 0 18px 22px;
  }

  .hero {
    padding: 30px 2px 24px;
  }

  .hero h1 {
    font-size: clamp(26px, 8.2vw, 33px);
  }

  .hero p {
    font-size: 13.5px;
  }

  .dropzone {
    padding: 42px 18px;
    border-radius: 16px;
  }

  .dz-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
  }

  .dz-title {
    font-size: 16.5px;
  }

  .dz-sub {
    font-size: 12.5px;
  }

  .panel {
    padding: 16px;
    border-radius: 16px;
  }

  .panel-title strong {
    font-size: 15px;
  }

  .queue-grid {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    gap: 8px;
  }

  .upload-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .title-input {
    font-size: 16px;
  }

  #uploadBtn {
    width: 100%;
  }

  .result-preview {
    max-height: 360px;
  }

  .viewer-actions {
    padding: 22px 16px calc(38px + env(safe-area-inset-bottom));
  }

  .share-btn {
    max-width: none;
  }

  .foot {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   后台管理（黑白拟态）
   ========================================================================== */

.admin-page {
  --neo-bg: #e9e9e9;
  --neo-shadow: 8px 8px 18px rgba(0, 0, 0, 0.13), -8px -8px 18px rgba(255, 255, 255, 0.95);
  --neo-shadow-sm: 4px 4px 10px rgba(0, 0, 0, 0.12), -4px -4px 10px rgba(255, 255, 255, 0.95);
  --neo-inset: inset 5px 5px 12px rgba(0, 0, 0, 0.12), inset -5px -5px 12px rgba(255, 255, 255, 0.95);
  --neo-inset-sm: inset 3px 3px 7px rgba(0, 0, 0, 0.1), inset -3px -3px 7px rgba(255, 255, 255, 0.9);
  background: var(--neo-bg);
  color: #111;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- 侧栏 ---------- */
.admin-side {
  position: sticky;
  top: 0;
  width: 234px;
  height: calc(100vh - 36px);
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 26px 18px;
  margin: 18px 0 18px 18px;
  border-radius: 24px;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  color: #111;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-brand-mark {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: #111;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.25);
}

.admin-brand-mark svg {
  width: 19px;
  height: 19px;
  display: block;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #555;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background 0.25s var(--ease), color 0.25s, box-shadow 0.25s, transform 0.2s;
}

.admin-nav button svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.admin-nav button:hover {
  color: #111;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow-sm);
  transform: translateY(-1px);
}

.admin-nav button:active {
  box-shadow: var(--neo-inset-sm);
  transform: translateY(1px);
}

.admin-nav button.is-active {
  background: #111;
  color: #fff;
  box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.28), -2px -2px 6px rgba(255, 255, 255, 0.55);
}

.admin-logout {
  margin-top: auto;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow-sm);
  color: #555;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: color 0.2s, box-shadow 0.25s, transform 0.2s;
}

.admin-logout:hover {
  color: #111;
}

.admin-logout:active {
  box-shadow: var(--neo-inset-sm);
  transform: translateY(1px);
}

/* ---------- 内容区 ---------- */
.admin-content {
  flex: 1;
  min-width: 0;
  padding: 34px 36px 80px;
}

.admin-view {
  max-width: 1000px;
}

.admin-view.view-in {
  animation: viewIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.admin-head h1 {
  margin: 0 0 4px;
  font-size: 28px;
  letter-spacing: -0.035em;
}

.admin-head p {
  margin: 0 0 24px;
  font-size: 13px;
  color: #666;
}

/* ---------- 登录 ---------- */
.admin-login {
  min-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  width: min(860px, 100%);
  border-radius: 30px;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow);
  overflow: hidden;
  animation: viewIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 42px 34px;
  background: #111;
  color: #fff;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  top: -70px;
  right: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 62%);
}

.login-logo svg {
  width: 44px;
  height: 44px;
  display: block;
}

.login-brand h1 {
  margin: 6px 0 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.login-brand p {
  margin: 0;
  font-size: 13px;
  color: #a8a8a8;
}

.login-note {
  margin-top: 26px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: #6a6a6a;
}

.login-form {
  padding: 46px 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-form h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.login-form > p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #666;
}

.login-btn {
  margin-top: 6px;
  height: 48px;
  border-radius: 12px;
}

body.is-guest .admin-side {
  display: none;
}

body.is-guest .admin-content {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

/* ---------- 表单控件 ---------- */
.admin-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--neo-bg);
  box-shadow: var(--neo-inset);
  color: #111;
  font-size: 15px;
  outline: none;
  transition: box-shadow 0.25s;
}

.admin-input + .admin-input {
  margin-top: 12px;
}

.admin-input::placeholder {
  color: #8a8a8a;
}

.admin-input:focus {
  box-shadow: var(--neo-inset), 0 0 0 2px rgba(0, 0, 0, 0.14) inset;
}

.admin-hint {
  min-height: 18px;
  margin: 6px 0 0;
  font-size: 12.5px;
  color: #b3261e;
}

/* ---------- 通用按钮（后台内覆盖） ---------- */
.admin-page .btn {
  border: 0;
  border-radius: 11px;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow-sm);
  color: #333;
  transition: transform 0.2s var(--ease), box-shadow 0.25s, background 0.2s, color 0.2s;
}

.admin-page .btn:hover {
  background: var(--neo-bg);
  color: #111;
  transform: translateY(-1px);
}

.admin-page .btn:active {
  transform: translateY(1px);
  box-shadow: var(--neo-inset-sm);
}

.admin-page .btn.primary {
  background: #111;
  color: #fff;
  box-shadow: 5px 5px 12px rgba(0, 0, 0, 0.24), -3px -3px 8px rgba(255, 255, 255, 0.7);
}

.admin-page .btn.primary:hover {
  background: #1e1e1e;
  color: #fff;
  transform: translateY(-1px);
}

.admin-page .btn.primary:active {
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.45);
  transform: translateY(1px);
}

.admin-page .btn:disabled {
  opacity: 0.45;
}

/* ---------- 概览 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border-radius: 18px;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow);
  transition: transform 0.28s var(--ease), box-shadow 0.28s;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.stat-card span {
  font-size: 12px;
  color: #666;
}

.stat-card strong {
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.admin-panel {
  padding: 22px;
  border-radius: 22px;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow);
  margin-bottom: 20px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-panel-head h2 {
  margin: 0;
  font-size: 16px;
}

.admin-panel h2 {
  margin: 0 0 14px;
  font-size: 16px;
}

.admin-muted {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: #666;
}

.admin-muted code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--neo-bg);
  box-shadow: var(--neo-inset-sm);
  font-size: 12px;
}

/* 最近上传 */
.admin-recent {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  color: #111;
  transition: background 0.2s, box-shadow 0.25s, transform 0.2s;
}

.recent-row:hover {
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow-sm);
  transform: translateY(-1px);
}

.recent-row img {
  width: 42px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #ddd;
  box-shadow: var(--neo-inset-sm);
  flex: none;
}

.recent-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.recent-info strong {
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-info span {
  font-size: 12px;
  color: #666;
}

.recent-arrow {
  flex: none;
  font-size: 16px;
  color: #777;
}

/* ---------- 链接管理 ---------- */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-toolbar .admin-input {
  flex: 1;
  height: 46px;
  font-size: 14px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.admin-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--neo-shadow);
}

.admin-thumb {
  flex: none;
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  background: #ddd;
  box-shadow: var(--neo-inset-sm);
}

.admin-info {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.admin-info h3 {
  margin: 0 0 5px;
  font-size: 15px;
  word-break: break-all;
}

.admin-info p {
  margin: 0 0 3px;
  font-size: 12px;
  color: #666;
  word-break: break-all;
}

.admin-link a {
  color: #111;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 280px;
}

.admin-ops button {
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow-sm);
  font-size: 12px;
  font-weight: 600;
  color: #333;
  transition: transform 0.18s, box-shadow 0.22s, color 0.18s;
}

.admin-ops button:hover {
  color: #111;
  transform: translateY(-1px);
}

.admin-ops button:active {
  transform: translateY(1px);
  box-shadow: var(--neo-inset-sm);
}

.admin-ops button.danger {
  color: #b3261e;
}

.admin-ops button:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  font-size: 12.5px;
  color: #666;
}

.admin-empty {
  padding: 36px 0;
  text-align: center;
  font-size: 13px;
  color: #777;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.38);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s var(--ease), visibility 0.24s;
}

.modal-mask.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  padding: 24px;
  border-radius: 22px;
  background: var(--neo-bg);
  box-shadow: 10px 10px 34px rgba(0, 0, 0, 0.24), -8px -8px 26px rgba(255, 255, 255, 0.85);
  transform: translateY(14px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-mask.is-open .modal-card {
  transform: none;
}

.modal-card h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.modal-sub {
  margin: 0 0 16px;
  font-size: 12px;
  color: #666;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.modal-actions .btn {
  flex: 1;
}

.qr-modal {
  max-width: 380px;
  text-align: center;
}

.qr-modal img {
  width: 240px;
  height: 240px;
  margin: 4px auto 12px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--neo-inset-sm);
}

.qr-link {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #666;
  word-break: break-all;
}

/* ---------- 分片管理 ---------- */
.admin-page .sheet {
  border: 0;
  background: var(--neo-bg);
  box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.22);
}

.admin-parts-sheet {
  max-width: 660px;
}

.admin-parts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  max-height: 46vh;
  overflow: auto;
  padding: 6px;
  margin-top: 14px;
  transition: opacity 0.2s;
}

.admin-parts.is-busy {
  opacity: 0.45;
  pointer-events: none;
}

.admin-part {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--neo-bg);
  box-shadow: var(--neo-shadow-sm);
  cursor: grab;
  transition: transform 0.22s var(--ease), box-shadow 0.22s, opacity 0.2s;
}

.admin-part:hover {
  transform: translateY(-2px);
}

.admin-part:active {
  cursor: grabbing;
}

.admin-part img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.admin-part.is-dragging {
  opacity: 0.4;
  transform: scale(0.94);
}

.admin-part.is-over {
  box-shadow: 0 0 0 3px #111, 0 0 0 7px rgba(255, 255, 255, 0.55);
}

.admin-part-no {
  position: absolute;
  left: 7px;
  top: 7px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #111;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.3);
}

.admin-part .part-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.22);
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.admin-part .part-del:hover {
  background: #111;
  color: #fff;
  transform: scale(1.05);
}

.part-move {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.part-move button {
  width: 28px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.95);
  color: #111;
  font-size: 13px;
  line-height: 1;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.18);
  transition: background 0.18s, color 0.18s, transform 0.18s;
}

.part-move button:hover {
  background: #111;
  color: #fff;
}

.part-move button:active {
  transform: scale(0.92);
}

.part-move button:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.admin-parts-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.admin-parts-actions .btn {
  flex: 1;
  min-width: 0;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
  font-size: 13.5px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .admin-shell {
    flex-direction: column;
  }

  .admin-side {
    position: sticky;
    top: 0;
    z-index: 30;
    width: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 10px 12px 0;
    padding: 10px 12px;
    border-radius: 18px;
  }

  .admin-brand {
    margin-right: auto;
  }

  .admin-logout {
    margin: 0;
    padding: 8px 12px;
  }

  .admin-nav {
    order: 3;
    width: 100%;
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
  }

  .admin-nav button {
    width: auto;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }

  .admin-nav button svg {
    display: none;
  }

  .admin-content {
    padding: 18px 14px 60px;
  }

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

  .stat-card {
    padding: 16px;
  }

  .stat-card strong {
    font-size: 23px;
  }

  .admin-head h1 {
    font-size: 24px;
  }

  .admin-item {
    flex-wrap: wrap;
  }

  .admin-thumb {
    width: 58px;
    height: 78px;
  }

  .admin-ops {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }

  .admin-parts {
    grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
    max-height: 40vh;
  }

  .login-card {
    grid-template-columns: 1fr;
    border-radius: 26px;
  }

  .login-brand {
    padding: 28px 24px;
    justify-content: flex-start;
  }

  .login-brand::before {
    top: -90px;
  }

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

  .login-note {
    display: none;
  }

  .login-form {
    padding: 28px 24px 32px;
  }
}

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