@charset "UTF-8";
/* AI生图页面样式 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuOKfMZg.ttf) format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf) format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuI6fMZg.ttf) format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf) format('truetype');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(https://fonts.gstatic.com/s/inter/v20/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuFuYMZg.ttf) format('truetype');
}

/* 页面基础样式 */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #F8F9FA;
}

/* 隐藏默认导航栏 */
.image-page .header-topbar-top,
.image-page .footer {
  display: none !important;
}

/* 移除顶部和底部padding */
.image-page {
  padding: 0 !important;
}

/* 重置body overflow */
.image-page body {
  overflow: hidden;
  height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 10px;
}

/* Sidebar Transition */
.sidebar-transition {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
  #sidebar {
    height: calc(100vh - 72px) !important;
    max-height: calc(100vh - 72px);
  }

  #sidebarUserArea {
    margin-top: auto;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    margin-bottom: clamp(10px, 1.8vh, 22px);
    background: #fff;
  }
}

@media (max-width: 767.98px) {
  #sidebarUserArea {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

/* Dropdown Animation */
.dropdown-enter {
  animation: dropdownFade 0.2s ease-out forwards;
}
@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.bg-gradient-to-br {
  background: linear-gradient(to bottom right, #4b5563, #1f2937) !important;
}

.to-primary-dark {
  background: #C53030 !important;
}

/* Message Bubbles */
.user-bubble {
  background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
  box-shadow: 0 4px 15px rgba(229, 62, 62, 0.3);
}
.ai-bubble {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Image Grid Hover */
.img-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.img-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 24px rgba(229, 62, 62, 0.15);
}

/* Action Buttons */
.action-btn {
  transition: all 0.2s ease;
}
.action-btn:hover {
  background: rgba(229, 62, 62, 0.1);
  color: #E53E3E;
  transform: scale(1.1);
}
.action-btn:active {
  transform: scale(0.95);
}

/* Input Glow */
.input-glow:focus-within {
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.15), 0 4px 20px rgba(0, 0, 0, 0.08);
  border-color: #E53E3E;
}

/* Send Button Pulse */
.send-btn {
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
}
.send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(229, 62, 62, 0.5);
}
.send-btn:active {
  transform: scale(0.95);
}

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Toast Notification */
.toast {
  animation: toastIn 0.3s ease-out;
}
@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Overlay */
.overlay {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

/* Nav Item Active */
.nav-item.active {
  background: linear-gradient(135deg, rgba(229, 62, 62, 0.08) 0%, rgba(229, 62, 62, 0.04) 100%);
  color: #E53E3E;
  border-right: 3px solid #E53E3E;
  font-weight: 600;
}
.nav-item.active svg {
  color: #E53E3E;
  filter: drop-shadow(0 0 4px rgba(229, 62, 62, 0.3));
}

/* Smooth scroll for chat */
.chat-scroll {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* User menu dropdown */
.user-menu-enter {
  animation: userMenuFade 0.2s ease-out forwards;
}
@keyframes userMenuFade {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Drag upload zone */
.drag-zone {
  transition: all 0.3s ease;
}
.drag-zone.dragover {
  border-color: #E53E3E;
  background: rgba(229, 62, 62, 0.05);
  transform: scale(1.02);
}

/* Style preview card */
.style-card {
  transition: all 0.2s ease;
}
.style-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}
.style-card.selected {
  border-color: #E53E3E;
  box-shadow: 0 0 0 2px rgba(229, 62, 62, 0.2);
}

/* Ratio icon */
.ratio-icon {
  transition: all 0.2s ease;
}
.ratio-icon:hover {
  transform: scale(1.1);
}
.ratio-icon.selected {
  background: rgba(229, 62, 62, 0.1);
  border-color: #E53E3E;
  color: #E53E3E;
}

/* Upload preview */
.upload-preview {
  animation: uploadIn 0.3s ease-out;
}
@keyframes uploadIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.upload-progress {
  transition: width 0.3s ease;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Inline toolbar in input area */
.inline-toolbar-btn {
  transition: all 0.2s ease;
}
.inline-toolbar-btn:hover {
  background: rgba(229, 62, 62, 0.1);
  color: #E53E3E;
}
.inline-toolbar-btn.active {
  background: rgba(229, 62, 62, 0.1);
  color: #E53E3E;
  font-weight: 500;
}

/* Sample Gallery */
.sample-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}
.sample-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}
.sample-card .sample-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
}
.sample-card:hover .sample-overlay {
  opacity: 1;
}
.sample-card .sample-prompt {
  color: white;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.sample-card .sample-btn {
  background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.sample-card .sample-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}
.sample-card .sample-title {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

/* Image Modal */
.image-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.image-modal img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
}
.image-modal .modal-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 90vw;
  max-height: calc(100vh - 160px);
}
.image-modal .modal-image-wrap img {
  display: block;
  max-width: 90vw;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: 12px;
}
.image-modal .modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}
.image-modal .modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}
.image-modal .modal-action-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  display: flex;
  align-items: center;
  justify-content:center;
  gap: 12px;
  pointer-events: auto;
}

.image-modal .modal-action-btn {
  border: none;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 6px 16px rgba(229, 62, 62, 0.35);
  backdrop-filter: blur(8px);
  background: #E53E3E;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.image-modal .modal-make-btn {
  background: #E53E3E;
}

.image-modal .modal-download-btn {
  background: #E53E3E;
}

.image-modal .modal-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(229, 62, 62, 0.42);
  background: #c53030;
}

@media (max-width: 768px) {
  .image-modal .modal-image-wrap {
    max-width: 92vw;
    max-height: calc(100vh - 150px);
  }
  .image-modal .modal-image-wrap img {
    max-width: 92vw;
    max-height: calc(100vh - 150px);
  }
  .image-modal .modal-action-bar {
    top: calc(100% + 8px);
    gap: 8px;
  }
  .image-modal .modal-action-btn {
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 9px;
    box-shadow: 0 5px 12px rgba(229, 62, 62, 0.35);
  }
}

/* Center Mode - 百度搜索风格 */
.center-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 48px - 56px);
}
.center-mode #chatArea {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: visible;
}
.center-mode #chatArea.hidden {
  display: none;
}
.center-mode #welcomeArea {
  margin-bottom: 2rem;
}
.center-mode #bottomBar,
.center-mode #discoverPanel {
  position: relative;
  width: 100%;
  max-width: 720px;
  border: none;
  background: transparent;
  padding: 0 1rem;
  margin-bottom: calc(clamp(12px, 2.2vh, 26px) + env(safe-area-inset-bottom, 0px));
}
.center-mode #bottomBar .input-glow,
.center-mode #discoverPanel .input-glow {
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}
.center-mode .sample-gallery-wrapper {
  width: 100%;
  max-width: 900px;
  margin-top: 2rem;
}

/* Chat Mode */
.chat-mode #chatArea {
  flex: 1;
  justify-content: flex-start;
}
.chat-mode #bottomBar {
  position: relative;
  width: 100%;
  max-width: none;
  border-top: 1px solid #e5e7eb;
  background: white;
  margin-bottom: calc(clamp(10px, 1.8vh, 20px) + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 640px) {
  .center-mode #bottomBar {
    margin-bottom: calc(clamp(18px, 3vh, 34px) + env(safe-area-inset-bottom, 0px));
  }
  .center-mode #discoverPanel {
    margin-bottom: calc(clamp(18px, 3vh, 34px) + env(safe-area-inset-bottom, 0px));
  }
  .chat-mode #bottomBar {
    margin-bottom: calc(clamp(14px, 2.6vh, 28px) + env(safe-area-inset-bottom, 0px));
  }
}

/* Hide samples in chat mode */
.chat-mode .sample-gallery-wrapper {
  display: none;
}
.center-mode .sample-gallery-wrapper {
  display: block;
}

/* Smooth transition for mode switch */
#mainContent {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#chatArea {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#bottomBar {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
#discoverPanel {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.edit-preview-wrap {
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  background: #fff;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 0;
}
.edit-preview-wrap img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100% - 36px);
  display: block;
  object-fit: contain;
}
.edit-input-wrap {
  min-height: 64px;
}
#editMessageInput {
  min-height: 40px !important;
  padding: 0 !important;
  line-height: 1.2;
  font-size: 18px !important;
  font-weight: 400 !important;
}

.edit-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.edit-modal.hidden {
  display: none !important;
}
.edit-modal-content {
  width: min(1100px, 92vw);
  max-height: 92vh;
  height: min(92vh, 920px);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}
.edit-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.edit-bottom-bar {
  padding-top: 16px;
  flex: 0 0 auto;
}

#messageInput {
  min-height: 60px !important;
  padding: 20px 0 !important;
}
nav {
  height: 72px;
}
.nav-list {
  overflow: hidden;
  display: flex;
  align-items: center;
}
.nav-list a {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  font-size: 16px;
  color: #181E25;
}
.nav-list a.active {
  background: linear-gradient(135deg, rgba(229, 62, 62, 0.08) 0%, rgba(229, 62, 62, 0.04) 100%);
  color: #E53E3E;
}
.nav-list a:hover {
  background-color: #F9FAFF;
  color: #FF4444;
}

/* Works waterfall */
.works-waterfall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.work-item {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}
.work-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8fafc;
  cursor: pointer;
}
.work-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.work-thumb .sample-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
}
.work-thumb:hover .sample-overlay {
  opacity: 1;
}
.work-thumb .sample-prompt {
  color: white;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.work-thumb .sample-btn {
  background: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.work-thumb .sample-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}
.work-meta {
  padding: 10px 10px 9px;
}
.work-prompt {
  margin: 0 0 8px 0;
  color: #374151;
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.work-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.work-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #4b5563;
  background: #f3f4f6;
}
.work-time {
  margin-left: auto;
  font-size: 11px;
  color: #9ca3af;
}
.work-download-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s ease;
}
.work-download-btn:hover {
  color: #E53E3E;
  background: rgba(229, 62, 62, 0.08);
}

@media (max-width: 1280px) {
  .works-waterfall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .works-waterfall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .works-waterfall {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  .edit-preview-wrap {
    padding: 12px 0;
  }
  .edit-preview-wrap img {
    max-height: calc(100% - 24px);
  }
  .edit-modal {
    padding: 10px;
  }
  .edit-modal-content {
    width: 100%;
    height: min(96vh, 900px);
  }
  .edit-bottom-bar {
    padding-top: 10px;
  }
  #mainContent.center-mode{
    overflow: auto;
    display: block;
  }
}
