/* =========================================================
   Longの图床 · Consolidated UI
   ========================================================= */

:root {
  --long-bg: #f8faff;
  --long-card: rgba(255, 255, 255, 0.82);
  --long-text: #172033;
  --long-muted: #778099;
  --long-line: rgba(90, 108, 150, 0.14);
  --long-cyan: #55d5f5;
  --long-blue: #6497ff;
  --long-violet: #a67cff;
  --long-pink: #ed9bd4;
  --long-brand-gradient: linear-gradient(
    125deg,
    #52c9f6 0%,
    #5e9bfa 30%,
    #747df7 54%,
    #aa75ed 78%,
    #df8fd0 100%
  );
  --long-shadow: 0 20px 55px rgba(72, 88, 140, 0.075),
    0 6px 22px rgba(166, 124, 255, 0.035),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

body.long-home {
  min-height: 100vh;
  margin: 0;
  padding-bottom: 72px;
  color: var(--long-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(ellipse 52% 42% at 4% 5%, rgba(85, 213, 245, 0.17), transparent 68%),
    radial-gradient(ellipse 46% 40% at 96% 6%, rgba(166, 124, 255, 0.145), transparent 68%),
    radial-gradient(ellipse 44% 36% at 89% 72%, rgba(237, 155, 212, 0.1), transparent 72%),
    radial-gradient(ellipse 40% 30% at 22% 82%, rgba(100, 151, 255, 0.065), transparent 74%),
    linear-gradient(180deg, #fbfdff 0%, #fafaff 48%, #fffafd 100%);
}

body.long-home::before,
body.long-home::after {
  position: fixed;
  z-index: -1;
  content: "";
  pointer-events: none;
  border-radius: 50%;
}

body.long-home::before {
  top: 6%;
  left: -190px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(85, 213, 245, 0.09), transparent 70%);
}

body.long-home::after {
  right: -210px;
  bottom: 4%;
  width: 470px;
  height: 470px;
  background: radial-gradient(circle, rgba(205, 132, 240, 0.075), transparent 70%);
}

/* ---------- 品牌栏 ---------- */

body.long-home #headcontainer {
  width: min(1100px, calc(100% - 40px));
  max-width: none;
  margin: 0 auto;
  padding: 20px 0 0;
}

body.long-home #headcontainer .row,
body.long-home #headcontainer .col-md-8 {
  width: 100%;
  margin: 0;
  padding: 0;
}

.long-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--long-text);
  text-decoration: none;
}

.long-brand:hover {
  color: var(--long-text);
  text-decoration: none;
}

.long-brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  overflow: hidden;
  place-items: center;
  color: rgba(255, 255, 255, 0.96);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.18),
    0 2px 8px rgba(57, 70, 155, 0.12);
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2) 22%, transparent 46%),
    radial-gradient(circle at 85% 88%, rgba(225, 152, 242, 0.27), transparent 48%),
    radial-gradient(circle at 18% 82%, rgba(85, 213, 245, 0.24), transparent 46%),
    linear-gradient(145deg, rgba(80, 174, 255, 0.72), rgba(98, 136, 255, 0.7) 48%, rgba(139, 105, 255, 0.67));
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(70, 91, 180, 0.16),
    0 4px 12px rgba(177, 125, 225, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 1px 0 0 rgba(255, 255, 255, 0.2),
    inset -1px 0 0 rgba(116, 104, 220, 0.1),
    inset 0 -1px 0 rgba(80, 78, 165, 0.12);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease, filter 0.22s ease;
}

.long-brand:hover .long-brand-mark {
  filter: brightness(1.025) saturate(1.04);
  transform: translateY(-1px) scale(1.015);
  box-shadow: 0 15px 34px rgba(70, 91, 180, 0.18),
    0 6px 15px rgba(177, 125, 225, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 1px 0 0 rgba(255, 255, 255, 0.23),
    inset -1px 0 0 rgba(116, 104, 220, 0.1),
    inset 0 -1px 0 rgba(80, 78, 165, 0.12);
}

.long-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.long-brand-title {
  color: #192238;
  font-size: 17px;
  font-weight: 760;
  letter-spacing: -0.025em;
}

.long-brand-subtitle {
  margin-top: 1px;
  color: rgba(112, 122, 150, 0.72);
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0.01em;
}

/* ---------- 主体与标题 ---------- */

body.long-home #main {
  width: min(900px, calc(100% - 40px));
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.long-hero {
  position: relative;
  padding: 24px 0 22px;
  overflow: visible;
  text-align: center;
}

.long-hero h1 {
  position: relative;
  z-index: 1;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.08em 0.1em 0.12em;
  overflow: visible;
  color: #172033;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.long-hero p {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 8px auto 0;
  color: rgba(91, 103, 133, 0.78);
  font-size: 14px;
  line-height: 1.65;
}

/* ---------- 上传主卡片 ---------- */

body.long-home #main > .well {
  position: relative;
  padding: 19px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 45% 70% at 5% 10%, rgba(85, 213, 245, 0.045), transparent 72%),
    radial-gradient(ellipse 45% 70% at 96% 12%, rgba(166, 124, 255, 0.042), transparent 72%),
    radial-gradient(ellipse 38% 55% at 88% 92%, rgba(237, 155, 212, 0.032), transparent 74%),
    var(--long-card);
  border: 1px solid rgba(132, 143, 205, 0.13);
  border-radius: 22px;
  box-shadow: var(--long-shadow);
  backdrop-filter: blur(16px) saturate(116%);
  -webkit-backdrop-filter: blur(16px) saturate(116%);
}

body.long-home #main > .well::before {
  position: absolute;
  top: 0;
  right: 30px;
  left: 30px;
  height: 1px;
  content: "";
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(85, 213, 245, 0.42),
    rgba(100, 151, 255, 0.42),
    rgba(166, 124, 255, 0.4),
    rgba(237, 155, 212, 0.32),
    transparent
  );
  border-radius: 999px;
}

.long-upload-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}

.long-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 4px 9px;
  color: #718094;
  font-size: 11.5px;
  background: rgba(239, 251, 255, 0.68);
  border: 1px solid rgba(91, 176, 225, 0.15);
  border-radius: 999px;
}

.long-format-chip {
  max-width: 100%;
  background: rgba(247, 242, 255, 0.66);
  border-color: rgba(166, 124, 255, 0.14);
}

/* ---------- 上传密钥 ---------- */

.long-key-disclosure {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.long-key-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 29px;
  padding: 4px 10px;
  color: #778096;
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  background: rgba(255, 245, 252, 0.64);
  border: 1px solid rgba(207, 139, 219, 0.14);
  border-radius: 999px;
  transform: translateY(0) scale(1);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
    background 0.18s ease, color 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, filter 0.18s ease;
}

.long-key-toggle:hover {
  color: #5a627a;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 245, 252, 0.84));
  border-color: rgba(172, 123, 220, 0.24);
  box-shadow: 0 8px 18px rgba(118, 110, 185, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(-1px);
}

.long-key-toggle:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.08s;
}

.long-key-disclosure.is-open .long-key-toggle,
.long-key-toggle[aria-expanded="true"] {
  color: #535d78;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(250, 244, 255, 0.9));
  border-color: rgba(170, 120, 228, 0.26);
  box-shadow: 0 9px 20px rgba(116, 109, 190, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transform: translateY(-1px);
}

.long-key-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(166, 124, 255, 0.12),
    0 8px 18px rgba(118, 110, 185, 0.08);
}

.long-key-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s ease;
}

.long-key-toggle:hover svg {
  transform: translateY(-1px) scale(1.04);
}

.long-key-disclosure.is-open .long-key-toggle svg,
.long-key-toggle[aria-expanded="true"] svg {
  transform: rotate(-8deg) scale(1.04);
}

.long-key-toggle-text {
  display: inline-block;
  min-width: 48px;
  white-space: nowrap;
  transition: color 0.18s ease, transform 0.18s ease;
}

.long-key-disclosure.is-open .long-key-toggle-text {
  color: #7b6fe3;
  transform: translateX(1px);
}

.long-key-panel {
  display: inline-flex;
  align-items: center;
  width: 0;
  margin-left: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-5px);
  transition: width 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.18s ease, margin 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.long-key-disclosure.is-open .long-key-panel {
  width: 156px;
  margin-left: 7px;
  pointer-events: auto;
  opacity: 1;
  transform: translateX(0);
}

.long-key-panel input {
  width: 156px;
  height: 29px;
  padding: 4px 10px;
  color: var(--long-text);
  font-size: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--long-line);
  border-radius: 10px;
}

.long-key-panel input:focus {
  border-color: rgba(81, 129, 255, 0.38);
  box-shadow: 0 0 0 3px rgba(80, 124, 255, 0.08);
}

/* ---------- Tabs ---------- */

body.long-home #uploadTabs {
  position: relative;
  z-index: 1;
  gap: 6px;
  margin-bottom: 14px !important;
  padding: 4px;
  background: linear-gradient(
    100deg,
    rgba(85, 213, 245, 0.05),
    rgba(100, 151, 255, 0.05) 42%,
    rgba(166, 124, 255, 0.052) 72%,
    rgba(237, 155, 212, 0.04)
  );
  border: 1px solid rgba(125, 145, 205, 0.055);
  border-radius: 13px;
}

body.long-home #uploadTabs .nav-item {
  margin: 0;
}

body.long-home #uploadTabs .nav-link {
  position: relative;
  padding: 8px 13px;
  color: #778099;
  font-size: 12.5px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-radius: 10px;
  transform: translateY(0) scale(1);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1),
    color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease,
    filter 0.18s ease;
}

body.long-home #uploadTabs .nav-link:hover {
  color: #4c5878;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(248, 249, 255, 0.7));
  box-shadow: 0 7px 18px rgba(70, 82, 130, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  transform: translateY(-2px);
}

body.long-home #uploadTabs .nav-link:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.08s;
}

body.long-home #uploadTabs .nav-link.active {
  color: #4d5685;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(249, 248, 255, 0.91));
  box-shadow: 0 8px 22px rgba(72, 82, 135, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

body.long-home #uploadTabs .nav-link::after {
  position: absolute;
  right: 50%;
  bottom: -1px;
  left: 50%;
  height: 2px;
  content: "";
  opacity: 0;
  background: linear-gradient(90deg, var(--long-cyan), var(--long-blue), var(--long-violet), var(--long-pink));
  border-radius: 999px;
  box-shadow: 0 2px 7px rgba(166, 124, 255, 0.2);
  transition: left 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    right 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s ease;
}

body.long-home #uploadTabs .nav-link.active::after {
  right: 10%;
  left: 10%;
  opacity: 1;
}

body.long-home #uploadTabs .nav-link:not(.active):hover::after {
  right: 28%;
  left: 28%;
  opacity: 0.28;
}

body.long-home #uploadTabs .nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(100, 151, 255, 0.13),
    0 7px 18px rgba(70, 82, 130, 0.08);
}

body.long-home #long-gallery-count,
body.long-home #my-uploads-count {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  margin-left: 5px;
  padding: 0 6px;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #5fcaf2, #727ff4 55%, #b978e7) !important;
  border-radius: 999px;
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.25, 1.35),
    box-shadow 0.2s ease, filter 0.2s ease;
}

body.long-home #uploadTabs .nav-link:hover #long-gallery-count,
body.long-home #uploadTabs .nav-link:hover #my-uploads-count {
  filter: brightness(1.05) saturate(1.08);
  transform: translateY(-1px) scale(1.08);
  box-shadow: 0 4px 10px rgba(108, 111, 240, 0.2);
}

/* ---------- Dropzone ---------- */

body.long-home #dropzone {
  position: relative;
  min-height: 238px;
  margin: 0;
  padding: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.64), rgba(251, 252, 255, 0.56), rgba(255, 250, 254, 0.51));
  border: 1.5px dashed rgba(99, 134, 202, 0.25);
  border-radius: 17px;
  box-shadow: none;
  transition: transform 0.2s ease, border-color 0.2s ease,
    background 0.2s ease, box-shadow 0.2s ease;
}

body.long-home #dropzone:hover,
body.long-home #dropzone.dz-drag-hover {
  background: linear-gradient(135deg, rgba(239, 251, 255, 0.82), rgba(248, 245, 255, 0.83) 58%, rgba(255, 243, 251, 0.72));
  border-color: rgba(142, 116, 244, 0.46);
  box-shadow: 0 20px 48px rgba(79, 113, 180, 0.075),
    0 9px 30px rgba(187, 121, 220, 0.06);
  transform: translateY(-1px);
}

body.long-home #dropzone .dz-message,
.long-drop-message {
  min-height: 200px;
  margin: 0;
}

.long-drop-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.long-drop-icon {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 13px;
  place-items: center;
  color: #747cff;
  background: linear-gradient(145deg, rgba(240, 252, 255, 0.98), rgba(245, 241, 255, 0.96), rgba(255, 241, 249, 0.9));
  border: 1px solid rgba(105, 116, 173, 0.12);
  border-radius: 16px;
  box-shadow: 0 11px 28px rgba(94, 102, 185, 0.1),
    0 5px 16px rgba(220, 145, 210, 0.055);
}

.long-drop-title {
  margin-bottom: 5px;
  color: #303a52;
  font-size: 15px;
  font-weight: 700;
}

.long-drop-hint {
  color: #8b93a8;
  font-size: 11.5px;
}

.long-drop-action,
body.long-home .btn-primary {
  color: #fff !important;
  background: var(--long-brand-gradient) !important;
  border: 0 !important;
  border-radius: 10px;
  box-shadow: 0 9px 22px rgba(105, 110, 230, 0.19),
    0 4px 14px rgba(218, 137, 203, 0.09);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.long-drop-action {
  margin-top: 13px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 650;
}

.long-drop-action:hover,
body.long-home .btn-primary:hover {
  filter: saturate(1.08) brightness(1.025);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(100, 109, 224, 0.23),
    0 6px 18px rgba(218, 137, 203, 0.12);
}

body.long-home .dropzone .dz-preview {
  margin: 12px;
}

body.long-home .dropzone .dz-preview .dz-image {
  overflow: hidden;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(54, 67, 105, 0.12);
}

/* ---------- 表单、状态和页脚 ---------- */

body.long-home #paste-pane > .well {
  margin: 0;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--long-line);
  border-radius: 18px;
  box-shadow: none;
}

body.long-home .form-control,
body.long-home .form-select {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(101, 114, 157, 0.18);
  border-radius: 12px;
}

body.long-home .form-control:focus,
body.long-home .form-select:focus {
  border-color: rgba(86, 119, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(86, 119, 255, 0.09);
}

body.long-home #uploadinfo .alert {
  margin-bottom: 16px;
  border: 0;
  border-radius: 13px;
}

body.long-home .footer {
  height: auto;
  min-height: 50px;
  padding: 15px 0;
  color: #a0a6b6;
  line-height: normal;
  background: rgba(255, 255, 255, 0.52);
  border-top: 1px solid rgba(105, 118, 165, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.long-home .footer p {
  margin: 0;
  font-size: 11.5px;
}

body.long-home .footer a {
  color: #858ce0;
  text-decoration: none;
}

body.long-home .long-hidden-doc,
body.long-home #my-uploads-tab,
body.long-home #my-uploads-pane {
  display: none !important;
}

/* ---------- 统一图库 ---------- */

body.long-home #long-gallery-pane {
  min-height: 320px;
}

.long-gallery-shell {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--long-line);
  border-radius: 18px;
}

.long-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 17px;
  background: rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(90, 108, 150, 0.11);
}

.long-gallery-heading {
  color: #303a52;
  font-size: 14px;
  font-weight: 720;
}

.long-gallery-subtitle {
  margin-top: 3px;
  color: #8b93a8;
  font-size: 11.5px;
  line-height: 1.5;
}

.long-gallery-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 7px;
}

.long-gallery-btn {
  min-height: 31px;
  padding: 6px 10px;
  color: #667089;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  appearance: none;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(100, 113, 160, 0.15);
  border-radius: 9px;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.long-gallery-btn:hover {
  color: #46516b;
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(91, 107, 255, 0.2);
}

.long-gallery-body,
.long-gallery-status {
  min-height: 270px;
}

.long-gallery-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 30px;
  color: #8b93a8;
  font-size: 12.5px;
  text-align: center;
}

.long-gallery-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(106, 117, 160, 0.16);
  border-top-color: #6e73ff;
  border-radius: 50%;
  animation: long-gallery-spin 0.75s linear infinite;
}

@keyframes long-gallery-spin {
  to {
    transform: rotate(360deg);
  }
}

.long-gallery-login,
.long-gallery-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 270px;
  padding: 32px 20px;
  text-align: center;
}

.long-gallery-login {
  min-height: 290px;
  padding: 34px 20px;
}

.long-gallery-login-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
  place-items: center;
  color: #6d72ff;
  background: linear-gradient(145deg, #fff, #f2f3ff);
  border: 1px solid rgba(100, 113, 160, 0.12);
  border-radius: 15px;
  box-shadow: 0 9px 24px rgba(73, 86, 150, 0.08);
}

.long-gallery-login-icon svg {
  width: 23px;
  height: 23px;
}

.long-gallery-login-title,
.long-gallery-empty-title {
  color: #303a52;
  font-size: 15px;
  font-weight: 700;
}

.long-gallery-empty-title {
  color: #414a61;
  font-size: 14px;
  font-weight: 680;
}

.long-gallery-login-desc,
.long-gallery-empty-desc {
  max-width: 440px;
  margin-top: 6px;
  color: #8b93a8;
  font-size: 11.5px;
  line-height: 1.65;
}

.long-gallery-login-form {
  display: flex;
  width: min(430px, 100%);
  gap: 8px;
  margin-top: 17px;
}

.long-gallery-key-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 7px 11px;
  color: var(--long-text);
  font-size: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(101, 114, 157, 0.18);
  border-radius: 10px;
}

.long-gallery-key-input:focus {
  border-color: rgba(86, 119, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(86, 119, 255, 0.08);
}

.long-gallery-login-btn {
  flex: none;
  height: 36px;
  padding: 0 15px;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  background: linear-gradient(135deg, var(--long-blue), var(--long-violet));
  border: 0;
  border-radius: 10px;
  box-shadow: 0 7px 16px rgba(91, 107, 255, 0.15);
}

.long-gallery-login-btn:hover {
  filter: brightness(1.03);
}

.long-gallery-login-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.long-gallery-login-error {
  min-height: 18px;
  margin-top: 8px;
  color: #c65c69;
  font-size: 11.5px;
}

.long-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 11px;
  padding: 13px;
}

.long-gallery-card {
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.77);
  border: 1px solid rgba(90, 108, 150, 0.12);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(62, 75, 111, 0.045);
}

.long-gallery-thumb {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, rgba(239, 242, 250, 0.9), rgba(247, 247, 255, 0.9));
}

.long-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.long-gallery-thumb:hover img {
  transform: scale(1.025);
}

.long-gallery-thumb img.is-error {
  opacity: 0.2;
}

.long-gallery-card-body {
  padding: 9px;
}

.long-gallery-name {
  overflow: hidden;
  color: #3d465d;
  font-size: 11.5px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.long-gallery-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  color: #969daf;
  font-size: 10px;
  white-space: nowrap;
}

.long-gallery-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 8px;
}

.long-gallery-action {
  min-width: 0;
  padding: 6px 7px;
  color: #68728a;
  font: inherit;
  font-size: 10.5px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  appearance: none;
  background: rgba(249, 250, 255, 0.88);
  border: 1px solid rgba(100, 113, 160, 0.13);
  border-radius: 8px;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.long-gallery-action:hover {
  color: #4c5670;
  background: #fff;
  border-color: rgba(91, 107, 255, 0.19);
}

.long-gallery-action.is-success {
  color: #458562;
  background: rgba(232, 248, 238, 0.9);
  border-color: rgba(73, 159, 105, 0.18);
}

.long-gallery-delete {
  color: #c25563;
}

.long-gallery-delete:hover {
  color: #b64050;
  background: rgba(255, 241, 243, 0.96);
  border-color: rgba(194, 72, 88, 0.22);
}

.long-gallery-delete:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* ---------- 删除密钥对话框 ---------- */

.long-delete-overlay {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(31, 38, 58, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.long-delete-dialog {
  width: min(390px, 100%);
  padding: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(115, 126, 170, 0.18);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(40, 49, 78, 0.22);
}

.long-delete-title {
  color: #303a52;
  font-size: 16px;
  font-weight: 720;
}

.long-delete-desc {
  margin-top: 7px;
  color: #838ba0;
  font-size: 12px;
  line-height: 1.6;
}

.long-delete-input {
  width: 100%;
  height: 38px;
  margin-top: 16px;
  padding: 7px 11px;
  color: var(--long-text);
  font-size: 12px;
  outline: none;
  background: #fff;
  border: 1px solid rgba(101, 114, 157, 0.2);
  border-radius: 10px;
}

.long-delete-input:focus {
  border-color: rgba(86, 119, 255, 0.42);
  box-shadow: 0 0 0 3px rgba(86, 119, 255, 0.09);
}

.long-delete-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.long-delete-buttons button {
  min-height: 34px;
  padding: 6px 13px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  border-radius: 9px;
}

.long-delete-cancel {
  color: #697289;
  background: #fff;
  border: 1px solid rgba(101, 114, 157, 0.18);
}

.long-delete-confirm {
  color: #fff;
  background: linear-gradient(135deg, #e77f91, #c66783);
  border: 0;
  box-shadow: 0 7px 16px rgba(194, 72, 88, 0.16);
}

/* ---------- 响应式 ---------- */

@media (max-width: 700px) {
  body.long-home {
    padding-bottom: 64px;
  }

  body.long-home #headcontainer,
  body.long-home #main {
    width: min(calc(100% - 24px), 900px);
  }

  body.long-home #headcontainer {
    padding-top: 14px;
  }

  .long-brand-mark {
    flex-basis: 46px;
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .long-hero {
    padding: 22px 0 18px;
  }

  .long-hero h1 {
    font-size: 31px;
  }

  .long-hero p {
    padding: 0 12px;
  }

  body.long-home #main > .well {
    padding: 14px;
    border-radius: 19px;
    backdrop-filter: blur(12px) saturate(112%);
    -webkit-backdrop-filter: blur(12px) saturate(112%);
  }

  .long-upload-meta {
    margin-bottom: 12px;
  }

  .long-key-disclosure {
    width: 100%;
  }

  .long-key-disclosure.is-open .long-key-panel {
    width: min(156px, calc(100vw - 170px));
  }

  .long-key-panel input {
    width: 100%;
  }

  body.long-home #uploadTabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  body.long-home #uploadTabs::-webkit-scrollbar {
    display: none;
  }

  body.long-home #uploadTabs .nav-link {
    white-space: nowrap;
  }

  body.long-home #dropzone {
    min-height: 220px;
  }

  body.long-home #dropzone .dz-message,
  .long-drop-message {
    min-height: 184px;
  }

  .long-gallery-head {
    align-items: flex-start;
    padding: 13px;
  }

  .long-gallery-subtitle {
    max-width: 210px;
  }

  .long-gallery-toolbar {
    gap: 5px;
  }

  .long-gallery-btn {
    min-height: 29px;
    padding: 5px 8px;
  }

  .long-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
  }

  .long-gallery-card-body {
    padding: 8px;
  }

  .long-gallery-meta {
    display: block;
    white-space: normal;
  }

  .long-gallery-meta span {
    display: block;
    margin-top: 2px;
  }

  .long-gallery-login {
    padding: 28px 14px;
  }

  .long-gallery-login-form {
    flex-direction: column;
  }

  .long-gallery-login-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .long-brand-mark,
  body.long-home #uploadTabs .nav-link,
  body.long-home #uploadTabs .nav-link::after,
  body.long-home #long-gallery-count,
  body.long-home #my-uploads-count,
  .long-key-toggle,
  .long-key-toggle svg,
  .long-key-panel,
  .long-gallery-thumb img {
    transition: none !important;
  }
}
