/* ============================================================
   耍起嘛 · 浅蓝 + 白 · 抽象娱乐风
   亮色系、卡通感、圆润、微倾斜贴纸感
   ============================================================ */
:root {
  --blue: #2f9bff;
  --blue-deep: #0f6fe0;
  --blue-dark: #0b5cb8;
  --blue-soft: #eaf5ff;
  --blue-line: #cfe7ff;
  --ink: #16324f;
  --ink-mid: rgba(22,50,79,.62);
  --ink-low: rgba(22,50,79,.42);
  --card: #ffffff;
  --green: #23c267;
  --red: #ff5d5d;
  --radius: 24px;
  --shadow: 0 10px 30px rgba(47,155,255,.16);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(760px 460px at 8% -6%, #d3e9ff, transparent 62%),
    radial-gradient(680px 420px at 108% 6%, #ddf3ff, transparent 58%),
    radial-gradient(720px 460px at 50% 114%, #dcefff, transparent 62%),
    linear-gradient(180deg, #f4faff 0%, #ffffff 46%, #eef7ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏 ---------- */
.weui-bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,.78);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--blue-line);
  text-align: center;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--blue-deep);
}
.weui-bar__back {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  text-decoration: none; color: var(--blue-deep);
  width: 32px; height: 32px; line-height: 28px; text-align: center;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue-line);
  box-shadow: 0 4px 0 rgba(47,155,255,.18);
  font-size: 18px; font-weight: 800;
}
.weui-bar__title { display: inline-block; }

/* ---------- 卡片 ---------- */
.weui-cells__title {
  padding: 18px 24px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--blue-deep);
  letter-spacing: .5px;
}
.weui-cells {
  margin: 0 14px;
  padding: 6px 0;
  background: var(--card);
  border: 2px solid var(--blue-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.weui-cell {
  position: relative;
  display: flex; align-items: center;
  padding: 14px 18px;
  background: transparent;
}
.weui-cells > .weui-cell:not(:first-child)::before {
  content: ""; position: absolute; left: 18px; right: 0; top: 0;
  border-top: 1px dashed var(--blue-line);
}
.weui-cell__bd { flex: 1; min-width: 0; }
.weui-cell__ft { text-align: right; color: var(--ink-low); }

/* ---------- 按钮（卡通 3D 感） ---------- */
.weui-btn {
  display: block; width: 100%;
  background: #fff;
  border: 2px solid var(--blue-line);
  color: var(--blue-deep);
  font-size: 16px; font-weight: 800;
  letter-spacing: .5px;
  padding: 13px;
  border-radius: 18px;
  box-shadow: 0 5px 0 rgba(47,155,255,.22);
  cursor: pointer;
  transition: transform .06s ease, box-shadow .06s ease;
}
.weui-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(47,155,255,.22); }
.weui-btn_primary {
  background: linear-gradient(180deg, #63b8ff, #1e86ff);
  border: 2px solid #fff;
  color: #fff;
  text-shadow: 0 1px 2px rgba(9,60,120,.35);
  box-shadow: 0 6px 0 var(--blue-dark), 0 12px 24px rgba(30,134,255,.3);
}
.weui-btn_primary:active { box-shadow: 0 2px 0 var(--blue-dark); }
.weui-btn:disabled { opacity: .45; box-shadow: none; }
.weui-btn + .weui-btn { margin-top: 12px; }

.page-foot {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 640px; margin: 0 auto;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,.92));
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border-top: 1px solid var(--blue-line);
}

/* ---------- 首页 ---------- */
.home-hero { text-align: center; padding: 44px 20px 20px; }
.home-logo {
  width: 92px; height: 92px; margin: 0 auto 16px;
  border-radius: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  background: #fff;
  border: 3px solid var(--blue-line);
  box-shadow: 0 10px 0 rgba(47,155,255,.2), 0 18px 34px rgba(47,155,255,.18);
  transform: rotate(-6deg);
  animation: floaty 3.2s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  50%      { transform: rotate(4deg) translateY(-8px); }
}
.home-hero h1 {
  font-size: 40px; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(120deg, #1e86ff 8%, #56b6ff 55%, #0f6fe0 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.home-hero p { color: var(--ink-mid); font-size: 14px; margin-top: 8px; letter-spacing: .8px; }

/* ---------- 首页"开耍"大按钮 ---------- */
.home-go { text-align: center; padding: 24px 12px 8px; }
/* 两个圆并排：左「开耍」主按钮，右「拍一张」备选 */
.go-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.go-btn {
  position: relative;
  flex: none;
  width: clamp(150px, 46vw, 186px);
  height: clamp(150px, 46vw, 186px);
  border-radius: 50%;
  border: 4px solid #fff;
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.95), rgba(255,255,255,.15) 58%),
    linear-gradient(160deg, #63b8ff, #1e86ff 70%);
  box-shadow: 0 12px 0 var(--blue-dark), 0 24px 44px rgba(30,134,255,.35);
  color: #fff;
  cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .08s ease, box-shadow .08s ease;
  animation: wiggle 4s ease-in-out infinite;
}
@keyframes wiggle {
  0%, 88%, 100% { transform: rotate(0deg); }
  91% { transform: rotate(-3deg); }
  94% { transform: rotate(3deg); }
  97% { transform: rotate(-1.5deg); }
}
.go-btn:active { transform: translateY(8px) scale(.97); box-shadow: 0 4px 0 var(--blue-dark); animation: none; }
.go-btn__icon { font-size: 42px; line-height: 1; text-shadow: 0 2px 8px rgba(9,60,120,.3); }
.go-btn__text { font-size: 34px; font-weight: 900; letter-spacing: 10px; margin-left: 10px; text-shadow: 0 2px 8px rgba(9,60,120,.3); }
.go-tip {
  display: inline-block;
  color: var(--blue-deep); font-size: 13px; font-weight: 700;
  margin-top: 22px; padding: 6px 14px;
  background: #fff; border: 2px dashed var(--blue-line); border-radius: 14px;
  transform: rotate(-1.5deg);
}
.home-flow { text-align: center; color: var(--ink-low); font-size: 13px; margin-top: 16px; letter-spacing: .5px; }
/* 举着累的时候的备选：拍一张照片让服务端画框 */
.alt-btn {
  flex: none;
  width: clamp(96px, 26vw, 112px);
  height: clamp(96px, 26vw, 112px);
  border-radius: 50%;
  border: 4px solid #fff;
  background: linear-gradient(160deg, #ffffff, #e6f2ff 72%);
  box-shadow: 0 8px 0 rgba(47,155,255,.22), 0 14px 26px rgba(30,134,255,.18);
  color: var(--blue-deep);
  text-decoration: none;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .08s ease, box-shadow .08s ease;
}
.alt-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(47,155,255,.22); }
.alt-btn__icon { font-size: 30px; line-height: 1; }
.alt-btn__text { font-size: 14px; font-weight: 800; letter-spacing: 1px; margin-top: 2px; }
.home-alt-tip { text-align: center; margin-top: 14px; font-size: 12px; }
.home-alt-tip a { color: var(--ink-low); text-decoration: none; }
.home-foot { text-align: center; padding: 26px 0 16px; }

/* ---------- 上传 ---------- */
.upload-box {
  display: block;
  border: 2px dashed var(--blue);
  border-radius: 20px;
  text-align: center;
  padding: 28px 12px;
  color: var(--blue-deep);
  cursor: pointer;
  background: var(--blue-soft);
}
.upload-box:active { background: #ddeeff; }
.upload-box__icon { display: block; font-size: 32px; }
.upload-box__text { font-size: 15px; font-weight: 800; }
.upload-tip { font-size: 12px; color: var(--ink-low); margin-top: 8px; }

/* ---------- 预览 ---------- */
.preview-grid { display: flex; flex-wrap: wrap; gap: 12px; padding: 16px 14px; }
.preview-item { position: relative; width: 92px; height: 92px; }
.preview-item img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 16px;
  border: 2px solid #fff;
  box-shadow: 0 6px 0 rgba(47,155,255,.18), 0 10px 20px rgba(47,155,255,.16);
}
.preview-del {
  position: absolute; top: -8px; right: -8px;
  width: 26px; height: 26px; line-height: 22px; text-align: center;
  background: linear-gradient(180deg, #ff8484, var(--red));
  border: 2px solid #fff;
  color: #fff; border-radius: 50%;
  font-size: 16px; font-weight: 800; cursor: pointer;
}

/* ---------- 结果 ---------- */
.code-cell { align-items: flex-start; }
.code-cell__code { font-family: monospace; font-size: 19px; font-weight: 800; letter-spacing: .5px; color: var(--blue-deep); }
.code-cell__meta { margin-top: 5px; }
.tag {
  display: inline-block; font-size: 11px; font-weight: 700; color: var(--blue-deep);
  background: var(--blue-soft);
  border: 1px solid var(--blue-line);
  border-radius: 9px; padding: 2px 8px;
  margin-right: 6px;
}
.code-check { width: 22px; height: 22px; accent-color: var(--blue); }

/* ---------- 目标 / 图例 ---------- */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: monospace; font-size: 14px; font-weight: 700;
  color: var(--blue-deep);
  background: var(--blue-soft);
  border: 2px solid var(--blue-line);
  border-radius: 18px; padding: 4px 12px;
}
.legend-cell { padding: 11px 18px; }
.legend-dot {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin-right: 12px; font-size: 14px; font-weight: 800; color: #fff;
  border: 2px solid #fff;
}
.legend-dot.found { background: linear-gradient(180deg, #58dd93, var(--green)); box-shadow: 0 3px 0 rgba(35,194,103,.35); }
.legend-dot.miss  { background: linear-gradient(180deg, #ff8b8b, var(--red));  box-shadow: 0 3px 0 rgba(255,93,93,.35); }

/* ---------- 加载 ---------- */
.loading-mask {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(226,241,255,.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
}
.loading-box {
  background: #fff;
  border: 2px solid var(--blue-line);
  border-radius: 22px;
  padding: 22px 28px;
  text-align: center;
  color: var(--blue-deep);
  box-shadow: 0 10px 0 rgba(47,155,255,.16), 0 18px 36px rgba(47,155,255,.2);
  min-width: 160px;
  animation: popIn .22s cubic-bezier(.2,1.5,.5,1);
}
@keyframes popIn { from { transform: scale(.85); opacity: .4; } to { transform: scale(1); opacity: 1; } }
.loading-spinner {
  width: 30px; height: 30px; margin: 0 auto 10px;
  border: 4px solid var(--blue-soft);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.loading-text { font-size: 14px; font-weight: 800; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 辅助 */
.link { color: var(--blue-deep); text-decoration: none; font-size: 13px; font-weight: 700; }

/* ---------- PWA 装到桌面 ---------- */
.pwa-wrap { text-align: center; padding: 0 20px 20px; }
.pwa-install {
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-deep);
  background: rgba(255,255,255,.92);
  border: 2px dashed var(--blue-line);
  border-radius: 999px;
  padding: 9px 18px;
  box-shadow: 0 4px 0 rgba(47,155,255,.14);
  cursor: pointer;
}
.pwa-install:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(47,155,255,.14); }
