/* ============================================
   每日海报相册 - 全局样式
   设计风格：深色沉浸式、3D视差、极简
   ============================================ */

:root {
  --primary: #4A90D9;
  --primary-light: #6BB5FF;
  --bg-dark: #0D0D0D;
  --bg-card: #1A1A1A;
  --bg-card2: #242424;
  --text-primary: #FFFFFF;
  --text-secondary: #CCCCCC;
  --text-muted: #888888;
  --success: #4CAF50;
  --danger: #F44336;
  --warning: #FF9800;
  --radius: 16px;
  --radius-sm: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'PingFang SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  /* 手机端：限制最大宽度 */
  max-width: 430px;
  margin: 0 auto;
}

/* ==================== 登录页样式 ==================== */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* 背景装饰球 */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  pointer-events: none;
}
.orb-1 { width: 300px; height: 300px; background: var(--primary); top: -100px; left: -100px; }
.orb-2 { width: 200px; height: 200px; background: #6BB5FF; bottom: -50px; right: -50px; }
.orb-3 { width: 150px; height: 150px; background: #9B59B6; top: 50%; left: 60%; }

.login-card {
  width: 100%;
  max-width: 360px;
  background: rgba(26, 26, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 40px 28px;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.login-logo h1 {
  font-size: 24px;
  font-weight: 800;
  margin-top: 12px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.login-logo .subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 2px;
}

.input-group {
  margin-bottom: 20px;
}
.input-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}
.input-group input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.input-group input:focus {
  border-color: var(--primary);
}
.input-group input::placeholder {
  color: var(--text-muted);
}

.btn-primary {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 4px;
}
.btn-primary:active {
  transform: scale(0.97);
}
.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(74, 144, 217, 0.4);
}

.btn-secondary {
  padding: 12px 24px;
  background: var(--bg-card2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
}
.login-footer a {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
}
.login-footer a:hover {
  color: var(--primary-light);
}

/* 管理员弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 28px;
  width: 90%;
  max-width: 360px;
}
.modal-card h3 {
  font-size: 18px;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: 1;
}

/* ==================== 相册主页面样式 ==================== */

.album-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: var(--bg-dark);
}

/* 顶部状态栏 */
.album-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(13, 13, 13, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  z-index: 10;
  flex-shrink: 0;
}
.header-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.header-actions {
  display: flex;
  gap: 12px;
}
.header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
}
.header-btn svg {
  width: 20px;
  height: 20px;
}

/* 3D 滑动区域 */
.slider-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.slider-track {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* 每一天卡片 - 位置由 JS 动态控制，CSS 只设基础样式 */
.day-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 90%;
  max-width: 500px;
  min-height: 200px;
  transform-origin: center center;
  /* will-change 仅在拖拽/动画时由 JS 动态添加，避免闲置时占用 GPU 层 */
  cursor: grab;
  background: var(--bg-dark);
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.day-card:active {
  cursor: grabbing;
}

/* 海报卡片内部 - 透明无框 */
.poster-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  outline: none !important;
}

.poster-date-label {
  text-align: center;
  padding: 6px 0 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.poster-images {
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

/* 单张海报 */
.poster-single .poster-images {
  padding: 0;
}
.poster-single img.poster-img {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 0;
}

/* 两张海报：并排显示，完整不裁切 */
.poster-double img.poster-img {
  width: calc(50% - 2px);
  max-height: 55vh;
  object-fit: contain;
  border-radius: 0;
}

/* 三张海报：上1下2，完整不裁切 */
.poster-triple img.poster-img {
  border-radius: 0;
  object-fit: contain;
}
.poster-triple img.poster-img:first-child {
  width: 100%;
  max-height: 35vh;
  margin-bottom: 2px;
}
.poster-triple img.poster-img:nth-child(2),
.poster-triple img.poster-img:nth-child(3) {
  width: calc(50% - 2px);
  max-height: 35vh;
}

/* 四张海报：2x2，完整不裁切 */
.poster-quad img.poster-img {
  width: calc(50% - 2px);
  max-height: 30vh;
  object-fit: contain;
  border-radius: 0;
}

/* 五张海报：上3下2，完整不裁切 */
.poster-penta {
  display: flex;
  flex-direction: column;
}
.poster-penta .poster-images {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.poster-penta img.poster-img {
  border-radius: 0;
  object-fit: contain;
}
.poster-penta img.poster-img:nth-child(1),
.poster-penta img.poster-img:nth-child(2),
.poster-penta img.poster-img:nth-child(3) {
  width: calc(33.33% - 3px);
  max-height: 30vh;
}
.poster-penta img.poster-img:nth-child(4),
.poster-penta img.poster-img:nth-child(5) {
  width: calc(50% - 2px);
  max-height: 30vh;
}

/* 六张海报：3行x2列，完整不裁切 */
.poster-hexa img.poster-img {
  width: calc(50% - 2px);
  max-height: 25vh;
  object-fit: contain;
  border-radius: 0;
}

.poster-img {
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

/* 全屏图片预览 */
.image-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.image-viewer.active {
  opacity: 1;
  pointer-events: auto;
}
.image-viewer img {
  max-width: 98vw;
  max-height: 98vh;
  object-fit: contain;
}
.image-viewer-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 36px;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  z-index: 1;
  line-height: 1;
  padding: 8px;
}
.image-viewer-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.88);
  font-size: 14px;
  background: rgba(0,0,0,0.55);
  padding: 12px 20px;
  border-radius: 14px;
  pointer-events: none;
  z-index: 1;
  text-align: center;
  line-height: 1.7;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.image-viewer-hint div + div {
  margin-top: 2px;
}

/* 无海报时的占位 */
.poster-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}
.poster-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* 底部操作栏 */
.album-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  z-index: 10;
}

.btn-download {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border: none;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s;
}
.btn-download:active {
  transform: scale(0.95);
}
.btn-download svg {
  width: 16px;
  height: 16px;
}

.btn-today {
  padding: 10px 16px;
  background: var(--bg-card2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.btn-today:active {
  border-color: var(--primary);
}

/* 日期搜索弹窗 */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.search-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.search-panel {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px 20px 0 0;
  padding: 24px 20px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.search-overlay.active .search-panel {
  transform: translateY(0);
}

.search-panel h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}

.search-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.search-input-group input {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-card2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
}
.search-input-group input:focus {
  border-color: var(--primary);
}

.search-results {
  max-height: 200px;
  overflow-y: auto;
}
.search-result-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.search-result-item:hover,
.search-result-item:active {
  background: var(--bg-card2);
  color: var(--primary-light);
}

/* ==================== 后台管理页样式 ==================== */

.admin-container {
  min-height: 100vh;
  background: var(--bg-dark);
  max-width: 430px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.admin-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.admin-tab {
  flex: 1;
  padding: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.admin-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.admin-panel {
  display: none;
  padding: 20px;
}
.admin-panel.active {
  display: block;
}

/* 表单 */
.admin-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(255,255,255,0.06);
}
.admin-form h3 {
  font-size: 15px;
  margin-bottom: 16px;
  color: var(--text-secondary);
}
.admin-form .input-group {
  margin-bottom: 14px;
}
.admin-form .btn-primary {
  margin-top: 8px;
}

/* 客户列表 */
.customer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.customer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.06);
}
.customer-info .name {
  font-size: 15px;
  font-weight: 600;
}
.customer-info .dates {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.customer-actions {
  display: flex;
  gap: 8px;
}
.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}
.btn-icon:hover {
  color: var(--danger);
}

/* 上传区域 */
.upload-zone {
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 16px;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(74, 144, 217, 0.05);
}
.upload-zone svg {
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  opacity: 0.4;
}
.upload-zone p {
  font-size: 13px;
  color: var(--text-muted);
}

.upload-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.upload-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* 上传进度条 */
.upload-progress {
  margin-bottom: 16px;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-card2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 3px;
  transition: width 0.3s ease;
}
.progress-text {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* 加载动画 */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.1);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
