/* ============================================================
   首页
   ============================================================ */
.home-page {
  --primary: #4d62c9;
  background: #f4f5f8;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.home-header {
  position: relative;
  background: linear-gradient(140deg, #5063ca 0%, #3b4dad 100%);
  padding: calc(env(safe-area-inset-top) + 22px) 22px 56px;
  border-radius: 0 0 24px 24px;
  overflow: hidden;
}
.home-header::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 240px at 100% 0%, rgba(255, 255, 255, .12), transparent 60%),
    radial-gradient(320px 220px at 0% 100%, rgba(255, 255, 255, .06), transparent 60%);
}
.header-inner { position: relative; z-index: 1; }

.user-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }

.user-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #2a1a08;
  background: linear-gradient(180deg, #d7bd93 0%, #a9885a 100%);
  box-shadow: 0 4px 14px rgba(0,0,0,.18), inset 0 0 0 2px rgba(255,255,255,.18);
}
.user-avatar svg { width: 36px; height: 36px; }

.user-info { flex: 1; min-width: 0; }
.user-name-row { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }

.user-name {
  font-size: 17px; font-weight: 700; color: #fff;
  letter-spacing: .2px; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crown-icon { color: #ffd966; flex-shrink: 0; }

.badge-monthly {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 20px;
  font-size: 11px; font-weight: 500; color: #fff;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.badge-monthly svg { color: #ffd966; }

.user-action-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.13);
}
.renew-btn {
  padding: 9px 22px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 22px;
  color: #fff; font-size: 13px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform .18s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.renew-btn:active { transform: scale(.95); background: rgba(255,255,255,.28); }

.expire-text { font-size: 13px; color: rgba(255,255,255,.92); font-weight: 500; }
.expire-text b { font-weight: 800; margin: 0 2px; }

/* 数据卡 */
.stats-card {
  display: flex; align-items: center;
  margin: -38px 14px 0;
  padding: 22px 0;
  background: #fff;
  border-radius: 20px;
  position: relative; z-index: 2;
  box-shadow: 0 10px 30px -10px rgba(20,30,80,.14), 0 2px 8px rgba(20,30,80,.04);
}
.stat-item { flex: 1; text-align: center; min-width: 0; }
.stat-value {
  font-size: 26px; font-weight: 800; color: #1a1d24;
  letter-spacing: -.5px; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: #9aa0ad; margin-top: 8px; }
.stat-divider { width: 1px; height: 32px; background: #eef0f4; flex-shrink: 0; }

/* 卡片 */
.section-card {
  margin: 12px 14px 0;
  padding: 18px 18px 22px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 10px rgba(20,30,80,.04);
}
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: #1a1d24;
}
.title-bar { width: 3px; height: 14px; background: var(--primary); border-radius: 2px; flex-shrink: 0; }
.title-icon { color: #8b93a4; flex-shrink: 0; }
.section-action { font-size: 12px; color: #9aa0ad; cursor: pointer; user-select: none; }

/* 图标宫格 */
.grid-icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px 8px;
}
.grid-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .16s cubic-bezier(.4, 0, .2, 1);
}
.grid-item:active { transform: scale(.92); }
.grid-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.grid-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }

.gi-purple { background: #eef0fb; color: #5b6fd8; }
.gi-green  { background: #e8f5ed; color: #4a9e6c; }
.gi-blue   { background: #e8eefb; color: #4a78c9; }
.gi-gray   { background: #f0f1f3; color: #6b7280; }

.grid-label {
  font-size: 12px; color: #555a66; line-height: 1.2;
  text-align: center; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

/* 空状态 */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 26px 0 18px; gap: 14px;
}
.empty-icon { width: 58px; height: 58px; color: #d8dbe3; }
.empty-state p { font-size: 13px; color: #9aa0ad; margin: 0; }

.empty-btn {
  margin-top: 4px;
  padding: 11px 30px;
  background: linear-gradient(180deg, #5266cf 0%, #3d4fb5 100%);
  color: #fff;
  border: none; border-radius: 24px;
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px -6px rgba(77, 98, 201, .55);
  transition: transform .18s;
  -webkit-tap-highlight-color: transparent;
}
.empty-btn:active { transform: scale(.96); }

.warning-text {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid #f0f1f4;
  font-size: 11px; color: #b0b5c0;
  text-align: center; line-height: 1.7;
}

.home-bottom-space { height: 96px; }

@media (max-width: 360px) {
  .home-header { padding-left: 18px; padding-right: 18px; }
  .grid-icons { gap: 16px 4px; }
  .grid-icon { width: 42px; height: 42px; border-radius: 12px; }
  .grid-icon svg { width: 19px; height: 19px; }
  .grid-label { font-size: 11px; }
  .section-card { padding: 16px 14px 18px; margin-left: 10px; margin-right: 10px; }
  .stats-card { margin-left: 10px; margin-right: 10px; }
}