/* 活动平台公共样式（e.html / admin.html / onsite.html 共用）
   设计语言取自邀请函 index.html 与问卷 survey.html：白底、墨色字、品牌青只点在重点上；
   靠字号、留白、颜色分层 —— 不用边框和分割线、不用胶囊标签和方框卡片、不用左侧色条，列表用圆点。 */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 300 800; font-display: swap; src: url(/assets/fonts/geist-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap; src: url(/assets/fonts/geist-mono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --paper: #FFFFFF;
  --paper-2: #F4F7F8;
  --paper-3: #EBF0F2;
  --ink: #0E1A20;
  --ink-2: #4B5A61;
  --ink-3: #8C989E;
  --ink-4: #B9C2C6;
  --brand: #0FA9CB;
  --brand-deep: #0A7C9C;
  --brand-wash: rgba(15, 169, 203, .1);
  --red: #D93A2B;
  --green: #2FA36B;
  --f-sans: "Geist", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .15, 1);
  --gutter: clamp(22px, 5vw, 64px);
  --max: 1080px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.7 var(--f-sans); -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand-deep); }
:focus-visible { outline: 2px solid var(--brand-deep); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); width: 100%; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--ink-3); }
.kw { word-break: keep-all; overflow-wrap: anywhere; }

/* ── 排版 ── */
.h-hero, .h-sec { margin: 0; font-weight: 700; letter-spacing: -.025em; text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }
.h-hero { font-size: clamp(36px, min(8vw, 9vh), 84px); line-height: 1.1; }
.h-sec { font-size: clamp(28px, min(5.6vw, 7vh), 56px); line-height: 1.16; }
.lead { margin: 0; font-size: clamp(16px, 1.8vw, 21px); line-height: 1.8; color: var(--ink-2); max-width: 32em; }
.num { font: 500 13px/1 var(--f-mono); letter-spacing: .08em; color: var(--brand-deep); }
.sec { padding-block: clamp(64px, 11vh, 120px) 0; }
.sec-head { display: grid; gap: 10px; margin-bottom: clamp(28px, 5vh, 52px); }
.sec-head p { margin: 0; color: var(--ink-3); font-size: 15px; }

/* 圆点列表 */
.dots-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.dots-list > li { position: relative; padding-left: 20px; }
.dots-list > li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

/* ── 按钮 ── */
.btn {
  border: 0; cursor: pointer; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none;
  font-size: 17px; font-weight: 600; letter-spacing: .01em; padding: 16px 32px; min-height: 56px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .25s var(--ease), background .25s, opacity .25s; -webkit-tap-highlight-color: transparent;
}
.btn.brand { background: var(--brand-deep); box-shadow: 0 14px 30px -14px rgba(10, 124, 156, .7); }
.btn.soft { background: var(--paper-2); color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: progress; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.wide { width: 100%; }
@media (max-width: 600px) { .btn.block-m { width: 100%; } }
.link { border: 0; background: none; padding: 6px 0; cursor: pointer; font-size: 15px; color: var(--ink-3); text-decoration: underline; text-underline-offset: 4px; }
.link.brand { color: var(--brand-deep); }
.go { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-deep); text-decoration: none; }
.go::after { content: "→"; font-family: var(--f-mono); transition: transform .25s var(--ease); }
.go:hover::after { transform: translateX(3px); }

/* ── 输入框：无边框，浅底，聚焦时淡青光晕 ── */
.field { display: grid; gap: 8px; }
.field > label { font-size: 15px; font-weight: 600; }
.field > label em, .q h3 em { font-style: normal; color: var(--red); font-weight: 500; margin-left: 2px; }
.inp {
  width: 100%; border: 0; border-radius: 14px; background: var(--paper-2); padding: 15px 16px; font-size: 17px; line-height: 1.5;
  -webkit-appearance: none; appearance: none; transition: background .2s, box-shadow .2s; outline: none;
}
.inp::placeholder { color: var(--ink-4); }
.inp:focus { background: var(--paper); box-shadow: 0 0 0 5px rgba(15, 169, 203, .16), 0 6px 18px -10px rgba(10, 124, 156, .35); }
textarea.inp { resize: none; min-height: 6.2em; overflow: hidden; }
.field.bad .inp, .inp.bad { background: #FDEDEB; }
.field.bad .inp:focus, .inp.bad:focus { box-shadow: 0 0 0 5px rgba(217, 58, 43, .12); }
.field .msg { font-size: 13.5px; color: var(--red); }
.field .msg:empty { display: none; }
.fields { display: grid; gap: 22px; }
.two { display: grid; gap: 22px; }
@media (min-width: 720px) { .two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.err-line { margin: 0; color: var(--red); font-size: 15px; }
.err-line:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── 题目（与 survey.html 同一手感） ── */
.q { padding-top: 52px; scroll-margin-top: 28px; }
.q:first-child { padding-top: 0; }
.q h3 { margin: 8px 0 0; font-size: clamp(21px, 5.4vw, 26px); line-height: 1.34; font-weight: 700; letter-spacing: -.015em; word-break: keep-all; overflow-wrap: anywhere; }
.q .sub { margin: 6px 0 0; font-size: 14px; color: var(--ink-3); }
.q .ans { margin-top: 22px; }
.q.miss h3 { color: var(--red); }
.q .miss-tip { margin: 10px 0 0; color: var(--red); font-size: 14px; }
.scale { display: flex; justify-content: space-between; max-width: 420px; }
.scale button { flex: 1; border: 0; background: none; padding: 4px 0 18px; cursor: pointer; position: relative; font: 300 clamp(40px, 12vw, 54px)/1 var(--f-mono); color: var(--ink-4); transition: color .25s, transform .3s var(--ease); -webkit-tap-highlight-color: transparent; }
.scale button::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--brand); transform: scale(0); transition: transform .3s var(--ease); }
.scale button:hover { color: var(--ink-2); }
.scale button.on { color: var(--brand-deep); font-weight: 500; }
.scale button.on::after { transform: scale(1); }
.scale-ends { display: flex; justify-content: space-between; max-width: 420px; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.opts { display: grid; grid-template-columns: 1fr; column-gap: 28px; }
@media (min-width: 560px) { .opts.c2 { grid-template-columns: 1fr 1fr; } }
.opt { border: 0; background: none; padding: 11px 0; display: flex; align-items: flex-start; gap: 12px; text-align: left; cursor: pointer; font-size: 17px; line-height: 1.45; color: var(--ink-2); transition: color .2s; -webkit-tap-highlight-color: transparent; }
.opt::before { content: ""; flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--ink-4); transition: box-shadow .2s, background .2s; }
.opts.multi .opt::before { border-radius: 6px; }
.opt.on { color: var(--ink); font-weight: 600; }
.opt.on::before { box-shadow: none; background: var(--brand-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.q .note { margin-top: 14px; }

/* ── 小源 ── */
.m-svg { width: 100%; height: 100%; overflow: visible; display: block; }
.m-svg * { transform-box: view-box; }
.m-breath { transform-origin: 100px 176px; animation: m-breath 3.4s ease-in-out infinite; }
@keyframes m-breath { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 1.04); } }
.m-antenna { transform-origin: 100px 66px; animation: m-wag 2.6s ease-in-out infinite alternate; }
@keyframes m-wag { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.m-hop { transform-origin: 100px 176px; }
.hop .m-hop { animation: m-hop .9s var(--ease) 2; }
@keyframes m-hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-16px); } }
.pet { display: block; }
.buddy { position: fixed; z-index: 45; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: 72px; height: 72px; border: 0; padding: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.buddy::after { content: ""; position: absolute; right: 0; top: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 3.5h10v6.5H7l-3 2.5V10H3z' fill='none' stroke='%230E1A20' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") center / 13px no-repeat;
  box-shadow: 0 2px 8px rgba(14, 26, 32, .18); }
@media (min-width: 900px) { .buddy { right: 32px; bottom: 28px; width: 88px; height: 88px; } }

/* ── 底部面板 / 弹窗 ── */
.sheet-wrap { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; visibility: hidden; transition: visibility 0s .45s; }
.sheet-wrap.open { visibility: visible; transition: none; }
.sheet-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; background: rgba(14, 26, 32, .38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s; }
.sheet { position: relative; width: 100%; max-height: 92vh; max-height: 92svh; overflow-y: auto; overscroll-behavior: contain; background: var(--paper);
  border-radius: 26px 26px 0 0; padding: 12px 22px calc(26px + env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform .5s cubic-bezier(.2, .9, .2, 1); }
.sheet-wrap.open .sheet-bg { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.grabber { width: 40px; height: 5px; border-radius: 99px; background: var(--paper-3); margin: 0 auto 18px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.sheet-head h2 { margin: 0; font-size: 25px; line-height: 1.3; letter-spacing: -.02em; }
.sheet-head p { margin: 6px 0 0; color: var(--ink-3); font-size: 14.5px; }
.x { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper-2); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.x svg { width: 16px; height: 16px; }
@media (min-width: 720px) {
  .sheet-wrap { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: 26px; padding: 32px 38px 34px; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .45s var(--ease), opacity .3s; }
  .sheet-wrap.open .sheet { opacity: 1; }
  .grabber { display: none; }
}

/* ── 提示 ── */
.toast { position: fixed; left: 50%; top: calc(18px + env(safe-area-inset-top, 0px)); z-index: 100; transform: translate(-50%, -14px); opacity: 0; pointer-events: none;
  width: max-content; max-width: calc(100vw - 40px); padding: 11px 18px; border-radius: 16px; background: rgba(14, 26, 32, .92); color: #fff; font-size: 15px; line-height: 1.5; text-align: center;
  box-shadow: 0 16px 40px -16px rgba(14, 26, 32, .5); transition: opacity .3s, transform .4s var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(160, 40, 30, .94); }

/* ── 加载中 ── */
.loading { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; }
.loading .pet { width: 96px; height: 96px; }
.spin { display: inline-flex; gap: 5px; }
.spin i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .45; animation: ev-dot 1.1s infinite ease-in-out; }
.spin i:nth-child(2) { animation-delay: .15s; } .spin i:nth-child(3) { animation-delay: .3s; }
@keyframes ev-dot { 0%, 70%, 100% { transform: translateY(0); opacity: .45; } 35% { transform: translateY(-5px); opacity: 1; } }

/* 进场 */
html.js .rv { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease) var(--d, 0s), transform .9s var(--ease) var(--d, 0s); }
html.js .rv.in { opacity: 1; transform: none; }

/* ══ 页面共享块（活动页 / 后台 / 工作台共用）══
   不依赖 flex gap / aspect-ratio：老一点的微信内核（iOS 14.0 及以下）也不乱版 */

/* 顶栏（无封面时） */
.top { display: flex; align-items: center; justify-content: space-between; padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
.top img { height: 22px; width: auto; margin-right: 16px; flex: none; }
.top span { font-size: 13px; color: var(--ink-3); text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
footer { padding: clamp(80px, 14vh, 140px) 0 calc(112px + env(safe-area-inset-bottom, 0px)); }
footer .wrap { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
footer img { height: 24px; width: auto; margin-right: 16px; }

/* 出错 / 不存在 */
.gone { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 24px; }
.gone .pet { width: 110px; height: 110px; margin: 0 auto 18px; }
.gone h1 { margin: 0 0 10px; font-size: 28px; }
.gone p { margin: 0; color: var(--ink-3); }

/* 问卷 / 表单页 */
.fv { max-width: 680px; margin: 0 auto; padding: 0 24px calc(80px + env(safe-area-inset-bottom, 0px)); }
.fv-hero { padding: 48px 104px 8px 0; position: relative; }
.fv-hero h1 { margin: 0; font-size: clamp(34px, 9vw, 52px); line-height: 1.14; font-weight: 800; letter-spacing: -.03em; word-break: keep-all; overflow-wrap: anywhere; }
.fv-hero p { margin: 16px 0 0; color: var(--ink-2); }
.fv-hero .pet { position: absolute; right: -6px; top: 30px; width: clamp(80px, 21vw, 112px); height: clamp(80px, 21vw, 112px); }
@media (max-width: 520px) { .fv-hero { padding-right: 0; } .fv-hero h1 { padding-right: 96px; } }
.fv .who { margin-top: 22px; font-size: 15px; color: var(--ink-3); }
.fv .who b { color: var(--ink); }
.fv .idf { margin-top: 44px; }
.fv .qs { margin-top: 56px; }
.fv .send { margin-top: 64px; display: grid; grid-gap: 14px; gap: 14px; justify-items: start; }
.fv .send p { margin: 0; font-size: 13px; color: var(--ink-3); }
.done { min-height: 80vh; min-height: 80svh; display: flex; flex-direction: column; justify-content: center; }
.done .pet { width: 120px; height: 120px; margin-bottom: 18px; }
.done h1 { margin: 0; font-size: clamp(34px, 9vw, 52px); line-height: 1.15; font-weight: 800; letter-spacing: -.03em; }
.done p { margin: 16px 0 34px; color: var(--ink-2); }

/* 照片墙：列数由 --cols 决定，每列从上往下排；图片用 width/height 属性定比例 */
.ph-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: clamp(24px, 4vh, 40px); }
.ph-head > * { margin-top: 14px; }
.ph-head .sec-head { margin: 14px 20px 0 0; }
.wall { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); grid-gap: 10px; gap: 10px; align-items: start; }
.wall .col { display: grid; grid-gap: 10px; gap: 10px; align-content: start; min-width: 0; }
@media (min-width: 720px) { .wall, .wall .col { grid-gap: 16px; gap: 16px; } }
.ph { margin: 0; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.ph .im { position: relative; border-radius: 16px; overflow: hidden; background: var(--paper-2); }
.ph img { display: block; width: 100%; height: auto; }
.ph figcaption { margin-top: 6px; font-size: 12.5px; color: var(--ink-3); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph.up { cursor: default; }
.ph.up img { filter: saturate(.6) brightness(.85); }
.ph .bar { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .45); overflow: hidden; }
.ph .bar i { display: block; height: 100%; width: 0; background: #fff; transition: width .2s; }
.ph .pct { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font: 500 15px var(--f-mono); text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }
.wall-empty { display: flex; align-items: center; color: var(--ink-3); font-size: 15px; }
.wall-empty .pet { width: 64px; height: 64px; flex: none; margin-right: 16px; }
.wall-more { margin-top: 28px; }

/* 看大图（长按保存靠真实 <img>） */
.lb { position: fixed; top: 0; right: 0; bottom: 0; left: 0; inset: 0; z-index: 80; background: rgba(0, 0, 0, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(56px + env(safe-area-inset-top, 0px)) 12px calc(28px + env(safe-area-inset-bottom, 0px)); }
.lb img { max-width: 100%; max-height: calc(100% - 60px); object-fit: contain; -webkit-touch-callout: default; }
.lb p { margin: 14px 0 0; color: rgba(255, 255, 255, .72); font-size: 14px; text-align: center; }
.lb .x { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; background: rgba(255, 255, 255, .14); color: #fff; }

/* 小源问答 */
.chat .sheet { display: flex; flex-direction: column; height: min(82vh, 640px); height: min(82svh, 640px); padding-bottom: 0; }
.chat .sheet-head { align-items: center; margin-bottom: 8px; }
.chat .ava { width: 44px; height: 44px; flex: none; margin-right: 12px; }
.chat .who { display: flex; align-items: center; }
.chat .who b { display: block; font-size: 17px; }
.chat .who span { font-size: 13px; color: var(--ink-3); }
.c-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 12px 0 16px; }
.c-b { max-width: 86%; padding: 10px 14px; border-radius: 18px; background: var(--paper-2); font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; border-bottom-left-radius: 6px; }
.c-b + .c-b { margin-top: 12px; }
.c-b.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.c-form { flex: none; display: flex; padding: 10px 0 calc(14px + env(safe-area-inset-bottom, 0px)); }
.c-form .inp { border-radius: 99px; padding: 12px 18px; font-size: 16px; margin-right: 8px; }
.c-form button { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; cursor: pointer; display: grid; place-items: center; }
.c-form button[disabled] { opacity: .4; cursor: progress; }
.c-form button svg { width: 18px; height: 18px; }
.buddy { transition: opacity .35s, transform .5s var(--ease); }
.buddy.away { opacity: 0; transform: translateY(40px); pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .m-breath, .m-antenna, .hop .m-hop, .spin i { animation: none !important; }
  html.js .rv { opacity: 1; transform: none; transition: none; }
  .sheet, .sheet-bg, .toast { transition: none !important; }
}

/* 界面语言胶囊切换（后台 / 工作台，见 i18n.js） */
.lang-sw { display: inline-flex; padding: 2px; border-radius: 999px; background: var(--paper-3); vertical-align: middle; }
.lang-sw button { border: 0; background: none; font: 600 12.5px/1 var(--f-sans); color: var(--ink-3); padding: 6px 11px; border-radius: 999px; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease); }
.lang-sw button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(14, 26, 32, .12); cursor: default; }
.lang-sw button:not(.on):hover { color: var(--ink); }
