/* ============================================================
   拾光集 · PhotoWall — 后台样式（白色基调 · 双主题）
   ============================================================ */
:root {
  --accent: #e75480;
  --accent-2: #a78bfa;
  --accent-grad: linear-gradient(120deg, #f472b6, #a78bfa);
  --bg: #f6f7fb;
  --card: #ffffff;
  --card-2: #f2f3f8;
  --text: #1d2230;
  --text-2: #616b7d;
  --text-3: #98a1b3;
  --line: rgba(24, 30, 48, .09);
  --line-strong: rgba(24, 30, 48, .16);
  --shadow-s: 0 2px 8px rgba(24, 30, 48, .06);
  --shadow-m: 0 12px 32px rgba(24, 30, 48, .10);
  --radius: 16px;
  --radius-s: 11px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}
[data-theme="dark"] {
  --accent: #ff7aa2;
  --accent-2: #b7a6ff;
  --bg: #0f1117;
  --card: #171a23;
  --card-2: #1c202b;
  --text: #eef1f7;
  --text-2: #a4adbf;
  --text-3: #6f7889;
  --line: rgba(236, 240, 255, .10);
  --line-strong: rgba(236, 240, 255, .18);
  --shadow-s: 0 2px 8px rgba(0, 0, 0, .35);
  --shadow-m: 0 12px 32px rgba(0, 0, 0, .45);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
code { background: var(--card-2); padding: .12em .45em; border-radius: 6px; font-size: .9em; }
.muted { color: var(--text-2); }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: var(--accent-grad); color: #fff;
  font-weight: 600; font-size: 14px;
  box-shadow: 0 8px 20px rgba(231, 84, 128, .26);
  transition: transform .22s, box-shadow .22s, filter .22s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn.full { width: 100%; }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line-strong); box-shadow: none;
}
.btn.ghost:hover { background: var(--card-2); transform: none; }
.btn.danger {
  background: linear-gradient(120deg, #f43f5e, #e11d48);
  box-shadow: 0 8px 20px rgba(225, 29, 72, .25);
}
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: var(--card-2);
  border: 1px solid var(--line);
  transition: background .22s, color .22s, border-color .22s;
}
.icon-btn:hover {
  background: var(--card); color: var(--text);
  border-color: var(--line-strong);
}
#adminThemeToggle .ic-moon, #loginThemeToggle .ic-moon { display: none; }
[data-theme="dark"] #adminThemeToggle .ic-sun { display: none; }
[data-theme="dark"] #adminThemeToggle .ic-moon { display: block; }

.field {
  display: block; margin-bottom: 14px;
}
.field span {
  display: block; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
}
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px;
  border-radius: var(--radius-s);
  border: 1px solid var(--line);
  background: var(--card); color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ---------- 登录 ---------- */
.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 26px;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(244, 114, 182, .16), transparent 60%),
    radial-gradient(900px 420px at 92% 8%, rgba(167, 139, 250, .14), transparent 55%),
    var(--bg);
}
.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-m);
  padding: 32px 30px 24px;
}
.login-brand { display: flex; gap: 13px; align-items: center; margin-bottom: 24px; }
.login-brand h1 { margin: 0; font-size: 19px; }
.login-brand p { margin: 2px 0 0; font-size: 12.5px; }
.mark {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  background: var(--accent-grad); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 22px rgba(231, 84, 128, .3);
}
.mark.sm { width: 34px; height: 34px; border-radius: 10px; }
.login-error {
  margin: 0 0 12px; padding: 9px 12px;
  background: rgba(244, 63, 94, .1); color: #e11d48;
  border-radius: 10px; font-size: 13px;
}
.login-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px;
}
.link {
  font-size: 13px; color: var(--text-2);
  background: none; border: 0; cursor: pointer; padding: 0;
}
.link:hover { color: var(--accent); }
.hint {
  margin: 16px 0 0; padding: 11px 13px;
  background: rgba(245, 158, 11, .12); color: #b45309;
  border-radius: 11px; font-size: 12.5px; line-height: 1.6;
}
[data-theme="dark"] .hint { color: #fbbf24; }

/* ---------- 头部 ---------- */
.a-header {
  position: sticky; top: 0; z-index: 40;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.a-brand { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.a-actions { display: flex; align-items: center; gap: 8px; }
.a-actions .btn.ghost {
  gap: 6px; height: 38px; padding: 0 15px;
  border-radius: 999px; white-space: nowrap;
}
.a-actions .btn.ghost:hover { border-color: var(--line-strong); background: var(--card-2); }

/* ---------- 主体 ---------- */
.a-main {
  max-width: 1180px; margin: 0 auto;
  padding: 24px 22px 60px;
  display: flex; flex-direction: column; gap: 22px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-s);
}
.stat-card b { display: block; font-size: 24px; font-weight: 800; line-height: 1.25; }
.stat-card span { font-size: 12.5px; color: var(--text-2); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-s);
}
.panel-head { margin-bottom: 16px; }
.panel-head.row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.panel-head h2 { margin: 0 0 4px; font-size: 17px; }
.panel-head p { margin: 0; font-size: 12.5px; }
.manage-ops { display: flex; gap: 8px; }

/* ---------- 上传 ---------- */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 38px 20px;
  text-align: center;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .25s, background .25s, transform .25s;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--text);
  transform: translateY(-2px);
}
.dropzone p { margin: 8px 0 0; font-size: 14px; }
.dropzone .muted { font-size: 12.5px; }

.upload-queue { margin-top: 18px; }
.queue-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 12px; flex-wrap: wrap;
}
.queue-ops { display: flex; gap: 8px; }
.queue-batch {
  display: flex; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  background: var(--card-2); border-radius: var(--radius-s);
}
.queue-batch label {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
}
.queue-batch input {
  padding: 8px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 13px; outline: none; min-width: 160px;
}
.queue-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.queue-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow: hidden; background: var(--card-2);
}
.queue-item img {
  width: 100%; height: 118px; object-fit: cover;
  background: var(--card-2);
}
.queue-item .qi-body { padding: 9px 10px; }
.queue-item .qi-name {
  font-size: 12px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-item input {
  width: 100%; margin-top: 6px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); font-size: 12px; outline: none;
}
.queue-item .qi-rm {
  margin-top: 6px; font-size: 11.5px; color: #e11d48;
}

.progress-wrap {
  margin-top: 14px;
  display: flex; align-items: center; gap: 12px;
}
.progress-bar {
  flex: 1; height: 9px; border-radius: 999px;
  background: var(--card-2); overflow: hidden;
}
.progress-bar i {
  display: block; height: 100%; width: 0;
  background: var(--accent-grad);
  border-radius: 999px;
  transition: width .3s var(--ease, ease);
}

/* ---------- 管理 ---------- */
.manage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.manage-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--card-2);
  position: relative;
  transition: transform .25s, box-shadow .25s;
}
.manage-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.manage-item.selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.manage-item .mi-check {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 20px; height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
}
.manage-item img {
  width: 100%; height: 132px; object-fit: cover;
  cursor: pointer;
}
.mi-body { padding: 10px 11px 12px; }
.mi-body b {
  display: block; font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mi-body span { font-size: 11.5px; color: var(--text-3); }
.mi-ops {
  display: flex; gap: 6px; margin-top: 9px;
}
.mi-ops button {
  flex: 1; padding: 6px 0;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--line);
  background: var(--card); color: var(--text-2);
  transition: all .2s;
}
.mi-ops button:hover { color: var(--text); border-color: var(--line-strong); }
.mi-ops button.del:hover { color: #e11d48; border-color: rgba(225, 29, 72, .4); }

.empty {
  padding: 40px 10px; text-align: center;
  color: var(--text-3); font-size: 13.5px;
}

/* ---------- 设置 ---------- */
.settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 6px 18px;
  align-items: end;
}
.settings-form .btn { margin-bottom: 14px; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12, 14, 22, .55);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 22px;
  box-shadow: var(--shadow-m);
  animation: popIn .28s ease;
}
.modal-card h3 { margin: 0 0 14px; font-size: 16px; }
.edit-preview {
  width: 100%; height: 170px; object-fit: cover;
  border-radius: 11px; margin-bottom: 14px;
  background: var(--card-2);
}
.modal-ops {
  display: flex; justify-content: flex-end; gap: 9px; margin-top: 6px;
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px;
  transform: translateX(-50%);
  z-index: 120;
  padding: 11px 20px;
  background: var(--text); color: var(--bg);
  border-radius: 999px;
  font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-m);
  animation: toastIn .3s ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .a-main { padding: 16px 14px 50px; }
  .panel { padding: 16px; }
  .login-card { padding: 24px 20px 18px; }
  .a-header { padding: 0 14px; }
  .queue-list { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .manage-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text-3) 38%, transparent);
  border-radius: 999px; border: 2.5px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-track { background: transparent; }
