:root {
  --bg: #eff3f9;
  --surface: #ffffff;
  --surface-soft: #f4f7fb;
  --line: #d9e1ee;
  --line-strong: #cbd6e6;
  --text: #2f3d5c;
  --muted: #90a0bd;
  --accent: #1671FA;
  --accent-strong: #1671FA;
  --accent-soft: rgba(22, 113, 250, 0.12);
  --shadow-lg: 0 18px 48px rgba(63, 83, 120, 0.08);
  --shadow-sm: 0 8px 22px rgba(63, 83, 120, 0.06);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --focus-ring: 0 0 0 4px rgba(22, 113, 250, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 42%),
    linear-gradient(180deg, #edf2f8 0%, #eef3f8 100%);
}

a,
button,
input,
summary {
  font: inherit;
}

button {
  border: 0;
}

a,
button,
input,
summary {
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.page-shell {
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1080px, calc(100% - 40px));
  margin: 20px auto 0;
  padding: 6px 4px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  font-size: 1.7rem;
  font-weight: 700;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-copy strong {
  font-size: 1.08rem;
}

.brand-copy h1 {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.top-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
}

.top-nav a:hover {
  color: var(--accent);
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}

.language-toggle:hover {
  border-color: rgba(22, 113, 250, 0.42);
  color: var(--accent);
}

.page-main {
  display: grid;
  gap: 28px;
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto 44px;
}

.hero-panel,
.info-section {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.hero-panel {
  padding: 42px 46px 44px;
}

.hero-head h1,
.block-title h2,
.copy-panel h2 {
  margin: 0;
}

.hero-head h1 {
  font-size: 1.36rem;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.upload-zone {
  display: block;
  margin-top: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 24px;
  background: linear-gradient(180deg, #fafcff 0%, #f9fbff 100%);
  overflow: hidden;
  cursor: pointer;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: rgba(22, 113, 250, 0.42);
  box-shadow: var(--focus-ring);
}

.upload-empty,
.upload-filled {
  min-height: 214px;
  padding: 24px 22px;
}

.upload-empty {
  display: grid;
  place-items: center;
  text-align: center;
}

.upload-filled {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 28px;
  text-align: left;
}

.upload-zone.has-image .upload-empty {
  display: none;
}

.upload-zone.has-image .upload-filled {
  display: flex;
}

.upload-illustration {
  font-size: 3.2rem;
  line-height: 1;
}

.upload-empty strong,
.file-summary strong {
  color: #48597b;
  font-size: clamp(1.24rem, 1.5vw, 1.52rem);
  font-weight: 500;
}

.upload-empty span,
.file-summary span,
.status-text {
  color: var(--muted);
}

.upload-empty span {
  margin-top: 10px;
  font-size: 0.94rem;
}

#previewCanvas {
  display: block;
  width: 180px;
  height: 180px;
  border-radius: 26px;
  background:
    linear-gradient(45deg, #edf2f9 25%, transparent 25%),
    linear-gradient(-45deg, #edf2f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #edf2f9 75%),
    linear-gradient(-45deg, transparent 75%, #edf2f9 75%),
    #fff;
  background-size: 18px 18px;
  background-position:
    0 0,
    0 9px,
    9px -9px,
    -9px 0;
  box-shadow: var(--shadow-sm);
}

.file-summary {
  display: grid;
  gap: 10px;
}

.file-summary span {
  font-size: 0.92rem;
  line-height: 1.55;
}

.controls-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 26px;
}

.block-title h2 {
  font-size: 1.36rem;
  font-weight: 700;
}

.size-list {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.size-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 58px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: #eef3fa;
  cursor: pointer;
}

.size-option:hover {
  transform: translateY(-1px);
}

.size-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.size-option span {
  color: #4d607f;
  font-size: 0.95rem;
  font-weight: 500;
}

.size-option.is-active {
  border-color: #1671FA;
  background: #f6f7ff;
  box-shadow: inset 0 0 0 2px rgba(111, 126, 247, 0.82);
}

.size-option.is-active span {
  color: #4f5ef1;
}

.action-block {
  display: grid;
  align-self: stretch;
}

.generate-button {
  width: 100%;
  min-height: 64px;
  border-radius: 18px;
  color: #fff;
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: #1671FA;
  cursor: pointer;
}

.generate-button:hover {
  transform: translateY(-1px);
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.status-text {
  margin: 10px 2px 0;
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: center;
}

.info-section {
  width: 100%;
  padding: 20px 0 40px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.section-tag,
.section-heading,
.info-grid,
.feature-grid,
.faq-list {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  max-width: none;
  margin: 0 auto 38px;
  text-align: center;
}

.section-kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: #9ea7bf;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.28em;
}

.section-heading h2 {
  margin: 0;
  color: #1A75FF;
  font-size: clamp(2rem, 3vw, 3.35rem);
  font-weight: 500;
  line-height: 1.18;
}

.section-heading p {
  margin: 20px auto 0;
  color: #6e7486;
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.8;
}

.section-heading-compact {
  margin-bottom: 32px;
}

.section-tag {
  margin-bottom: 22px;
  color: #4b5e80;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.info-grid article {
  padding: 24px 24px 22px;
  border: 1px solid #e3e8f5;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 255, 0.98) 100%);
  box-shadow: 0 8px 24px rgba(72, 92, 135, 0.04);
}

.info-grid h3 {
  margin: 0;
  color: #32415f;
  font-size: 1.08rem;
}

.info-grid p {
  margin: 12px 0 0;
  color: #707d95;
  line-height: 1.8;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 34px 26px 30px;
  border: 1px solid #e3e8f5;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 255, 0.98) 100%);
  box-shadow: 0 8px 24px rgba(72, 92, 135, 0.05);
  text-align: center;
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 98px;
  height: 98px;
  margin: 0 auto 28px;
  border-radius: 30px;
  color: #476ff6;
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(180deg, #eef2ff 0%, #eef1fb 100%);
}

.feature-card h3 {
  margin: 0;
  color: #1f2740;
  font-size: 1.12rem;
  font-weight: 700;
}

.feature-card p {
  margin: 16px 0 0;
  color: #707d95;
  font-size: 0.98rem;
  line-height: 1.95;
}

.faq-list {
  display: grid;
  gap: 16px;
}

.faq-list details {
  border: 1px solid #dfe6f6;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(72, 92, 135, 0.04);
}

.faq-list details[open] {
  border-color: #bfd0ff;
}

.faq-list summary {
  position: relative;
  display: block;
  list-style: none;
  padding: 28px 74px 28px 28px;
  color: #1e2740;
  font-size: 1.12rem;
  font-weight: 700;
  cursor: pointer;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 28px;
  top: 50%;
  color: #6b7280;
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  transform: translateY(-50%);
}

.faq-list details[open] summary::after {
  content: "×";
}

.faq-list p {
  margin: 0;
  padding: 0 28px 28px;
  color: #6d7382;
  font-size: 0.98rem;
  line-height: 1.95;
}

.faq-code {
  margin: -12px 28px 28px;
  padding: 16px 18px;
  overflow-x: auto;
  border: 1px solid #dfe6f6;
  border-radius: 14px;
  color: #32415f;
  background: #f7f9fd;
  font-size: 0.9rem;
  line-height: 1.7;
}

.faq-code code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.site-footer {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 34px;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.8;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

@media (max-width: 1180px) {
  .hero-panel {
    padding: 42px 32px 44px;
  }

  .size-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .size-option {
    min-width: 0;
  }

  .info-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    width: min(100% - 16px, 100%);
    margin-top: 8px;
    padding: 10px 6px 18px;
  }

  .top-nav {
    flex-wrap: wrap;
    gap: 16px;
  }

  .page-main {
    width: min(100% - 16px, 100%);
    margin-bottom: 24px;
  }

  .hero-panel {
    padding: 30px 20px 32px;
    border-radius: 24px;
  }

  .upload-zone {
    margin-top: 28px;
    border-width: 3px;
  }

  .upload-empty,
  .upload-filled {
    min-height: 220px;
    padding: 28px 18px;
  }

  .upload-filled {
    flex-direction: column;
    text-align: center;
  }

  #previewCanvas {
    width: 144px;
    height: 144px;
  }

  .size-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .size-option {
    min-height: 72px;
    padding: 0 18px;
  }

  .generate-button {
    min-height: 62px;
    font-size: 1.4rem;
  }

  .info-section {
    padding: 38px 8px 18px;
  }

  .section-tag,
  .section-heading,
  .info-grid,
  .feature-grid,
  .faq-list {
    width: 100%;
  }

  .section-heading {
    margin-bottom: 28px;
  }

  .feature-card {
    padding: 28px 18px 24px;
    border-radius: 24px;
  }

  .feature-icon {
    width: 82px;
    height: 82px;
    margin-bottom: 22px;
    border-radius: 24px;
    font-size: 1.9rem;
  }

  .faq-list summary {
    padding: 22px 58px 22px 20px;
    font-size: 1rem;
  }

  .faq-list summary::after {
    right: 20px;
    font-size: 1.8rem;
  }

  .faq-list p {
    padding: 0 20px 22px;
  }
}

@media (max-width: 520px) {
  .brand-copy {
    gap: 8px;
  }

  .brand-copy strong,
  .brand-copy h1 {
    width: 100%;
  }

  .hero-head h1 {
    font-size: 1.7rem;
  }

  .hero-head p {
    font-size: 1rem;
  }

  .upload-empty strong,
  .file-summary strong {
    font-size: 1.18rem;
    line-height: 1.5;
  }

  .size-option {
    grid-column: 1 / -1;
  }
}
