:root {
  color-scheme: light;
  --ink: #172521;
  --muted: #60716b;
  --line: #d9e2de;
  --surface: #ffffff;
  --surface-soft: #f2f7f5;
  --accent: #0b6b57;
  --accent-dark: #074d3f;
  --accent-pale: #dff2eb;
  --danger: #b42318;
  --shadow: 0 14px 36px rgba(22, 56, 47, 0.09);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { background: #e9f0ed; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(27, 139, 111, 0.14), transparent 32rem),
    linear-gradient(180deg, #f7faf8 0, #e9f0ed 100%);
}

button, input, a { font: inherit; }

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(36px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  letter-spacing: -0.05em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(1.35rem, 5vw, 2rem); line-height: 1.2; }
.app-header p { margin-bottom: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.panel, .photo-guide {
  min-width: 0;
  background: var(--surface);
  border: 1px solid rgba(177, 195, 188, 0.72);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.panel { padding: 22px; }

.step-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.step-title > span {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-pale);
  color: var(--accent-dark);
  font-weight: 800;
}
.step-title h2 { margin: 1px 0 4px; font-size: 1.06rem; }
.step-title p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.step-title.compact { align-items: center; margin-bottom: 16px; }
.step-title.compact h2 { margin: 0; }

.file-button, .primary-button, .download-button {
  min-height: 50px;
  border-radius: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.file-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: 1px dashed #78a99b;
  color: var(--accent-dark);
  background: #eff8f4;
}
.file-button svg { width: 22px; height: 22px; fill: currentColor; }
.file-button:hover { background: #e4f3ed; }
.file-meta { margin: 9px 0 13px; color: var(--muted); font-size: 0.84rem; overflow-wrap: anywhere; }

.preview-frame {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 230px;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background: #e9efec;
  border: 1px solid var(--line);
}
.preview-frame img { display: block; width: 100%; max-height: 520px; object-fit: contain; }
.preview-frame.empty img { display: none; }
.empty-state { display: grid; place-items: center; gap: 8px; color: #71827c; font-size: 0.9rem; }
.empty-state svg { width: 46px; height: 46px; fill: #9baba6; }
.preview-frame:not(.empty) .empty-state { display: none; }

.form-section { margin-top: 22px; }
label[for="id-input"], label[for="sell-input"] { display: block; margin: 14px 0 7px; font-size: 0.92rem; font-weight: 700; }
input[type="text"] {
  width: 100%;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid #b8c8c2;
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  font-size: 1rem;
  outline: none;
}
input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(11, 107, 87, 0.13); }

.primary-button, .download-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(11, 107, 87, 0.2);
  text-decoration: none;
}
.primary-button { margin-top: 18px; }
.primary-button:hover, .download-button:hover { background: var(--accent-dark); }
.primary-button:active, .download-button:active, .file-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: 0.68; }
.download-button.disabled { pointer-events: none; background: #9eaaa6; box-shadow: none; }

.message { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; line-height: 1.45; }
.message.error { color: var(--danger); background: #fff0ee; border: 1px solid #f4c7c2; }

.result-details { margin: 14px 0; padding: 13px 14px; border-radius: 13px; background: var(--surface-soft); }
.result-details div { display: grid; gap: 4px; }
.result-details div + div { margin-top: 10px; }
.result-details span { color: var(--muted); font-size: 0.78rem; }
.result-details code, .result-details strong { font-size: 0.88rem; overflow-wrap: anywhere; }
.ios-note { margin: 9px 2px 0; color: var(--muted); font-size: 0.78rem; text-align: center; }

.photo-guide { margin-top: 18px; padding: 18px 22px; box-shadow: none; background: rgba(255, 255, 255, 0.76); }
.photo-guide h2 { margin-bottom: 10px; font-size: 1rem; }
.photo-guide ul { display: grid; gap: 7px; margin: 0; padding-left: 1.3rem; color: var(--muted); line-height: 1.5; font-size: 0.9rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 760px) {
  .app-shell { padding-top: max(15px, env(safe-area-inset-top)); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 17px; border-radius: 18px; }
  .preview-frame { min-height: 200px; }
  .app-header { align-items: flex-start; }
  .brand-mark { width: 44px; height: 44px; flex-basis: 44px; border-radius: 13px; }
}

@media (max-width: 420px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .panel { padding: 15px; }
  .step-title { gap: 10px; }
  .preview-frame { min-height: 180px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
