/* ================= 陶瓦图床 · 液态玻璃样式（苹果风） ================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg1: #0f1120;
  --bg2: #1a1d33;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-strong: rgba(255, 255, 255, 0.11);
  --border: rgba(255, 255, 255, 0.14);
  --ink: #f5f6fa;
  --muted: rgba(235, 238, 250, 0.55);
  --accent: #0a84ff;
  --accent2: #5e5ce6;
  --green: #30d158;
  --red: #ff453a;
  --yellow: #ffd60a;
  --radius: 22px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

html { -webkit-font-smoothing: antialiased; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(1100px 600px at 12% -10%, rgba(94, 92, 230, 0.35), transparent 60%),
    radial-gradient(900px 600px at 88% 12%, rgba(10, 132, 255, 0.28), transparent 55%),
    radial-gradient(1000px 700px at 50% 110%, rgba(48, 209, 88, 0.14), transparent 55%),
    linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 100%);
  background-attachment: fixed;
}

/* 玻璃卡片 */
.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* 认证页 */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; padding: 40px 36px; }
.brand { font-size: 30px; font-weight: 800; letter-spacing: 1px; text-align: center; }
.brand span { color: var(--accent); }
.brand-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 26px; letter-spacing: 2px; }
.auth-form label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.auth-form input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.08);
  color: var(--ink); font-size: 15px; outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.auth-form input:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.12); }
.cap-row { display: flex; gap: 10px; }
.cap-row input { flex: 1; }
.cap-img { height: 46px; border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }
.btn-primary {
  width: 100%; margin-top: 22px; padding: 13px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; letter-spacing: 4px;
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(10, 132, 255, 0.45); }
.btn-primary:active { transform: translateY(0); }
.auth-alt { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }
.auth-alt a { color: var(--accent); text-decoration: none; }
.notice { border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 6px; text-align: center; }
.notice.err { background: rgba(255, 69, 58, 0.15); color: #ff9f99; border: 1px solid rgba(255, 69, 58, 0.3); }
.notice.ok { background: rgba(48, 209, 88, 0.12); color: #7ee8a0; border: 1px solid rgba(48, 209, 88, 0.3); }

/* 主界面 */
.app { max-width: 1080px; margin: 0 auto; padding: 28px 18px 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.topbar .brand { font-size: 22px; }
.top-user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #fff;
}
.link-btn {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--glass); color: var(--ink); font-size: 13px; cursor: pointer; text-decoration: none;
  transition: background 0.2s;
}
.link-btn:hover { background: var(--glass-strong); }
.link-btn.danger { color: #ff9f99; border-color: rgba(255, 69, 58, 0.35); }

/* 配额条 */
.quota { padding: 18px 22px; margin-bottom: 18px; display: flex; align-items: center; gap: 18px; }
.quota-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.quota-bar { flex: 1; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.quota-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width 0.4s; }
.quota-num { font-size: 13px; white-space: nowrap; }
.quota-num b { color: var(--ink); }

/* 上传区 */
.dropzone {
  padding: 34px 24px; text-align: center; cursor: pointer;
  border: 2px dashed rgba(255, 255, 255, 0.2); border-radius: var(--radius);
  background: var(--glass); backdrop-filter: blur(24px) saturate(180%);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  position: relative; overflow: hidden;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--glass-strong); }
.dropzone.drag { transform: scale(1.005); }
.dropzone .dz-icon { font-size: 42px; margin-bottom: 10px; }
.dropzone .dz-title { font-size: 17px; font-weight: 700; }
.dropzone .dz-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.dropzone .dz-sub span { color: var(--accent); }

/* 上传进度 */
.queue { margin-top: 14px; }
.q-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; margin-bottom: 8px;
  border-radius: 14px; background: var(--glass); border: 1px solid var(--border);
  font-size: 13px;
}
.q-item .q-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-bar { width: 120px; height: 6px; border-radius: 999px; background: rgba(255,255,255,0.1); overflow: hidden; }
.q-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); transition: width 0.2s; }
.q-status { width: 60px; text-align: right; color: var(--muted); }
.q-status.done { color: var(--green); }
.q-status.err { color: var(--red); }

/* 结果外链 */
.linkbox { margin-top: 14px; padding: 18px 20px; }
.linkbox h3 { font-size: 14px; margin-bottom: 12px; color: var(--muted); font-weight: 600; }
.code-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.code-row { display: flex; align-items: center; gap: 8px; }
.code-row label { font-size: 11px; color: var(--muted); width: 58px; flex-shrink: 0; }
.code-row input {
  flex: 1; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25); color: var(--ink); font-size: 12px; font-family: ui-monospace, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy-btn { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--glass); color: var(--ink); font-size: 12px; cursor: pointer; transition: background 0.2s; }
.copy-btn:hover { background: var(--glass-strong); }

/* 图片网格 */
.grid-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 4px 14px; }
.grid-title h2 { font-size: 16px; font-weight: 700; }
.grid-title .cnt { font-size: 12px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.card {
  border-radius: 18px; overflow: hidden; background: var(--glass);
  border: 1px solid var(--border); backdrop-filter: blur(24px) saturate(180%);
  transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4); }
.card .thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: rgba(0,0,0,0.2); cursor: zoom-in; transition: transform 0.2s; }
.thumb-wrap { position: relative; }
.share-badge {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: rgba(48, 209, 88, 0.85); color: #062b12;
  backdrop-filter: blur(8px);
}

/* 多选 */
.pick {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(10, 12, 24, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s;
}
.pick:hover { background: rgba(10, 12, 24, 0.8); border-color: var(--accent); }
.pick input { display: none; }
.pick::after {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  background: transparent; transition: background 0.15s;
}
.card.picked .pick { background: var(--accent); border-color: var(--accent); }
.card.picked .pick::after { background: #fff; }
.card.picked {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.45), 0 14px 40px rgba(0, 0, 0, 0.4);
}
.card.picked .thumb-wrap::after {
  content: ''; position: absolute; inset: 0;
  background: rgba(10, 132, 255, 0.12); pointer-events: none;
}

/* 批量操作栏 */
.bulkbar {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(120px);
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; z-index: 80;
  transition: transform 0.28s ease; white-space: nowrap;
}
.bulkbar.show { transform: translateX(-50%) translateY(0); }
.bulk-count { font-size: 13px; color: var(--ink); font-weight: 600; margin-right: 6px; }
@media (max-width: 640px) {
  .bulkbar { width: calc(100vw - 24px); justify-content: center; flex-wrap: wrap; }
}
.card .meta { padding: 12px 14px; }
.card .m-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .m-sub { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.card .m-sub .exp-badge { color: var(--yellow); }
.card .m-sub .exp-badge.off { color: var(--muted); }
.card .ops { display: flex; gap: 6px; padding: 0 14px 14px; flex-wrap: wrap; }
.card .ops select {
  flex: 1; min-width: 90px; padding: 6px 8px; border-radius: 9px; font-size: 12px;
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.25); color: var(--ink); outline: none;
}
.sm-btn { padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--glass); color: var(--ink); font-size: 12px; cursor: pointer; transition: background 0.2s; }
.sm-btn:hover { background: var(--glass-strong); }
.sm-btn.danger { color: #ff9f99; border-color: rgba(255, 69, 58, 0.35); }

.empty {
  padding: 60px 20px; text-align: center; color: var(--muted); font-size: 14px;
  border-radius: var(--radius); background: var(--glass); border: 1px solid var(--border);
}
.empty .big { font-size: 40px; margin-bottom: 12px; }

/* toast */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 12px 22px; border-radius: 999px; font-size: 13px; opacity: 0;
  background: var(--glass-strong); border: 1px solid var(--border);
  backdrop-filter: blur(24px) saturate(180%);
  transition: transform 0.3s, opacity 0.3s; z-index: 99; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* modal（分享弹窗 + 灯箱） */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center;
  background: rgba(8, 10, 20, 0.65);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 24px;
}
#shareDlg { z-index: 95; } /* 分享弹窗在灯箱之上 */
.modal {
  width: 100%; max-width: 520px; padding: 28px;
  animation: pop 0.22s ease;
  position: relative;
}
.modal h3 { font-size: 16px; margin-bottom: 14px; }
.modal-x {
  position: absolute; top: 12px; left: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.1); color: var(--muted);
  font-size: 14px; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.modal-x:hover { background: rgba(255, 255, 255, 0.2); color: var(--ink); }
.modal .share-name, .modal > h3 { padding-left: 26px; }
.up-thumb { margin: 4px 0 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.2); }
.up-thumb img { width: 100%; max-height: 260px; object-fit: contain; display: block; }
.share-label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 6px; font-weight: 600; }
.share-result { border-top: 1px solid var(--border); padding-top: 14px; }
.lightbox-img {
  max-width: 94vw; max-height: 76vh; border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border); background: rgba(0, 0, 0, 0.3);
  display: block;
}
.lb-wrap { max-width: 96vw; }
.lb-info {
  margin-top: 14px; padding: 14px 18px;
}
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.lb-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row { display: flex; align-items: center; gap: 8px; }
.lb-row label { font-size: 11px; color: var(--muted); width: 58px; flex-shrink: 0; }
.lb-row input {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25); color: var(--ink); font-size: 12px; font-family: ui-monospace, monospace;
}
.lb-remain { margin-top: 8px; font-size: 12px; color: var(--muted); }
.lb-remain a { color: var(--accent); text-decoration: none; }
.lb-remain b { color: var(--yellow); }
@keyframes pop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.footer { text-align: center; margin-top: 40px; color: var(--muted); font-size: 12px; line-height: 2; }

@media (max-width: 640px) {
  .code-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
