:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-warm: #fff8e6;
  --text: #172033;
  --muted: #64748b;
  --line: #dbe3ef;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --yellow: #f7c948;
  --red: #dc2626;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 260px),
    var(--bg);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 10;
  padding: 8px 12px;
  color: #ffffff;
  background: var(--teal-dark);
  border-radius: 8px;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 32px;
}

.hero {
  padding: 24px 0 20px;
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--teal-dark);
  font-size: 17px;
  font-weight: 800;
}

.brand-mark {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.18);
}

.hero h1 {
  margin: 18px 0 10px;
  font-size: 44px;
  line-height: 1.04;
  letter-spacing: 0;
}

.compact-hero h1 {
  font-size: 36px;
}

.hero-copy {
  max-width: 36rem;
  margin: 0;
  color: #43536a;
  font-size: 17px;
}

.action-section,
.info-section,
.privacy-section,
.fallback-panel {
  margin-top: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

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

p {
  margin: 0;
}

.status-line {
  min-height: 24px;
  color: var(--muted);
  font-size: 14px;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.keyword-input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 17px;
}

.keyword-input:focus {
  outline: 3px solid rgba(15, 118, 110, 0.20);
  border-color: rgba(15, 118, 110, 0.65);
}

.ocr-status-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  background: #eef8f6;
}

.ocr-status-panel[hidden] {
  display: none;
}

.ocr-status-panel strong {
  display: block;
  color: #0f4f4a;
  font-size: 0.95rem;
}

.ocr-status-panel p {
  margin: 4px 0 0;
  color: #47615e;
  font-size: 0.88rem;
}

.ocr-status-panel progress {
  width: 100%;
  height: 8px;
}

.shared-image-preview {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
}

.candidate-panel,
.ocr-raw-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.candidate-panel[hidden],
.ocr-raw-panel[hidden] {
  display: none;
}

.candidate-label {
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.candidate-list {
  display: grid;
  gap: 8px;
}

.candidate-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  text-align: left;
  overflow-wrap: anywhere;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.candidate-button.is-active {
  color: #0f4f4a;
  border-color: rgba(15, 118, 110, 0.65);
  background: #eef8f6;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.ocr-raw-panel pre {
  max-height: 180px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #334155;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.share-details {
  margin-top: 14px;
  color: var(--muted);
}

.share-details summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 800;
}

.share-summary {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.share-summary div {
  display: grid;
  gap: 4px;
}

.share-summary dt {
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.share-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.platform-list {
  display: grid;
  gap: 12px;
}

.platform-button {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 14px;
  padding: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.platform-button:focus-visible,
.copy-button:focus-visible,
.fallback-url:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.25);
  outline-offset: 3px;
}

.platform-button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.10);
}

.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  color: #ffffff;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 900;
  flex: 0 0 auto;
}

.platform-meituan .platform-icon {
  color: #172033;
  background: var(--yellow);
}

.platform-jd .platform-icon {
  background: var(--red);
}

.platform-text {
  min-width: 0;
}

.platform-text strong,
.platform-text small {
  display: block;
}

.platform-text strong {
  font-size: 21px;
  line-height: 1.2;
}

.platform-text small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.platform-arrow {
  color: #94a3b8;
  font-size: 34px;
  line-height: 1;
}

.fallback-panel {
  background: var(--surface-warm);
  border-color: #f1c75b;
}

.fallback-panel[hidden] {
  display: none;
}

.fallback-panel h2 {
  margin-bottom: 8px;
}

.fallback-actions {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.fallback-url,
.copy-button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 13px;
  border-radius: 8px;
  font-weight: 800;
}

.fallback-url {
  color: #ffffff;
  background: var(--teal-dark);
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fallback-url.secondary {
  color: var(--teal-dark);
  background: #ffffff;
  border: 1px solid rgba(17, 94, 89, 0.28);
}

.copy-button {
  color: var(--teal-dark);
  background: #ffffff;
  border: 1px solid rgba(17, 94, 89, 0.28);
  cursor: pointer;
}

.manual-line {
  color: #334155;
  font-size: 15px;
}

.manual-hint {
  margin-top: 6px;
  color: #6b4e16;
  font-size: 14px;
}

.info-section p,
.privacy-section p {
  margin-top: 8px;
  color: #475569;
}

.plain-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding-left: 20px;
  color: #475569;
}

.site-footer {
  padding: 22px 4px 4px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

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

.search-shell {
  max-width: 430px;
  padding: 22px 24px 32px;
  background: #ffffff;
}

.search-topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-topbar h1 {
  margin: 0;
  color: #111827;
  font-size: 25px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0;
}

.search-panel,
.search-candidate-panel,
.bottom-search-actions {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.search-label {
  display: block;
  margin-bottom: 12px;
  color: #111827;
  font-size: 19px;
  font-weight: 800;
}

.final-keyword {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: center;
  min-height: 58px;
  border: 1.5px solid #008a86;
  border-radius: 8px;
  background: #ffffff;
}

.final-keyword .keyword-input {
  min-height: 56px;
  padding: 11px 0 11px 18px;
  border: 0;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 500;
}

.final-keyword .keyword-input:focus {
  outline: 0;
  border-color: transparent;
  box-shadow: none;
}

.image-pick-button {
  width: 44px;
  height: 44px;
  margin-right: 4px;
  color: #111827;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 26px;
  cursor: pointer;
}

.image-pick-button:focus-visible {
  outline: 3px solid rgba(0, 138, 134, 0.20);
}

.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
  min-height: 44px;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  overflow: hidden;
}

.mode-button {
  color: #6b7280;
  background: #ffffff;
  border: 0;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.mode-button.is-active {
  color: #ffffff;
  background: #008a86;
}

.selection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin-top: 18px;
  color: #6b7280;
  font-size: 16px;
}

.check-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #ffffff;
  background: #008a86;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.search-panel .status-line {
  min-height: 0;
  color: #6b7280;
  font-size: 13px;
}

.search-candidate-panel {
  margin-top: 36px;
}

.search-candidate-panel h2 {
  margin-bottom: 18px;
  color: #111827;
  font-size: 20px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 14px;
}

.candidate-chip {
  width: auto;
  min-width: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  color: #111827;
  background: #ffffff;
  border: 1px solid #d9dee7;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1.2;
  text-align: center;
  box-shadow: none;
}

.candidate-chip.is-active {
  color: #008a86;
  border-color: #008a86;
  background: #ffffff;
  box-shadow: none;
}

.candidate-chip [data-check] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #ffffff;
  background: #008a86;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
}

.candidate-chip [data-check][hidden] {
  display: none;
}

.hidden-filtered-panel {
  margin-top: 32px;
  padding-top: 18px;
  color: #6b7280;
  border-top: 1px solid #d9dee7;
}

.hidden-filtered-panel[hidden] {
  display: none;
}

.hidden-filtered-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 17px;
}

.summary-chevron {
  color: #374151;
  font-size: 22px;
  line-height: 1;
}

.hidden-filtered-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hidden-filtered-chip {
  padding: 6px 10px;
  color: #6b7280;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
}

.compact-status {
  margin-top: 18px;
  box-shadow: none;
}

.bottom-search-actions {
  margin-top: 104px;
}

.search-summary {
  margin-bottom: 28px;
  color: #6b7280;
  font-size: 17px;
  text-align: center;
}

.search-summary strong {
  color: #111827;
}

.search-platform-list {
  gap: 12px;
}

.search-platform-list .platform-button {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  text-align: center;
}

.search-platform-list .platform-button strong {
  font-size: 22px;
  line-height: 1;
}

.search-platform-list .platform-meituan {
  color: #111827;
  background: #ffc400;
}

.search-platform-list .platform-jd {
  color: #ffffff;
  background: #ef1f2d;
}

@media (min-width: 640px) {
  .app-shell {
    padding: 34px 24px 44px;
  }

  .hero {
    padding-top: 30px;
  }

  .hero h1 {
    font-size: 56px;
  }

  .action-section,
  .info-section,
  .privacy-section,
  .fallback-panel {
    padding: 22px;
  }

  .section-heading {
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
  }

  .status-line {
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
