:root {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #101828;
  background:
    radial-gradient(circle at top left, rgba(255, 115, 115, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 204, 112, 0.16), transparent 28%),
    radial-gradient(circle at bottom center, rgba(71, 191, 255, 0.14), transparent 32%),
    #ffffff;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  padding: 40px 24px 64px;
}

.page-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.85)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffd7f7' fill-opacity='0.18'%3E%3Ccircle cx='80' cy='80' r='1'/%3E%3Ccircle cx='24' cy='44' r='1'/%3E%3Ccircle cx='128' cy='130' r='1'/%3E%3Ccircle cx='142' cy='36' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.8;
}

.magic-cursor {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  filter: blur(22px);
  background:
    conic-gradient(from 180deg, #ff7a7a, #ffd66b, #78f0ae, #6ecbff, #bd8cff, #ff89dd, #ff7a7a);
  transition: opacity 180ms ease;
  mix-blend-mode: multiply;
}

.magic-cursor.visible {
  opacity: 0.38;
}

.hero,
.workspace,
.history-section {
  position: relative;
  z-index: 1;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  max-width: 1280px;
  margin: 0 auto 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #ff4b77;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 640px;
  margin: 16px 0 0;
  color: #475467;
  font-size: 17px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(16, 24, 40, 0.08);
  box-shadow: 0 18px 36px rgba(16, 24, 40, 0.08);
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d0d5dd;
}

.status-dot.uploading,
.status-dot.generating {
  background: #ff9f1a;
  box-shadow: 0 0 0 8px rgba(255, 159, 26, 0.16);
}

.status-dot.success {
  background: #12b76a;
  box-shadow: 0 0 0 8px rgba(18, 183, 106, 0.14);
}

.status-dot.error {
  background: #f04438;
  box-shadow: 0 0 0 8px rgba(240, 68, 56, 0.14);
}

.workspace {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr;
  gap: 20px;
}

.panel,
.history-section {
  border-radius: 30px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 28px 90px rgba(16, 24, 40, 0.08);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 22px;
}

.panel-head,
.history-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2,
.history-head h2 {
  margin: 0;
  font-size: 20px;
}

.panel-head span,
.history-head span {
  color: #667085;
  font-size: 13px;
}

.upload-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1.5px dashed rgba(255, 75, 119, 0.36);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 240, 245, 0.88), rgba(247, 251, 255, 0.86));
  text-align: center;
  color: #344054;
}

.upload-box input {
  display: none;
}

.upload-box span {
  font-size: 16px;
  font-weight: 700;
}

.upload-box small,
.hint,
.status-message {
  color: #667085;
}

.preview-card {
  display: grid;
  place-items: center;
  min-height: 360px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9), rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(16, 24, 40, 0.06);
}

.result-card {
  margin-top: 0;
}

.empty-state {
  color: #98a2b3;
  text-align: center;
  font-size: 15px;
}

.image-button,
.history-image-button {
  border: 0;
  padding: 0;
  background: transparent;
  width: 100%;
}

.preview-image,
.history-image {
  width: 100%;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.14);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.image-button:hover .preview-image,
.history-image-button:hover .history-image {
  transform: scale(1.02);
  box-shadow: 0 22px 52px rgba(16, 24, 40, 0.18);
}

.prompt-input {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  background: rgba(255, 255, 255, 0.9);
  color: #101828;
  outline: none;
}

.prompt-input:focus {
  border-color: rgba(255, 75, 119, 0.42);
  box-shadow: 0 0 0 6px rgba(255, 75, 119, 0.08);
}

.generate-button {
  width: 100%;
  margin-top: 18px;
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(90deg, #ff5d7d 0%, #ff9a3d 26%, #3bc9ff 72%, #6b7cff 100%);
  box-shadow: 0 20px 40px rgba(77, 122, 255, 0.25);
  transition: transform 180ms ease, opacity 180ms ease;
}

.generate-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.generate-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.history-section {
  max-width: 1280px;
  margin: 28px auto 0;
  padding: 24px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.history-card {
  padding: 14px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(16, 24, 40, 0.06);
}

.history-time {
  margin: 14px 0 10px;
  color: #ff4b77;
  font-size: 13px;
  font-weight: 700;
}

.history-prompt {
  margin: 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.6;
}

.history-empty {
  border-radius: 22px;
  padding: 24px;
  background: rgba(248, 250, 252, 0.88);
  color: #98a2b3;
  text-align: center;
}

.zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 13, 18, 0.8);
}

.zoom-modal[hidden] {
  display: none;
}

.zoom-image {
  max-width: min(1200px, 96vw);
  max-height: 88vh;
  border-radius: 22px;
  box-shadow: 0 24px 120px rgba(0, 0, 0, 0.42);
}

.zoom-close {
  position: absolute;
  top: 24px;
  right: 24px;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: #ffffff;
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 20px 14px 36px;
  }

  .panel,
  .history-section {
    border-radius: 22px;
  }

  .preview-card {
    min-height: 280px;
  }

  .status-pill {
    white-space: normal;
  }
}
