:root {
  color-scheme: light;
  --bg: #f5f6fa;
  --card: #ffffff;
  --ink: #22252b;
  --muted: #7a808b;
  --line: #e5e8ef;
  --brand: #ff5f8e;
  --brand-dark: #df3f73;
  --soft: #fff4f8;
  --warn-bg: #eef3f5;
  --warn-line: #d5e0e4;
  --warn-text: #405f6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
}

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

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

.shell {
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 14px 12px 28px;
}

.save-box,
.entry-panel,
.notice-panel,
.tutorial-panel,
.seo-panel,
.faq-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.save-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.save-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.save-box strong,
.save-box span {
  display: block;
}

.save-box strong {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.3;
}

.save-box span {
  color: var(--muted);
  font-size: 13px;
}

.save-box button {
  min-width: 54px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.entry-panel {
  margin-top: 10px;
  overflow: hidden;
}

.entry-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.entry-row:first-child {
  border-top: 0;
}

.entry-row strong {
  font-size: 16px;
}

.entry-row a {
  min-width: 92px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.entry-row a.secondary {
  border: 1px solid var(--brand);
  background: #fff;
  color: var(--brand-dark);
}

.qr-download {
  display: none;
  width: 86px;
}

.qr-download img {
  width: 86px;
  height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  object-fit: cover;
}

.notice-panel {
  margin-top: 10px;
  padding: 12px 14px;
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.notice-panel p {
  margin: 0;
  color: var(--warn-text);
  font-size: 14px;
  line-height: 1.72;
}

.notice-panel p + p {
  margin-top: 8px;
}

.tutorial-panel,
.seo-panel,
.faq-panel {
  margin-top: 10px;
  padding: 14px;
}

h1,
h2 {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.3;
  letter-spacing: 0;
}

.brand-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.brand-tabs button {
  min-height: 35px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.brand-tabs button.active {
  border-color: var(--brand);
  background: var(--soft);
  color: var(--brand-dark);
}

.tutorial {
  display: none;
}

.tutorial.active {
  display: block;
}

.tutorial ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.tutorial li {
  position: relative;
  padding: 10px 10px 10px 38px;
  border-radius: 8px;
  background: #f8f9fc;
  color: #424852;
  font-size: 14px;
  line-height: 1.65;
  counter-increment: step;
}

.tutorial li::before {
  content: counter(step);
  position: absolute;
  top: 11px;
  left: 10px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.seo-panel p,
.faq-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.72;
}

.seo-panel {
  background: linear-gradient(180deg, #fff, #fbfcff);
}

.seo-panel h2,
.faq-panel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.seo-panel h2::before,
.faq-panel h2::before {
  content: "";
  width: 7px;
  height: 18px;
  border-radius: 999px;
  background: var(--brand);
}

.seo-panel p {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.faq-panel details {
  border-top: 1px solid var(--line);
}

.faq-panel details:first-of-type {
  border-top: 0;
}

.faq-panel summary {
  position: relative;
  cursor: pointer;
  padding: 13px 24px 13px 0;
  font-size: 14px;
  font-weight: 900;
  list-style: none;
}

.faq-panel summary::-webkit-details-marker {
  display: none;
}

.faq-panel summary::after {
  content: "+";
  position: absolute;
  top: 13px;
  right: 2px;
  color: var(--brand-dark);
  font-size: 16px;
  line-height: 1;
}

.faq-panel details[open] summary::after {
  content: "-";
}

.faq-panel details p {
  margin-bottom: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  border-radius: 8px;
  background: #22252b;
  color: #fff;
  padding: 10px 14px;
  font-size: 14px;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (min-width: 720px) {
  .shell {
    padding-top: 24px;
  }

  .entry-row {
    min-height: 116px;
  }

  .entry-row .mobile-download {
    display: none;
  }

  .entry-row .qr-download {
    display: grid;
  }
}

@media (max-width: 420px) {
  .brand-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 340px) {
  .save-box {
    grid-template-columns: auto 1fr;
  }

  .save-box button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 360px) {
  .entry-row {
    gap: 8px;
    padding: 12px;
  }

  .entry-row a {
    min-width: 82px;
    padding: 0 10px;
  }
}
