:root {
  --bg: #eef7ef;
  --bg-warm: #fff2de;
  --bg-mint: #ddf4ea;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(248, 255, 250, 0.72);
  --line: rgba(53, 108, 86, 0.14);
  --line-strong: rgba(53, 108, 86, 0.22);
  --text: #1d342b;
  --muted: #5d7368;
  --brand: #ff7c52;
  --brand-deep: #dc5a2f;
  --brand-soft: rgba(255, 124, 82, 0.14);
  --leaf: #2f8f6f;
  --leaf-deep: #215f4a;
  --leaf-soft: rgba(47, 143, 111, 0.12);
  --sun: #ffd86e;
  --shadow: 0 24px 70px rgba(48, 91, 72, 0.14);
  --shadow-soft: 0 12px 34px rgba(48, 91, 72, 0.08);
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --font-ui: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 215, 156, 0.7), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(128, 230, 183, 0.32), transparent 18%),
    radial-gradient(circle at 84% 32%, rgba(255, 138, 92, 0.18), transparent 16%),
    linear-gradient(180deg, #f7fcf5 0%, var(--bg) 46%, var(--bg-warm) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 86%);
}

.page-shell > * {
  animation: riseIn 560ms ease both;
}

.page-shell > *:nth-child(2) {
  animation-delay: 80ms;
}

textarea,
input,
button,
select,
a {
  font: inherit;
}

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

.page-shell {
  position: relative;
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 28px) 16px calc(env(safe-area-inset-bottom) + 44px);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(70, 127, 102, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 255, 248, 0.95) 42%, rgba(255, 243, 225, 0.92) 100%);
  box-shadow: var(--shadow);
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(47, 143, 111, 0.12);
  box-shadow: 0 10px 26px rgba(47, 143, 111, 0.08);
}

.brand-mark__icon {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 124, 82, 0.96), rgba(47, 143, 111, 0.96));
}

.brand-mark__icon::before,
.brand-mark__icon::after {
  content: "";
  position: absolute;
}

.brand-mark__icon::before {
  inset: 8px 9px 8px 9px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
}

.brand-mark__icon::after {
  left: 16px;
  top: 10px;
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--leaf) 0%, var(--brand) 100%);
  box-shadow:
    -6px 6px 0 0 rgba(47, 143, 111, 0.75),
    6px -2px 0 0 rgba(255, 124, 82, 0.8);
}

.brand-mark strong,
.brand-mark span {
  display: block;
}

.brand-mark strong {
  font-size: 0.98rem;
}

.brand-mark span {
  color: var(--muted);
  font-size: 0.8rem;
}

.topbar-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-actions a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--leaf-deep);
  font-size: 0.9rem;
  font-weight: 700;
  background: rgba(47, 143, 111, 0.08);
  border: 1px solid rgba(47, 143, 111, 0.1);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.hero::before {
  top: -38px;
  right: -24px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 124, 82, 0.22), transparent 68%);
}

.hero::after {
  bottom: -40px;
  left: -20px;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(47, 143, 111, 0.18), transparent 68%);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 22px;
}

.hero-copy-block {
  display: grid;
  gap: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--leaf-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-chip-row,
.hero-tags,
.hero-flow,
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-chip,
.hero-tags span,
.summary-pill,
.upload-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
}

.hero-chip {
  background: rgba(47, 143, 111, 0.1);
  color: var(--leaf-deep);
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-copy {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.86;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.hero-link:hover,
button:hover {
  transform: translateY(-1px);
}

.hero-link--primary {
  background: linear-gradient(135deg, var(--brand) 0%, #ff9b60 100%);
  color: #fffaf6;
  box-shadow: 0 16px 30px rgba(220, 90, 47, 0.2);
}

.hero-link--ghost {
  background: rgba(47, 143, 111, 0.1);
  color: var(--leaf-deep);
  border: 1px solid rgba(47, 143, 111, 0.16);
}

.hero-tags span,
.summary-pill {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.studio-snapshot {
  display: grid;
  gap: 10px;
}

.snapshot-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(242, 255, 247, 0.8));
  border: 1px solid rgba(47, 143, 111, 0.12);
}

.snapshot-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.snapshot-card strong {
  font-size: 1rem;
}

.hero-visual {
  position: relative;
  display: grid;
  gap: 14px;
}

.hero-card,
.hero-note,
.metric-card,
.panel,
.field,
.upload-card,
.result-card,
.tip-card,
.composer-callout {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-card,
.hero-note,
.metric-card,
.composer-callout {
  border-radius: 24px;
  backdrop-filter: blur(12px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.hero-card--main {
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.97), rgba(231, 255, 242, 0.92));
}

.hero-card--accent {
  background:
    linear-gradient(160deg, rgba(255, 248, 241, 0.96), rgba(255, 241, 224, 0.92));
}

.hero-card-label,
.panel-kicker {
  display: inline-block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-card h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}

.hero-flow {
  margin-top: 16px;
}

.hero-flow span {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--leaf-deep);
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid rgba(47, 143, 111, 0.14);
}

.tone-stack {
  display: grid;
  gap: 12px;
}

.tone-stack div {
  display: grid;
  gap: 3px;
}

.tone-stack strong {
  font-size: 1rem;
}

.tone-stack span,
.hero-note p,
.metric-card p,
.panel-heading p,
.field span,
.upload-copy p,
.help-copy,
.tip-card p,
.composer-callout p {
  color: var(--muted);
}

.hero-note {
  padding: 16px 18px;
  background: linear-gradient(145deg, rgba(243, 255, 247, 0.92), rgba(255, 250, 240, 0.9));
}

.hero-note strong,
.metric-card strong,
.tip-card strong,
.composer-callout strong {
  display: block;
  margin-bottom: 6px;
}

.hero-note p,
.metric-card p,
.composer-callout p,
.tip-card p {
  margin: 0;
  line-height: 1.7;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.metric-card {
  padding: 16px 18px;
  border-radius: 22px;
}

.metric-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(47, 143, 111, 0.16), rgba(255, 124, 82, 0.12));
  color: var(--leaf-deep);
  font-weight: 800;
}

.content {
  margin-top: 22px;
  display: grid;
  gap: 20px;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 22px 18px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 124, 82, 0), rgba(255, 124, 82, 0.5), rgba(47, 143, 111, 0));
}

.panel-heading {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.panel-copy h2 {
  margin: 0;
  font-size: 1.46rem;
}

.panel-heading p {
  margin: 8px 0 0;
  line-height: 1.7;
}

.panel-index {
  flex: none;
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 124, 82, 0.16), rgba(47, 143, 111, 0.16));
  color: var(--leaf-deep);
  font-weight: 800;
  display: grid;
  place-items: center;
}

.form-grid,
.upload-grid,
.tips-grid,
.ai-grid {
  display: grid;
  gap: 14px;
}

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

.field,
.upload-card,
.result-card,
.tip-card {
  border-radius: var(--radius-md);
}

.field,
.upload-card,
.result-card {
  padding: 16px;
}

.field {
  display: grid;
  gap: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.field span {
  font-size: 0.92rem;
  font-weight: 700;
}

.field-wide {
  grid-column: 1 / -1;
}

.field input,
.field textarea,
.field select,
.upload-card textarea,
.result-card textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(77, 131, 106, 0.22);
  border-radius: 16px;
  background: rgba(252, 255, 252, 0.96);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.upload-card textarea:focus,
.result-card textarea:focus {
  border-color: rgba(47, 143, 111, 0.52);
  box-shadow: 0 0 0 4px rgba(47, 143, 111, 0.12);
}

.upload-card {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 255, 250, 0.84));
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.upload-card:hover,
.tip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 143, 111, 0.22);
  box-shadow: 0 18px 36px rgba(47, 143, 111, 0.1);
}

.upload-head {
  display: grid;
  gap: 10px;
}

.upload-tag {
  justify-self: start;
  background: rgba(47, 143, 111, 0.1);
  color: var(--leaf-deep);
}

.upload-card--meal .upload-tag {
  background: rgba(255, 124, 82, 0.14);
  color: var(--brand-deep);
}

.upload-card--workout .upload-tag {
  background: rgba(255, 216, 110, 0.22);
  color: #8f6612;
}

.upload-card--extra .upload-tag {
  background: rgba(111, 124, 255, 0.1);
  color: #5360be;
}

.upload-copy h3,
.result-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

.upload-copy p {
  margin: 6px 0 0;
  font-size: 0.95rem;
  line-height: 1.68;
}

.upload-card input[type="file"] {
  width: 100%;
  padding: 14px;
  border: 1px dashed rgba(47, 143, 111, 0.3);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(243, 255, 247, 0.96), rgba(255, 248, 241, 0.86));
}

.upload-card input[type="file"]::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(47, 143, 111, 0.12);
  color: var(--leaf-deep);
  font-weight: 700;
  cursor: pointer;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.preview-grid:empty {
  min-height: 96px;
  padding: 12px;
  align-content: center;
  justify-items: start;
  border-radius: 18px;
  border: 1px dashed rgba(47, 143, 111, 0.18);
  background: linear-gradient(180deg, rgba(245, 255, 248, 0.72), rgba(255, 249, 241, 0.62));
}

.preview-grid:empty::before {
  content: attr(data-empty);
  max-width: 240px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.thumb {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 1 / 1;
  background: linear-gradient(180deg, #eff8f0, #f9f0e7);
  border: 1px solid rgba(47, 143, 111, 0.12);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.thumb-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(29, 52, 43, 0.76);
  color: #fffdf8;
  box-shadow: 0 8px 20px rgba(29, 52, 43, 0.18);
}

.thumb-remove::after {
  content: "×";
  margin: 0;
  font-size: 1rem;
  line-height: 1;
  transform: none;
}

.thumb-remove:hover::after {
  transform: none;
}

.thumb-count {
  position: absolute;
  inset: auto 8px 8px auto;
  min-width: 28px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  background: rgba(29, 52, 43, 0.8);
  color: #fffdf8;
}

.thumb:hover img {
  transform: scale(1.05);
}

.composer-callout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: linear-gradient(145deg, rgba(241, 255, 246, 0.95), rgba(255, 248, 238, 0.94));
}

.summary-pill--glow {
  background: rgba(47, 143, 111, 0.12);
  color: var(--leaf-deep);
}

.analysis-preview {
  min-height: 220px;
  white-space: pre-wrap;
  line-height: 1.82;
}

.analysis-block {
  display: grid;
  gap: 12px;
}

.analysis-item {
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(243, 255, 246, 0.72), rgba(255, 249, 241, 0.7));
  border: 1px solid rgba(47, 143, 111, 0.12);
}

.analysis-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.analysis-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.analysis-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
}

.action-bar {
  margin-bottom: 10px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button:active {
  transform: translateY(1px) scale(0.995);
}

.primary-btn::after,
.secondary-btn::after,
.ghost-btn::after,
.hero-link--primary::after,
.hero-link--ghost::after {
  display: inline-block;
  margin-left: 8px;
  transition: transform 160ms ease;
}

.primary-btn::after,
.hero-link--primary::after {
  content: "↗";
}

.secondary-btn::after {
  content: "→";
}

.ghost-btn::after,
.hero-link--ghost::after {
  content: "↘";
}

.primary-btn:hover::after,
.secondary-btn:hover::after,
.ghost-btn:hover::after,
.hero-link:hover::after {
  transform: translateX(2px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand) 0%, #ff9a60 100%);
  color: #fff9f4;
  box-shadow: 0 16px 32px rgba(220, 90, 47, 0.18);
}

.secondary-btn {
  background: rgba(255, 250, 244, 0.96);
  color: var(--brand-deep);
  border: 1px solid rgba(255, 124, 82, 0.18);
}

.ghost-btn {
  background: rgba(47, 143, 111, 0.1);
  color: var(--leaf-deep);
}

.result-card {
  display: grid;
  gap: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.result-card--glow {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 255, 248, 0.84));
}

.result-card--soft {
  background:
    linear-gradient(180deg, rgba(254, 255, 252, 0.94), rgba(248, 252, 247, 0.84));
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.help-copy {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.75;
}

.summary-pill--soft {
  background: rgba(47, 143, 111, 0.1);
  color: var(--leaf-deep);
}

.status-banner {
  min-height: 24px;
  margin-bottom: 2px;
  color: var(--leaf-deep);
  font-size: 0.95rem;
  font-weight: 700;
}

.post-preview {
  min-height: 180px;
  white-space: pre-wrap;
  line-height: 1.9;
  color: var(--text);
}

.empty-preview {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 32px 20px;
  border-radius: 22px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(243, 255, 246, 0.6), rgba(255, 248, 241, 0.6));
  border: 1px dashed rgba(47, 143, 111, 0.16);
}

.panel--tips {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(242, 255, 246, 0.82));
}

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

.tip-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
}

.tip-card strong {
  font-size: 1rem;
}

@media (min-width: 760px) {
  .form-grid,
  .upload-grid,
  .tips-grid,
  .ai-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .studio-snapshot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 26px;
  }
}

@media (min-width: 980px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
    align-items: stretch;
  }

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

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

@media (max-width: 640px) {
  .page-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero,
  .panel {
    padding: 20px 16px;
  }

  .hero h1 {
    font-size: clamp(2.15rem, 11vw, 3rem);
  }

  .panel-copy h2 {
    font-size: 1.28rem;
  }

  .composer-callout {
    padding: 14px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
