:root {
  --bg: #0b1220;
  --panel: #141b2d;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --tile: #1f2937;
  --tile-border: #263142;
  --tile-hover: #2a364a;
  --ring: rgba(59,130,246,.35);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-1: 0 10px 30px rgba(0,0,0,.35);
  --shadow-2: 0 6px 18px rgba(0,0,0,.25);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, rgba(59,130,246,.25), rgba(34,211,238,.12) 40%, transparent 70%), var(--bg);
}

.app {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.header {
  padding: 20px 16px 6px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(59,130,246,.3), rgba(34,211,238,.25));
  border: 1px solid rgba(148,163,184,.25);
  border-radius: 12px;
  box-shadow: var(--shadow-2);
  overflow: hidden; /* 防止内部大图溢出 */
}
.logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.title h1 {
  margin: 0 0 4px 0;
  font-size: 18px;
}
.subtitle {
  margin: 0; color: var(--muted); font-size: 13px;
}

.main { padding: 12px 16px 24px; }

.video-preview { margin: 12px 0 20px; }
.section-block {
  padding: 14px 12px 12px;
  background: var(--panel);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.section-block .section-title { text-align: center; margin: 0 0 10px 0; }
.section-block .section-title::after {
  content: "";
  display: block;
  width: 44px; height: 3px;
  margin: 8px auto 0;
  border-radius: 9999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.section-body { display: grid; place-items: center; margin-top: 4px; }
.video-card {
  width: 100%;
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.25);
  background: linear-gradient(135deg, #0f1729, #1a202c);
  padding: 0;
  min-height: 0;
}
.video-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: linear-gradient(135deg, #0f1729, #1a202c);
  transition: opacity 0.3s ease;
}

.video-card img:not([src]),
.video-card img[src=""] {
  opacity: 0;
}

.video-card img[src]:not([src=""]) {
  opacity: 1;
}
.video-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.0), rgba(0,0,0,.35) 60%);
}
.video-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  line-height: 1;
  background: rgba(0,0,0,.6);
  border: none;
  transition: transform .15s ease, opacity .15s ease;
  opacity: 0.9;
}

.video-card:hover .video-card__play {
  transform: translate(-50%, -50%) scale(1.1);
  opacity: 1;
}

.video-card:active .video-card__play {
  transform: translate(-50%, -50%) scale(.95);
}
.video-card__caption {
  position: absolute; left: 12px; bottom: 10px; color: #e5e7eb; font-size: 13px; letter-spacing: .2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.tile {
  appearance: none;
  border: 1px solid var(--tile-border);
  background: linear-gradient(180deg, rgba(31,41,55,.85), rgba(17,24,39,.85));
  color: var(--text);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--shadow-1);
  min-height: 96px;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.tile:active { transform: translateY(1px) scale(.985); }
.tile:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile:hover { background: var(--tile-hover); box-shadow: 0 12px 34px rgba(0,0,0,.45), 0 0 0 4px var(--ring) inset; }
.icon { font-size: 30px; display: inline-flex; color: var(--accent); }
.icon svg { width: 28px; height: 28px; display: block; }
.label { font-size: 16px; letter-spacing: .2px; font-weight: 600; }

.tips { margin-top: 10px; }
.tips p {
  margin: 0;
  color: var(--muted);
  background: rgba(148,163,184,.08);
  border: 1px dashed rgba(148,163,184,.25);
  padding: 10px 12px;
  border-radius: var(--radius-md);
}

.footer {
  padding: 16px; color: var(--muted); text-align: center; font-size: 12px;
  border-top: 1px solid rgba(148,163,184,.15);
}

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
}
.modal__mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.55);
}
.modal__content {
  position: relative;
  width: min(92vw, 520px);
  background: var(--panel);
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 16px;
  padding: 18px 16px 20px;
  box-shadow: var(--shadow-1);
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-origin: center top;
}
.modal__content h2 { margin: 4px 0 6px; font-size: 18px; }
.modal__content .muted { color: var(--muted); margin: 0 0 12px; font-size: 13px; }
.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6);
  background: rgba(0,0,0,.7);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1000;
  transition: all .2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.modal__close:hover {
  background: rgba(0,0,0,.9);
  border-color: rgba(255,255,255,.8);
  transform: scale(1.05);
}

.modal__close:active {
  transform: scale(.95);
  background: rgba(0,0,0,.8);
}

.modal__close:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
.qrcode-wrap { display: grid; place-items: center; }
.qrcode-wrap img {
  width: min(70vw, 280px);
  height: auto;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border: 1px solid rgba(148,163,184,.25);
  padding: 12px;
  box-shadow: 0 10px 30px rgba(2,6,23,.08);
}

.modal__content--video {
  width: min(94vw, 640px);
  padding: 10px;
}
#activation-video { width: 100%; height: auto; border-radius: 12px; }

/* ===== Modal 出场动画 ===== */
.modal { --modal-duration: .28s; }
.modal__mask { opacity: 1; }
.modal[aria-hidden="false"] .modal__mask {
  animation: modalMaskFadeIn var(--modal-duration) ease-out both;
}
.modal[aria-hidden="false"] .modal__content {
  animation: modalContentIn var(--modal-duration) cubic-bezier(.16,.84,.44,1) both;
}

@keyframes modalMaskFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalContentIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .modal[aria-hidden="false"] .modal__mask,
  .modal[aria-hidden="false"] .modal__content { animation: none !important; }
  .modal__close { transition: none; }
}

@media (min-width: 480px) {
  .label { font-size: 17px; }
  .icon { font-size: 30px; }
}

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}


/* ===== Light theme overrides based on XunjieMao brand ===== */
:root {
  --bg: #f7fafc;
  --panel: #ffffff;
  --accent: #2ea8ff;
  --accent-2: #19e0ff;
  --text: #0f172a;
  --muted: #6b7280;
  --tile: #ffffff;
  --tile-border: #e5e7eb;
  --tile-hover: #f1f5f9;
  --ring: rgba(46,168,255,.28);
  --shadow-1: 0 10px 30px rgba(0,0,0,.08);
  --shadow-2: 0 6px 18px rgba(0,0,0,.06);
}

img { max-width: 100%; height: auto; display: block; }

body {
  color: var(--text);
  background:
    radial-gradient(1000px 500px at 70% -10%, rgba(46,168,255,.18), rgba(25,224,255,.1) 40%, transparent 70%),
    radial-gradient(600px 300px at 0% 100%, rgba(25,224,255,.08), transparent 60%),
    var(--bg);
}

.logo {
  background: linear-gradient(135deg, rgba(46,168,255,.18), rgba(25,224,255,.16));
  border: 1px solid #e5e7eb;
}

.video-preview { margin: 12px 0 20px; }

.video-card { border: 1px solid #e5e7eb; background: #ffffff; }
.video-card__overlay { background: linear-gradient(180deg, rgba(255,255,255,0), rgba(0,0,0,.18) 70%); }

.grid { gap: 16px; }

.tile {
  border: 1px solid var(--tile-border);
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  min-height: 96px;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
.tile:hover { background: var(--tile-hover); box-shadow: 0 12px 34px rgba(2,6,23,.08), 0 0 0 4px var(--ring) inset; }
.tile:active { transform: translateY(1px) scale(.985); }

.icon { color: var(--accent); font-size: 30px; }

.label { font-weight: 600; }

.footer { border-top: 1px solid #e5e7eb; }

.section-title { margin: 0 0 10px 2px; font-size: 16px; font-weight: 700; color: #0f172a; }

