/* ============================================
   联盛森宝 · H5 智慧服务平台
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --green-900: #1b5e20;
  --green-700: #2e7d32;
  --green-500: #43a047;
  --green-100: #c8e6c9;
  --gold: #f9a825;
  --gold-light: #fff8e1;
  --bg: #f0f4f0;
  --card-bg: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-light: #9a9ab0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  padding-bottom: env(safe-area-inset-bottom);
}

a { text-decoration: none; color: inherit; }
button { border: none; outline: none; cursor: pointer; font-family: inherit; }

/* ---------- Background Decoration ---------- */
.bg-decoration {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
}

.c1 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, var(--green-500), transparent);
  top: -80px; right: -80px;
}

.c2 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--gold), transparent);
  bottom: 120px; left: -60px;
}

.c3 {
  width: 150px; height: 150px;
  background: radial-gradient(circle, var(--green-700), transparent);
  bottom: -40px; right: 20px;
}

/* ---------- Container ---------- */
.container {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Hero Header ---------- */
.hero {
  text-align: center;
  padding: 32px 0 28px;
  animation: fadeDown 0.7s ease forwards;
}

.hero-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  position: relative;
}

.hero-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-500);
  margin-right: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 8px;
}

.title-sen {
  color: var(--green-700);
  text-shadow: 0 2px 8px rgba(46,125,50,0.2);
}

.title-bao {
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(249,168,37,0.25);
}

.title-sub {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 3px;
}

.hero-desc {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* ---------- Card Grid ---------- */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 8px 0 20px;
  animation: fadeUp 0.8s ease 0.15s both;
}

/* ---------- Single Card ---------- */
.nav-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  padding: 16px 18px 16px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Ripple effect base */
.nav-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(0,0,0,0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.nav-card:active::after {
  opacity: 1;
}

.nav-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.nav-card:active {
  transform: translateY(0px) scale(0.98);
  box-shadow: var(--shadow-sm);
}

/* Card Icon */
.card-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.card-icon {
  width: 26px;
  height: 26px;
}

/* Card Text */
.card-body {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Card Arrow */
.card-arrow {
  color: var(--text-light);
  flex-shrink: 0;
  transition: transform 0.3s, color 0.3s;
}

.nav-card:hover .card-arrow {
  transform: translateX(3px);
  color: var(--green-500);
}

/* ---------- NFC Guide ---------- */
.nfc-guide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 16px;
  padding: 12px 16px;
  background: rgba(46,125,50,0.06);
  border-radius: var(--radius-sm);
  animation: fadeUp 0.8s ease 0.4s both;
}

.nfc-icon {
  color: var(--green-500);
  display: flex;
  align-items: center;
}

.nfc-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  margin-top: auto;
  padding: 16px 0 8px;
  animation: fadeUp 0.8s ease 0.5s both;
}

.footer-text {
  font-size: 0.7rem;
  color: var(--text-light);
  line-height: 1.8;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: #fff;
  width: 300px;
  border-radius: var(--radius-lg);
  padding: 32px 24px 24px;
  text-align: center;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal-box {
  transform: scale(1) translateY(0);
}

.modal-icon {
  color: var(--gold);
  margin-bottom: 14px;
}

.modal-qr {
  display: block;
  width: 180px;
  height: 180px;
  margin: 0 auto 14px;
  border-radius: 8px;
  border: 1px solid #eee;
}

.modal-qr-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-light);
  margin-bottom: 16px;
  line-height: 1.6;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  padding: 12px 0;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s;
}

.modal-btn.primary {
  background: var(--green-500);
  color: #fff;
}

.modal-btn.primary:active {
  background: var(--green-700);
  transform: scale(0.97);
}

.modal-btn.secondary {
  background: #f0f0f0;
  color: var(--text-secondary);
}

.modal-btn.secondary:active {
  background: #e0e0e0;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.8);
  color: #fff;
  font-size: 0.82rem;
  padding: 10px 22px;
  border-radius: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
  z-index: 200;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Animations ---------- */
@keyframes fadeDown {
  0%   { opacity: 0; transform: translateY(-18px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUp {
  0%   { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ---------- Responsive ---------- */
@media (min-width: 500px) {
  .container {
    padding: 32px 24px;
  }

  .card-grid {
    gap: 16px;
  }

  .nav-card {
    padding: 20px 22px 20px 20px;
  }

  .card-icon-wrap {
    width: 58px;
    height: 58px;
  }

  .card-icon {
    width: 30px;
    height: 30px;
  }
}

/* ---------- Safe area for notch phones ---------- */
@supports (padding-top: env(safe-area-inset-top)) {
  .container {
    padding-left: calc(16px + env(safe-area-inset-left));
    padding-right: calc(16px + env(safe-area-inset-right));
  }
}
