/* airdrop-v2 — hidden-amount hourly tasks + AI review. Self-contained per prototype principle. */

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ============ APP SHELL ============ */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 680px) 320px;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}

/* ============ SIDEBAR ============ */
.sidebar { position: sticky; top: 24px; height: calc(100vh - 48px); display: flex; flex-direction: column; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 14px; font-size: 32px; font-weight: 800; margin-bottom: 36px; color: var(--text); }
.brand img { width: 42px; height: 42px; object-fit: contain; }
.sidebar nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar nav a {
  padding: 14px 18px; color: var(--text-soft); border-radius: 999px; font-weight: 600; font-size: 16px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.sidebar nav a.active, .sidebar nav a:hover { background: var(--surface); color: var(--text); box-shadow: var(--shadow-card); }
.new-post { border-radius: 999px; background: var(--cta-bg); color: var(--cta-text); font-weight: 700; padding: 14px 22px; font-size: 16px; }

/* ============ MAIN ============ */
.main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.topbar {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px;
}
.topbar .back {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-soft);
  transition: background 0.15s, color 0.15s;
}
.topbar .back:hover { background: var(--surface-soft); color: var(--text); }
.topbar h1 { font-size: 28px; margin: 0; font-weight: 700; letter-spacing: -0.01em; flex: 1; }
.topbar-brand { display: none; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 22px; letter-spacing: -0.01em; }
.topbar-brand img { width: 24px; height: 24px; object-fit: contain; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.wallet-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 700; font-size: 13px;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
}
.wallet-chip:hover { background: var(--surface); border-color: var(--primary); transform: translateY(-1px); }
.wallet-chip .ic { display: inline-flex; align-items: center; line-height: 1; }
.wallet-chip .ic svg { display: block; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }

/* ============ HERO ============ */
.claim-hero {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-md);
  padding: 28px 26px 26px;
  color: white;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.claim-hero.ready::after {
  content: "";
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 50%, transparent 70%);
  animation: hero-shimmer 3.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hero-shimmer {
  0%, 100% { transform: translate(-30%, -30%) rotate(0); }
  50%      { transform: translate(30%, 30%) rotate(0); }
}
.claim-hero::before {
  content: "";
  position: absolute;
  right: -90px; top: -90px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,0.15), transparent);
  pointer-events: none;
}
.claim-hero .gift { line-height: 1; margin-bottom: 10px; color: white; position: relative; z-index: 1; }
.claim-hero .gift svg { display: block; margin: 0 auto; }
.claim-hero .title {
  font-size: 16px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin: 0;
  letter-spacing: 0.04em;
}
.claim-hero .amount {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 4px 0 14px;
  font-variant-numeric: tabular-nums;
}
.claim-hero .amount small { font-size: 18px; font-weight: 700; opacity: 0.9; margin-left: 4px; }
.hero-badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  font-size: 12px;
  font-weight: 700;
  color: white;
  position: relative;
  z-index: 1;
}
.claim-meta {
  margin: 0;
  font-size: 12px;
  color: rgba(255,255,255,0.78);
  position: relative;
  z-index: 1;
}
.claim-meta b { color: white; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ============ FACE-VERIFY BANNER ============ */
.fv-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
}
.fv-banner[hidden] { display: none !important; }
.fv-banner .fv-ic { flex-shrink: 0; display: grid; place-items: center; color: #b45309; }
.fv-banner p { margin: 0; }
.fv-banner a { font-weight: 800; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }

/* ============ DEMO ROW ============ */
.demo-row { display: flex; align-items: center; gap: 8px; }
.demo-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
#ff-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
#ff-btn:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--primary-soft); }

/* ============ SECTION HEADER ============ */
.section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 18px 4px 8px;
}
.section-h h2 { font-size: 17px; font-weight: 800; margin: 0; }
.section-h .meta { color: var(--text-soft); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ============ TASKS ============ */
.tasks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.15s;
}
.task:hover { border-color: var(--primary); }
.task .t-ic {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.task .t-body { flex: 1; min-width: 0; }
.task .t-body b { display: block; font-size: 14px; font-weight: 800; }
.task .t-body small { display: block; margin-top: 3px; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.task .t-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.t-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  transition: opacity 0.15s;
}
.t-link:hover { opacity: 0.75; text-decoration: underline; text-underline-offset: 2px; }

/* ============ HISTORY / FEED ============ */
.history { padding: 16px 18px; }
.history-list {
  list-style: none; padding: 0; margin: 0;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 6px;
}
.history-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.history-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.history-list li:first-child { padding-top: 0; }
.history-list .ic {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: grid; place-items: center;
  font-size: 14px;
  flex-shrink: 0;
}
.history-list .meta { flex: 1; min-width: 0; }
.history-list .meta b { display: block; font-weight: 700; font-size: 13px; }
.history-list .meta small { color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.history-list .amt {
  font-weight: 800; font-size: 13px;
  color: var(--success);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-list .amt small { font-size: 10px; opacity: 0.7; margin-left: 3px; }

/* ============ DAILY TOTALS ============ */
.daily { padding: 16px 18px; }
.daily-list {
  list-style: none; padding: 0; margin: 0;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 6px;
}
.daily-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.daily-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.daily-list li:first-child { padding-top: 0; }
.daily-list .d { width: 78px; flex-shrink: 0; font-size: 13px; font-weight: 700; color: var(--text-soft); }
.daily-list li.today .d { color: var(--primary-dark); }
.daily-list .bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
}
.daily-list .bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.4s ease;
}
.daily-list .amt {
  flex-shrink: 0;
  font-weight: 800; font-size: 13px;
  color: var(--success);
  font-variant-numeric: tabular-nums;
}
.daily-list .amt small { font-size: 10px; opacity: 0.7; margin-left: 3px; }

/* ============ PULSE UTILITY ============ */
.utility { padding: 16px 18px; }
.uses {
  list-style: none; padding: 0; margin: 0 0 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.uses li { display: flex; align-items: flex-start; gap: 10px; }
.uses li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.uses .u-ic {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.uses .u-body b { display: block; font-size: 13px; font-weight: 800; }
.uses .u-body small { display: block; margin-top: 2px; color: var(--text-soft); font-size: 12px; line-height: 1.5; }
.u-note {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-soft);
}
.u-note + .u-note { padding-top: 4px; border-top: 0; }
.u-note.muted { color: var(--text-muted); }

/* ============ RIGHT PANEL ============ */
.right-panel { display: flex; flex-direction: column; gap: 18px; }
.right-panel .card { padding: 18px; }
.right-panel h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; }
.right-panel p { font-size: 13px; line-height: 1.6; margin: 0 0 8px; color: var(--text); }
.right-panel p:last-child { margin-bottom: 0; }

/* Invite card */
.invite-card {
  padding: 18px;
  background: linear-gradient(180deg, var(--surface), var(--primary-soft));
}
.inv-sub { color: var(--text-soft); font-size: 13px; line-height: 1.6; margin: 0 0 8px; }
.inv-sub b { color: var(--primary-dark); }
.inv-code {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}
.inv-code code {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px dashed var(--primary);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.05em;
  text-align: center;
}
.inv-code button {
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--cta-bg);
  color: var(--cta-text);
  font-weight: 700;
  font-size: 13px;
  transition: transform 0.15s;
}
.inv-code button:active { transform: scale(0.96); }
.inv-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.inv-stats div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: center;
}
.inv-stats b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.inv-stats small { color: var(--text-soft); font-size: 11px; }
.inv-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.inv-list li { display: flex; align-items: center; gap: 10px; }
.inv-list .av {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 800;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.inv-list div { flex: 1; min-width: 0; }
.inv-list b { display: block; font-size: 13px; font-weight: 700; }
.inv-list small { color: var(--text-soft); font-size: 11px; }
.inv-list .c { font-weight: 800; font-size: 13px; color: var(--success); font-variant-numeric: tabular-nums; }
.inv-note { color: var(--text-muted); font-size: 11px; text-align: center; margin: 0; }
.inv-recent {
  display: block; text-decoration: none; color: inherit;
  margin: 0 -10px 10px; padding: 8px 10px 6px;
  border-radius: var(--radius-sm, 12px);
  transition: background 0.15s;
}
.inv-recent:hover { background: var(--primary-soft, #eef2ff); }
.inv-recent .inv-list { margin-bottom: 8px; }
.inv-more {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--primary);
}
.inv-more b { font-variant-numeric: tabular-nums; }

/* Rules card */
.rules { background: linear-gradient(180deg, var(--surface), var(--primary-soft)); }
.rules ol {
  padding-left: 0;
  margin: 8px 0 0;
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rules ol li {
  counter-increment: step;
  padding-left: 28px;
  position: relative;
  font-size: 13px;
  line-height: 1.55;
}
.rules ol li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 800;
  display: grid; place-items: center;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--text);
  color: white;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-float);
  z-index: 1400;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ BACK TO TOP ============ */
.to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--text);
  color: white;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.32);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, background 0.15s;
}
.to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
@media (hover: hover) {
  .to-top:hover { background: var(--primary-dark); }
}
.to-top:active { transform: translateY(0) scale(0.94); }

/* ============ MOBILE NAV ============ */
.mobile-nav { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 12px;
    padding-bottom: 96px;
    gap: 12px;
  }
  .sidebar, .right-panel { display: none; }

  .topbar {
    position: sticky; top: 0; z-index: 10;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 4px; margin: 0 0 12px;
  }
  .topbar h1 { display: none; }
  .topbar-brand { display: inline-flex; flex: 1; }

  .claim-hero .amount { font-size: 42px; }

  .uses { grid-template-columns: 1fr; }

  .task { flex-wrap: wrap; }
  .task .t-right { flex-direction: row; align-items: center; width: 100%; justify-content: flex-end; }

  .mobile-nav {
    position: fixed;
    left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: 10px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 20;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
  }
  .mobile-nav.nav-hidden {
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    pointer-events: none;
  }
  .mobile-nav a { text-align: center; font-size: 12px; color: var(--text-soft); padding: 8px 4px; }
  .mobile-nav a.active { color: var(--text); font-weight: 600; }
  .mobile-nav .compose-btn {
    width: 46px; height: 46px;
    margin: auto; padding: 0;
    border-radius: 50%;
    background: var(--cta-bg); color: var(--cta-text);
    display: grid; place-items: center; line-height: 1;
  }

  .to-top {
    bottom: 88px; right: 16px; width: 42px; height: 42px;
    transition: opacity 0.2s, transform 0.2s, background 0.15s,
                bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }
  body.nav-hidden .to-top { bottom: 28px; }
}

/* ============ 解鎖狀態卡 ============ */
.unlock-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.unlock-card[hidden] { display: none !important; }
.ul-head { display: flex; align-items: center; gap: 8px; }
.ul-head b { font-size: 14px; }
.ul-ic { display: inline-flex; color: var(--primary); }
.unlock-card.open .ul-ic { color: #16a34a; }
.ul-pill { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ul-pill.amber { background: #fef3c7; color: #b45309; }
.ul-pill.green { background: #dcfce7; color: #15803d; }
.unlock-card .cd { display: flex; gap: 10px; }
.unlock-card .cd span { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; padding: 10px 0; border-radius: 14px; background: var(--surface-soft, #f8fafc); border: 1px solid var(--line); }
.unlock-card .cd b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.unlock-card .cd i { font-style: normal; font-size: 11px; color: var(--text-muted); }
.ul-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.ul-btn { display: block; text-align: center; padding: 11px; border-radius: 999px; background: var(--cta-bg); color: var(--cta-text); font-size: 13.5px; font-weight: 800; transition: background 0.15s, transform 0.15s; }
.ul-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }

/* Earnings source split card */
.split-card { padding: 16px 18px; }
.sp-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0 14px;
  background: var(--primary-soft);
}
.sp-bar i { display: block; height: 100%; }
.sp-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sp-list li { display: flex; align-items: center; gap: 10px; }
.sp-list .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sp-list div { flex: 1; min-width: 0; }
.sp-list b { display: block; font-size: 13px; font-weight: 700; }
.sp-list small { color: var(--text-soft); font-size: 11px; }
.sp-list .v {
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.sp-list .v small { display: block; font-weight: 600; }
.sp-list .sp-total { border-top: 1px dashed var(--line); padding-top: 10px; }
.sp-list .sp-total .v { color: var(--primary); }

/* === Spy 唯讀模式 === */
.spy-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 16px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--primary-soft, #eef2ff);
  color: var(--primary, #4f46e5);
  font-size: 13px;
}
.spy-pill {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--primary, #4f46e5);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.spy-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(8px);
  padding: 10px 18px;
  border-radius: 999px;
  background: #1e293b;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
.spy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
