/* 周五村越野跑团 — shared mini-program tokens */
:root {
  --brand: #01ADFA;
  --brand-deep: #008FCF;
  --brand-soft: color-mix(in srgb, #01ADFA 14%, #ffffff);
  --brand-tint: color-mix(in srgb, #01ADFA 8%, #f4fafd);
  --bg: #f2f7fb;
  --surface: #ffffff;
  --fg: #0b1f2c;
  --muted: #5b6f7c;
  --border: #d7e4ec;
  --success: #1f9d63;
  --warn: #d97706;
  --danger: #dc4b4b;
  --trail: #0f766e;
  --shell: #0b1220;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 8px 28px rgba(11, 31, 44, 0.08);
  --font-display: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, system-ui, sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-bottom: 34px;
  --tab-h: 56px;
  --status-h: 44px;
  --nav-h: 44px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%;
  min-height: 100%;
  background: var(--shell);
  color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* —— Phone frame —— */
.device-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px 40px;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, color-mix(in srgb, var(--brand) 35%, transparent), transparent),
    var(--shell);
}
.phone {
  width: 390px;
  height: 844px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 48px);
  background: var(--bg);
  border-radius: 44px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 0 0 10px #1a2332,
    0 0 0 12px #2a3548,
    0 40px 80px rgba(0,0,0,.45);
  display: flex;
  flex-direction: column;
}
.phone-status {
  height: var(--status-h);
  padding: 12px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg);
  background: var(--surface);
  flex-shrink: 0;
  z-index: 20;
}
.phone-status .time { font-variant-numeric: tabular-nums; }
.phone-status .icons {
  display: flex;
  align-items: center;
  gap: 6px;
}
.phone-status svg { width: 16px; height: 16px; }
.island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 34px;
  background: #0a0a0a;
  border-radius: 20px;
  z-index: 30;
  pointer-events: none;
}
.phone-nav {
  height: var(--nav-h);
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 15;
}
.phone-nav .title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.nav-btn {
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--brand-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 10px;
}
.nav-btn:active { opacity: 0.65; }
.nav-btn.ghost { color: var(--muted); }
.phone-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 8px);
}
.phone-body.no-tab { padding-bottom: calc(var(--safe-bottom) + 16px); }
.phone-tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding: 6px 8px var(--safe-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 25;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--brand-deep); }
.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 5px;
  background: rgba(0,0,0,.18);
  border-radius: 100px;
  z-index: 40;
  pointer-events: none;
}

/* —— UI primitives —— */
.section { padding: 16px; }
.section + .section { padding-top: 4px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head .more {
  font-size: 13px;
  color: var(--brand-deep);
  letter-spacing: 0.02em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 500;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.chip.muted {
  background: #eef2f5;
  color: var(--muted);
}
.chip.outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg);
}
.chip.active {
  background: var(--brand);
  color: #fff;
}
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(0.98); opacity: 0.9; }
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-secondary {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}
.btn-block { width: 100%; }
.btn-danger {
  background: color-mix(in srgb, var(--danger) 12%, #fff);
  color: var(--danger);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.field label {
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  outline: none;
  font-size: 15px;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.pill-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pill-status.open {
  background: color-mix(in srgb, var(--success) 14%, #fff);
  color: var(--success);
}
.pill-status.full {
  background: #eef2f5;
  color: var(--muted);
}
.pill-status.soon {
  background: color-mix(in srgb, var(--warn) 16%, #fff);
  color: var(--warn);
}
.toast {
  position: absolute;
  left: 50%;
  top: 96px;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(11, 31, 44, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
  white-space: nowrap;
  max-width: 86%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 44, 0.42);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 12px 16px calc(var(--safe-bottom) + 16px);
  z-index: 46;
  transform: translateY(110%);
  transition: transform .25s ease;
}
.sheet.show { transform: translateY(0); }
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  margin: 0 auto 14px;
}
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--trail));
  flex-shrink: 0;
}
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.stat-num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.map-ph {
  position: relative;
  background:
    linear-gradient(180deg, transparent 60%, rgba(11,31,44,.08)),
    repeating-linear-gradient(0deg, transparent, transparent 18px, rgba(1,173,250,.06) 18px, rgba(1,173,250,.06) 19px),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(1,173,250,.06) 18px, rgba(1,173,250,.06) 19px),
    linear-gradient(145deg, #d9f0fa 0%, #e8f7ef 45%, #f0f6f2 100%);
  overflow: hidden;
}
.map-ph .trail-line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  background: #eef3f7;
  border-radius: 12px;
  border: 1px solid transparent;
}
.search-bar:focus-within {
  background: var(--surface);
  border-color: var(--brand);
}
.search-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  min-height: 40px;
  font-size: 14px;
}
.search-bar svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }

/* Launcher page */
.launcher {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  padding: 48px 24px 64px;
  max-width: 960px;
  margin: 0 auto;
}
.launcher h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 10px;
}
.launcher .lead {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 52ch;
  margin-bottom: 28px;
}
.launcher-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.launcher-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #fff;
}
.launcher-mark svg { width: 22px; height: 22px; }
.screen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.screen-card {
  display: block;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.screen-card:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  transform: translateY(-2px);
}
.screen-card .kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-deep);
  margin-bottom: 8px;
}
.screen-card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.screen-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.color-swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.color-swatch i {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--brand);
  display: block;
}

@media (max-width: 440px) {
  .device-stage { padding: 0; }
  .phone {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .island { display: none; }
}
