/* ============================================================
   PicVault — 设计令牌
   ============================================================ */
:root {
  --bg: #0F172A;
  --bg-deep: #0B1220;
  --card: #1B2336;
  --card-soft: #151D2E;
  --muted: #272F42;
  --border: #334155;
  --border-strong: #475569;
  --fg: #F8FAFC;
  --fg-muted: #94A3B8;
  --fg-dim: #64748B;
  --accent: #22C55E;
  --accent-strong: #16A34A;
  --accent-soft: rgba(34, 197, 94, .12);
  --danger: #EF4444;
  --danger-soft: rgba(239, 68, 68, .12);
  --warn: #F59E0B;

  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 10px;

  --font: "IBM Plex Sans", -apple-system, "Segoe UI", system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  --shadow-card: 0 1px 0 rgba(255,255,255,.03) inset, 0 18px 40px -28px rgba(0,0,0,.9);
  --ease: cubic-bezier(.2,.7,.3,1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg);
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(34,197,94,.10), transparent 62%),
    radial-gradient(900px 480px at 88% -2%, rgba(56,132,255,.10), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,p,dl,dt,dd { margin: 0; }

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ============================================================
   顶栏
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
  padding: 0 32px;
  background: rgba(15, 23, 42, .74);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(71, 85, 105, .32);
}

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

.brand-logo {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 9px;
  color: #0B1220;
  background: linear-gradient(150deg, #34D399, #22C55E 55%, #16A34A);
  box-shadow: 0 6px 18px -8px rgba(34,197,94,.75);
}
.brand-logo svg { width: 18px; height: 18px; }

.brand-name { font-size: 17px; font-weight: 650; letter-spacing: -.2px; }

.brand-tag {
  margin-left: 4px;
  padding: 2px 8px;
  font-size: 11.5px;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.nav { display: flex; align-items: center; gap: 4px; }

.nav-link {
  padding: 8px 14px;
  font-size: 14px;
  color: var(--fg-muted);
  border-radius: 9px;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nav-link:hover { color: var(--fg); background: rgba(71,85,105,.22); }
.nav-link.is-active { color: var(--fg); }
.nav-link.is-active::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 6px;
  border-radius: 2px;
  background: var(--accent);
}

/* ============================================================
   容器
   ============================================================ */
.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 32px 64px;
}

/* ============================================================
   Hero：用量卡 + 上传卡（同一行，强制等高）
   ============================================================ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;          /* 两卡上下沿严格对齐 */
  margin-bottom: 26px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 232px;             /* 两卡共同的最小高度 */
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

/* —— 用量卡 —— */
.usage-card {
  padding: 20px 22px 18px;
  justify-content: space-between;
  gap: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.head-icon { color: var(--accent); display: inline-flex; }
.head-icon svg { width: 16px; height: 16px; }

.card-head h2 {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--fg-muted);
  letter-spacing: .3px;
}

.pill {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

.usage-body { display: flex; flex-direction: column; gap: 12px; }

.usage-figure { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }

.usage-figure strong {
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.8px;
  color: var(--fg);
}

.usage-total { font-family: var(--mono); font-size: 13px; color: var(--fg-muted); }

.meter {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  min-width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #16A34A, var(--accent));
  box-shadow: 0 0 12px rgba(34,197,94,.45);
  transition: width .45s var(--ease), background .3s var(--ease);
}

.meter-tick {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
    background: rgba(15,23,42,.55);
}

.usage-foot {
  display: flex;
    align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--fg-muted);
}
.usage-foot #usedPct { font-family: var(--mono); color: var(--fg); }

/* —— 上传卡 —— */
.upload-card { padding: 12px; }

/* 上传进度：多文件共用一个条 */
.up-progress { margin-top: 10px; }
.up-progress[hidden] { display: none; }
.up-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--fg-muted);
}
.up-progress-head #upProgressLabel { font-family: var(--mono); color: var(--fg); }
.up-progress-head #upProgressPct { font-family: var(--mono); color: var(--accent); font-weight: 600; }
.up-track {
  position: relative;
  height: 6px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.up-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #22C55E, #4ADE80);
  box-shadow: 0 0 12px rgba(34,197,94,.45);
  transition: width .25s var(--ease);
}
.up-fill.is-done { background: linear-gradient(90deg, #22C55E, #22C55E); }

/* 上传中：整块稍微压暗，避免用户又拖一批进来 */
.drop.is-busy { opacity: .6; pointer-events: none; }

.drop {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(39,47,66,.28), rgba(21,29,46,.18));
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop.is-over {
  border-color: var(--accent);
  background: rgba(34,197,94,.16);
  transform: scale(.995);
}

.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.drop-icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 4px;
  border-radius: 12px;
  color: var(--accent);
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.22);
}
.drop-icon svg { width: 22px; height: 22px; }

.drop-title { font-size: 14.5px; font-weight: 500; }
.drop-title .link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.drop-hint { font-size: 12.5px; color: var(--fg-muted); }

/* ============================================================
   刚上传结果条
   ============================================================ */
.result {
  margin-bottom: 22px;
  padding: 14px 18px 16px;
  background: var(--card-soft);
  border: 1px solid rgba(34,197,94,.28);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  animation: rise .28s var(--ease);
}

@keyframes rise { from { transform: translateY(6px); } to { transform: none; } }

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.result-head h3 { font-size: 13px; font-weight: 550; color: var(--accent); letter-spacing: .3px; }

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

.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  background: rgba(15,23,42,.5);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.result-row img {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--muted);
}

.result-name {
  flex: 0 1 30%;
  min-width: 0;
  font-size: 12.5px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-url {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
}

/* ============================================================
   图库
   ============================================================ */
.gallery { margin-top: 4px; }

.gal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.gal-title { display: flex; align-items: center; gap: 9px; }
.gal-title h2 { font-size: 16px; font-weight: 600; letter-spacing: -.2px; }

.count {
  min-width: 24px;
  padding: 1px 7px;
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(34,197,94,.3);
  border-radius: 999px;
}

.gal-tools { display: flex; align-items: center; gap: 8px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  color: var(--fg-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: border-color .18s var(--ease);
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 15px; height: 15px; flex: 0 0 15px; }
.search input {
  width: 168px;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--fg);
  outline: none;
}
.search input::placeholder { color: var(--fg-dim); }

.select { position: relative; display: inline-flex; align-items: center; }
.select select {
  height: 38px;
  padding: 0 30px 0 12px;
  font-size: 13px;
  color: var(--fg-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  appearance: none;
  cursor: pointer;
}
.select svg {
  position: absolute;
  right: 9px;
  width: 14px; height: 14px;
  pointer-events: none;
  color: var(--fg-muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 16px;
}

.tile {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.tile:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 16px 30px -22px rgba(0,0,0,.9); }

.tile-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--muted);
  cursor: zoom-in;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.tile-open img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ease), opacity .3s var(--ease);
  opacity: .96;
}
.tile:hover .tile-open img { transform: scale(1.03); opacity: 1; }

.tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px 10px;
  border-top: 1px solid rgba(71,85,105,.28);
}
.tile-name {
  min-width: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-size { flex: 0 0 auto; font-family: var(--mono); font-size: 11px; color: var(--fg-dim); }

.tile-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.tile:hover .tile-actions,
.tile:focus-within .tile-actions { opacity: 1; transform: none; }

.mini-btn {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  color: var(--fg);
  background: rgba(11,18,32,.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(71,85,105,.6);
  border-radius: 9px;
  cursor: pointer;
  transition: background-color .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease);
}
.mini-btn svg { width: 15px; height: 15px; }
.mini-btn:hover { background: var(--accent); color: #062513; border-color: var(--accent); }
.mini-btn.is-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* 分组条 */
.groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
  color: var(--fg-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--border-strong); }
.chip em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--fg-dim);
}
.chip.is-on {
  color: #05230F;
  background: var(--accent);
  border-color: var(--accent);
}
.chip.is-on em { color: rgba(5, 35, 15, .62); }

.chip-add {
  color: var(--accent);
  border-style: dashed;
  border-color: rgba(34,197,94,.45);
  background: transparent;
}
.chip-add:hover { background: var(--accent-soft); border-style: dashed; }

.group-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.group-form input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 11px;
  font-size: 12.5px;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--accent);
  border-radius: 9px;
  outline: none;
}
.group-form .btn { height: 34px; padding: 0 14px; font-size: 12.5px; }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}
.pager-btn {
  height: 36px;
  padding: 0 15px;
  font-size: 12.5px;
  color: var(--fg);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: background-color .16s var(--ease), border-color .16s var(--ease), opacity .16s var(--ease);
}
.pager-btn:hover:not(:disabled) { background: #27324A; border-color: var(--border-strong); }
.pager-btn:disabled { opacity: .4; cursor: default; }
.pager-info { font-size: 12.5px; color: var(--fg-muted); }
.pager-info strong { font-family: var(--mono); font-weight: 600; color: var(--fg); }

/* 空状态 */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 56px 20px 64px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  background: rgba(27,35,54,.35);
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 54px; height: 54px;
  margin-bottom: 8px;
  color: var(--fg-dim);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.empty-icon svg { width: 26px; height: 26px; }
.empty-title { font-size: 14px; font-weight: 550; }
.empty-hint { font-size: 12.5px; color: var(--fg-muted); }

/* 搜索无结果 */
.empty.is-filter { border-style: solid; background: transparent; padding: 40px 20px; }

/* ============================================================
   关于 / 页脚
   ============================================================ */
.about {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid rgba(71,85,105,.3);
  flex-wrap: wrap;
}
.about-title { font-size: 14px; font-weight: 600; }
.about-hint { max-width: 560px; margin-top: 4px; font-size: 12.5px; color: var(--fg-muted); }
.about-hint code {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 1px 5px;
  background: var(--muted);
  border-radius: 5px;
}
.about-meta { font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); }

/* ============================================================
   弹窗
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6,10,20,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.dialog {
  position: relative;
  width: 100%;
  max-width: 980px;
  max-height: 88vh;
  background: #131B2C;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 80px -40px #000;
  animation: pop .22s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99) } to { opacity: 1; transform: none } }

.preview {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, .95fr);
  max-width: 1060px;
  overflow: hidden;
}
.preview:focus { outline: none; }

.dialog-close { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(11,18,32,.8); }

.preview-media {
  display: grid;
  place-items: center;
  padding: 18px;
  background: #0A1120;
  min-height: 320px;
  overflow: hidden;
}
.media-frame { position: relative; display: inline-block; line-height: 0; }

.preview-media img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

/* —— 裁切 —— */
.crop-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 8px;
  touch-action: none;
}

.crop-box {
  position: absolute;
  box-shadow: 0 0 0 9999px rgba(4, 8, 16, .62), 0 0 0 1px rgba(34,197,94,.9) inset;
  cursor: move;
  touch-action: none;
}
.crop-box::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.28) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.28) 1px, transparent 1px);
  background-size: 33.333% 33.333%;
  background-position: -1px -1px;
  opacity: .9;
}

.crop-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--accent);
  border: 2px solid #05230F;
  z-index: 2;
}
.crop-handle[data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.crop-handle[data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.crop-handle[data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.crop-handle[data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }

.crop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  flex-wrap: wrap;
}
.ratio-set { display: flex; gap: 6px; }
.ratio-chip {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--fg-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease);
}
.ratio-chip:hover { color: var(--fg); border-color: var(--border-strong); }
.ratio-chip.is-on { color: #05230F; background: var(--accent); border-color: var(--accent); }

.crop-actions { display: flex; gap: 8px; margin-left: auto; }

.preview.is-cropping .preview-info { opacity: .38; pointer-events: none; }
.preview.is-cropping .preview-info .preview-actions { opacity: 0; }
.preview.is-cropping .dialog-close { opacity: 0; pointer-events: none; }

.preview-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 22px 22px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
}
.preview-info h3 {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  word-break: break-all;
  padding-right: 34px;
}

.meta {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 7px 10px;
  font-size: 12.5px;
}
.meta dt { color: var(--fg-dim); }
.meta dd { font-family: var(--mono); font-size: 12px; color: var(--fg-muted); }

.url-row { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* —— 压缩 / 转格式 —— */
.opt-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--card-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.opt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.opt-title { font-size: 12px; letter-spacing: .02em; color: var(--fg-muted); }
.opt-now { font-family: var(--mono); font-size: 11.5px; color: var(--fg-dim); }
.opt-block select {
  width: 100%;
  height: 34px;
  padding: 0 9px;
  font-size: 12.5px;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.opt-targets { flex-wrap: wrap; gap: 6px; }
.opt-block .btn { height: 36px; font-size: 12.5px; }
.opt-block .btn[disabled] { opacity: .6; cursor: default; }

.group-pick { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.group-pick label { font-size: 12.5px; color: var(--fg-dim); }
.group-pick select {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
}
.url-row input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.url-row .btn { width: 100%; }
.url-btns { display: flex; gap: 8px; }
.url-btns .btn { flex: 1; width: auto; }

/* —— 从链接导入 —— */
.url-import { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.url-import-label { font-size: 11.5px; color: var(--fg-dim); padding-left: 2px; }
.url-import-row { display: flex; gap: 8px; }
.url-import-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.url-import-row input::placeholder { color: #55617A; }
.url-import-row .btn { height: 36px; font-size: 12.5px; padding: 0 14px; }

.btn {
  height: 40px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .16s var(--ease), background-color .16s var(--ease), border-color .16s var(--ease);
  white-space: nowrap;
}
.btn-accent { background: var(--accent); color: #05230F; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-accent.is-done { background: var(--accent-strong); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }

.preview-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.preview-actions .btn { flex: 1; }

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: rgba(239,68,68,.45);
}
.btn-danger-ghost:hover { background: var(--danger-soft); }

.btn-ghost { background: var(--muted); color: var(--fg); border-color: var(--border); }
.btn-ghost:hover { background: #313B52; }

.hint { font-size: 11.5px; color: var(--fg-dim); }

.confirm-dialog { max-width: 380px; padding: 24px; }
.confirm-title { font-size: 15px; font-weight: 600; }
.confirm-text { margin-top: 6px; font-size: 12.5px; color: var(--fg-muted); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  padding: 0;
  color: var(--fg-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  transition: color .16s var(--ease), background-color .16s var(--ease);
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { color: var(--fg); background: rgba(71,85,105,.28); }

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--fg);
  background: #1C2437;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: 0 18px 40px -18px #000;
  opacity: 0;
  transform: translate(-50%, 10px);
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.toast.is-warn .dot { background: var(--warn); }
.toast.is-error .dot { background: var(--danger); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .hero { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
  .wrap { padding: 22px 22px 56px; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .usage-card { min-height: 190px; }
  .upload-card { min-height: 200px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .topbar { height: 58px; padding: 0 14px; }
  .brand-tag { display: none; }
  .wrap { padding: 16px 14px 40px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

  .gal-bar { align-items: stretch; }
  .gal-tools { width: 100%; }
  .search { flex: 1; }
  .search input { width: 100%; }

  .result-row { flex-wrap: wrap; }
  .result-name { flex: 1 1 auto; }
  .result-url { flex: 1 1 100%; order: 3; }

  .preview { grid-template-columns: 1fr; max-height: 92vh; overflow: auto; }
  .preview-media { min-height: 220px; padding: 14px; }
  .preview-media img { max-height: 52vh; }
  .preview-info { border-left: 0; border-top: 1px solid var(--border); padding: 18px 16px 20px; }
  .btn { height: 44px; }
  .url-row input { height: 44px; }

  .mini-btn { width: 44px; height: 44px; }
  .tile-actions { opacity: 1; transform: none; }
  .icon-btn { width: 44px; height: 44px; }

  .chip { height: 40px; padding: 0 14px; font-size: 13px; }
  .group-form input { height: 40px; }
  .group-form .btn { height: 40px; }
  .pager-btn { height: 44px; }
  .pager { gap: 10px; }
  .pager-info { font-size: 12px; }

  .about { flex-direction: column; align-items: flex-start; gap: 10px; }
}

/* 触屏设备：操作按钮常显 */
@media (hover: none) {
  .tile-actions { opacity: 1; transform: none; }
  .mini-btn { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .tile:hover { transform: none; }
  .tile:hover .tile-open img { transform: none; }
}
