/* ====== CSS Variables ====== */
:root {
  --primary: #6C5CE7;
  --primary-light: #8B7CF6;
  --primary-dark: #5A4BD1;
  --primary-bg: rgba(108,92,231,0.08);
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --text: #2D3436;
  --text-secondary: #636E72;
  --text-muted: #B2BEC3;
  --border: #E8ECF0;
  --danger: #E17055;
  --danger-bg: #FFF0EE;
  --success: #00B894;
  --success-bg: #E6FFF9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ====== Reset ====== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
input, button, textarea, select { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; outline: none; }
input, textarea { outline: none; border: none; }

/* ====== Utility ====== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: 6px; }
.gap-sm { gap: 10px; }
.gap-md { gap: 16px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); font-size: 0.85rem; }
.mt-sm { margin-top: 10px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }
.mb-sm { margin-bottom: 10px; }
.mb-md { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 42px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(108,92,231,0.3);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; min-height: 32px; }
.btn-xs { padding: 4px 10px; font-size: 0.75rem; min-height: 28px; }
.btn-block { width: 100%; }

/* ====== Form ====== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--card);
  transition: border-color 0.2s;
  color: var(--text);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* ====== Card ====== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
}

/* ====== Page Layout ====== */
.page { display: none; }
.page.active { display: block; }

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 16px;
}
@media (min-width: 768px) {
  .container { max-width: 800px; padding: 32px 24px; }
}
@media (min-width: 1024px) {
  .container { max-width: 1000px; }
}

/* ====== Header ====== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
}
.app-header .inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
}
.app-header .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ====== Auth Page ====== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 25%, #24243e 50%, #1a1a2e 75%, #0f0c29 100%);
}
/* 动态波纹层1 */
.auth-wave-1 {
  position: absolute;
  bottom: 0; left: -50%;
  width: 200%; height: 100%;
  background: radial-gradient(ellipse at 30% 80%, rgba(99,102,241,0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 90%, rgba(236,72,153,0.1) 0%, transparent 50%);
  animation: waveMove1 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
/* 动态波纹层2 */
.auth-wave-2 {
  position: absolute;
  bottom: -30%; left: -30%;
  width: 180%; height: 100%;
  background: radial-gradient(ellipse at 70% 60%, rgba(139,92,246,0.12) 0%, transparent 45%),
              radial-gradient(ellipse at 40% 70%, rgba(59,130,246,0.08) 0%, transparent 50%);
  animation: waveMove2 25s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}
/* 浮动光球 */
.auth-orbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
.auth-orb:nth-child(1) {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #6366f1, transparent);
  top: 10%; left: 20%;
  animation: orbFloat1 12s infinite alternate;
}
.auth-orb:nth-child(2) {
  width: 250px; height: 250px;
  background: radial-gradient(circle, #ec4899, transparent);
  top: 50%; right: 15%;
  animation: orbFloat2 15s infinite alternate;
}
.auth-orb:nth-child(3) {
  width: 200px; height: 200px;
  background: radial-gradient(circle, #06b6d4, transparent);
  bottom: 20%; left: 40%;
  animation: orbFloat3 18s infinite alternate;
}
.auth-orb:nth-child(4) {
  width: 180px; height: 180px;
  background: radial-gradient(circle, #8b5cf6, transparent);
  top: 30%; right: 30%;
  animation: orbFloat4 14s infinite alternate;
}
/* 星星粒子层 */
.auth-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.auth-star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  animation: starTwinkle 4s ease-in-out infinite;
}
.auth-star:nth-child(1) { width:3px; height:3px; top:15%; left:10%; animation-delay:0s; }
.auth-star:nth-child(2) { width:2px; height:2px; top:25%; left:80%; animation-delay:0.5s; }
.auth-star:nth-child(3) { width:2px; height:2px; top:60%; left:30%; animation-delay:1s; }
.auth-star:nth-child(4) { width:3px; height:3px; top:70%; left:75%; animation-delay:1.5s; }
.auth-star:nth-child(5) { width:2px; height:2px; top:40%; left:55%; animation-delay:2s; }
.auth-star:nth-child(6) { width:2px; height:2px; top:85%; left:15%; animation-delay:2.5s; }
.auth-star:nth-child(7) { width:3px; height:3px; top:10%; left:50%; animation-delay:3s; }
.auth-star:nth-child(8) { width:2px; height:2px; top:50%; left:90%; animation-delay:3.5s; }
.auth-star:nth-child(9) { width:2px; height:2px; top:35%; left:35%; animation-delay:1.2s; }
.auth-star:nth-child(10) { width:2px; height:2px; top:75%; left:60%; animation-delay:2.8s; }

@keyframes waveMove1 {
  0%, 100% { transform: translateX(0) translateY(0); }
  25% { transform: translateX(5%) translateY(-3%); }
  50% { transform: translateX(-3%) translateY(-6%); }
  75% { transform: translateX(-8%) translateY(-2%); }
}
@keyframes waveMove2 {
  0%, 100% { transform: translateX(0) translateY(0); }
  33% { transform: translateX(-6%) translateY(-5%); }
  66% { transform: translateX(4%) translateY(-8%); }
}
@keyframes orbFloat1 {
  0% { transform: translate(0, 0) scale(1); opacity: .4; }
  50% { transform: translate(80px, -40px) scale(1.3); opacity: .25; }
  100% { transform: translate(-40px, 30px) scale(0.9); opacity: .5; }
}
@keyframes orbFloat2 {
  0% { transform: translate(0, 0) scale(1); opacity: .35; }
  50% { transform: translate(-60px, 50px) scale(1.25); opacity: .2; }
  100% { transform: translate(30px, -30px) scale(0.85); opacity: .45; }
}
@keyframes orbFloat3 {
  0% { transform: translate(0, 0) scale(1); opacity: .3; }
  50% { transform: translate(50px, -60px) scale(1.35); opacity: .18; }
  100% { transform: translate(-50px, -20px) scale(0.8); opacity: .4; }
}
@keyframes orbFloat4 {
  0% { transform: translate(0, 0) scale(1); opacity: .35; }
  50% { transform: translate(-70px, 30px) scale(1.2); opacity: .22; }
  100% { transform: translate(40px, -40px) scale(0.9); opacity: .42; }
}
@keyframes starTwinkle {
  0%, 100% { opacity: .3; transform: scale(1); }
  50% { opacity: .9; transform: scale(1.8); }
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 40px 30px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}
.auth-card .logo {
  text-align: center;
  font-size: 3.5rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.auth-card h1 {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  letter-spacing: 1px;
}
.auth-card .subtitle {
  text-align: center;
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
  margin-bottom: 32px;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 4px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s;
  background: transparent;
}
.auth-tab.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
/* Auth form inputs dark theme */
#page-auth .form-label {
  color: rgba(255,255,255,0.6);
}
#page-auth .form-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  transition: all 0.3s;
}
#page-auth .form-input::placeholder {
  color: rgba(255,255,255,0.3);
}
#page-auth .form-input:focus {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
#page-auth .btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 10px;
  padding: 14px;
  font-size: 1rem;
  letter-spacing: 2px;
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}
#page-auth .btn-primary:active {
  transform: scale(0.98);
}
/* 忘记密码提示 */
.auth-help {
  text-align: center;
  margin-top: 14px;
}
.auth-help-text {
  color: rgba(255,255,255,0.4);
  font-size: 0.78rem;
}
/* 客服微信 */
.auth-contact {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.auth-contact-label {
  color: rgba(255,255,255,0.4);
  font-size: 0.75rem;
  margin-bottom: 8px;
}
.auth-wechat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(7,193,96,0.15);
  border: 1px solid rgba(7,193,96,0.3);
  border-radius: 20px;
  padding: 8px 18px;
  color: #07c160;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.5px;
}
.auth-wechat:hover {
  background: rgba(7,193,96,0.25);
  box-shadow: 0 0 20px rgba(7,193,96,0.2);
}
.auth-wechat-icon {
  font-size: 1.2rem;
}
.auth-copy-hint {
  color: rgba(255,255,255,0.3);
  font-size: 0.7rem;
  margin-top: 6px;
  transition: all 0.3s;
}

/* ====== Toast ====== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  white-space: nowrap;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====== Tabs (Dashboard) ====== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ====== Gallery Grid ====== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 540px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}
@media (min-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: #e8ecf0;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}
.gallery-item:active { transform: scale(0.97); }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item .item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  padding: 24px 10px 8px;
  color: #fff;
}
.gallery-item .item-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gallery-item .item-cat {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-top: 2px;
}

/* ====== Category List ====== */
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.cat-item .cat-name { font-weight: 600; font-size: 0.9rem; }
.cat-item .cat-actions { display: flex; gap: 6px; }

/* ====== Upload Zone ====== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-bg);
}
.upload-zone .icon { font-size: 2.5rem; margin-bottom: 8px; }
.upload-zone .text { color: var(--text-secondary); font-size: 0.85rem; }
.upload-zone .hint { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }

/* ====== Image Detail Modal ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--card);
  border-radius: var(--radius);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.active .modal {
  transform: translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ====== Share Page (public gallery) ====== */
.share-header {
  background: var(--card);
  padding: 24px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.share-admin-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 0.78rem;
  color: #fff;
  text-decoration: none;
  padding: 6px 16px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
  transition: all 0.25s ease;
  letter-spacing: 0.5px;
}
.share-admin-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,0.45);
  color: #fff;
}
.share-header .avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 10px;
  overflow: hidden;
}
.share-header .avatar.has-img {
  background: none;
}
.share-header .avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.share-header h2 { font-size: 1.1rem; font-weight: 700; }
.share-header p { color: var(--text-secondary); font-size: 0.8rem; margin-top: 4px; }

/* ====== Header Avatar (Dashboard) ====== */
.header-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.header-avatar:hover { transform: scale(1.1); }
.header-avatar.has-img { background: none; }
.header-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ====== Profile Avatar (Settings) ====== */
.profile-avatar-wrap {
  position: relative;
  width: 96px; height: 96px;
  margin: 0 auto;
  cursor: pointer;
}
.profile-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  overflow: hidden;
}
.profile-avatar.has-img { background: none; }
.profile-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.2s;
}
.profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1; }

.profile-settings { padding: 8px 0; }

/* ====== Lightbox ====== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  touch-action: none;
}
.lightbox.active { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: 94vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
}
.lightbox-close {
  position: fixed;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.lightbox-desc {
  position: fixed;
  bottom: 40px; left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  padding: 8px 18px;
  border-radius: 20px;
  max-width: 90vw;
  text-align: center;
}

/* ====== Empty State ====== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty .icon { font-size: 3rem; margin-bottom: 12px; }
.empty p { font-size: 0.9rem; }

/* ====== Spinner ====== */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 管理版块标签 ====== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid transparent;
}
.tag:hover { border-color: var(--primary); color: var(--primary); }
.tag.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

/* ====== Group Card (图片组封面卡片) ====== */
.group-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s;
}
.group-card:active { transform: scale(0.97); }
.group-card.dragging { opacity: 0.4; }
.group-cover {
  position: relative;
  aspect-ratio: 3/4;
  background: #e8ecf0;
  overflow: hidden;
}
.group-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.group-no-cover {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--bg);
}
.group-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.group-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 8px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  display: flex;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.group-card:hover .group-overlay,
.group-card:active .group-overlay { opacity: 1; }
.group-share-btn-sm {
  background: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  color: #fff !important;
  backdrop-filter: blur(6px);
}
.group-info {
  padding: 10px 10px 12px;
}
.group-sort-btns {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.sort-btn {
  width: 24px; height: 24px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f5f5f5;
  color: #666;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  padding: 0;
}
.sort-btn:active { background: #e0e0e0; }
.group-name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}
.group-cat {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ====== Detail Image List (组内图片列表) ====== */
.detail-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-image-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: background 0.15s, opacity 0.2s;
}
.detail-image-item:hover { background: #eef0f6; }
.detail-image-item.dragging { opacity: 0.5; }
.detail-image-item.drag-over { border: 2px dashed var(--primary); }
.sort-handle {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: #999;
  cursor: grab;
  user-select: none;
  padding: 0 4px;
  line-height: 1;
}
.sort-handle:active { cursor: grabbing; }
.detail-image-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #e0e0e0;
}
.detail-image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-image-info {
  flex: 1;
  min-width: 0;
}
.detail-image-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-image-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Detail image actions (edit/delete buttons) */
.detail-image-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}
.detail-image-actions .btn {
  white-space: nowrap;
}

/* ====== Batch Upload Preview ====== */
.batch-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.batch-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.batch-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.batch-remove {
  position: absolute;
  top: 2px; right: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(231,76,60,0.85);
  color: #fff;
  border: none;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  z-index: 3;
  padding: 0;
}
.batch-idx {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 0 0 0 6px;
}

/* ====== Lightbox Nav ====== */
.lightbox-nav {
  position: fixed;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  pointer-events: none;
  z-index: 20;
}
.lightbox-prev, .lightbox-next {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s;
}
.lightbox-prev:active, .lightbox-next:active { background: rgba(255,255,255,0.3); }
.lightbox-counter {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-weight: 500;
}

/* ====== Share Group Detail ====== */
.share-group-detail {
  padding: 16px 0;
}
.share-group-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.share-group-desc {
  margin-top: 4px;
}

/* ====== Upload Zone Small ====== */
.upload-zone-sm {
  padding: 24px 16px;
}
.upload-zone-sm .icon { font-size: 1.5rem; }
.upload-zone-sm .text { font-size: 0.8rem; }

/* ====== Password Protection ====== */
.group-protected-badge {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 2;
  background: rgba(239,68,68,0.85);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.5;
  pointer-events: none;
}
/* 分享页保密组模糊（未验证用户） */
.group-cover.protected img {
  filter: blur(20px) brightness(0.4);
  transform: scale(1.05);
}
.group-cover.protected .group-protected-badge {
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  padding: 6px 14px;
  font-size: 0.8rem;
}
.protect-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 6px;
}
.protect-toggle input { display: none; }
.protect-switch {
  width: 44px; height: 24px;
  background: #ddd;
  border-radius: 12px;
  position: relative;
  transition: background 0.3s;
  flex-shrink: 0;
}
.protect-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.protect-toggle input:checked + .protect-switch {
  background: var(--danger);
}
.protect-toggle input:checked + .protect-switch::after {
  transform: translateX(20px);
}
.protect-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.protect-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-left: auto;
}
.pwd-input-group {
  margin-top: 10px;
  display: none;
}
.pwd-input-group.show { display: block; }
/* Password verify modal */
.pwd-modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.pwd-modal {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 360px; width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.pwd-modal-icon { font-size: 2.5rem; margin-bottom: 12px; }
.pwd-modal h3 { font-size: 1.1rem; margin-bottom: 6px; }
.pwd-modal p { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 20px; }
.pwd-modal input { margin-bottom: 14px; }
.pwd-modal .pwd-mode-hint { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 8px; }
.pwd-modal .btn { width: 100%; }
.pwd-error { color: var(--danger); font-size: 0.78rem; min-height: 20px; }

/* ====== QRCode Modal ====== */
.qrcode-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
}
.qrcode-wrapper canvas,
.qrcode-wrapper img {
  display: block;
}

/* 分享页二维码按钮 */
.share-qrcode-btn {
  position: absolute;
  top: 14px;
  left: 16px;
  width: 32px;
  height: 32px;
  border-radius: 20px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.25s;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.share-qrcode-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99,102,241,0.45);
}

/* ====== Responsive: Group Card match gallery grid ====== */
@media (min-width: 540px) {
  .group-card .group-cover { aspect-ratio: 3/4; }
}
@media (min-width: 768px) {
  .group-card .group-cover { aspect-ratio: 4/5; }
}
