/**
 * ============================================
 * 倩之物语后台管理系统 - 样式表
 * ============================================
 * 
 * 设计理念：
 * 复用前台网站的朦胧美学风格，使用柔和的粉色调和毛玻璃效果，
 * 营造温馨、专业的管理界面体验。
 * 
 * 设计特点：
 * - 毛玻璃效果（backdrop-filter）
 * - 柔和的色彩搭配
 * - 流畅的动画过渡
 * - 响应式设计
 * - 移动端优化
 * 
 * @version 1.0.0
 */

/* ============================================
   全局变量与重置
   ============================================ */

/* CSS 自定义属性（变量） - 复用前台网站配色 */
:root {
  --primary-pink: #eecbc4;
  --bg-cream: #fdfbf7;
  --text-main: #5e5e5e;
  --text-accent: #8d7b68;
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.4);
  --font-serif: 'Noto Serif SC', serif;
  --font-script: 'Dancing Script', cursive;
  
  /* 管理系统特定颜色 */
  --success-color: #90ee90;
  --error-color: #ffb6c1;
  --warning-color: #ffd700;
  --info-color: #87ceeb;
  
  /* 安全区域适配 */
  --safe-area-inset-top: env(safe-area-inset-top);
  --safe-area-inset-right: env(safe-area-inset-right);
  --safe-area-inset-bottom: env(safe-area-inset-bottom);
  --safe-area-inset-left: env(safe-area-inset-left);
}

/* 基础重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-serif);
  background-color: var(--bg-cream);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.6;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}

ul {
  list-style: none;
}

button {
  font-family: var(--font-serif);
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

input,
textarea,
select {
  font-family: var(--font-serif);
  font-size: 1rem;
}

/* ============================================
   核心特效类
   ============================================ */

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

/* ============================================
   页面加载指示器
   ============================================ */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg-cream) 0%, #fff5f0 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
  animation: breathe 3s infinite ease-in-out;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  border: 4px solid rgba(238, 203, 196, 0.2);
  border-top: 4px solid var(--primary-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes breathe {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}

.loader-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
}

.loader-subtext {
  font-family: var(--font-script);
  font-size: 1.2rem;
  color: var(--primary-pink);
  letter-spacing: 2px;
}

/* ============================================
   应用容器
   ============================================ */

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Toast 提示容器
   ============================================ */

.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 10px;
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.fade-out {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.4;
}

.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.success .toast-icon {
  color: #2d7a2d;
}

.toast.error {
  border-left: 4px solid var(--error-color);
}

.toast.error .toast-icon {
  color: #c44569;
}

.toast.warning {
  border-left: 4px solid var(--warning-color);
}

.toast.warning .toast-icon {
  color: #b8860b;
}

.toast.info {
  border-left: 4px solid var(--info-color);
}

.toast.info .toast-icon {
  color: #4682b4;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============================================
   通用按钮样式
   ============================================ */

.btn {
  display: inline-block;
  padding: 12px 30px;
  background: linear-gradient(135deg, #eecbc4, #d4a5a5);
  color: white;
  border-radius: 50px;
  font-size: 1rem;
  letter-spacing: 1px;
  box-shadow: 0 5px 15px rgba(212, 165, 165, 0.4);
  transition: 0.3s;
  border: none;
  cursor: pointer;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(212, 165, 165, 0.6);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: rgba(200, 200, 200, 0.3);
  color: var(--text-main);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background: rgba(200, 200, 200, 0.5);
}

/* ============================================
   登录页面样式
   ============================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--bg-cream) 0%, #fff5f0 100%);
}

.login-card {
  width: 100%;
  max-width: 450px;
  padding: 3rem 2.5rem;
  border-radius: 20px;
  animation: fadeInUp 0.6s ease;
}

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

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-title {
  font-size: 2.5rem;
  color: var(--text-accent);
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.login-subtitle {
  font-family: var(--font-script);
  font-size: 1.3rem;
  color: var(--primary-pink);
  letter-spacing: 2px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.95rem;
  color: var(--text-accent);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.form-input {
  padding: 14px 18px;
  border: 2px solid rgba(238, 203, 196, 0.3);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
  transition: all 0.3s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary-pink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(238, 203, 196, 0.1);
}

.form-input::placeholder {
  color: rgba(94, 94, 94, 0.4);
}

.form-error {
  font-size: 0.85rem;
  color: #c44569;
  margin-top: 0.25rem;
  display: none;
}

.form-error.show {
  display: block;
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.form-input.error {
  border-color: #ffb6c1;
  background: rgba(255, 182, 193, 0.05);
}

.login-button {
  width: 100%;
  padding: 16px;
  margin-top: 1rem;
  font-size: 1.1rem;
  font-weight: 500;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(238, 203, 196, 0.3);
}

.login-footer-text {
  font-size: 0.9rem;
  color: var(--text-main);
  opacity: 0.7;
}

/* ============================================
   响应式设计 - 移动端优化
   ============================================ */

@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  
  .toast {
    padding: 0.9rem 1.2rem;
  }
  
  .toast-message {
    font-size: 0.9rem;
  }
  
  /* 登录页面移动端优化 */
  .login-container {
    padding: 1rem;
  }
  
  .login-card {
    padding: 2rem 1.5rem;
  }
  
  .login-title {
    font-size: 2rem;
  }
  
  .login-subtitle {
    font-size: 1.1rem;
  }
}

/* ============================================
   触摸设备优化
   ============================================ */

@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
  }
  
  .btn:active {
    transform: scale(0.95);
  }
  
  /* 登录表单触摸优化 */
  .form-input {
    min-height: 48px;
    font-size: 16px; /* 防止 iOS 自动缩放 */
  }
  
  .login-button {
    min-height: 52px;
  }
}

/* ============================================
   管理系统布局
   ============================================ */

.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-cream);
}

/* ============================================
   侧边栏导航
   ============================================ */

.sidebar {
  width: 260px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
  padding: var(--safe-area-inset-top) 0 var(--safe-area-inset-bottom) 0;
}

.sidebar-header {
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(238, 203, 196, 0.3);
}

.sidebar-title {
  font-size: 1.8rem;
  color: var(--text-accent);
  letter-spacing: 2px;
  margin-bottom: 0.3rem;
  font-weight: 700;
}

.sidebar-subtitle {
  font-family: var(--font-script);
  font-size: 1rem;
  color: var(--primary-pink);
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 1.5rem;
  color: var(--text-main);
  transition: all 0.3s ease;
  cursor: pointer;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: rgba(238, 203, 196, 0.15);
  color: var(--text-accent);
}

.nav-item.active {
  background: rgba(238, 203, 196, 0.25);
  border-left-color: var(--primary-pink);
  color: var(--text-accent);
  font-weight: 500;
}

.nav-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.nav-text {
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(238, 203, 196, 0.3);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(200, 200, 200, 0.2);
  color: var(--text-main);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(200, 200, 200, 0.35);
  transform: translateY(-2px);
}

/* ============================================
   主内容区域
   ============================================ */

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 2rem;
  min-height: 100vh;
}

.content-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(238, 203, 196, 0.3);
}

.content-title {
  font-size: 2rem;
  color: var(--text-accent);
  letter-spacing: 2px;
  font-weight: 700;
}

.content-body {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   仪表板样式
   ============================================ */

.dashboard-welcome {
  padding: 3rem 2rem;
  border-radius: 15px;
  text-align: center;
  max-width: 600px;
  margin: 2rem auto;
}

.dashboard-welcome h3 {
  font-size: 1.8rem;
  color: var(--text-accent);
  margin-bottom: 1rem;
  letter-spacing: 1px;
}

.dashboard-welcome p {
  font-size: 1.1rem;
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 0.8rem;
}

/* ============================================
   占位符消息
   ============================================ */

.placeholder-message {
  padding: 3rem 2rem;
  border-radius: 15px;
  text-align: center;
  max-width: 600px;
  margin: 2rem auto;
}

.placeholder-message p {
  font-size: 1.2rem;
  color: var(--text-main);
  opacity: 0.7;
}

/* ============================================
   移动端菜单按钮
   ============================================ */

.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 101;
  width: 48px;
  height: 48px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
  transform: scale(1.05);
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-accent);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   响应式设计 - 平板和移动端
   ============================================ */

@media (max-width: 768px) {
  /* 显示移动端菜单按钮 */
  .mobile-menu-toggle {
    display: flex;
  }
  
  /* 侧边栏默认隐藏 */
  .sidebar {
    transform: translateX(-100%);
  }
  
  /* 侧边栏打开状态 */
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  }
  
  /* 主内容区域调整 */
  .main-content {
    margin-left: 0;
    padding: 5rem 1rem 1rem;
  }
  
  /* 内容标题调整 */
  .content-title {
    font-size: 1.5rem;
  }
  
  /* 仪表板欢迎消息调整 */
  .dashboard-welcome {
    padding: 2rem 1.5rem;
    margin: 1rem 0;
  }
  
  .dashboard-welcome h3 {
    font-size: 1.5rem;
  }
  
  .dashboard-welcome p {
    font-size: 1rem;
  }
  
  /* 占位符消息调整 */
  .placeholder-message {
    padding: 2rem 1.5rem;
    margin: 1rem 0;
  }
  
  .placeholder-message p {
    font-size: 1rem;
  }
}

/* ============================================
   响应式设计 - 小屏幕移动端
   ============================================ */

@media (max-width: 480px) {
  .sidebar {
    width: 100%;
  }
  
  .main-content {
    padding: 4.5rem 0.75rem 0.75rem;
  }
  
  .content-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
  }
  
  .content-title {
    font-size: 1.3rem;
  }
  
  .sidebar-title {
    font-size: 1.5rem;
  }
  
  .sidebar-subtitle {
    font-size: 0.9rem;
  }
  
  .nav-item {
    padding: 12px 1rem;
  }
  
  .nav-icon {
    font-size: 1.2rem;
  }
  
  .nav-text {
    font-size: 0.9rem;
  }
}

/* ============================================
   遮罩层（移动端侧边栏打开时）
   ============================================ */

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  display: block;
  opacity: 1;
}

@media (max-width: 768px) {
  .sidebar-overlay {
    display: block;
  }
}

/* ============================================
   图片管理模块样式
   ============================================ */

/* 拖拽上传区域 */
.upload-dropzone {
  border: 2px dashed rgba(238, 203, 196, 0.5);
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  transition: all 0.3s ease;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-dropzone.dragover {
  border-color: var(--primary-pink);
  background: rgba(238, 203, 196, 0.1);
  transform: scale(1.02);
}

.dropzone-content {
  width: 100%;
}

.dropzone-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.dropzone-text {
  font-size: 1.2rem;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.dropzone-subtext {
  font-size: 1rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-accent);
  opacity: 0.7;
}

/* 上传进度 */
.upload-progress {
  width: 100%;
  max-width: 400px;
}

.progress-bar {
  width: 100%;
  height: 30px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid rgba(238, 203, 196, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-pink), #f5d5ce);
  transition: width 0.3s ease;
  border-radius: 15px;
}

.progress-text {
  font-size: 1rem;
  color: var(--text-accent);
  font-weight: 600;
}

/* 图片网格布局 */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* 图片卡片 */
.image-card {
  border-radius: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.image-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.image-thumbnail {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: rgba(238, 203, 196, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.image-card:hover .image-thumbnail img {
  transform: scale(1.1);
}

.image-card-info {
  padding: 1rem;
}

.image-name {
  font-size: 0.9rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-size {
  font-size: 0.8rem;
  color: var(--text-accent);
}

.image-card-actions {
  display: flex;
  gap: 0.5rem;
  padding: 0 1rem 1rem;
}

.btn-icon {
  flex: 1;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(238, 203, 196, 0.3);
  border-radius: 8px;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.btn-icon:hover {
  background: var(--primary-pink);
  transform: scale(1.05);
}

/* 图片详情模态窗口 */
.image-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.image-viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  padding: 1rem;
}

.detail-image {
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid var(--primary-pink);
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
  color: var(--text-accent);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.nav-btn:hover {
  background: var(--primary-pink);
  color: white;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(238, 203, 196, 0.4);
}

.nav-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.nav-prev {
  left: -60px;
}

.nav-next {
  right: -60px;
}

.image-navigation-hint {
  text-align: center;
  padding: 0.75rem 1rem;
  background: rgba(238, 203, 196, 0.15);
  border-radius: 10px;
  border: 1px solid rgba(238, 203, 196, 0.3);
}

.image-navigation-hint p {
  font-size: 0.85rem;
  color: var(--text-accent);
  margin: 0;
  line-height: 1.5;
}

.image-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(238, 203, 196, 0.2);
}

.image-info p {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.image-info strong {
  color: var(--text-accent);
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.btn-page {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(238, 203, 196, 0.3);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  min-width: 44px;
  min-height: 44px;
}

.btn-page:hover {
  background: var(--primary-pink);
  color: white;
  transform: translateY(-2px);
}

.btn-page.active {
  background: var(--primary-pink);
  color: white;
  font-weight: 600;
}

.pagination-ellipsis {
  padding: 0.5rem;
  color: var(--text-accent);
}

/* 空状态 */
.empty-state {
  padding: 3rem;
  text-align: center;
  border-radius: 15px;
}

.empty-state p {
  font-size: 1.1rem;
  color: var(--text-accent);
}

/* 错误消息 */
.error-message {
  padding: 2rem;
  text-align: center;
  border-radius: 15px;
  background: rgba(255, 182, 193, 0.2);
}

.error-message p {
  font-size: 1rem;
  color: var(--error-color);
}

/* 加载占位符 */
.loading-placeholder {
  padding: 3rem;
  text-align: center;
  font-size: 1.1rem;
  color: var(--text-accent);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .image-thumbnail {
    height: 150px;
  }
  
  .image-card-info {
    padding: 0.75rem;
  }
  
  .image-name {
    font-size: 0.85rem;
  }
  
  .image-size {
    font-size: 0.75rem;
  }
  
  .image-detail {
    gap: 1rem;
  }
  
  .image-viewer {
    min-height: 200px;
    padding: 0.5rem;
  }
  
  .detail-image {
    max-height: 50vh;
  }
  
  /* 移动端导航按钮调整 */
  .nav-btn {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    border-width: 1px;
  }
  
  .nav-prev {
    left: 5px;
  }
  
  .nav-next {
    right: 5px;
  }
  
  .image-info {
    padding: 0.75rem;
    gap: 0.5rem;
  }
  
  .image-info p {
    font-size: 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .image-info strong {
    min-width: auto;
  }
  
  .image-navigation-hint {
    padding: 0.5rem 0.75rem;
  }
  
  .image-navigation-hint p {
    font-size: 0.75rem;
  }
  
  .upload-dropzone {
    padding: 1.5rem;
    min-height: 150px;
  }
  
  .dropzone-icon {
    font-size: 2rem;
  }
  
  .dropzone-text {
    font-size: 1rem;
  }
  
  .dropzone-subtext {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
  }
  
  .image-thumbnail {
    height: 120px;
  }
}

/* ============================================
   图片上传区域
   ============================================ */

/* 拖拽上传区域 */
.upload-dropzone {
  margin-bottom: 2rem;
  padding: 3rem 2rem;
  border: 2px dashed var(--primary-pink);
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.upload-dropzone:hover {
  border-color: var(--text-accent);
  background: rgba(238, 203, 196, 0.1);
}

.upload-dropzone.dragover {
  border-color: var(--text-accent);
  background: rgba(238, 203, 196, 0.2);
  transform: scale(1.02);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.dropzone-icon {
  font-size: 3rem;
  opacity: 0.7;
}

.dropzone-text {
  font-size: 1.2rem;
  color: var(--text-main);
  font-weight: 500;
  margin: 0;
}

.dropzone-subtext {
  font-size: 1rem;
  color: var(--text-accent);
  margin: 0;
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-accent);
  opacity: 0.8;
  margin: 0;
}

/* 上传进度条 */
.upload-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
}

.progress-bar {
  width: 100%;
  max-width: 400px;
  height: 8px;
  background: rgba(238, 203, 196, 0.2);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-pink), var(--text-accent));
  border-radius: 10px;
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  font-size: 0.9rem;
  color: var(--text-accent);
  margin: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .upload-dropzone {
    padding: 2rem 1rem;
  }
  
  .dropzone-icon {
    font-size: 2.5rem;
  }
  
  .dropzone-text {
    font-size: 1rem;
  }
  
  .dropzone-subtext {
    font-size: 0.9rem;
  }
  
  .nav-prev {
    left: 10px;
  }
  
  .nav-next {
    right: 10px;
  }
  
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}


/* ============================================
   内容管理模块样式
   ============================================ */

/* 内容工具栏 */
.content-toolbar {
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 20px;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

/* 搜索框 */
.search-box {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.5rem;
  border: 1px solid rgba(142, 123, 104, 0.2);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-pink);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(238, 203, 196, 0.1);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.6;
}

/* 过滤按钮组 */
.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(142, 123, 104, 0.2);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--primary-pink);
}

.filter-btn.active {
  background: var(--primary-pink);
  border-color: var(--primary-pink);
  color: white;
}

/* 卡片区域 */
.card-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  color: var(--text-accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-count {
  font-size: 1rem;
  color: var(--text-main);
  opacity: 0.7;
}

/* 卡片网格 */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* 单个卡片项 */
.card-item {
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.card-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(31, 38, 135, 0.15);
}

.card-image-preview {
  width: 100%;
  height: 200px;
  overflow: hidden;
  background: rgba(142, 123, 104, 0.1);
}

.card-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card-item:hover .card-image-preview img {
  transform: scale(1.05);
}

.card-info {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.2rem;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.card-description {
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.card-section-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

.card-section-badge.visual {
  background: rgba(135, 206, 235, 0.2);
  color: #4682b4;
}

.card-section-badge.diary {
  background: rgba(255, 182, 193, 0.2);
  color: #c71585;
}

.card-order {
  color: var(--text-main);
  opacity: 0.7;
}

/* 卡片操作按钮 */
.card-actions {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-item:hover .card-actions {
  opacity: 1;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.btn-icon:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-edit:hover {
  background: rgba(135, 206, 235, 0.9);
}

.btn-delete:hover {
  background: rgba(255, 182, 193, 0.9);
}

/* 卡片表单 */
.card-form {
  max-width: 600px;
}

.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-accent);
  font-weight: 500;
}

.required {
  color: #ff6b6b;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(142, 123, 104, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-pink);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(238, 203, 196, 0.1);
}

.char-count {
  position: absolute;
  right: 0.5rem;
  bottom: -1.5rem;
  font-size: 0.8rem;
  color: var(--text-main);
  opacity: 0.6;
}

/* 图片选择器 */
.image-selector {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.selected-image {
  width: 100%;
  height: 200px;
  border: 2px dashed rgba(142, 123, 104, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.3);
}

.selected-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.placeholder-text {
  color: var(--text-main);
  opacity: 0.5;
}

/* 图片选择器网格 */
.image-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1rem;
}

.image-selector-item {
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.3);
}

.image-selector-item:hover {
  border-color: var(--primary-pink);
  transform: scale(1.05);
}

.image-selector-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

.image-name {
  padding: 0.5rem;
  font-size: 0.8rem;
  text-align: center;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 表单操作按钮 */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  border-radius: 20px;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-text {
  font-size: 1.2rem;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
  .content-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-box {
    min-width: 100%;
  }
  
  .filter-buttons {
    justify-content: center;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .card-actions {
    opacity: 1;
  }
  
  .image-selector-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions button {
    width: 100%;
  }
}

/* ============================================
   消息查看模块样式
   ============================================ */

/* 消息统计 */
.messages-stats {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  border-radius: 20px;
  margin-bottom: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-main);
  opacity: 0.7;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-accent);
}

/* 消息列表 */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 单个消息项 */
.message-item {
  border-radius: 15px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
}

.message-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(31, 38, 135, 0.12);
}

/* 消息头部 */
.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid rgba(142, 123, 104, 0.1);
}

.message-meta {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.message-id {
  font-size: 0.85rem;
  color: var(--text-main);
  opacity: 0.6;
  font-family: monospace;
}

.message-date {
  font-size: 0.85rem;
  color: var(--text-main);
  opacity: 0.7;
}

.btn-delete-message {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 182, 193, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.btn-delete-message:hover {
  background: rgba(255, 182, 193, 0.9);
  border-color: rgba(255, 182, 193, 0.6);
  transform: scale(1.1);
}

/* 消息内容 */
.message-content {
  margin-bottom: 0.5rem;
}

.message-content.expanded {
  /* 展开状态 */
}

.message-text {
  font-size: 1rem;
  color: var(--text-main);
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 消息底部 */
.message-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.8rem;
}

.message-toggle {
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  background: rgba(238, 203, 196, 0.2);
  border: 1px solid rgba(238, 203, 196, 0.3);
  color: var(--text-accent);
  font-size: 0.85rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.message-toggle:hover {
  background: rgba(238, 203, 196, 0.4);
  border-color: var(--primary-pink);
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(142, 123, 104, 0.2);
  color: var(--text-main);
  font-size: 0.9rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.pagination-btn:hover:not(.disabled) {
  background: rgba(238, 203, 196, 0.3);
  border-color: var(--primary-pink);
  transform: translateY(-2px);
}

.pagination-btn.active {
  background: var(--primary-pink);
  border-color: var(--primary-pink);
  color: white;
  font-weight: 600;
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 0 0.5rem;
  color: var(--text-main);
  opacity: 0.5;
}

/* 空状态（消息） */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  border-radius: 20px;
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.5rem;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 1rem;
  color: var(--text-main);
  opacity: 0.7;
}

/* 加载占位符 */
.loading-placeholder {
  text-align: center;
  padding: 4rem 2rem;
}

.loading-placeholder .loader-spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
  border: 4px solid rgba(238, 203, 196, 0.2);
  border-top: 4px solid var(--primary-pink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-placeholder p {
  font-size: 1rem;
  color: var(--text-main);
  opacity: 0.7;
}

/* 错误消息 */
.error-message {
  text-align: center;
  padding: 3rem 2rem;
  border-radius: 20px;
}

.error-message p {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

/* 响应式设计 - 消息查看 */
@media (max-width: 768px) {
  .messages-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .message-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  
  .message-meta {
    width: 100%;
    justify-content: space-between;
  }
  
  .btn-delete-message {
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
  
  .pagination {
    gap: 0.3rem;
  }
  
  .pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.8rem;
    font-size: 0.85rem;
  }
}

/* ============================================
   数据导入导出样式
   ============================================ */

.settings-section {
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.5rem;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.section-description {
  color: var(--text-main);
  opacity: 0.8;
  margin-bottom: 2rem;
}

.data-io-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.action-card {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.action-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.action-card h4 {
  font-size: 1.25rem;
  color: var(--text-accent);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.action-card p {
  color: var(--text-main);
  opacity: 0.8;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.action-card .btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-pink), #f5d5cb);
  color: white;
  border: none;
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(238, 203, 196, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-accent);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: scale(1.02);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .data-io-actions {
    grid-template-columns: 1fr;
  }
  
  .settings-section {
    padding: 1.5rem;
  }
  
  .action-card {
    padding: 1.5rem;
  }
}

/* ============================================
   响应式设计增强 - 任务 21
   ============================================ */

/* ============================================
   21.1 桌面布局优化 (Desktop Layout)
   ============================================ */

/* 大屏幕桌面布局 (1200px+) */
@media (min-width: 1200px) {
  /* 侧边栏宽度优化 */
  .sidebar {
    width: 280px;
  }
  
  .main-content {
    margin-left: 280px;
    padding: 2.5rem 3rem;
  }
  
  /* 多列网格布局优化 */
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
  }
  
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
  }
  
  /* 内容区域最大宽度 */
  .content-body {
    max-width: 1400px;
  }
  
  /* 仪表板欢迎消息 */
  .dashboard-welcome {
    max-width: 700px;
    padding: 3.5rem 2.5rem;
  }
  
  /* 图片详情模态窗口 */
  .image-detail {
    max-width: 1000px;
  }
  
  .detail-image {
    max-height: 70vh;
  }
  
  /* 导航按钮位置优化 */
  .nav-prev {
    left: -70px;
  }
  
  .nav-next {
    right: -70px;
  }
}

/* 中等桌面布局 (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .sidebar {
    width: 260px;
  }
  
  .main-content {
    margin-left: 260px;
    padding: 2rem 2.5rem;
  }
  
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* 小桌面/平板横屏布局 (769px - 991px) */
@media (min-width: 769px) and (max-width: 991px) {
  .sidebar {
    width: 240px;
  }
  
  .main-content {
    margin-left: 240px;
    padding: 2rem;
  }
  
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .sidebar-title {
    font-size: 1.6rem;
  }
  
  .nav-item {
    padding: 12px 1.2rem;
  }
}

/* ============================================
   21.2 移动端布局优化 (Mobile Layout)
   ============================================ */

/* 平板竖屏和大手机 (481px - 768px) */
@media (max-width: 768px) {
  /* 汉堡菜单显示 */
  .mobile-menu-toggle {
    display: flex;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    width: 48px;
    height: 48px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }
  
  /* 侧边栏移动端样式 */
  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    box-shadow: none;
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
  }
  
  /* 遮罩层 */
  .sidebar-overlay {
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  
  /* 主内容区域 */
  .main-content {
    margin-left: 0;
    padding: 5rem 1.5rem 1.5rem;
    width: 100%;
  }
  
  /* 单列布局 */
  .images-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* 内容标题 */
  .content-title {
    font-size: 1.6rem;
  }
  
  /* 工具栏 */
  .content-toolbar {
    flex-direction: column;
    padding: 1rem;
  }
  
  .search-box {
    width: 100%;
    min-width: 100%;
  }
  
  .filter-buttons {
    width: 100%;
    justify-content: flex-start;
  }
  
  /* 卡片操作按钮始终显示 */
  .card-actions {
    opacity: 1;
  }
  
  /* 图片详情 */
  .nav-prev {
    left: 10px;
  }
  
  .nav-next {
    right: 10px;
  }
  
  /* 表单 */
  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .form-actions button {
    width: 100%;
  }
  
  /* 消息列表 */
  .messages-stats {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .message-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  /* 数据导入导出 */
  .data-io-actions {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* 小手机 (320px - 480px) */
@media (max-width: 480px) {
  /* 汉堡菜单 */
  .mobile-menu-toggle {
    width: 44px;
    height: 44px;
    top: 0.75rem;
    left: 0.75rem;
  }
  
  .mobile-menu-toggle span {
    width: 20px;
  }
  
  /* 侧边栏全屏 */
  .sidebar {
    width: 100%;
  }
  
  /* 主内容区域 */
  .main-content {
    padding: 4.5rem 1rem 1rem;
  }
  
  /* 单列布局 */
  .images-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .image-thumbnail {
    height: 120px;
  }
  
  /* 内容标题 */
  .content-title {
    font-size: 1.4rem;
    letter-spacing: 1px;
  }
  
  .content-header {
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
  }
  
  /* 侧边栏 */
  .sidebar-title {
    font-size: 1.5rem;
  }
  
  .sidebar-subtitle {
    font-size: 0.9rem;
  }
  
  .nav-item {
    padding: 12px 1rem;
  }
  
  .nav-icon {
    font-size: 1.2rem;
  }
  
  .nav-text {
    font-size: 0.9rem;
  }
  
  /* 按钮 */
  .btn {
    padding: 10px 24px;
    font-size: 0.95rem;
  }
  
  /* 图片详情导航 */
  .nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
  
  .nav-prev {
    left: 5px;
  }
  
  .nav-next {
    right: 5px;
  }
  
  /* Toast 提示 */
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    padding: 0.8rem 1rem;
  }
  
  /* 分页 */
  .pagination {
    gap: 0.25rem;
  }
  
  .pagination-btn,
  .btn-page {
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    font-size: 0.85rem;
  }
  
  /* 上传区域 */
  .upload-dropzone {
    padding: 1.5rem 1rem;
    min-height: 140px;
  }
  
  .dropzone-icon {
    font-size: 2rem;
  }
  
  .dropzone-text {
    font-size: 1rem;
  }
  
  .dropzone-subtext {
    font-size: 0.85rem;
  }
  
  /* 空状态 */
  .empty-state {
    padding: 2.5rem 1.5rem;
  }
  
  .empty-icon {
    font-size: 3rem;
  }
  
  .empty-text {
    font-size: 1rem;
  }
}

/* 超小手机 (< 360px) */
@media (max-width: 359px) {
  .main-content {
    padding: 4rem 0.75rem 0.75rem;
  }
  
  .content-title {
    font-size: 1.2rem;
  }
  
  .images-grid {
    grid-template-columns: 1fr;
  }
  
  .sidebar-title {
    font-size: 1.3rem;
  }
  
  .nav-item {
    padding: 10px 0.75rem;
  }
}

/* ============================================
   21.3 触摸交互优化 (Touch Optimization)
   ============================================ */

/* 触摸设备检测 */
@media (hover: none) and (pointer: coarse) {
  /* 所有可点击元素最小尺寸 44x44px */
  .btn,
  .btn-icon,
  .nav-item,
  .filter-btn,
  .pagination-btn,
  .btn-page,
  .mobile-menu-toggle,
  .btn-logout,
  .btn-delete-message,
  .message-toggle,
  button {
    min-width: 44px;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  
  /* 链接和导航项 */
  a,
  .nav-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* 表单输入 */
  .form-input,
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  textarea,
  select {
    min-height: 48px;
    font-size: 16px; /* 防止 iOS 自动缩放 */
    padding: 12px 16px;
  }
  
  textarea {
    min-height: 120px;
  }
  
  /* 触摸反馈 - 按钮 */
  .btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  .btn-icon:active {
    transform: scale(0.9);
    transition: transform 0.1s ease;
  }
  
  /* 触摸反馈 - 导航项 */
  .nav-item:active {
    background: rgba(238, 203, 196, 0.35);
    transition: background 0.1s ease;
  }
  
  /* 触摸反馈 - 卡片 */
  .image-card:active,
  .card-item:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  /* 触摸反馈 - 消息项 */
  .message-item:active {
    transform: scale(0.99);
    transition: transform 0.1s ease;
  }
  
  /* 触摸反馈 - 过滤按钮 */
  .filter-btn:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* 触摸反馈 - 分页按钮 */
  .pagination-btn:active,
  .btn-page:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* 增大图片卡片操作按钮 */
  .card-actions .btn-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  
  /* 图片详情导航按钮 */
  .nav-btn {
    width: 48px;
    height: 48px;
    font-size: 1.6rem;
  }
  
  /* 删除按钮 */
  .btn-delete-message {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  
  /* 汉堡菜单 */
  .mobile-menu-toggle {
    width: 48px;
    height: 48px;
  }
  
  .mobile-menu-toggle:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
  
  /* 登录按钮 */
  .login-button {
    min-height: 52px;
  }
  
  /* 图片选择器项 */
  .image-selector-item {
    min-height: 44px;
  }
  
  /* 消息切换按钮 */
  .message-toggle {
    padding: 0.6rem 1.5rem;
    min-height: 44px;
  }
  
  /* 移除 hover 效果，使用 active 代替 */
  .btn:hover {
    transform: none;
  }
  
  .btn:active {
    transform: scale(0.95);
  }
  
  /* 卡片操作按钮始终可见 */
  .card-actions {
    opacity: 1;
  }
  
  /* 优化滚动性能 */
  .sidebar-nav,
  .main-content,
  .image-selector-grid {
    -webkit-overflow-scrolling: touch;
  }
  
  /* 防止双击缩放 */
  * {
    touch-action: manipulation;
  }
  
  /* 允许特定元素缩放（如图片查看器） */
  .detail-image,
  .image-viewer {
    touch-action: pinch-zoom;
  }
}

/* ============================================
   横屏模式优化
   ============================================ */

/* 手机横屏 */
@media (max-width: 768px) and (orientation: landscape) {
  .main-content {
    padding-top: 4rem;
  }
  
  .sidebar {
    width: 240px;
  }
  
  .sidebar-header {
    padding: 1.5rem 1rem 1rem;
  }
  
  .sidebar-title {
    font-size: 1.4rem;
  }
  
  .nav-item {
    padding: 10px 1rem;
  }
  
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .image-thumbnail {
    height: 140px;
  }
}

/* ============================================
   打印样式
   ============================================ */

@media print {
  /* 隐藏不需要打印的元素 */
  .sidebar,
  .mobile-menu-toggle,
  .sidebar-overlay,
  .toast-container,
  .page-loader,
  .btn,
  .card-actions,
  .message-toggle,
  .btn-delete-message,
  .pagination {
    display: none !important;
  }
  
  /* 主内容区域 */
  .main-content {
    margin-left: 0;
    padding: 0;
  }
  
  /* 移除背景和阴影 */
  body,
  .glass,
  .card-item,
  .message-item {
    background: white !important;
    box-shadow: none !important;
  }
  
  /* 优化文字 */
  body {
    color: black;
    font-size: 12pt;
  }
  
  /* 分页 */
  .card-item,
  .message-item {
    page-break-inside: avoid;
  }
}

/* ============================================
   高对比度模式支持
   ============================================ */

@media (prefers-contrast: high) {
  :root {
    --text-main: #000000;
    --text-accent: #000000;
    --glass-border: rgba(0, 0, 0, 0.5);
  }
  
  .btn,
  .nav-item,
  .form-input {
    border-width: 2px;
  }
  
  .nav-item.active {
    border-left-width: 4px;
  }
}

/* ============================================
   减少动画模式支持
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .page-loader {
    animation: none;
  }
  
  .loader-spinner {
    animation: none;
    border-top-color: var(--primary-pink);
  }
}

/* ============================================
   暗色模式支持（预留）
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* 暗色模式样式可以在这里添加 */
  /* 目前保持浅色主题以符合设计风格 */
}

/* ============================================
   表单验证样式
   ============================================ */

/* 表单组 */
.form-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
}

.form-group .required {
  color: var(--error-color);
  margin-left: 0.25rem;
}

/* 输入字段 */
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-pink);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(238, 203, 196, 0.2);
}

/* 错误状态 */
.form-group input.error,
.form-group textarea.error,
.form-group select.error {
  border-color: var(--error-color);
  background: rgba(255, 182, 193, 0.1);
}

.form-group input.error:focus,
.form-group textarea.error:focus,
.form-group select.error:focus {
  border-color: var(--error-color);
  box-shadow: 0 0 0 3px rgba(255, 182, 193, 0.2);
}

/* 字段错误消息 */
.field-error {
  display: none;
  color: #d8000c;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  padding: 0.5rem;
  background: rgba(255, 182, 193, 0.2);
  border-left: 3px solid var(--error-color);
  border-radius: 4px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 字符计数 */
.char-count {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-accent);
  pointer-events: none;
}

.form-group textarea + .char-count {
  bottom: 0.75rem;
}

/* 成功状态（可选） */
.form-group input.success,
.form-group textarea.success,
.form-group select.success {
  border-color: var(--success-color);
  background: rgba(144, 238, 144, 0.1);
}

/* 禁用状态 */
.form-group input:disabled,
.form-group textarea:disabled,
.form-group select:disabled {
  background: rgba(200, 200, 200, 0.2);
  cursor: not-allowed;
  opacity: 0.6;
}

/* 表单提示文本 */
.form-hint {
  font-size: 0.875rem;
  color: var(--text-accent);
  margin-top: 0.25rem;
  font-style: italic;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* 防止 iOS 自动缩放 */
  }
}


/* ============================================
   管理面板布局样式
   ============================================ */

/* 侧边栏 */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(135deg, rgba(238, 203, 196, 0.95) 0%, rgba(253, 251, 247, 0.95) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--glass-border);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 2rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-accent);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.sidebar-subtitle {
  font-family: var(--font-script);
  font-size: 1rem;
  color: var(--primary-pink);
  letter-spacing: 1px;
}

/* 侧边栏导航 */
.sidebar-nav {
  flex: 1;
  padding: 1.5rem 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.5rem;
  color: var(--text-main);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.4);
  border-left-color: var(--primary-pink);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.6);
  border-left-color: var(--primary-pink);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.5rem;
  margin-right: 1rem;
  min-width: 30px;
  text-align: center;
}

.nav-text {
  font-size: 1rem;
}

/* 侧边栏底部 */
.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  z-index: 1100;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.mobile-menu-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-accent);
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.show {
  opacity: 1;
}

/* 管理面板布局 */
.admin-layout {
  margin-left: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 主内容区域 */
.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
}

/* 内容头部 */
.content-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(238, 203, 196, 0.3);
}

.content-title {
  font-size: 2rem;
  color: var(--text-accent);
  font-weight: 700;
  letter-spacing: 1px;
}

/* 内容主体 */
.content-body {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 仪表板欢迎卡片 */
.dashboard-welcome {
  padding: 3rem;
  border-radius: 20px;
  text-align: center;
  animation: breathe 3s infinite ease-in-out;
}

.dashboard-welcome h3 {
  font-size: 2rem;
  color: var(--text-accent);
  margin-bottom: 1rem;
  font-weight: 700;
}

.dashboard-welcome p {
  font-size: 1.1rem;
  color: var(--text-main);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

/* 响应式设计 - 平板 */
@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
  
  .admin-layout {
    margin-left: 240px;
  }
  
  .main-content {
    padding: 1.5rem;
  }
}

/* 响应式设计 - 移动端 */
@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
  }
  
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-overlay {
    display: block;
  }
  
  .admin-layout {
    margin-left: 0;
  }
  
  .main-content {
    padding: 1rem;
    padding-top: 5rem;
  }
  
  .content-title {
    font-size: 1.5rem;
  }
  
  .dashboard-welcome {
    padding: 2rem 1.5rem;
  }
  
  .dashboard-welcome h3 {
    font-size: 1.5rem;
  }
  
  .dashboard-welcome p {
    font-size: 1rem;
  }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .sidebar {
    width: 260px;
  }
  
  .main-content {
    padding: 0.75rem;
    padding-top: 4.5rem;
  }
  
  .content-header {
    margin-bottom: 1.5rem;
  }
  
  .dashboard-welcome {
    padding: 1.5rem 1rem;
  }
}
