:root {
  color-scheme: light;
  --bg: #fff7fa;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --line: rgba(222, 118, 151, 0.16);
  --ink: #4d313b;
  --muted: #876d77;
  --rose: #ff6e95;
  --rose-deep: #d85a82;
  --shadow: 0 18px 44px rgba(203, 114, 144, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 226, 236, 0.82), transparent 24rem),
    linear-gradient(180deg, #ffe6ef, #fff9fb 42%, #ffffff);
  color: var(--ink);
}

body {
  min-height: 100dvh;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(100%, 860px);
  margin: 0 auto;
  padding: 18px 16px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--rose-deep);
  box-shadow: 0 10px 22px rgba(214, 112, 145, 0.12);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 20px;
  line-height: 1.2;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.top-link {
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--rose-deep);
  font-size: 13px;
  font-weight: 800;
}

.layout {
  display: grid;
  gap: 18px;
}

.hero-card,
.form-card,
.media-card,
.generate-card,
.share-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 30px 26px 28px;
  background:
    radial-gradient(circle at top right, rgba(255, 222, 232, 0.72), transparent 14rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 250, 0.92));
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rose-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
}

.hero-card h1 {
  margin: 0;
  max-width: 14em;
  font-size: clamp(28px, 6vw, 38px);
  line-height: 1.18;
}

.hero-card p:not(.eyebrow) {
  margin: 12px 0 0;
  max-width: 32em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.85;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-meta span {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--rose-deep);
  font-size: 12px;
  font-weight: 700;
}

.form-card,
.media-card,
.generate-card,
.share-card {
  padding: 24px;
}

.share-card[hidden] {
  display: none;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.form-grid label,
.viewer-date-entry {
  display: grid;
  gap: 8px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid span {
  font-size: 13px;
  font-weight: 850;
}

input,
textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
  outline: 0;
  font-size: 16px;
  line-height: 1.45;
}

textarea {
  min-height: 130px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 110, 149, 0.52);
  box-shadow: 0 0 0 4px rgba(255, 110, 149, 0.12);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.upload-block {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px dashed rgba(255, 110, 149, 0.22);
  border-radius: 22px;
  background: rgba(255, 248, 250, 0.82);
}

.upload-button,
.pill-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 900;
}

.upload-button,
.pill-button,
.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--rose-deep);
}

.primary-button,
.secondary-button.filled {
  border: 0;
  background: linear-gradient(135deg, #ff8dae, #ff6e95);
  color: #fff;
  box-shadow: 0 18px 32px rgba(219, 105, 144, 0.24);
}

.upload-button svg,
.pill-button svg,
.primary-button svg,
.secondary-button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.upload-button svg,
.pill-button svg,
.secondary-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.primary-button svg {
  fill: currentColor;
}

.upload-button,
.pill-button {
  position: relative;
}

.file-picker {
  overflow: hidden;
}

.file-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.native-file-input {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.status-line.strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.generate-card .status-line.strong {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(222, 118, 151, 0.14);
  border-radius: 16px;
  background: rgba(255, 248, 250, 0.86);
  color: var(--muted);
  font-weight: 800;
}

.generate-card .section-head p {
  max-width: 42rem;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.photo-preview-actions {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 0;
}

.photo-preview-actions[hidden] {
  display: none;
}

.clear-photos-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(216, 90, 130, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--rose-deep);
  font-size: 12px;
  font-weight: 900;
}

.thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 18px rgba(212, 118, 150, 0.08);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(61, 39, 46, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.thumb-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  background: rgba(77, 49, 59, 0.72);
  color: #fff;
  box-shadow: 0 8px 16px rgba(77, 49, 59, 0.18);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.audio-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.audio-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 18px rgba(212, 118, 150, 0.08);
}

.audio-preview[hidden] {
  display: none;
}

.audio-preview span {
  font-size: 14px;
  font-weight: 800;
}

.audio-preview button {
  margin-left: auto;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8dae, #ff6e95);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.generate-actions,
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.qr-panel {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 14px;
}

.qr-head h2 {
  margin: 6px 0 4px;
  font-size: clamp(32px, 8vw, 54px);
  line-height: 1.05;
  color: var(--rose-deep);
}

.qr-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.qr-box {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  overflow: hidden;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(75, 45, 50, 0.12);
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-url {
  width: min(100%, 42rem);
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  word-break: break-all;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 50;
  width: min(calc(100vw - 32px), 420px);
  padding: 14px 16px;
  transform: translate(-50%, 18px);
  border-radius: 16px;
  background: rgba(66, 45, 52, 0.94);
  color: #fff;
  font-size: 14px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .media-grid,
  .audio-actions {
    grid-template-columns: 1fr;
  }

  .thumb-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
