/* =========================================================
   小飞机 · utility-first interface
   ========================================================= */

@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/airmail/space-grotesk.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/airmail/ibm-plex-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f5ef;
  --surface: #fffdf9;
  --ink: #171512;
  --muted: #6b665c;
  --line: #ddd8ce;
  --line-strong: #c9c2b5;
  --accent: #e5532d;
  --accent-soft: #fbe9e3;
  --ok: #0f7a53;
  --ok-soft: #e9f6ef;
  --radius: 12px;
  --wrap: 1120px;
  --pad: clamp(16px, 3vw, 32px);
  --sans: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.site-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: #fff;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.site-main {
  flex: 1;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 239, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
}

.brand-mark svg {
  width: 16px;
  height: 16px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-text strong {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-text small {
  margin-top: 0.28rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.12em;
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: transparent;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav-toggle span {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--ink);
  transition: transform 180ms var(--ease);
}

.nav-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(2.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-2.5px) rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-link {
  padding: 0.46rem 0.7rem;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.nav-link:hover {
  color: var(--ink);
  background: #efece4;
}

.nav-link.is-active {
  color: var(--ink);
  background: #ece8df;
  font-weight: 600;
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #f3f0e9;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links a {
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- base blocks ---------- */
.page {
  padding: clamp(1.6rem, 3vw, 2.6rem) 0 clamp(2.4rem, 4vw, 3.6rem);
}

.page.narrow {
  max-width: 760px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-head {
  margin-bottom: 1.25rem;
}

.page-title {
  margin: 0;
  font-size: clamp(1.65rem, 3.6vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-desc {
  max-width: 48rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.panel-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-body {
  padding: 1rem;
}

.panel-note {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn:hover {
  border-color: var(--ink);
}

.btn:disabled,
.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.btn-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: #2b2822;
  border-color: #2b2822;
}

.btn-accent {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: #cc4421;
  border-color: #cc4421;
}

.btn-accent:disabled,
.btn-accent[disabled] {
  border-color: var(--line);
  background: #f1eee7;
  color: var(--muted);
  opacity: 1;
}

.btn-sm {
  min-height: 32px;
  padding: 0.35rem 0.65rem;
  font-size: 0.76rem;
}

.btn-block {
  width: 100%;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 0.35rem;
  border: 1px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  vertical-align: -1px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- home dashboard ---------- */
.home {
  padding: clamp(1.6rem, 3.5vw, 3rem) 0 clamp(2rem, 4vw, 3.5rem);
}

.home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line-strong);
}

.home-title {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.home-desc {
  max-width: 38rem;
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.home-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1rem;
  margin-top: 1rem;
}

.send-list {
  padding: 0.5rem;
}

.send-option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 0.75rem;
  border-radius: 9px;
  text-decoration: none;
  transition: background 150ms ease;
}

.send-option + .send-option {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.send-option:hover {
  background: #f6f3eb;
}

.option-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  flex: 0 0 auto;
}

.option-icon svg {
  width: 18px;
  height: 18px;
}

.option-text {
  min-width: 0;
  flex: 1;
}

.option-text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
}

.option-text small {
  display: block;
  margin-top: 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.option-arrow {
  color: var(--muted);
  font-size: 1rem;
  transition: transform 150ms ease, color 150ms ease;
}

.send-option:hover .option-arrow {
  color: var(--ink);
  transform: translateX(2px);
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.info-item {
  padding: 0.9rem 1rem;
  background: var(--surface);
}

.info-item strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 400;
}

.info-item span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.76rem;
}

/* ---------- forms ---------- */
.form-panel {
  padding: clamp(1rem, 2.5vw, 1.5rem);
}

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1eee7;
  width: fit-content;
}

.tab {
  padding: 0.38rem 0.8rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 550;
  text-decoration: none;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(23, 21, 18, 0.08);
}

.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

.label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.label-plain {
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.label span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.textarea {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.textarea::placeholder {
  color: #a19a8e;
}

.textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 21, 18, 0.07);
}

.textarea.is-invalid {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 83, 45, 0.1);
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
}

.counter {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
}

.counter.is-warn {
  color: var(--accent);
}

.field-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.notice {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f6f3eb;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.notice.warning {
  border-color: #ecd6c8;
  background: #fcf2ec;
  color: #7a3b24;
}

/* ---------- code input ---------- */
.code-grid {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}

.code-box {
  width: 100%;
  height: 58px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 1.55rem;
  line-height: 1;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.code-box:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23, 21, 18, 0.07);
}

.code-box.is-filled {
  border-color: var(--line-strong);
  background: #f1eee7;
}

/* ---------- upload ---------- */
.dropzone {
  padding: 1.5rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: #fbf9f3;
  text-align: center;
  transition: border-color 150ms ease, background 150ms ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--ink);
  background: #f7f3e9;
}

.dropzone-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
}

.dropzone-icon svg {
  width: 18px;
  height: 18px;
}

.dropzone h2 {
  margin: 0 0 0.2rem;
  font-size: 0.98rem;
  font-weight: 650;
}

.dropzone p {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.dropzone .drop-meta {
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.05em;
}

.file-list {
  margin-top: 0.85rem;
  text-align: left;
}

.file-item {
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.file-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.file-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size,
.file-percent {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
}

.progress {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e4da;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms linear;
}

.form-status {
  min-height: 1rem;
  margin-top: 0.6rem;
  color: var(--accent);
  font-size: 0.76rem;
  text-align: left;
}

.form-status:empty {
  display: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

/* ---------- result ---------- */
.result-panel {
  padding: clamp(1.4rem, 4vw, 2.5rem);
  text-align: center;
}

.result-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 0.8rem;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
}

.result-icon svg {
  width: 21px;
  height: 21px;
}

.result-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.result-sub {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.result-code {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.3rem 0 1rem;
}

.result-code strong {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.12em;
  line-height: 1;
  text-indent: 0.12em;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 550;
}

.copy-btn:hover {
  border-color: var(--ink);
}

.copy-btn.is-copied {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.result-note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

/* ---------- received text ---------- */
.received-text {
  display: block;
  width: 100%;
  min-height: 220px;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  background: #fbf9f3;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
}

.code-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.04em;
}

/* ---------- qr ---------- */
.qr-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.qr-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.qr-frame img,
.qr-frame canvas {
  max-width: 100%;
  height: auto;
}

.qr-info h2 {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.qr-info p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
  word-break: break-word;
}

/* ---------- help / donate ---------- */
.help-layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.help-toc {
  position: sticky;
  top: 86px;
  display: grid;
  gap: 0.1rem;
}

.help-toc a {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
}

.help-toc a:hover {
  color: var(--ink);
  background: #efece4;
}

.help-section + .help-section {
  margin-top: 1.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.help-section h2 {
  margin: 0 0 0.8rem;
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.step-list {
  display: grid;
  gap: 0.55rem;
}

.step {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.65rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.step-num {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  padding-top: 0.1rem;
}

.step h3 {
  margin: 0 0 0.15rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

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

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 550;
  list-style: none;
}

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

.faq-item summary::after {
  content: "+";
  color: var(--muted);
  font-family: var(--mono);
  font-weight: 400;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-body {
  padding: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.65;
}

.donate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  justify-content: center;
  gap: 1rem;
}

.donate-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.donate-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  padding: 0.5rem;
  background: #fff;
  filter: grayscale(1) contrast(1.05);
  transition: filter 300ms ease;
}

.donate-card:hover img {
  filter: grayscale(0) contrast(1);
}

.donate-card .caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.56rem;
}

/* ---------- toast ---------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: min(92vw, 400px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  box-shadow: 0 10px 30px rgba(23, 21, 18, 0.22);
  pointer-events: auto;
  animation: toast-in 180ms ease both;
}

.toast.is-error {
  background: #a32716;
}

.toast.is-success {
  background: #0b6b49;
}

.toast svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .home-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.7rem;
  }

  .home-meta {
    text-align: left;
  }

  .home-grid {
    grid-template-columns: 1fr;
  }

  .help-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .help-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
  }

  .qr-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .qr-frame {
    max-width: 280px;
    margin: 0 auto;
  }

  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: absolute;
    top: 66px;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.65rem var(--pad) 0.9rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 12px 24px rgba(23, 21, 18, 0.06);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    padding: 0.65rem 0.7rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 520px) {
  body.site-body {
    font-size: 14px;
  }

  .header-inner {
    min-height: 60px;
  }

  .site-nav {
    top: 60px;
  }

  .page {
    padding-top: 1.4rem;
  }

  .home-title {
    font-size: 1.8rem;
  }

  .info-strip {
    grid-template-columns: 1fr;
  }

  .code-grid {
    gap: 0.3rem;
  }

  .code-box {
    height: 52px;
    font-size: 1.35rem;
  }

  .form-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .form-foot .btn {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn {
    width: 100%;
  }

  .donate-grid {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin: 0 auto;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
