/* ============================================================
   AI创作展示平台 - 自定义样式
   ============================================================ */

/* ---------- 作品卡片网格（大屏默认一行 6 个） ---------- */
#cards-container {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
  #cards-container {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 768px) {
  #cards-container {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  #cards-container {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  #cards-container {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ---------- 自定义工具类 ---------- */
.content-auto {
  content-visibility: auto;
}

/* ---------- 卡片悬浮效果 ---------- */
.card-hover {
  transition: all 0.3s ease;
}
.card-hover:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-4px);
}

/* ---------- 模型筛选按钮 ---------- */
.model-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  outline: none;
  font-size: 14px;
}
.model-btn-active {
  background-color: #3B82F6;
  color: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.model-btn-inactive {
  background-color: #f3f4f6;
  color: #374151;
}
.model-btn-inactive:hover {
  background-color: #e5e7eb;
}

/* 暗色模式 - 模型按钮 */
.dark .model-btn-inactive {
  background-color: #334155;
  color: #e2e8f0;
}
.dark .model-btn-inactive:hover {
  background-color: #475569;
}

/* ---------- 滑块对比组件 ---------- */
.slider {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
}
.slider-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slider-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 100%;
  width: 4px;
  background: #ffffff;
  transform: translateX(-50%);
  cursor: ew-resize;
  z-index: 10;
}
.slider-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}
.slider-handle::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #374151;
  font-weight: bold;
  font-size: 14px;
}

/* ---------- 淡入动画 ---------- */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes slideUp {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out;
}
.animate-slide-up {
  animation: slideUp 0.5s ease-in-out;
}

/* ---------- 模态框动画 ---------- */
@keyframes modalIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.modal-animate-in {
  animation: modalIn 0.3s ease-out;
}

/* ---------- 登录 / 注册模态框 ---------- */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-modal-overlay.hidden {
  display: none !important;
}
.auth-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  margin: 0 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.dark .auth-modal {
  background: #1e293b;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.auth-modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-modal-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: #1e293b;
}
.dark .auth-modal-header h2 {
  color: #f1f5f9;
}
.auth-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.auth-modal-close:hover {
  background: #e2e8f0;
  color: #1e293b;
}
.dark .auth-modal-close {
  background: #334155;
  color: #94a3b8;
}
.dark .auth-modal-close:hover {
  background: #475569;
  color: #f1f5f9;
}
.auth-modal-body {
  padding: 24px;
}
.share-modal {
  max-width: 520px;
}
.share-modal-body {
  max-height: min(70vh, 640px);
  overflow-y: auto;
}
.share-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.share-select,
.share-input-plain,
.share-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #1e293b;
  box-sizing: border-box;
}
.dark .share-select,
.dark .share-input-plain,
.dark .share-textarea {
  background: #334155;
  border-color: #475569;
  color: #f1f5f9;
}
.share-textarea {
  resize: vertical;
  min-height: 72px;
}
.share-optional {
  font-weight: 400;
  color: #94a3b8;
  font-size: 12px;
}
.share-hint {
  font-size: 12px;
  color: #64748b;
  margin: -8px 0 16px;
  line-height: 1.5;
}
.dark .share-hint {
  color: #94a3b8;
}
.share-field {
  display: none;
}
.share-field.share-field-visible {
  display: block;
}

.share-upload-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.share-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.share-dropzone {
  position: relative;
  min-height: 148px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
  overflow: hidden;
}

.share-dropzone:hover,
.share-dropzone:focus-visible {
  border-color: #6366f1;
  background: #f1f5f9;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.share-dropzone-active {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.share-dropzone-busy {
  pointer-events: none;
  opacity: 0.85;
}

.share-dropzone-has-file {
  border-style: solid;
  border-color: #e2e8f0;
  background: #fff;
  min-height: auto;
  cursor: default;
}

.share-dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  text-align: center;
  gap: 6px;
}

.share-dropzone-has-file .share-dropzone-empty {
  display: none;
}

.share-dropzone-icon {
  width: 52px;
  height: 52px;
  color: #94a3b8;
  flex-shrink: 0;
}

.share-dropzone-title {
  font-size: 13px;
  color: #64748b;
  margin: 4px 0 0;
  line-height: 1.5;
}

.share-dropzone-hint {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

.share-dropzone-preview {
  display: none;
  padding: 12px;
}

.share-dropzone-has-file .share-dropzone-preview {
  display: block;
}

.share-dropzone-remove {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  cursor: pointer;
  z-index: 2;
  padding: 0;
  transition: background 0.2s;
}

.share-dropzone-remove:hover {
  background: rgba(15, 23, 42, 0.75);
}

.share-dropzone-remove .icon {
  width: 14px;
  height: 14px;
}

.share-dropzone-has-file .share-dropzone-remove {
  display: flex;
}

.share-dropzone-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: #64748b;
  text-align: center;
  line-height: 1.5;
}

.dark .share-dropzone-status {
  color: #94a3b8;
}

.dark .share-dropzone {
  border-color: #475569;
  background: #1e293b;
}

.dark .share-dropzone:hover,
.dark .share-dropzone:focus-visible {
  border-color: #818cf8;
  background: #334155;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

.dark .share-dropzone-active {
  border-color: #818cf8;
  background: #312e81;
}

.dark .share-dropzone-has-file {
  border-color: #475569;
  background: #0f172a;
}

.dark .share-dropzone-icon {
  color: #64748b;
}

.dark .share-dropzone-title {
  color: #94a3b8;
}

.dark .share-dropzone-hint {
  color: #64748b;
}

.share-upload-meta {
  font-size: 12px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

.dark .share-upload-meta {
  color: #94a3b8;
}

.share-upload-preview {
  min-height: 0;
}

.share-upload-thumb {
  display: block;
  width: 100%;
  max-height: 200px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.dark .share-upload-thumb {
  border-color: #475569;
  background: #1e293b;
}

@media (max-width: 480px) {
  .share-form-row {
    grid-template-columns: 1fr;
  }
}
.auth-modal-footer {
  padding: 0 24px 24px;
  text-align: center;
}
.auth-modal-footer p {
  font-size: 14px;
  color: #64748b;
}
.dark .auth-modal-footer p {
  color: #94a3b8;
}
.auth-modal-footer a {
  color: #3B82F6;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}
.auth-modal-footer a:hover {
  color: #2563eb;
}

/* ---------- 表单元素 ---------- */
.auth-form-group {
  margin-bottom: 16px;
}
.auth-form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}
.dark .auth-form-group label {
  color: #e2e8f0;
}
.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-input-wrapper .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 16px;
  pointer-events: none;
}
.auth-input-wrapper .toggle-password {
  left: auto;
  right: 8px;
  pointer-events: auto;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s ease;
  color: #94a3b8;
}
.auth-input-wrapper .toggle-password:hover {
  background: #f1f5f9;
  color: #64748b;
}
.dark .auth-input-wrapper .toggle-password:hover {
  background: #334155;
  color: #cbd5e1;
}
.auth-input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
}
.auth-input::placeholder {
  color: #94a3b8;
}
.auth-input:focus {
  border-color: #3B82F6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.dark .auth-input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}
.dark .auth-input:focus {
  border-color: #3B82F6;
  background: #1e293b;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.auth-input.error {
  border-color: #ef4444;
  background: #fef2f2;
}
.dark .auth-input.error {
  border-color: #ef4444;
  background: #450a0a;
}
.auth-input.success {
  border-color: #22c55e;
}

/* ---------- 邮箱验证码 ---------- */
.auth-verify-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.auth-verify-row .auth-input-wrapper {
  flex: 1;
}
.auth-verify-row .auth-input {
  padding-right: 8px;
}
.auth-send-code-btn {
  flex-shrink: 0;
  height: 42px;
  padding: 0 14px;
  border: 2px solid #3B82F6;
  border-radius: 10px;
  background: transparent;
  color: #3B82F6;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: inherit;
}
.auth-send-code-btn:hover {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
}
.auth-send-code-btn:active {
  transform: scale(0.96);
}
.auth-send-code-btn.counting {
  border-color: #cbd5e1;
  color: #94a3b8;
  cursor: not-allowed;
  background: #f8fafc;
  pointer-events: none;
}
.dark .auth-send-code-btn {
  border-color: #3B82F6;
  color: #60a5fa;
}
.dark .auth-send-code-btn:hover {
  background: #1e3a5f;
  border-color: #60a5fa;
  color: #93bbfd;
}
.dark .auth-send-code-btn.counting {
  border-color: #475569;
  color: #64748b;
  background: #1e293b;
}

.auth-error-msg {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  display: none;
  align-items: center;
  gap: 4px;
}
.auth-error-msg .icon,
.auth-success-msg .icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.auth-error-msg.visible {
  display: flex;
}
.auth-success-msg {
  font-size: 12px;
  color: #22c55e;
  margin-top: 4px;
  display: none;
  align-items: center;
  gap: 4px;
}
.auth-success-msg.visible {
  display: flex;
}

/* ---------- 全局提示消息 ---------- */
.auth-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-toast .icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.auth-toast.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.auth-toast.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.dark .auth-toast.error {
  background: #450a0a;
  color: #fecaca;
  border-color: #7f1d1d;
}
.dark .auth-toast.success {
  background: #052e16;
  color: #bbf7d0;
  border-color: #166534;
}

/* ---------- 表单按钮 ---------- */
.auth-submit-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  background: #3B82F6;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.auth-submit-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}
.auth-submit-btn:active {
  transform: scale(0.98);
}
.auth-submit-btn:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.auth-submit-btn .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.auth-submit-btn.loading .spinner {
  display: inline-block;
}
.auth-submit-btn.loading .btn-text {
  display: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 记住我 复选框 ---------- */
.auth-checkbox-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.auth-checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 6px;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #64748b !important;
  cursor: pointer;
}
.auth-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3B82F6;
  cursor: pointer;
}
.auth-forgot-link {
  font-size: 13px;
  color: #3B82F6;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}
.auth-forgot-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ---------- 分隔线 ---------- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}
.dark .auth-divider::before,
.dark .auth-divider::after {
  background: #334155;
}
.auth-divider span {
  font-size: 12px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- 社交登录按钮 ---------- */
.auth-social-btns {
  display: flex;
  gap: 12px;
}
.auth-social-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.auth-social-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
.dark .auth-social-btn {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .auth-social-btn:hover {
  background: #1e293b;
  border-color: #475569;
}

/* ---------- 密码强度指示器 ---------- */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.password-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
  transition: background 0.3s ease;
}
.password-strength-bar.weak {
  background: #ef4444;
}
.password-strength-bar.medium {
  background: #f59e0b;
}
.password-strength-bar.strong {
  background: #22c55e;
}
.password-strength-text {
  font-size: 11px;
  margin-top: 4px;
  color: #94a3b8;
}

/* ---------- 用户下拉菜单 ---------- */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  overflow: hidden;
  z-index: 60;
}
.dark .user-dropdown {
  background: #1e293b;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}
.user-dropdown-header {
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.dark .user-dropdown-header {
  border-bottom-color: #334155;
}
.user-dropdown-header img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.user-dropdown-header .user-info {
  display: flex;
  flex-direction: column;
}
.user-dropdown-header .user-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}
.dark .user-dropdown-header .user-name {
  color: #f1f5f9;
}
.user-dropdown-header .user-email {
  font-size: 12px;
  color: #94a3b8;
}
.user-dropdown-item {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.user-dropdown-item:hover {
  background: #f8fafc;
  color: #3B82F6;
}
.dark .user-dropdown-item {
  color: #e2e8f0;
}
.dark .user-dropdown-item:hover {
  background: #0f172a;
  color: #3B82F6;
}
.user-dropdown-item .icon {
  width: 18px;
  height: 18px;
}
.user-dropdown-item.logout {
  color: #ef4444;
  border-top: 1px solid #f1f5f9;
}
.dark .user-dropdown-item.logout {
  border-top-color: #334155;
}
.user-dropdown-item.logout:hover {
  background: #fef2f2;
  color: #dc2626;
}
.dark .user-dropdown-item.logout:hover {
  background: #450a0a;
}

/* ---------- 页脚信息模态框 ---------- */
.info-modal {
  max-width: 640px;
}
.info-modal-body {
  max-height: min(65vh, 520px);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
}
.dark .info-modal-body {
  color: #cbd5e1;
}
.info-modal-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  margin: 20px 0 8px;
}
.dark .info-modal-body h3 {
  color: #f1f5f9;
}
.info-modal-body h3:first-child {
  margin-top: 0;
}
.info-modal-body p {
  margin-bottom: 12px;
}
.info-modal-body ul {
  margin: 0 0 12px 1.25rem;
  list-style: disc;
}
.info-modal-body li {
  margin-bottom: 6px;
}
.info-modal-body a {
  color: #6366f1;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.info-modal-body a:hover {
  color: #4f46e5;
}
.info-modal-body .info-muted {
  font-size: 13px;
  color: #94a3b8;
}
.dark .info-modal-body .info-muted {
  color: #64748b;
}
.info-modal-footer {
  padding: 0 24px 24px;
}
.info-modal-footer .auth-submit-btn {
  width: 100%;
}
.info-contact-list {
  list-style: none !important;
  margin-left: 0 !important;
  padding: 12px 16px;
  background: #f8fafc;
  border-radius: 8px;
}
.dark .info-contact-list {
  background: #334155;
}

/* ---------- 响应式调整 ---------- */
@media (max-width: 640px) {
  .auth-modal {
    max-width: 100%;
    margin: 0 8px;
    border-radius: 16px 16px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }
  .auth-social-btns {
    flex-direction: column;
  }
  .auth-modal-body {
    padding: 16px;
  }
}
