:root {
  --ink: #17140b;
  --ink-soft: #2c2818;
  --paper: #fffdf1;
  --paper-2: #fff8d8;
  --yellow: #ffd400;
  --yellow-hot: #ffe70a;
  --yellow-pale: #fff6b0;
  --lime: #c7ee00;
  --lime-bright: #deff38;
  --orange: #ff8a00;
  --orange-deep: #ff6300;
  --red: #ff432e;
  --blue: #57d5ff;
  --muted: #746c53;
  --line: rgba(23, 20, 11, .14);
  --shadow-hard: 0 6px 0 rgba(23, 20, 11, .92);
  --shadow-soft: 0 14px 40px rgba(61, 37, 0, .16);
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Arial Black", "Impact", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--yellow);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--ink); color: var(--lime); }

/* 细颗粒，让大面积黄色更有质感 */
.grain {
  position: relative;
  isolation: isolate;
}
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .14;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 12px 22px;
  background: var(--paper);
  font-weight: 800;
  font-size: 14px;
  line-height: 1;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 3px 0 var(--ink);
}
.hp-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink); }
.hp-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.hp-btn--ink { background: var(--ink); color: var(--yellow); }
.hp-btn--lime { background: var(--lime); color: var(--ink); }
.hp-btn--yellow { background: var(--yellow); color: var(--ink); }
.hp-btn--ghost { background: transparent; box-shadow: none; }
.hp-btn[disabled], .hp-btn.is-disabled {
  opacity: .44;
  cursor: not-allowed;
  filter: grayscale(.55);
  box-shadow: 0 2px 0 var(--ink);
}

.hp-icon { width: 20px; height: 20px; display: inline-block; flex: 0 0 auto; vertical-align: -4px; }

.hp-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #d7d7d2, #f8f8f4);
  border: 2px solid var(--ink);
  color: #8f8f89;
  flex: 0 0 auto;
}
.hp-avatar svg { width: 66%; height: 66%; }
.hp-avatar--lime { background: var(--lime); color: var(--ink); }
.hp-avatar--yellow { background: var(--yellow-hot); color: var(--ink); }

.hp-toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}
.hp-toast {
  max-width: min(86vw, 460px);
  padding: 12px 18px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fffbe3;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  animation: toast-in .28s cubic-bezier(.2,.8,.2,1);
}
.hp-toast--success { background: var(--lime); color: var(--ink); }
.hp-toast--warn { background: var(--yellow); color: var(--ink); }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* 通用弹层 */
.hp-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 14, 6, .56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility .22s;
}
.hp-overlay.is-open { opacity: 1; visibility: visible; }
.hp-overlay__panel {
  width: min(420px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 8px 10px 0 rgba(0,0,0,.32);
  transform: translateY(18px) scale(.98);
  transition: transform .24s cubic-bezier(.2,.8,.2,1);
}
.hp-overlay.is-open .hp-overlay__panel { transform: translateY(0) scale(1); }
.hp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.hp-sheet-head h3 { font-size: 19px; font-weight: 900; letter-spacing: -.02em; }
.hp-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: #fff;
  display: grid;
  place-items: center;
}
.hp-close .hp-icon { width: 17px; height: 17px; }

.muted { color: var(--muted); }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.no-scroll { overflow: hidden !important; }

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