/* ============================================================
   图床 Image Host - Modern dark glass theme
   ============================================================ */
:root {
  --bg: #0b0b12;
  --bg-2: #12121d;
  --card: rgba(255, 255, 255, 0.055);
  --card-strong: rgba(255, 255, 255, 0.085);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9e9f2;
  --text-dim: #9b9bb0;
  --text-faint: #6b6b80;
  --accent: #7c8cff;
  --accent-2: #a855f7;
  --accent-3: #4ade80;
  --danger: #f87171;
  --warn: #fbbf24;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
  --mono: 'SF Mono', 'Cascadia Code', Consolas, 'Courier New', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 85% -10%, rgba(168, 85, 247, 0.16), transparent 60%),
    radial-gradient(1000px 600px at -10% 20%, rgba(124, 140, 255, 0.14), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(74, 222, 128, 0.07), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.55;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

.container {
  width: min(1180px, 100% - 40px);
  margin: 0 auto;
}

::selection { background: rgba(124, 140, 255, 0.35); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(124, 140, 255, 0.28);
}
.btn.primary:hover { box-shadow: 0 10px 30px rgba(124, 140, 255, 0.42); transform: translateY(-1px); }
.btn.ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.11); border-color: var(--border-strong); }
.btn.ghost.danger:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.5); background: rgba(248, 113, 113, 0.08); }
.btn.small { padding: 7px 14px; font-size: 0.82rem; border-radius: 8px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: var(--border-strong); }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 18, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 62px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.logo svg { filter: drop-shadow(0 4px 12px rgba(124, 140, 255, 0.35)); }
.topnav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.topnav a {
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.topnav a.active { color: #fff; background: rgba(124, 140, 255, 0.14); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-badge {
  padding: 5px 14px;
  background: rgba(124, 140, 255, 0.12);
  border: 1px solid rgba(124, 140, 255, 0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b7c1ff;
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 34px;
  text-align: center;
}
.hero-title {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.hero-title span {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 14px;
  color: var(--text-dim);
  font-size: 1.02rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.stat {
  min-width: 130px;
  padding: 14px 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
.stat-num {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.78rem; color: var(--text-faint); margin-top: 2px; }

/* ---------- Dropzone ---------- */
.dropzone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: 20px;
  padding: 46px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  background: var(--card);
  margin-bottom: 22px;
  overflow: hidden;
}
.dropzone:hover { border-color: rgba(124, 140, 255, 0.65); background: rgba(124, 140, 255, 0.06); }
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(124, 140, 255, 0.12);
  box-shadow: inset 0 0 0 3px rgba(124, 140, 255, 0.15), 0 0 40px rgba(124, 140, 255, 0.15);
  transform: scale(1.005);
}
.dropzone.login-hint { cursor: default; }
.dropzone.login-hint:hover { border-color: var(--border-strong); background: var(--card); }
.dropzone-icon {
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  color: var(--accent);
  background: rgba(124, 140, 255, 0.12);
  border: 1px solid rgba(124, 140, 255, 0.2);
  animation: float 3.5s ease-in-out infinite;
}
.dropzone-icon.muted { color: var(--text-faint); background: rgba(255,255,255,0.04); border-color: var(--border); animation: none; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.dropzone-text { font-size: 1.08rem; font-weight: 500; }
.dropzone-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.dropzone-hint { margin-top: 8px; color: var(--text-faint); font-size: 0.82rem; }

/* Upload queue */
.dropzone-queue {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  text-align: left;
}
.dropzone-queue.visible { display: flex; }
.queue-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  animation: slideIn 0.25s ease both;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.queue-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.queue-info { flex: 1; min-width: 0; }
.queue-name {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-track {
  margin-top: 6px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.queue-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}
.queue-status {
  font-size: 0.76rem;
  color: var(--text-faint);
  flex-shrink: 0;
  min-width: 64px;
  text-align: right;
}
.queue-item.done .queue-fill { background: var(--accent-3); width: 100% !important; }
.queue-item.done .queue-status { color: var(--accent-3); }
.queue-item.error .queue-fill { background: var(--danger); }
.queue-item.error .queue-status { color: var(--danger); }

/* ---------- Result ---------- */
.result {
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 26px;
  animation: slideIn 0.3s ease both;
}
.result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.result-head h2 {
  font-size: 1.2rem;
  background: linear-gradient(120deg, #4ade80, #7c8cff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.result-sub { color: var(--text-faint); font-size: 0.82rem; margin-top: 2px; }
.result-buttons { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 4px; }
.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
}
.result-row img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.result-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.76rem;
  outline: none;
}
.result-row .btn { padding: 7px 12px; font-size: 0.76rem; }

/* ---------- Gallery ---------- */
.gallery { padding: 10px 0 40px; scroll-margin-top: 80px; }
.gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.gallery-head h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.gallery-count { color: var(--text-faint); font-size: 0.83rem; margin-top: 2px; }
.gallery-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-faint);
  transition: border-color 0.2s ease;
}
.search-wrap:focus-within { border-color: var(--accent); }
.search-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 0.86rem;
  font-family: var(--font);
  width: 170px;
}
.search-wrap input::placeholder { color: var(--text-faint); }
.select {
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.84rem;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
}
.select:focus { border-color: var(--accent); }
.select option { background: #171725; color: var(--text); }
.seg {
  display: flex;
  padding: 3px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  gap: 2px;
}
.seg button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: all 0.2s ease;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: rgba(124, 140, 255, 0.2); color: #fff; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.gallery-grid[data-view="list"] { grid-template-columns: 1fr; gap: 10px; }
.gallery-item {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  animation: fadeIn 0.35s ease both;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.gallery-item:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 140, 255, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(124, 140, 255, 0.12);
}
.gallery-item.pinned { border-color: rgba(251, 191, 36, 0.45); }
.gallery-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gallery-img-wrap { width: 100%; overflow: hidden; background: rgba(255, 255, 255, 0.03); }
.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.45s ease;
}
.gallery-img-wrap img.loaded { opacity: 1; }
.gallery-item:hover .gallery-img-wrap img { transform: scale(1.045); }
.gallery-info {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.g-name {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-meta { font-size: 0.72rem; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-meta.sub { margin-top: 1px; font-size: 0.68rem; color: var(--text-faint); opacity: 0.85; }
.g-uploader { color: #aab6ff; }
.pin-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(251, 191, 36, 0.85);
  color: #1a1400;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.gallery-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.25s ease;
  z-index: 3;
}
.gallery-item:hover .gallery-actions, .gallery-item:focus-visible .gallery-actions { opacity: 1; transform: none; }
.btn-pin, .btn-del {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.btn-pin { background: rgba(251, 191, 36, 0.85); color: #1a1400; }
.btn-pin:hover { background: var(--warn); transform: scale(1.08); }
.btn-del { background: rgba(248, 113, 113, 0.85); }
.btn-del:hover { background: var(--danger); transform: scale(1.08); }
.gallery-overlay {
  position: absolute;
  inset: 0 0 0 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.gallery-item:hover .gallery-overlay, .gallery-item:focus-visible .gallery-overlay { opacity: 1; }
.overlay-btns { display: flex; gap: 8px; pointer-events: auto; }
.btn-copy-link {
  padding: 7px 16px;
  border: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-copy-link:hover { background: var(--accent); transform: translateY(-1px); }
.btn-dl-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}
.btn-dl-icon:hover { background: var(--accent-3); color: #06210f; transform: translateY(-1px); }

/* Batch mode */
.item-check {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  width: 26px;
  height: 26px;
  display: none;
  cursor: pointer;
}
.gallery-grid.batch-mode .item-check { display: flex; align-items: center; justify-content: center; }
.item-check input { display: none; }
.checkmark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.45);
  transition: all 0.15s ease;
}
.item-check input:checked + .checkmark {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.9);
}
.gallery-grid.batch-mode .gallery-item { border-color: rgba(124, 140, 255, 0.25); }
.gallery-grid.batch-mode .gallery-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 140, 255, 0.55);
}
.gallery-grid.batch-mode .gallery-overlay { opacity: 0; }
.batch-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(24, 24, 38, 0.92);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.batch-count { font-size: 0.85rem; font-weight: 600; color: #c6cdf5; }
.batch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 70px 20px;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
}

/* list view */
.gallery-grid[data-view="list"] .gallery-item { display: flex; align-items: center; }
.gallery-grid[data-view="list"] .gallery-img-wrap { width: 86px; height: 64px; flex-shrink: 0; }
.gallery-grid[data-view="list"] .gallery-img-wrap img { object-fit: cover; }
.gallery-grid[data-view="list"] .gallery-info { flex: 1; }
.gallery-grid[data-view="list"] .gallery-overlay { position: static; background: none; opacity: 1; padding: 0 12px 0 0; pointer-events: auto; }
.gallery-grid[data-view="list"] .overlay-btns { gap: 6px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(5, 5, 10, 0.94);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox-img {
  max-width: min(92vw, 1400px);
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
  animation: zoomIn 0.25s ease both;
}
@keyframes zoomIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  z-index: 2;
  background: rgba(255, 255, 255, 0.08);
}
.lightbox-nav:hover { background: rgba(124, 140, 255, 0.3); color: #fff; }
.lightbox-nav.prev { left: 22px; }
.lightbox-nav.next { right: 22px; }
.lightbox-bar {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(20, 20, 32, 0.8);
  border: 1px solid var(--border);
  max-width: min(92vw, 760px);
  width: auto;
}
.lightbox-info { display: flex; flex-direction: column; min-width: 0; }
.lb-name { font-size: 0.84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.lb-meta { font-size: 0.74rem; color: var(--text-faint); }
.lightbox-tools { display: flex; align-items: center; gap: 8px; }
.lb-counter { font-size: 0.76rem; color: var(--text-faint); margin-left: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px 36px;
  color: var(--text-faint);
  font-size: 0.8rem;
}
.footer .dot { opacity: 0.5; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: #e9e9f2;
  color: #0b0b12;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 900;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 42px 38px;
  border-radius: 22px;
  text-align: center;
  animation: slideIn 0.4s ease both;
}
.auth-logo { justify-content: center; margin-bottom: 18px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.auth-sub { color: var(--text-dim); font-size: 0.88rem; margin: 6px 0 24px; }
.auth-form { text-align: left; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); margin-bottom: 7px; }
.field input {
  width: 100%;
  padding: 12px 15px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 140, 255, 0.15); }

/* ---------- Alerts ---------- */
.alert {
  padding: 11px 15px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 18px;
  text-align: left;
}
.alert.error { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.3); color: #fca5a5; }
.alert.success { background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); color: #86efac; }

/* ---------- Settings ---------- */
.settings-main { padding-top: 38px; padding-bottom: 60px; }
.settings-hero { margin-bottom: 24px; }
.settings-hero h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; }
.settings-hero p { color: var(--text-dim); font-size: 0.9rem; }
.panel {
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { font-size: 1.05rem; font-weight: 700; }
.panel-hint { font-size: 0.78rem; color: var(--text-faint); }
.storage-bar {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.storage-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.6s ease;
  min-width: 2px;
}
.storage-text { margin-top: 9px; font-size: 0.8rem; color: var(--text-dim); }
.add-form { display: flex; gap: 10px; flex-wrap: wrap; }
.add-form input {
  flex: 1;
  min-width: 160px;
  padding: 11px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--font);
  outline: none;
}
.add-form input:focus { border-color: var(--accent); }
.field-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); margin: 16px 0 7px; }
.hotlink-form textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.86rem;
  font-family: var(--mono);
  outline: none;
  resize: vertical;
  margin-bottom: 14px;
}
.hotlink-form textarea:focus { border-color: var(--accent); }
.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  cursor: pointer;
  margin-bottom: 6px;
}
.switch-row input { display: none; }
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}
.switch-row input:checked + .switch { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.form-tip { margin-left: 14px; font-size: 0.8rem; color: var(--text-faint); }
.form-tip.ok { color: var(--accent-3); }
.form-tip.err { color: var(--danger); }
.log-list { display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.log-empty { color: var(--text-faint); font-size: 0.85rem; text-align: center; padding: 22px; }
.log-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.8rem;
}
.log-time { color: var(--text-faint); font-family: var(--mono); font-size: 0.72rem; flex-shrink: 0; }
.log-type {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(124, 140, 255, 0.14);
  color: #aab6ff;
}
.log-type.upload { background: rgba(74, 222, 128, 0.14); color: #86efac; }
.log-type.delete, .log-type.batch-delete { background: rgba(248, 113, 113, 0.14); color: #fca5a5; }
.log-type.pin { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
.log-type.login-fail { background: rgba(248, 113, 113, 0.2); color: #fecaca; }
.log-type.config { background: rgba(255, 255, 255, 0.1); color: var(--text-dim); }
.log-detail { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-list { display: flex; flex-direction: column; gap: 8px; }
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  border-radius: 11px;
}
.account-info { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 140, 255, 0.35), rgba(168, 85, 247, 0.35));
  font-weight: 700;
  font-size: 0.95rem;
}
.account-text { display: flex; align-items: center; gap: 10px; }
.account-id { font-size: 0.92rem; font-weight: 600; }
.account-role { font-size: 0.72rem; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.account-role.op { background: rgba(251, 191, 36, 0.14); color: var(--warn); }
.account-role.user { background: rgba(124, 140, 255, 0.14); color: #aab6ff; }

/* ---------- Share page ---------- */
.share-body { background-attachment: scroll; }
.share-shell { position: relative; z-index: 1; width: min(900px, 100% - 32px); margin: 0 auto; padding: 26px 0 50px; }
.share-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.share-card { border-radius: 22px; overflow: hidden; animation: slideIn 0.35s ease both; }
.share-image { background: rgba(0, 0, 0, 0.4); display: flex; align-items: center; justify-content: center; max-height: 68vh; overflow: hidden; }
.share-image img { max-width: 100%; max-height: 68vh; object-fit: contain; }
.share-broken { padding: 80px 30px; color: var(--text-faint); font-size: 0.95rem; }
.share-meta { padding: 24px; }
.share-name { font-size: 1.15rem; font-weight: 700; word-break: break-all; }
.share-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 404 ---------- */
.nf-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.nf-card {
  width: min(440px, 100%);
  padding: 44px 36px;
  text-align: center;
  border-radius: 22px;
  animation: slideIn 0.4s ease both;
}
.nf-code {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nf-card h1 { font-size: 1.25rem; margin: 6px 0 8px; }
.nf-card p { color: var(--text-dim); font-size: 0.88rem; margin-bottom: 24px; }

/* ---------- Glass helper ---------- */
.glass {
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .lightbox-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .lightbox-tools { width: 100%; justify-content: space-between; }
}
@media (max-width: 640px) {
  .container { width: min(1180px, 100% - 24px); }
  .hero { padding: 42px 0 26px; }
  .hero-stats { gap: 8px; }
  .stat { min-width: 104px; padding: 11px 14px; }
  .topnav { display: none; }
  .dropzone { padding: 34px 16px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 10px; }
  .gallery-head { flex-direction: column; align-items: stretch; }
  .gallery-tools { flex-wrap: wrap; }
  .search-wrap { flex: 1; }
  .search-wrap input { width: 100%; }
  .gallery-grid[data-view="list"] .gallery-img-wrap { width: 64px; height: 52px; }
  .gallery-grid[data-view="list"] .gallery-overlay { display: none; }
  .gallery-grid[data-view="list"] .gallery-actions { opacity: 1; transform: none; }
  .lightbox-nav.prev { left: 8px; }
  .lightbox-nav.next { right: 8px; }
  .lightbox-bar { bottom: 12px; }
  .lb-name { max-width: 180px; }
  .auth-card { padding: 34px 24px; }
  .panel { padding: 18px; }
  .footer { flex-direction: column; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
