/* Nano Banana Pro 图像生成器 - 样式文件 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --fabric-base: #f4f1ea;
  --fabric-light: #fdfbf7;
  --primary: #5c7c8a;
  --primary-hover: #4a6572;
  --accent: #d97d54;
  --text-main: #4a4a4a;
  --text-sub: #8c8880;
  --stitch-color: #d4cbb8;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--fabric-base);
  background-image: 
    linear-gradient(45deg, rgba(0,0,0,0.02) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.02) 75%),
    linear-gradient(45deg, rgba(0,0,0,0.02) 25%, transparent 25%, transparent 75%, rgba(0,0,0,0.02) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  color: var(--text-main);
  min-height: 100vh;
}

.container { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }

.header {
  text-align: center;
  padding: 40px 0 60px;
  position: relative;
}

.header h1 {
  font-size: 42px;
  font-weight: 700;
  color: var(--text-main);
  text-shadow: 2px 2px 0px rgba(255,255,255,0.8);
}

.header p { color: var(--text-sub); font-size: 16px; margin-top: 8px; }

.credits-display {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  z-index: 100;
}

.credits-info {
  background: var(--fabric-light);
  border: 2px dashed var(--stitch-color);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 2px 2px 0 rgba(212, 203, 184, 0.5);
}

.credits-info .amount {
  color: var(--primary);
  font-size: 20px;
  margin-left: 8px;
}

.settings-btn {
  background: var(--primary);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.24s;
  box-shadow: 0 4px 12px rgba(92, 124, 138, 0.3);
}

.settings-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--fabric-light);
  border-radius: 16px;
  padding: 40px;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  position: relative;
}

.modal-content::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 2px dashed var(--stitch-color);
  border-radius: 12px;
  pointer-events: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
  z-index: 3;
}

.modal-header h2 {
  font-size: 24px;
  color: var(--primary);
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-sub);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.24s;
}

.close-btn:hover {
  color: var(--accent);
  transform: rotate(90deg);
}

.modal-body {
  position: relative;
  z-index: 3;
}

.card-status {
  background: rgba(92, 124, 138, 0.1);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.card-status p {
  margin: 8px 0;
  font-size: 14px;
}

.card-status .label {
  color: var(--text-sub);
  display: inline-block;
  width: 80px;
}

.card-status .value {
  color: var(--text-main);
  font-weight: 600;
}

.logout-btn {
  width: 100%;
  background: var(--text-sub);
  border: none;
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.24s;
}

.logout-btn:hover {
  background: #c0392b;
}

.card {
  background: var(--fabric-light);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 8px 24px rgba(92, 85, 75, 0.06);
  border: 1px solid #fff;
  position: relative;
}

.card::after {
  content: '';
  position: absolute;
  top: 12px; left: 12px; right: 12px; bottom: 12px;
  border: 2px dashed var(--stitch-color);
  border-radius: 12px;
  pointer-events: none;
}

.input-group {
  margin-bottom: 32px;
  position: relative;
  z-index: 3;
}

.input-group label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.input-group input,
.input-group textarea {
  width: 100%;
  background: #f0ede6;
  border: none;
  border-bottom: 2px solid var(--stitch-color);
  border-radius: 8px 8px 0 0;
  padding: 20px;
  color: var(--text-main);
  font-size: 16px;
  font-family: inherit;
  transition: all 0.24s;
  box-shadow: inset 0 2px 6px rgba(92, 85, 75, 0.12);
  resize: vertical;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  background: #fff;
  border-bottom-color: var(--primary);
  box-shadow: 0 4px 12px rgba(92, 124, 138, 0.1);
}

.aspect-ratio-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.aspect-btn {
  background: transparent;
  border: 2px solid var(--stitch-color);
  border-radius: 8px;
  padding: 12px 8px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.24s;
  font-size: 14px;
}

.aspect-btn:hover {
  border-color: var(--primary-hover);
  color: var(--primary-hover);
  background: rgba(92, 124, 138, 0.05);
}

.aspect-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(92, 124, 138, 0.3);
}

.resolution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.resolution-btn {
  background: transparent;
  border: 2px solid var(--stitch-color);
  border-radius: 8px;
  padding: 12px 8px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.24s;
  font-size: 14px;
}

.resolution-btn:hover {
  border-color: var(--primary-hover);
  color: var(--primary-hover);
  background: rgba(92, 124, 138, 0.05);
}

.resolution-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(92, 124, 138, 0.3);
}

.generate-btn {
  width: 100%;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  padding: 20px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.24s;
  box-shadow: 0 4px 0 #b5603b, 0 8px 16px rgba(181, 96, 59, 0.3);
  z-index: 5;
  position: relative;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #b5603b, 0 12px 20px rgba(181, 96, 59, 0.4);
}

.generate-btn:disabled {
  background: var(--text-sub);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.status {
  text-align: center;
  padding: 16px;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-sub);
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  display: none;
}

.status.processing { color: var(--primary); border-left: 4px solid var(--primary); }
.status.error { color: #c0392b; border-left: 4px solid #c0392b; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  padding: 0 10px;
}

.gallery-item {
  background: #fff;
  padding: 12px 12px 16px 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: rotate(-1deg);
  transition: all 0.24s;
  position: relative;
}

.gallery-item:nth-child(even) { transform: rotate(1deg); }

.gallery-item:hover {
  transform: rotate(0) scale(1.02);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  z-index: 10;
}

.gallery-item img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.05);
  cursor: pointer;
}

#dropZone {
  width: 100%;
  min-height: 80px;
  border: 2px dashed var(--stitch-color);
  border-radius: 8px;
  padding: 16px;
  background: var(--fabric-base);
  transition: all 0.24s;
  cursor: pointer;
}

#imagePreviewContainer {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 隐藏元素 */
.hidden { display: none !important; }

/* 下拉区域内容样式 */
#dropZoneContent {
  text-align: center;
  color: var(--text-sub);
}

#dropZoneContent .icon {
  font-size: 32px;
  margin-bottom: 6px;
}

#dropZoneContent .title {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}

#dropZoneContent .subtitle {
  font-size: 12px;
  opacity: 0.7;
}

/* 图片预览项样式 */
.preview-item {
  position: relative;
  display: inline-block;
}

.preview-item img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--stitch-color);
}

.preview-item .remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}

/* 画廊项内容样式 */
.gallery-item .info {
  padding-top: 12px;
}

.gallery-item .prompt-text {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-item .timestamp {
  color: #64748b;
  font-size: 11px;
  margin-top: 4px;
}

.gallery-empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px;
  color: var(--text-sub);
}

/* 画廊标题 */
.gallery-title {
  margin-bottom: 20px;
  font-size: 24px;
}

/* 卡密状态值颜色 */
.status-verified {
  color: #27ae60;
}

@media (max-width: 768px) {
  .aspect-ratio-grid { grid-template-columns: repeat(3, 1fr); }
}
