:root {
  color-scheme: light;
  --bg: #f3f5f2;
  --paper: #ffffff;
  --paper-strong: #fbfcf8;
  --ink: #172018;
  --muted: #647067;
  --faint: #8a948d;
  --line: #dce3dc;
  --line-strong: #c8d2c9;
  --green: #18784f;
  --green-dark: #0d5f3b;
  --blue: #2458a6;
  --blue-soft: #e9f0fb;
  --amber: #b56b12;
  --amber-soft: #fff4df;
  --red: #b42318;
  --red-soft: #fff0ef;
  --shadow: 0 18px 42px rgba(32, 45, 35, 0.08);
  --shadow-soft: 0 8px 24px rgba(32, 45, 35, 0.06);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: 0 0 0 4px rgba(24, 120, 79, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0, rgba(243, 245, 242, 0) 280px),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: rgba(251, 252, 248, 0.94);
  border-bottom: 1px solid rgba(200, 210, 201, 0.72);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
}

.brand img {
  flex: 0 0 auto;
}

.brand span {
  overflow-wrap: anywhere;
}

.nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.nav a,
.link-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.nav a:hover,
.link-button:hover {
  color: var(--ink);
  background: #edf2ec;
}

.link-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.home-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 30px auto 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 370px);
  gap: 22px;
  align-items: start;
}

.workspace {
  min-width: 0;
}

.workspace-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

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

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

h1 {
  margin-bottom: 10px;
  font-size: 42px;
  line-height: 1.08;
  letter-spacing: 0;
}

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

h3 {
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #f0d39c;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius);
  color: #6f4109;
  background: var(--amber-soft);
  line-height: 1.55;
}

.notice[hidden] {
  display: none;
}

.query-surface,
.admin-panel,
.auth-panel,
.list-surface {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.query-surface {
  padding: 0;
  display: grid;
  gap: 0;
  overflow: hidden;
  border-top: 3px solid var(--green);
}

label {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.paste-field {
  gap: 12px;
  padding: clamp(18px, 3vw, 24px);
  color: var(--ink);
  font-size: 15px;
}

.paste-field::before {
  content: "把美团分享整段粘进来即可，系统会自动识别店铺";
  order: 2;
  margin-top: -2px;
  color: var(--faint);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 13px 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.6;
}

.paste-field textarea {
  order: 1;
  min-height: 96px;
  border-color: #cbd9ce;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdfa 100%);
  font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

input::placeholder,
textarea::placeholder {
  color: #9aa49d;
}

input:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: var(--focus);
  background: #fffefb;
}

.form-footer,
.button-row,
.section-head,
.sticky-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.form-footer {
  padding: 14px clamp(18px, 3vw, 24px);
  border-top: 1px solid var(--line);
  background: #f9fbf8;
}

.message {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.message.error {
  color: var(--red);
}

.message.success {
  color: var(--green-dark);
}

button,
.entry-button,
.inline-link {
  border-radius: var(--radius);
  font-weight: 850;
  letter-spacing: 0;
}

button,
.entry-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  padding: 11px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

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

.primary-button,
.entry-button.primary {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 20px rgba(24, 120, 79, 0.18);
}

.primary-button:hover,
.entry-button.primary:hover {
  background: var(--green-dark);
}

.secondary-button,
.entry-button.secondary {
  color: var(--ink);
  background: #f7faf6;
  border-color: var(--line-strong);
}

.secondary-button:hover,
.entry-button.secondary:hover {
  background: #eef4ed;
}

.entry-button.amber {
  color: #fff;
  background: var(--amber);
  border-color: #d97706;
  box-shadow: 0 10px 20px rgba(181, 107, 18, 0.18);
}

.entry-button.amber:hover {
  background: #9a4f0d;
}

.entry-button.danger,
.danger-button {
  color: #fff;
  background: var(--red);
  border-color: #d92d20;
  box-shadow: 0 10px 20px rgba(180, 35, 24, 0.18);
}

.entry-button.danger:hover,
.danger-button:hover {
  background: #991b1b;
}

.entry-button.disabled {
  pointer-events: none;
  color: #87918a;
  background: #eef2ee;
  border-color: var(--line);
}

.inline-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 36px;
  color: var(--blue);
  text-decoration: none;
}

.inline-link:hover {
  color: #123e7e;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.quick-rail {
  display: grid;
  gap: 20px;
}

.rail-section {
  display: grid;
  gap: 10px;
}

.rail-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rail-title span {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--green-dark);
  background: #fff;
  font-size: 12px;
  font-weight: 850;
}

.rail-title h2 {
  margin: 0;
}

.offer-list,
.result-list,
.activity-grid,
.editor-list {
  display: grid;
  gap: 10px;
}

.offer-item,
.result-item {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.offer-item {
  padding: 15px;
}

.offer-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--green);
}

.offer-item.offer-jd::before {
  background: #d92d20;
}

.offer-item.offer-eleme::before {
  background: #1d6ed8;
}

.offer-item.offer-activity::before {
  background: var(--amber);
}

.offer-item.offer-jd .card-meta {
  color: #9f1d14;
  background: #fff0ef;
}

.offer-item.offer-eleme .card-meta {
  color: #174f9b;
  background: #eaf2ff;
}

.offer-item.offer-activity .card-meta {
  color: #81500c;
  background: #fff4df;
}

.offer-item h3,
.result-item h3 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.28;
}

.card-meta {
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.offer-item p,
.result-item p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.result-list {
  margin-top: 16px;
}

.result-item {
  padding: 18px;
  background: #fafffb;
  border-color: #b9dcc9;
}

.result-item::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 4px solid var(--green);
  pointer-events: none;
}

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

.result-poi {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.result-poi code {
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #f3f6f2;
  overflow-wrap: anywhere;
}

.result-action-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.result-action-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.result-action-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.result-action-meta {
  min-width: 0;
}

.result-action-meta h4 {
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.3;
}

.result-action-meta p {
  margin: 0;
  font-size: 13px;
}

.result-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.result-action-buttons .entry-button {
  min-height: 38px;
  padding: 9px 13px;
  white-space: nowrap;
}


.single-page {
  width: min(1080px, calc(100% - 32px));
  margin: 32px auto 56px;
}

.page-heading {
  margin-bottom: 18px;
}

.list-surface {
  padding: clamp(18px, 3vw, 24px);
}

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

.activity-grid .offer-item {
  min-height: 172px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(243, 245, 242, 0)),
    var(--bg);
}

.auth-panel {
  position: relative;
  overflow: hidden;
  width: min(430px, 100%);
  padding: 28px;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--green);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--green-dark);
  font-weight: 850;
}

.auth-panel h1 {
  margin-bottom: 8px;
  font-size: 32px;
}

.auth-panel p {
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.auth-panel .security-note {
  margin: 4px 0 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  color: #6f4109;
  background: var(--amber-soft);
  font-size: 13px;
}

.query-form {
  display: grid;
  gap: 13px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}

.check-line input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.admin-layout {
  width: min(1100px, calc(100% - 32px));
  margin: 30px auto 72px;
  display: grid;
  gap: 16px;
}

.admin-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.admin-hero h1 {
  margin-bottom: 0;
  font-size: 38px;
}

.admin-hero-meta {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #e8f5ed;
  font-size: 13px;
  font-weight: 850;
}

.admin-panel {
  padding: clamp(18px, 3vw, 24px);
  display: grid;
  gap: 14px;
}

.admin-panel textarea {
  min-height: 82px;
}

#merchantCouponBaseUrl {
  min-height: 104px;
}

.admin-panel h2 {
  margin-bottom: 2px;
  padding-left: 10px;
  border-left: 3px solid var(--green);
}

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

.editor-list {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.editor-row {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.editor-row:last-child {
  border-bottom: 0;
}

.editor-row:nth-child(even) {
  background: var(--paper-strong);
}

.sticky-actions {
  position: sticky;
  bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

@media (max-width: 980px) {
  .home-shell {
    grid-template-columns: 1fr;
  }

  .quick-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

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

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

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .home-shell,
  .single-page,
  .admin-layout {
    width: min(100% - 24px, 1100px);
    margin-top: 20px;
  }

  .workspace-head,
  .admin-hero {
    display: grid;
  }

  h1 {
    font-size: 34px;
  }

  .admin-grid,
  .editor-grid,
  .quick-rail,
  .activity-grid {
    grid-template-columns: 1fr;
  }

  .form-footer {
    align-items: stretch;
  }

  .button-row {
    width: 100%;
  }

  .button-row button {
    flex: 1;
  }

  .paste-field textarea {
    min-height: 92px;
  }

  .result-action-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .result-action-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  .nav a,
  .link-button {
    padding: 0 8px;
    font-size: 13px;
  }

  .query-surface,
  .admin-panel,
  .auth-panel,
  .list-surface {
    padding: 16px;
  }

  .result-action-buttons .entry-button {
    flex: 1 1 100%;
    width: 100%;
  }
}
