:root {
  color-scheme: light;
  --ink: #1f211d;
  --muted: #6d6f68;
  --paper: #f7f2e8;
  --panel: #fffaf0;
  --panel-strong: #fff4dc;
  --line: #ded2bd;
  --green: #255f4a;
  --green-bright: #2f7d61;
  --red: #bd4b3d;
  --amber: #d89c35;
  --shadow: 0 18px 45px rgba(49, 40, 23, 0.12);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, rgba(216, 156, 53, 0.23), transparent 27rem),
    linear-gradient(135deg, rgba(37, 95, 74, 0.12), transparent 24rem),
    var(--paper);
}

button,
textarea,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 16px 116px;
}

.hero {
  min-height: 224px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid rgba(31, 33, 29, 0.1);
  background:
    linear-gradient(160deg, rgba(255, 250, 240, 0.93), rgba(255, 244, 220, 0.88)),
    repeating-linear-gradient(110deg, rgba(37, 95, 74, 0.11) 0 1px, transparent 1px 16px);
  box-shadow: var(--shadow);
}

.hero__chrome,
.section-heading,
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.merchant-pill,
.status-dot,
.photo-count {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(31, 33, 29, 0.12);
  color: var(--green);
  background: rgba(255, 250, 240, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.status-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--green-bright);
  box-shadow: 0 0 0 5px rgba(47, 125, 97, 0.13);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 10em;
  margin-bottom: 10px;
  font-size: clamp(42px, 13vw, 72px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.merchant-area {
  max-width: 30em;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.flow-step {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.66);
}

.flow-step span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-bottom: 10px;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-weight: 800;
}

.flow-step strong,
.flow-step small {
  display: block;
}

.flow-step small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.flow-step.is-active {
  background: var(--green);
  color: #fff;
}

.flow-step.is-active span {
  color: var(--green);
  background: #fff;
}

.flow-step.is-active small {
  color: rgba(255, 255, 255, 0.76);
}

.panel,
.publish-guide {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.86);
  box-shadow: 0 10px 28px rgba(49, 40, 23, 0.08);
}

.capture-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 176px;
  margin-top: 16px;
  padding: 22px;
  text-align: center;
  border: 1.5px dashed rgba(37, 95, 74, 0.48);
  background: linear-gradient(180deg, rgba(255, 244, 220, 0.94), rgba(255, 250, 240, 0.62));
}

.capture-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.capture-zone strong {
  margin-top: 10px;
  font-size: 18px;
}

.capture-zone small,
.hint {
  max-width: 28em;
  color: var(--muted);
  line-height: 1.5;
}

.capture-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: var(--green);
  border-radius: 18px;
}

.capture-icon svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.photo-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 92px;
  gap: 10px;
  overflow-x: auto;
  min-height: 104px;
  margin-top: 12px;
  padding-bottom: 4px;
}

.photo-card,
.empty-photo {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  overflow: hidden;
}

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

fieldset {
  min-width: 0;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}

.rating-row,
.tone-row,
.highlight-grid,
.jump-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-chip,
.tone-chip,
.jump-option,
.highlight-grid label,
.ghost-button {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}

.rating-chip.is-selected,
.tone-chip.is-selected,
.jump-option.is-selected,
.highlight-grid label.is-selected {
  border-color: rgba(37, 95, 74, 0.55);
  background: rgba(37, 95, 74, 0.12);
  color: var(--green);
  font-weight: 800;
}

.jump-options {
  margin-top: 14px;
}

.jump-option {
  flex: 1 1 220px;
  min-height: 86px;
  text-align: left;
}

.jump-option strong,
.jump-option small {
  display: block;
}

.jump-option small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.jump-option.is-selected small {
  color: var(--green);
}

.highlight-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.highlight-grid input {
  accent-color: var(--green);
}

.draft-panel textarea {
  width: 100%;
  min-height: 178px;
  margin-top: 14px;
  padding: 14px;
  resize: vertical;
  border: 1px solid var(--line);
  outline: none;
  background: #fffdf8;
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
}

.draft-panel textarea:focus {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 4px rgba(47, 125, 97, 0.12);
}

.hint {
  margin: 10px 0 0;
  font-size: 13px;
}

.publish-guide {
  background: #233f34;
  color: #fff;
}

.publish-guide h2 {
  margin-bottom: 12px;
}

.publish-guide ol {
  margin: 0;
  padding-left: 22px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.68;
}

.action-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(31, 33, 29, 0.12);
  background: rgba(247, 242, 232, 0.86);
  backdrop-filter: blur(16px);
}

.secondary-action,
.primary-action {
  min-height: 52px;
  flex: 1;
  padding: 0 14px;
  font-size: 16px;
  font-weight: 900;
}

.secondary-action {
  color: var(--green);
  background: #fffaf0;
  border: 1px solid rgba(37, 95, 74, 0.35);
}

.primary-action {
  color: #fff;
  background: var(--green);
}

.primary-action:active,
.secondary-action:active,
.ghost-button:active,
.rating-chip:active,
.tone-chip:active {
  transform: translateY(1px);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 88px;
  left: 18px;
  z-index: 5;
  width: min(480px, calc(100% - 36px));
  margin: 0 auto;
  padding: 13px 14px;
  color: #fff;
  background: rgba(31, 33, 29, 0.92);
  text-align: center;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 28px;
  }

  .hero,
  .panel,
  .publish-guide,
  .flow-step {
    border-radius: 6px;
  }

  .control-grid {
    grid-template-columns: 0.78fr 1.22fr;
    gap: 18px;
  }

  .action-bar {
    border-radius: 10px 10px 0 0;
  }
}

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

  .flow-step {
    min-height: auto;
  }

  .flow-step span {
    display: inline-grid;
    margin: 0 8px 0 0;
    vertical-align: middle;
  }
}
