/* ========== 提示词广场 ========== */
.gallery-body { background: #0b0c10; color: #e0e0e0; min-height: 100vh; }

/* Header */
.gallery-header { position: sticky; top: 0; z-index: 100; background: rgba(11,12,16,0.92); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(255,255,255,0.06); }
.gallery-header-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 20px; }
.gallery-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 700; font-size: 17px; white-space: nowrap; }
.gallery-logo .brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #B4532A, #D99A2B); display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; font-weight: 700; }
.gallery-search-box { flex: 1; max-width: 480px; position: relative; }
.gallery-search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #666; }
.gallery-search-box input { width: 100%; padding: 9px 14px 9px 38px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; color: #e0e0e0; font-size: 14px; outline: none; transition: border-color .2s; }
.gallery-search-box input:focus { border-color: rgba(180, 83, 42,0.5); }
.gallery-search-box input::placeholder { color: #666; }
.gallery-back-btn { padding: 8px 16px; border-radius: 8px; background: rgba(255,255,255,0.06); color: #aaa; text-decoration: none; font-size: 13px; white-space: nowrap; transition: background .2s; }
.gallery-back-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }

/* Main */
.gallery-main { max-width: 1280px; margin: 0 auto; padding: 24px 24px 60px; }

/* Filters */
.gallery-filters, .gallery-sub-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-chip, .sub-chip { padding: 7px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.1); background: transparent; color: #aaa; font-size: 13px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.filter-chip:hover, .sub-chip:hover { border-color: rgba(180, 83, 42,0.4); color: #ccc; }
.filter-chip.active, .sub-chip.active { background: linear-gradient(135deg, #B4532A, #D99A2B); color: #fff; border-color: transparent; }
.gallery-sub-filters { margin-bottom: 20px; }

/* Stats */
.gallery-stats { font-size: 13px; color: #666; margin-bottom: 16px; }

/* Grid - masonry-like */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* Card */
.prompt-card { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; display: flex; flex-direction: column; }
.prompt-card:hover { transform: translateY(-3px); border-color: rgba(180, 83, 42,0.3); box-shadow: 0 8px 30px rgba(0,0,0,0.3); }

/* Card preview image */
.prompt-card-preview-img { width: 100%; height: 280px; overflow: hidden; background: linear-gradient(135deg, #1a1b2e, #2d1f4e); position: relative; display: flex; align-items: center; justify-content: center; }
.prompt-card-preview-img img { width: 100%; height: 100%; object-fit: contain; padding: 8px; box-sizing: border-box; transition: transform .3s; }
.prompt-card:hover .prompt-card-preview-img img { transform: scale(1.03); }
.prompt-card-preview-img.img-failed { background: linear-gradient(135deg, #1a1b2e, #2d1f4e); }
.prompt-card-preview-img.img-failed img { display: none; }

.prompt-card-color { height: 6px; width: 100%; }
.prompt-card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.prompt-card-title { font-size: 15px; font-weight: 600; color: #e0e0e0; margin-bottom: 6px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prompt-card-preview { font-size: 12.5px; color: #888; line-height: 1.6; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.prompt-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.prompt-tag { padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,0.06); color: #999; font-size: 11px; white-space: nowrap; }
.prompt-tag.type-tag { background: rgba(180, 83, 42,0.15); color: #b4a0f0; }
.prompt-tag.industry-tag { background: rgba(217, 154, 43,0.15); color: #93b8f0; }
.prompt-card-footer { display: flex; justify-content: space-between; align-items: center; }
.prompt-card-use { padding: 6px 14px; border-radius: 8px; background: linear-gradient(135deg, #B4532A, #D99A2B); color: #fff; font-size: 12.5px; border: none; cursor: pointer; transition: opacity .2s; }
.prompt-card-use:hover { opacity: 0.85; }
.prompt-card-ratio { font-size: 12px; color: #666; }

/* Card color variants */
.pc-purple .prompt-card-color { background: linear-gradient(135deg, #B4532A, #D99A2B); }
.pc-blue .prompt-card-color { background: linear-gradient(135deg, #D99A2B, #60a5fa); }
.pc-green .prompt-card-color { background: linear-gradient(135deg, #2F5D50, #6B8275); }
.pc-orange .prompt-card-color { background: linear-gradient(135deg, #d97706, #fbbf24); }
.pc-pink .prompt-card-color { background: linear-gradient(135deg, #db2777, #f472b6); }
.pc-red .prompt-card-color { background: linear-gradient(135deg, #dc2626, #f87171); }
.pc-teal .prompt-card-color { background: linear-gradient(135deg, #0d9488, #5eead4); }
.pc-indigo .prompt-card-color { background: linear-gradient(135deg, #4f46e5, #818cf8); }

/* Empty state */
.gallery-empty { text-align: center; padding: 80px 20px; color: #666; }
.gallery-empty p { margin: 16px 0 4px; font-size: 16px; color: #888; }
.gallery-empty span { font-size: 13px; }

/* Modal overlay */
.prompt-modal-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .2s; }

/* Modal — split layout (left info + right image) */
.prompt-modal-card { background: #181a20; border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; width: 100%; max-width: 600px; max-height: 85vh; overflow-y: auto; position: relative; }
.prompt-modal-card.prompt-modal-split { display: flex; flex-direction: row; max-width: 880px; overflow: hidden; }

.prompt-modal-close { position: absolute; top: 12px; right: 16px; background: none; border: none; color: #666; font-size: 24px; cursor: pointer; line-height: 1; z-index: 10; }
.prompt-modal-close:hover { color: #fff; }

/* Left side (info) */
.prompt-modal-left { flex: 1; min-width: 320px; display: flex; flex-direction: column; overflow-y: auto; max-height: 85vh; }
.prompt-modal-info { padding: 20px 24px 0; }
.prompt-modal-info h3 { font-size: 17px; color: #e0e0e0; margin-bottom: 4px; line-height: 1.4; }
.prompt-modal-info .modal-tags { font-size: 12px; color: #888; margin-bottom: 4px; }
.prompt-modal-info .modal-tags .tag-chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,0.06); color: #999; font-size: 11px; margin-right: 6px; }
.prompt-modal-info .modal-tags .tag-chip.type-tag { background: rgba(180, 83, 42,0.15); color: #b4a0f0; }
.prompt-modal-info .modal-ratio { font-size: 12px; color: #666; }

.prompt-modal-body { padding: 14px 24px; flex: 1; overflow-y: auto; }
.prompt-modal-label { font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.prompt-modal-text { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 10px; padding: 14px 16px; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; color: #c8c8c8; line-height: 1.7; white-space: pre-wrap; word-break: break-all; margin: 0; }
.prompt-modal-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.prompt-modal-actions { padding: 14px 24px 24px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid rgba(255,255,255,0.04); }

/* Right side (preview image) */
.prompt-modal-right { width: 340px; flex-shrink: 0; background: linear-gradient(135deg, #1a1b2e, #2d1f4e); display: flex; align-items: center; justify-content: center; border-left: 1px solid rgba(255,255,255,0.04); }
.modal-preview-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.modal-preview-img img { width: 100%; height: 100%; object-fit: contain; padding: 12px; box-sizing: border-box; }

/* Toast */
.gallery-toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #2F5D50; color: #fff; padding: 10px 24px; border-radius: 10px; font-size: 13px; z-index: 300; animation: fadeIn .2s; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Gallery nav tabs */
.gallery-nav-tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.04); border-radius: 10px; padding: 3px; }
.gallery-tab { padding: 7px 16px; border-radius: 8px; border: none; background: transparent; color: #888; font-size: 13px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.gallery-tab:hover { color: #ccc; }
.gallery-tab.active { background: rgba(180, 83, 42,0.25); color: #e0d0ff; font-weight: 500; }

/* UGC submit bar */
.ugc-submit-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding: 14px 20px; background: rgba(180, 83, 42,0.08); border: 1px dashed rgba(180, 83, 42,0.3); border-radius: 12px; }
.ugc-submit-hint { font-size: 13px; color: #888; }

/* UGC modal */
.ugc-modal-header { padding: 24px 24px 0; }
.ugc-modal-header h3 { font-size: 18px; color: #e0e0e0; margin-bottom: 6px; }
.ugc-modal-header p { font-size: 13px; color: #888; margin-bottom: 0; }
.ugc-modal-header strong { color: #D99A2B; }
.ugc-form { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.ugc-form label { display: flex; flex-direction: column; gap: 6px; }
.ugc-form label > span { font-size: 13px; color: #aaa; font-weight: 500; }
.ugc-form label > span em { color: #f87171; font-style: normal; }
.ugc-form input, .ugc-form textarea, .ugc-form select { padding: 10px 14px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; color: #e0e0e0; font-size: 14px; outline: none; transition: border-color .2s; }
.ugc-form input:focus, .ugc-form textarea:focus, .ugc-form select:focus { border-color: rgba(180, 83, 42,0.5); }
.ugc-form textarea { resize: vertical; min-height: 100px; font-family: inherit; }
.ugc-form select { appearance: auto; }
.ugc-form select option { background: #181a20; color: #e0e0e0; }
.ugc-form-row { display: flex; gap: 12px; }
.ugc-form-row > label { flex: 1; }
.char-count { font-size: 11px; color: #666; text-align: right; }
.ugc-form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }
.ugc-form-note { font-size: 12px; color: #666; text-align: center; }

/* UGC card badge */
.ugc-badge { padding: 2px 8px; border-radius: 6px; font-size: 10px; font-weight: 600; }
.ugc-badge.pending { background: rgba(251,191,36,0.15); color: #fbbf24; }
.ugc-badge.approved { background: rgba(47,93,80,0.15); color: #2F5D50; }
.ugc-badge.rejected { background: rgba(248,113,113,0.15); color: #f87171; }
.ugc-card-author { font-size: 12px; color: #666; margin-bottom: 4px; }
.ugc-card-stats { font-size: 11px; color: #555; display: flex; gap: 12px; }
.ugc-card-stats span { display: flex; align-items: center; gap: 3px; }
.ugc-card-reject-reason { font-size: 11px; color: #f87171; margin-top: 6px; background: rgba(248,113,113,0.08); padding: 6px 10px; border-radius: 6px; }

/* UGC my works stats */
.ugc-my-stats { display: flex; gap: 16px; margin-bottom: 16px; }
.ugc-my-stat { padding: 12px 20px; background: rgba(255,255,255,0.04); border-radius: 10px; display: flex; flex-direction: column; align-items: center; min-width: 100px; }
.ugc-my-stat strong { font-size: 22px; color: #e0e0e0; }
.ugc-my-stat span { font-size: 11px; color: #888; margin-top: 2px; }

/* Responsive */
@media (max-width: 640px) {
  .gallery-header-inner { padding: 0 14px; gap: 12px; }
  .gallery-search-box { max-width: none; }
  .gallery-main { padding: 16px 14px 40px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .prompt-modal-card { max-height: 90vh; }
  .prompt-modal-card.prompt-modal-split { flex-direction: column-reverse; max-width: 100%; }
  .prompt-modal-right { width: 100%; height: 220px; border-left: none; border-bottom: 1px solid rgba(255,255,255,0.04); }
  .prompt-modal-left { min-width: auto; max-height: calc(90vh - 220px); }
  .gallery-back-btn { display: none; }
  .gallery-nav-tabs { order: 3; flex: 1 0 100%; justify-content: center; }
  .ugc-form-row { flex-direction: column; gap: 14px; }
  .ugc-my-stats { flex-wrap: wrap; }
}
