/* ================================
   图床 - 设计系统
   ================================ */

/* 颜色系统 */
:root {
  --color-primary: #FF6B35;
  --color-primary-light: #FF8A5C;
  --color-secondary: #004E89;
  --color-bg: #FAFAF8;
  --color-surface: #FFFFFF;
  --color-text: #1A1A2E;
  --color-text-secondary: #6B7280;
  --color-border: #E8E5E0;
  --color-border-hover: #D1CCC5;
  --color-success: #10B981;
  --color-error: #EF4444;
  
  /* 字体 */
  --font-display: 'Outfit', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  
  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* 圆角 */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
}

/* ================================
   基础样式
   ================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ================================
   导航栏
   ================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--space-xl);
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.brand-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-status {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--color-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ================================
   主内容
   ================================ */

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
}

/* ================================
   上传区域
   ================================ */

.upload-section {
  margin-bottom: var(--space-2xl);
}

.upload-zone {
  position: relative;
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.upload-zone:hover {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, rgba(255,107,53,0.02) 0%, rgba(255,107,53,0.05) 100%);
}

.upload-zone.dragover {
  border-color: var(--color-primary);
  border-style: solid;
  background: linear-gradient(135deg, rgba(255,107,53,0.05) 0%, rgba(255,107,53,0.08) 100%);
  transform: scale(1.01);
}

.upload-content {
  position: relative;
  z-index: 2;
}

.upload-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: var(--color-bg);
  border-radius: 50%;
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  transition: transform 0.3s ease;
}

.upload-zone:hover .upload-icon {
  transform: translateY(-4px);
}

.upload-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.upload-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

.upload-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-btn:hover {
  color: var(--color-primary-light);
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* 上传波纹效果 */
.upload-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(255,107,53,0.3) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  z-index: 1;
}

.upload-ripple.active {
  animation: rippleExpand 0.8s ease-out forwards;
}

@keyframes rippleExpand {
  0% {
    width: 0;
    height: 0;
    opacity: 1;
  }
  100% {
    width: 600px;
    height: 600px;
    opacity: 0;
  }
}

/* 进度条 */
.progress-wrapper {
  margin-top: var(--space-lg);
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeInUp 0.3s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.progress-track {
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-align: center;
}

/* ================================
   画廊
   ================================ */

.gallery-section {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.gallery-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--color-bg);
  border-color: var(--color-border-hover);
  color: var(--color-text);
}

/* 图片网格 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

.gallery-item {
  position: relative;
  aspect-ratio: 1;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item .item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,26,46,0.9) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md);
}

.gallery-item:hover .item-overlay {
  opacity: 1;
}

.item-info {
  margin-bottom: var(--space-sm);
}

.item-name {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-size {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.6);
}

.item-actions {
  display: flex;
  gap: var(--space-sm);
}

.item-btn {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.item-btn-copy {
  background: var(--color-primary);
  color: white;
}

.item-btn-copy:hover {
  background: var(--color-primary-light);
}

.item-btn-delete {
  background: rgba(255,255,255,0.15);
  color: white;
  flex: 0;
  padding: var(--space-sm);
}

.item-btn-delete:hover {
  background: var(--color-error);
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: var(--space-2xl);
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: var(--color-bg);
  border-radius: 50%;
  color: var(--color-border);
  margin-bottom: var(--space-lg);
}

.empty-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

.empty-hint {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* ================================
   Toast 提示
   ================================ */

.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--color-text);
  color: white;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

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

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-error);
}

/* ================================
   响应式
   ================================ */

@media (max-width: 640px) {
  .main {
    padding: var(--space-lg) var(--space-md);
  }
  
  .upload-zone {
    padding: var(--space-xl) var(--space-md);
  }
  
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  
  .nav {
    padding: var(--space-md);
  }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
