/* 一隅图床 · 软软的粉色主题 */
:root {
  --pink: #ff8fb1;
  --pink-deep: #ee6f96;
  --ink: #4a3a44;
  --muted: #9a8794;
  --line: rgba(238, 111, 150, 0.16);
  --card: rgba(255, 255, 255, 0.84);
  --shadow: 0 10px 30px rgba(238, 111, 150, 0.12);
  --radius: 20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, #fff6f9 0%, #fdf3ff 45%, #f4f2ff 100%);
  min-height: 100vh;
  padding-bottom: 36px;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

.bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 420px at 110% -10%, #ffe3ee, transparent 62%),
    radial-gradient(520px 400px at -20% 30%, #eae4ff, transparent 62%);
  z-index: 0;
}

header, main, footer {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------------------------------------------------- 头部 */

.hero { padding-top: 30px; }

.brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.heart {
  color: var(--pink);
  animation: beat 2.4s ease-in-out infinite;
  display: inline-block;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.18); }
  24% { transform: scale(1); }
}

.tagline {
  margin: 6px 0 18px;
  font-size: 13px;
  color: var(--muted);
}

.storage {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 13px 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.storage-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.storage-num { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.bar {
  height: 9px;
  border-radius: 999px;
  background: #ffe6ee;
  overflow: hidden;
}

.bar > div {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9cba, #f2789a);
  transition: width 0.45s cubic-bezier(0.3, 0.9, 0.3, 1);
}

/* ---------------------------------------------------------- 相册区 */

.albums { margin-top: 18px; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, background 0.2s, color 0.2s;
}

.chip:active { transform: scale(0.95); }

.chip.active {
  background: var(--pink);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(238, 111, 150, 0.3);
}

.chip .count { opacity: 0.7; font-size: 11px; margin-left: 3px; }

.chip .x {
  display: inline-block;
  margin-left: 6px;
  width: 16px;
  height: 16px;
  line-height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  text-align: center;
  font-size: 11px;
}

.chip.add { color: var(--pink-deep); border-style: dashed; }

/* ---------------------------------------------------------- 上传区 */

.dropzone {
  margin: 8px 0 14px;
  border: 2px dashed rgba(238, 111, 150, 0.32);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.55);
  padding: 24px 16px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.dropzone:active { transform: scale(0.99); }

.dropzone.drag {
  background: #ffeef4;
  border-color: var(--pink);
}

.dz-icon { font-size: 28px; color: var(--pink); line-height: 1; }

.dz-title { font-size: 16px; font-weight: 700; margin-top: 8px; }

.dz-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }

.dz-icon, .dz-title, .dz-sub { pointer-events: none; }

/* ---------------------------------------------------------- 按钮 */

.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.2s;
}

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

.btn.primary {
  margin-top: 14px;
  background: linear-gradient(135deg, #ff9cba, #f2789a);
  color: #fff;
  box-shadow: 0 8px 18px rgba(238, 111, 150, 0.3);
}

.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.danger {
  background: #ffeef1;
  color: #d9577c;
  border: 1px solid #ffd0dc;
}

/* ---------------------------------------------------------- 上传进度 */

.upload-list { display: grid; gap: 8px; margin-bottom: 8px; }

.urow {
  background: var(--card);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  animation: slidein 0.25s ease;
}

@keyframes slidein {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

.urow-top {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  gap: 10px;
  margin-bottom: 7px;
}

.uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }

.upct { color: var(--pink-deep); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

.ubar { height: 6px; border-radius: 999px; background: #ffe6ee; overflow: hidden; }

.ubar > div {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc4d6, #f2789a);
  transition: width 0.2s;
}

/* ---------------------------------------------------------- 图片墙 */

.gallery { margin-top: 16px; }

.gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gallery-head h2 { font-size: 17px; margin: 0; font-weight: 700; }

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

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

.gcard {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: slidein 0.3s ease;
}

.gcard img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #f7eef3;
  cursor: zoom-in;
}

.ginfo { padding: 8px 10px 10px; }

.gname {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gmeta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.gactions { display: flex; gap: 6px; margin-top: 8px; }

.gactions button {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 7px 0;
  font-size: 11px;
  font-family: inherit;
  background: #fff0f5;
  color: var(--pink-deep);
  cursor: pointer;
}

.gactions button:active { transform: scale(0.94); }

.gactions button.del { background: #fdeef2; color: #d9577c; }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 0;
}

/* ---------------------------------------------------------- 底部 */

.foot {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 30px;
  line-height: 1.9;
}

.foot p { margin: 0; }

/* ---------------------------------------------------------- 提示条 */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: rgba(74, 58, 68, 0.93);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  max-width: 80vw;
  text-align: center;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 60;
}

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

/* ---------------------------------------------------------- 弹层 */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(60, 40, 55, 0.42);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
}

.modal[hidden] { display: none; }

.modal-card {
  background: #fff;
  border-radius: 24px;
  padding: 14px;
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow: auto;
  position: relative;
  box-shadow: 0 24px 60px rgba(120, 60, 90, 0.28);
  animation: pop 0.22s ease;
}

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

.modal-card img {
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  border-radius: 16px;
  background: #faf4f8;
  display: block;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(246, 234, 240, 0.92);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  z-index: 2;
}

.link-row { display: flex; gap: 8px; margin-top: 12px; }

.link-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  background: #fdf8fb;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.link-row .btn { margin-top: 0; padding: 10px 16px; }

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

.modal-actions .btn { flex: 1; margin-top: 0; }

.modal-card.small { max-width: 360px; }

.modal-card.small h3 { margin: 4px 2px 12px; font-size: 17px; }

.modal-card.small input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: #fdf8fb;
  outline: none;
}

.modal-card.small input:focus { border-color: var(--pink); }

@media (min-width: 520px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .brand { font-size: 34px; }
}

/* ============================================================ v0.2 登录 */

.login {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  background:
    radial-gradient(700px 500px at 100% 0%, #ffe0ec, transparent 60%),
    radial-gradient(600px 480px at 0% 100%, #e9e3ff, transparent 62%),
    linear-gradient(170deg, #fff7fa, #f7f3ff);
}

.login[hidden] { display: none; }

.login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 28px;
  padding: 30px 22px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(238, 111, 150, 0.18);
  backdrop-filter: blur(10px);
  animation: pop 0.3s ease;
}

.login-heart {
  font-size: 40px;
  color: var(--pink);
  line-height: 1;
  animation: beat 2.4s ease-in-out infinite;
}

.login-card h1 {
  margin: 10px 0 4px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.login-sub {
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--muted);
}

.login-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fdf8fb;
  outline: none;
  text-align: center;
  letter-spacing: 1px;
}

.login-input:focus { border-color: var(--pink); }

.btn.wide { width: 100%; margin-top: 14px; padding: 12px 18px; }

.login-tip {
  margin: 14px 0 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
}

/* ============================================================ v0.2 顶栏 */

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account {
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-name {
  font-size: 12px;
  color: var(--pink-deep);
  background: #fff0f5;
  border-radius: 999px;
  padding: 5px 10px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--pink-deep);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.mini:active { transform: scale(0.94); }

.danger-mini { color: #d9577c; background: #fdeef2; }

/* ============================================================ v0.2 管理面板 */

.admin-title { margin: 4px 2px 10px; font-size: 18px; }

.admin-block {
  border-top: 1px dashed var(--line);
  padding: 12px 0 4px;
}

.admin-block h4 {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--pink-deep);
  font-weight: 700;
}

.field-row { display: flex; gap: 8px; }

.field {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: #fdf8fb;
  outline: none;
}

.field:focus { border-color: var(--pink); }

select.field {
  flex: 0 0 auto;
  max-width: 52%;
}

.btn.small-btn {
  margin-top: 10px;
  padding: 9px 16px;
  font-size: 13px;
}

.codes { margin-top: 10px; }

.code-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff0f5;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--pink-deep);
}

.code-item code { letter-spacing: 1px; font-weight: 700; }

.admin-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fdf7fa;
  border: 1px solid rgba(238, 111, 150, 0.1);
  border-radius: 12px;
  padding: 9px 11px;
}

.admin-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-main strong { font-size: 13px; font-weight: 600; }

.admin-main .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-main code {
  font-size: 12px;
  color: var(--pink-deep);
  letter-spacing: 0.6px;
}

.admin-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* ============================================================ v0.3 用量提醒 */

.quota-tip {
  margin-top: 10px;
  background: #fff6e6;
  border: 1px solid #ffd9a8;
  color: #9a5b00;
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.6;
  animation: slidein 0.3s ease;
}

.quota-tip.bad {
  background: #ffedf0;
  border-color: #ffc6d2;
  color: #b3355b;
}

.admin-main .warn {
  color: #b3355b;
  font-weight: 600;
}

/* ============================================================ v0.3 多选管理 */

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

.gcard {
  position: relative;
}

.gcard.selectable {
  cursor: pointer;
}

.gcard.selected {
  outline: 2px solid var(--pink-deep);
  box-shadow: 0 0 0 4px rgba(238, 111, 150, 0.14);
}

.gcheck {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2px solid #ffb3c9;
  color: transparent;
  display: none;
  place-items: center;
  font-size: 12px;
  line-height: 1;
  z-index: 2;
  transition: background 0.15s, color 0.15s;
}

.gcard.selectable .gcheck {
  display: grid;
}

.gcard.selected .gcheck {
  background: var(--pink-deep);
  border-color: var(--pink-deep);
  color: #fff;
}

.bulkbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  max-width: 620px;
  margin: 0 auto;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(120, 60, 90, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bulkbar[hidden] {
  display: none;
}

.bulk-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.bulk-top b {
  color: var(--pink-deep);
  font-size: 14px;
}

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

.bulk-actions .btn {
  flex: 1;
  margin-top: 0;
  padding: 9px 6px;
  font-size: 12px;
  border-radius: 11px;
}

.btn:disabled {
  opacity: 0.45;
}

body.selecting {
  padding-bottom: 118px;
}

.picker {
  display: grid;
  gap: 6px;
  max-height: 52vh;
  overflow: auto;
  margin: 4px 0 10px;
}

.picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  background: #fdf7fa;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.picker-row:active {
  transform: scale(0.99);
}

.picker-row .count {
  font-size: 11px;
  color: var(--muted);
}

/* ============================================================ v0.3 质量开关 */

.quality-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: -4px 0 14px;
  padding: 0 2px;
}

.quality-label {
  font-size: 12px;
  color: var(--muted);
  margin-right: 2px;
}

.qchip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.qchip:active {
  transform: scale(0.95);
}

.qchip.active {
  background: var(--pink);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 10px rgba(238, 111, 150, 0.28);
}

.quality-hint {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
  white-space: nowrap;
}

/* ============================================================ v0.4 美化搬家 */

.tool-row {
  margin: 0 0 16px;
}

.tool-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  padding: 12px 14px;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.tool-card:active {
  transform: scale(0.995);
}

.tool-icon {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #fff0f5;
  color: var(--pink-deep);
  display: grid;
  place-items: center;
  font-size: 16px;
}

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

.tool-text b {
  font-size: 14px;
}

.tool-text small {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.migrate-tip {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.7;
}

.migrate-info {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.migrate-count {
  font-size: 14px;
}

.migrate-count b {
  color: var(--pink-deep);
  font-size: 16px;
}

.migrate-hosts {
  font-size: 11px;
  line-height: 1.7;
  word-break: break-all;
  max-height: 84px;
  overflow: auto;
}

.migrate-progress {
  min-height: 16px;
  font-size: 12px;
  color: var(--pink-deep);
}

.migrate-done {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
}

.small-note {
  font-size: 11px;
  line-height: 1.6;
  margin: 0;
}
