* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg0: #050b18;
  --bg1: #0a1830;
  --card: rgba(255, 255, 255, 0.055);
  --card-2: rgba(255, 255, 255, 0.035);
  --line: rgba(160, 190, 235, 0.14);
  --line-strong: rgba(160, 190, 235, 0.24);
  --txt: #eaf2ff;
  --muted: #8ea6c9;
  --dim: #5f759a;
  --blue: #3aa0ff;
  --cyan: #28d7ff;
  --green: #22d3a6;
  --amber: #ffb648;
  --red: #ff6b7d;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg0);
  color: var(--txt);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { position: relative; overflow-x: hidden; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 45% at 12% 0%, rgba(58, 160, 255, 0.22), transparent 60%),
    radial-gradient(50% 40% at 92% 8%, rgba(40, 215, 255, 0.12), transparent 65%),
    radial-gradient(70% 55% at 50% 110%, rgba(34, 211, 166, 0.10), transparent 65%),
    linear-gradient(165deg, #050b18 0%, #0a1830 52%, #060d1c 100%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(140, 180, 240, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 180, 240, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(80% 60% at 50% 0%, #000 0%, transparent 80%);
}

.m-app {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 18px calc(130px + env(safe-area-inset-bottom));
}
.m-login-app { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

/* Brand */
.m-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 2px 18px;
}
.m-logo {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #3aa0ff, #1a63d6);
  box-shadow: 0 10px 24px rgba(58, 160, 255, 0.35);
  flex: 0 0 42px;
}
.m-logo svg { width: 23px; height: 23px; }
.m-brand-text { flex: 1; min-width: 0; }
.m-brand-text h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }
.m-brand-text p { margin: 2px 0 0; font-size: 11px; color: var(--dim); letter-spacing: 1.5px; }
.m-pill {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}
.m-pill.ok { color: #7ff0d1; border-color: rgba(34, 211, 166, 0.35); background: rgba(34, 211, 166, 0.10); }
.m-pill.warn { color: #ffd08a; border-color: rgba(255, 182, 72, 0.35); background: rgba(255, 182, 72, 0.10); }

/* Hero */
.m-hero { padding: 14px 2px 22px; }
.m-eyebrow {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 2.4px;
  color: #6fc3ff;
  margin-bottom: 10px;
}
.m-hero h2 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: 0.5px; }
.m-hero p { margin: 9px 0 0; font-size: 13px; line-height: 1.65; color: var(--muted); }

/* Card */
.m-card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.028));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.m-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.m-card-title h3 { margin: 0; font-size: 14px; font-weight: 700; }
.m-card-title span { font-size: 11px; color: var(--dim); }

/* Inputs */
.m-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(4, 10, 22, 0.55);
  margin-bottom: 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.m-input:focus-within {
  border-color: rgba(58, 160, 255, 0.7);
  box-shadow: 0 0 0 4px rgba(58, 160, 255, 0.12);
}
.m-input svg { width: 18px; height: 18px; color: #6f87ab; flex: 0 0 18px; }
.m-input input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.3px;
}
.m-input input::placeholder { color: #53688a; font-size: 14px; }
.m-eye {
  border: 0;
  background: transparent;
  color: #6f87ab;
  padding: 4px;
  display: grid;
  place-items: center;
}
.m-eye svg { width: 18px; height: 18px; }

/* Buttons */
.m-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
  color: #dcebff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-decoration: none;
  transition: transform 0.12s, filter 0.18s;
}
.m-btn svg { width: 18px; height: 18px; }
.m-btn:active { transform: scale(0.98); }
.m-btn:disabled { opacity: 0.55; }
.m-btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #3aa0ff 0%, #1d6fe0 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(31, 111, 224, 0.4);
}
.m-btn.primary:hover { filter: brightness(1.06); }
.m-btn.success {
  border-color: transparent;
  background: linear-gradient(135deg, #22d3a6 0%, #12a97f 100%);
  color: #04231b;
  box-shadow: 0 14px 30px rgba(34, 211, 166, 0.32);
}
.m-btn.ghost { background: rgba(255, 255, 255, 0.04); }
.m-btn-lg { min-height: 58px; font-size: 17px; letter-spacing: 6px; }

/* Status / info */
.m-kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(160, 190, 235, 0.12);
  font-size: 13px;
}
.m-kv:last-child { border-bottom: 0; }
.m-kv span { color: var(--muted); }
.m-kv b { color: #eaf4ff; font-weight: 600; }
.m-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(34, 211, 166, 0.8);
  display: inline-block;
  margin-right: 7px;
}
.m-dot.live { background: var(--amber); box-shadow: 0 0 10px rgba(255, 182, 72, 0.8); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Elevator card */
.m-entity {
  display: flex;
  align-items: center;
  gap: 14px;
}
.m-entity-icon {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #9ed6ff;
  background: linear-gradient(150deg, rgba(58, 160, 255, 0.24), rgba(40, 215, 255, 0.08));
  border: 1px solid rgba(58, 160, 255, 0.25);
  flex: 0 0 58px;
}
.m-entity-icon svg { width: 30px; height: 30px; }
.m-entity-info { flex: 1; min-width: 0; }
.m-entity-info h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: 0.5px; }
.m-entity-info p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-tag {
  display: inline-block;
  font-size: 10px;
  color: #8fc2ff;
  background: rgba(58, 160, 255, 0.12);
  border: 1px solid rgba(58, 160, 255, 0.28);
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

/* Timer */
.m-timer-card { text-align: center; padding: 22px 18px; }
.m-timer-label { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.m-timer {
  margin: 10px 0 4px;
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #8fc2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.m-timer-sub { font-size: 11.5px; color: var(--dim); }

/* Photo */
.m-photo-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(4, 9, 19, 0.45);
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.m-photo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  font-size: 12px;
  color: var(--muted);
}
.m-photo-head b { color: #eaf4ff; font-weight: 600; }
.m-photo-head em { font-style: normal; color: var(--dim); font-size: 11px; }
.m-photo { display: block; width: 100%; background: #000; }
.m-photo-card a { display: block; }

/* Timeline */
.m-timeline { padding: 6px 18px; }
.m-tl-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 12px 0 16px 20px;
}
.m-tl-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 20px;
  bottom: -8px;
  width: 1px;
  background: rgba(160, 190, 235, 0.18);
}
.m-tl-item:last-child::before { display: none; }
.m-tl-dot {
  position: absolute;
  left: 0;
  top: 16px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(58, 160, 255, 0.15);
}
.m-tl-dot.end { background: var(--green); box-shadow: 0 0 0 4px rgba(34, 211, 166, 0.15); }
.m-tl-body { flex: 1; min-width: 0; }
.m-tl-body b { font-size: 13px; }
.m-tl-body p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.m-tl-thumb { width: 64px; height: 40px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); }

/* Success */
.m-success { text-align: center; padding: 24px 18px; }
.m-check {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #05251d;
  background: linear-gradient(150deg, #3ef0c0, #16b589);
  box-shadow: 0 12px 28px rgba(34, 211, 166, 0.35);
  animation: pop-in 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.m-check svg { width: 32px; height: 32px; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }
.m-success h3 { margin: 0; font-size: 20px; font-weight: 800; }
.m-success p { margin: 7px 0 0; font-size: 12.5px; color: var(--muted); }
.m-big-duration {
  margin: 14px 0 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #7ff0d1;
  font-variant-numeric: tabular-nums;
}

/* FAB */
.m-fab {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(5, 11, 24, 0.86) 38%, rgba(5, 11, 24, 0.98));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.m-fab-inner { max-width: 560px; margin: 0 auto; }

/* Check-in circular button */
.m-stage { text-align: center; padding: 14px 0 24px; }
.m-checkin {
  position: relative;
  width: 218px;
  height: 218px;
  margin: 0 auto;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: #fff;
}
.m-checkin::before,
.m-checkin::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(58, 160, 255, 0.35);
  animation: ripple 2.6s ease-out infinite;
}
.m-checkin::after { animation-delay: 1.3s; }
@keyframes ripple {
  0% { transform: scale(0.86); opacity: 0.9; }
  100% { transform: scale(1.22); opacity: 0; }
}
.m-checkin-core {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background:
    radial-gradient(80% 70% at 50% 20%, rgba(58, 160, 255, 0.42), rgba(10, 24, 48, 0.9) 70%),
    linear-gradient(160deg, #164a8f, #0a1c3a);
  border: 1px solid rgba(120, 190, 255, 0.35);
  box-shadow: 0 18px 50px rgba(20, 80, 170, 0.45), inset 0 0 40px rgba(58, 160, 255, 0.15);
}
.m-checkin-core svg { width: 44px; height: 44px; color: #a9dcff; }
.m-checkin-core span { font-size: 17px; font-weight: 800; letter-spacing: 3px; }
.m-checkin-core em { font-style: normal; font-size: 10px; color: #8fb7e0; letter-spacing: 2px; }
.m-stage-hint { margin: 18px 0 0; font-size: 12px; color: var(--dim); }

/* Countdown overlay */
.m-countdown {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(3, 8, 18, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.m-count-ring {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid rgba(58, 160, 255, 0.18);
}
.m-count-ring::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--blue);
  border-right-color: rgba(58, 160, 255, 0.4);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.m-count-num {
  font-size: 108px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 60px rgba(58, 160, 255, 0.75);
  font-variant-numeric: tabular-nums;
}
.m-count-tip { margin-top: 22px; font-size: 15px; color: #9fb4d8; letter-spacing: 2px; }

/* Message / toast */
.m-msg {
  min-height: 18px;
  margin-top: 12px;
  font-size: 12.5px;
  text-align: center;
  color: #ff9aa5;
}
.m-msg.ok { color: #7ff0d1; }
.m-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 11px;
  color: #4e6284;
  letter-spacing: 0.5px;
}
.m-hint { margin: 10px 0 0; font-size: 11.5px; color: var(--dim); line-height: 1.7; }
.hidden { display: none !important; }

.m-userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  color: var(--muted);
}
.m-userbar b { color: #eaf4ff; font-weight: 600; }
.m-userbar button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: #8fc2ff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
}
.m-notice {
  border: 1px solid rgba(255, 107, 125, 0.35);
  background: rgba(255, 107, 125, 0.08);
  color: #ffb3bc;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
}
.m-notice b { color: #fff; }

/* Skeleton */
.m-skeleton {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 25%, rgba(255, 255, 255, 0.075) 37%, rgba(255, 255, 255, 0.03) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  height: 120px;
  margin-bottom: 14px;
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (min-width: 600px) {
  .m-app { padding-top: 34px; }
  .m-card, .m-photo-card { border-radius: 20px; }
}
