/* ──────────────────────────────────────────────────────────────────────────────
 * AllocLab UI v5 — /profile（個人專區、Phase 5a mini）
 * 4 sections：hero / 4 stats / tier card / quick actions
 * ────────────────────────────────────────────────────────────────────────────── */

/* ---------- Header ---------- */
.pf-hdr {
  background: var(--al-bg);
  border-bottom: 1px solid var(--al-border-soft);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}
.pf-hdr__row {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: var(--header-h);
  padding: 0 8px;
  gap: 4px;
}
.pf-hdr__title {
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--al-ink);
  letter-spacing: -0.005em;
}

/* ---------- Main shell ---------- */
.pf-main {
  padding: var(--sp-4) var(--pad-x);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

/* ---------- Hero ---------- */
.pf-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: var(--sp-5) var(--pad-x);
  background: linear-gradient(180deg, rgba(217,119,87,0.06), var(--al-surface));
  border: 1px solid var(--al-border-soft);
  border-radius: var(--radius-card);
}

.pf-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--al-active-bg);
  color: var(--al-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ff-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0;
  border: 2px solid var(--al-accent);
  box-shadow: 0 4px 16px rgba(217, 119, 87, 0.15);
}

.pf-hero__name {
  margin: 6px 0 0;
  font-family: var(--ff-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--al-ink-deep);
  letter-spacing: -0.005em;
}

.pf-hero__email {
  font-size: 0.78rem;
  color: var(--al-ink-muted);
  font-variant-numeric: tabular-nums;
}

.pf-hero__tier {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--al-active-bg);
  color: var(--al-accent);
  font-size: 0.78rem;
  font-weight: 500;
}
.pf-hero__tier strong { font-weight: 700; }
.pf-hero__tier svg { width: 14px; height: 14px; }

/* ---------- Section heading ---------- */
.pf-sec__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin: 0 4px var(--sp-2);
  min-height: 24px;
}
.pf-sec__head h3 {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--al-ink-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- Stats grid (4 cell) ---------- */
.pf-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: var(--sp-3);
  background: var(--al-surface);
  border: 1px solid var(--al-border-soft);
  border-radius: var(--radius-card);
}
.pf-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--radius-inner);
  text-align: center;
  transition: background var(--t-fast) var(--ease);
}
.pf-stat:hover { background: var(--al-surface-2); }
.pf-stat__v {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--al-ink);
  line-height: 1;
}
.pf-stat__k {
  font-size: 0.68rem;
  color: var(--al-ink-muted);
  letter-spacing: 0.04em;
}

/* ---------- Tier card ---------- */
.pf-tier {
  background: var(--al-surface);
  border: 1px solid var(--al-border-soft);
  border-radius: var(--radius-card);
  padding: var(--sp-4);
}
.pf-tier__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
}
.pf-tier__pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  background: var(--al-active-bg);
  color: var(--al-accent);
  border: 1px solid var(--al-accent);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.pf-tier__price {
  font-size: 0.78rem;
  color: var(--al-ink-muted);
}
.pf-tier__price b {
  color: var(--al-ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  margin-right: 2px;
}
.pf-tier__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--al-border-soft);
  border-bottom: 1px solid var(--al-border-soft);
}
.pf-tier__row {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-sm);
}
.pf-tier__row .k { color: var(--al-ink-muted); }
.pf-tier__row .v {
  color: var(--al-ink);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.pf-tier__cta-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--sp-3);
}
.pf-tier__cta-up {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  background: var(--al-accent);
  color: #fff;
  border-radius: var(--radius-inner);
  font-size: var(--fs-base);
  font-weight: 600;
  min-height: 44px;
  transition: background var(--t-fast) var(--ease);
}
.pf-tier__cta-up:hover { background: var(--al-accent-2); }
.pf-tier__cta-up svg { width: 14px; height: 14px; }
.pf-tier__cta-mng {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  background: transparent;
  color: var(--al-ink-2);
  border: 1px solid var(--al-border);
  border-radius: var(--radius-inner);
  font-size: var(--fs-sm);
  min-height: 40px;
  transition: color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.pf-tier__cta-mng:hover {
  color: var(--al-accent);
  border-color: var(--al-accent);
}

/* ---------- List rows ---------- */
.pf-list {
  background: var(--al-surface);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.pf-row {
  display: grid;
  grid-template-columns: 36px 1fr 16px;
  gap: 12px;
  align-items: center;
  padding: 12px var(--sp-4);
  border-top: 1px solid var(--al-border-soft);
  width: 100%;
  text-align: left;
  min-height: 56px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.pf-row:first-child { border-top: 0; }
.pf-row:hover { background: var(--al-surface-2); }

.pf-row__ico {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-inner);
  background: var(--al-surface-2);
  color: var(--al-ink-2);
}
.pf-row__ico svg {
  width: 18px;
  height: 18px;
}
.pf-row__lbl {
  min-width: 0;
}
.pf-row__lbl .k {
  font-size: var(--fs-base);
  color: var(--al-ink);
  font-weight: 500;
  line-height: 1.4;
}
.pf-row__lbl .sub {
  font-size: var(--fs-xs);
  color: var(--al-ink-muted);
  margin-top: 2px;
}
.pf-row__chev {
  width: 16px;
  height: 16px;
  color: var(--al-ink-muted);
  flex: 0 0 auto;
}
.pf-row__chev svg { width: 100%; height: 100%; }

.pf-row.pf-row--signout {
  grid-template-columns: 36px 1fr;
}
.pf-row--signout .pf-row__lbl .k {
  color: var(--al-accent);
  font-weight: 600;
}
.pf-row--signout .pf-row__ico {
  background: var(--al-active-bg);
  color: var(--al-accent);
}

/* ---------- Version footer ---------- */
.pf-version {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--al-ink-muted);
  padding: var(--sp-3) var(--pad-x);
  letter-spacing: 0.02em;
}

/* ---------- Desktop ≥768 ---------- */
@media (min-width: 768px) {
  .pf-hdr__row,
  .pf-main {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
  .pf-hero {
    padding: var(--sp-7) var(--pad-x);
  }
  .pf-tier__cta-row {
    flex-direction: row;
  }
  .pf-tier__cta-up { flex: 2; }
  .pf-tier__cta-mng { flex: 1; }
}
