/* 5811图库 - 全局样式 */

:root {
  --color-bg: #FFFFFF;
  --color-bg-secondary: #F8F8F8;
  --color-bg-card: #FAFAFA;
  --color-text: #1A1A1A;
  --color-text-secondary: #666666;
  --color-text-muted: #999999;
  --color-border: #E8E8E8;
  --color-divider: #F0F0F0;
  --color-primary: #1A1A1A;
  --color-primary-hover: #333333;
  --color-white: #FFFFFF;
  --header-height: 60px;
  --sidebar-width: 280px;
  --footer-height: 80px;
  --border-radius: 8px;
  --content-max-width: 1920px;
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* 通用按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 24px; border: none; border-radius: var(--border-radius);
  font-size: var(--font-size-base); font-weight: 500; transition: all 0.2s;
}
.btn-primary { background: var(--color-primary); color: var(--color-white); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-outline { background: transparent; color: var(--color-primary); border: 1px solid var(--color-border); }
.btn-outline:hover { border-color: var(--color-primary); background: var(--color-bg-secondary); }
.btn-sm { padding: 6px 14px; font-size: var(--font-size-sm); }

/* 加载动画 */
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid var(--color-divider);
  border-top-color: var(--color-primary); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 页面布局 */
.app-layout {
  display: flex; flex-direction: column; min-height: 100vh;
}
.app-main {
  flex: 1; display: flex; margin-top: var(--header-height);
}

/* 骨架屏动画 */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-secondary) 25%, #eeeeee 50%, var(--color-bg-secondary) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--border-radius);
}
.skeleton-img { width: 100%; min-height: 160px; }
.skeleton-text { height: 14px; margin: 8px 12px; width: 60%; }
.skeleton-text-short { height: 12px; margin: 6px 12px 10px; width: 40%; }

/* 图片懒加载占位符 */
.img-placeholder-wrap {
  position: relative; width: 100%; background: var(--color-bg-secondary); overflow: hidden;
}
.img-placeholder-wrap .lazy-img {
  width: 100%; display: block; opacity: 0;
  transition: opacity 0.5s ease;
  min-height: 100px;
}
.img-placeholder-wrap.loaded .lazy-img { opacity: 1; }
.img-placeholder-icon {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--color-border); pointer-events: none;
  transition: opacity 0.3s ease;
}
.img-placeholder-wrap.loaded .img-placeholder-icon { opacity: 0; }

/* Toast 通知 */
.toast-container {
  position: fixed; top: calc(var(--header-height) + 16px); right: 24px;
  z-index: 300; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 20px; border-radius: var(--border-radius);
  font-size: var(--font-size-sm); color: var(--color-white);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 360px; word-break: break-word;
}
.toast-error { background: #e74c3c; }
.toast-success { background: #27ae60; }
.toast-info { background: #3498db; }
.toast-warning { background: #f39c12; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

/* 回到顶部按钮 */
.scroll-top-btn {
  position: fixed; bottom: 32px; right: 32px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-primary); color: var(--color-white);
  border: none; font-size: 18px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: all 0.3s;
  opacity: 0; pointer-events: none;
}
.scroll-top-btn.visible { opacity: 1; pointer-events: auto; }
.scroll-top-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.3); }

/* 空状态重试按钮 */
.retry-btn {
  margin-top: 12px; padding: 8px 24px;
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--border-radius); font-size: var(--font-size-sm);
  color: var(--color-text-secondary); cursor: pointer; transition: all 0.2s;
}
.retry-btn:hover { border-color: var(--color-primary); color: var(--color-text); }

/* ========== 用户菜单样式 ========== */

/* 用户区域 */
.header-user-area {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.header-login-area {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.header-login-btn {
  padding: 8px 20px;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

/* 用户菜单 */
.header-user-menu {
  position: relative;
}

.header-user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.header-user-trigger:hover {
  border-color: var(--color-primary);
  background: var(--color-bg-secondary);
}

.header-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.header-avatar-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.header-username {
  font-size: var(--font-size-sm);
  color: var(--color-text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 用户下拉菜单 */
.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  min-width: 180px;
  padding: 8px 0;
  display: none;
  z-index: 100;
}

.header-user-dropdown.show {
  display: block;
  animation: dropdownFadeIn 0.15s ease;
}

@keyframes dropdownFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  background: transparent;
  border: none;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
}

.dropdown-divider {
  height: 1px;
  background: var(--color-divider);
  margin: 4px 0;
}

.dropdown-logout {
  color: #e74c3c;
}

.dropdown-logout:hover {
  color: #c0392b;
  background: #fef0f0;
}

/* 积分链接 */
.header-points-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--color-bg-secondary);
  border-radius: 16px;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  transition: all 0.2s;
  text-decoration: none;
}

.header-points-link:hover {
  background: var(--color-bg-card);
  color: var(--color-text);
}

#headerPoints {
  color: #e74c3c;
  font-weight: 600;
}

/* ========== 可见性设置样式 ========== */

.visibility-options {
  display: flex;
  gap: 12px;
}

.visibility-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.visibility-option input[type="radio"] {
  display: none;
}

.visibility-option:hover {
  border-color: var(--color-primary);
}

.visibility-option.selected {
  border-color: var(--color-primary);
  background: var(--color-bg-secondary);
}

.visibility-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* 积分横幅（创作页） */
.form-group .points-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--color-bg-secondary);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
}

.form-group .points-banner strong {
  color: #e74c3c;
  font-size: var(--font-size-lg);
}

.form-group .points-cost {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}
