:root {
  --bg: #0b101b;
  --surface: #141c2f;
  --surface-2: #1c2640;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f6fc;
  --muted: #93a1be;
  --gold: #ffd737;
  --gold-dark: #d9a700;
  --primary: #4f7cff;
  --success: #22c55e;
  --danger: #ef4444;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 84px;
}

.hidden { display: none !important; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.px-4 { padding: 0 4px; }
.text-right { text-align: right; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: rgba(11, 16, 27, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, #fff, var(--gold));
  box-shadow: 0 0 12px rgba(255, 215, 55, 0.7);
}
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: 0.4px; }
.brand-sub { font-size: 11px; color: var(--muted); }

.credit-pill {
  background: var(--surface-2);
  border: 1px solid rgba(255, 215, 55, 0.35);
  color: var(--gold);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pill-arrow { margin-left: 4px; opacity: 0.8; }

.renew-banner {
  margin: 10px 14px 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 215, 55, 0.2), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(255, 215, 55, 0.45);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: #ffe787; cursor: pointer;
}
.renew-btn {
  background: var(--gold); color: #111;
  padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 12px;
}

.main-content { padding: 12px 14px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.login-card { margin: 20px 14px; text-align: center; }
.hero-badge {
  display: inline-block;
  background: rgba(79, 124, 255, 0.16);
  color: #93b4ff;
  padding: 4px 12px; border-radius: 999px; font-size: 12px; margin-bottom: 10px;
}
.card h2 { margin: 6px 0 8px; font-size: 20px; }
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; }

.muted { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.muted-sm { color: var(--muted); font-size: 12px; }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }

input[type="text"], textarea, select {
  width: 100%;
  background: #0e1526;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { resize: vertical; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }

.segmented {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: #0d1322; padding: 4px; border-radius: 12px;
}
.seg-btn {
  border: none; background: transparent; color: var(--muted);
  padding: 9px 6px; border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.seg-btn.active { background: var(--surface-2); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.25); }

.btn {
  border: none; border-radius: 12px; padding: 11px 16px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-full { width: 100%; }
.btn-lg { padding: 14px 16px; font-size: 15px; }
.btn-primary { background: linear-gradient(135deg, #4f7cff, #3b5bdb); color: #fff; }
.btn-gold { background: linear-gradient(135deg, var(--gold), #f59e0b); color: #111827; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.2); color: var(--text); }
.btn-link { background: none; border: none; color: #8ab0ff; font-size: 13px; cursor: pointer; padding: 0; }
.btn-chip {
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer;
}
.btn-chip.recording { background: rgba(239, 68, 68, 0.25); border-color: var(--danger); color: #fca5a5; }

.divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 14px; color: var(--muted); font-size: 12px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.helper-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-pass { background: rgba(34, 197, 94, 0.18); color: #4ade80; }
.badge-warn { background: rgba(255, 215, 55, 0.18); color: var(--gold); }

.notice-box {
  background: rgba(79, 124, 255, 0.14); border: 1px solid rgba(79, 124, 255, 0.3);
  border-radius: 10px; padding: 8px 10px; font-size: 12px; color: #bdd2ff; margin-bottom: 10px;
}

.dims-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dim-item {
  background: #0e1526; border-radius: 10px; padding: 7px 8px;
  border: 1px solid var(--border); font-size: 11px;
}
.dim-score { color: var(--gold); font-weight: 700; font-size: 13px; }

.version-tabs { display: flex; gap: 6px; overflow-x: auto; }
.ver-btn {
  flex: 1; padding: 8px 10px; border-radius: 10px;
  background: #0e1526; border: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer;
}
.ver-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(255,215,55,0.08); }

.upload-box {
  background: #0e1526; border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 12px; padding: 12px;
}
.upload-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.upload-btn { margin-top: 8px; padding: 7px 12px; font-size: 12px; }
.uploaded-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-pill {
  background: rgba(34,197,94,0.16); color: #86efac;
  padding: 3px 9px; border-radius: 999px; font-size: 11px;
}

.stack-list { display: flex; flex-direction: column; gap: 10px; }
.market-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.market-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.market-title { font-weight: 700; font-size: 15px; }
.hook-preview {
  background: #0d1322; border-left: 3px solid var(--gold);
  padding: 8px 10px; border-radius: 8px; margin: 8px 0; font-size: 13px;
}
.hook-preview .gold { color: var(--gold); font-weight: 700; }

.progress-bar {
  height: 8px; border-radius: 999px; background: #0d1322; overflow: hidden; margin: 8px 0;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold));
  transition: width 0.4s ease;
}
.video-preview {
  width: 100%; max-height: 460px; border-radius: 12px;
  background: #000; margin: 10px 0;
}
.meta-box {
  background: #0d1322; border-radius: 10px; padding: 10px;
  font-size: 12px; white-space: pre-wrap; color: #cbd5e1;
  max-height: 150px; overflow-y: auto;
}

.account-hero { background: linear-gradient(145deg, #17223b, #121a2d); border-color: rgba(255,215,55,0.22); }
.acc-top { display: flex; justify-content: space-between; align-items: flex-end; }
.big-num { font-size: 36px; font-weight: 800; color: var(--gold); line-height: 1.1; }
.exp-text { font-size: 16px; font-weight: 700; }
.key-box { background: rgba(0,0,0,0.28); padding: 10px; border-radius: 10px; }
.key-val-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.key-val-row code { font-size: 12px; color: #93c5fd; word-break: break-all; }

.plans-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-card {
  background: #0e1526; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px; font-size: 12px;
}
.plan-price { color: var(--gold); font-size: 16px; font-weight: 800; margin: 2px 0; }

.ref-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #0e1526; padding: 10px 12px; border-radius: 12px;
}
.ref-code { color: var(--gold); font-size: 16px; letter-spacing: 1px; }
.guide-list { padding-left: 18px; margin: 8px 0 0; color: #cbd5e1; font-size: 13px; }
.guide-list li { margin-bottom: 6px; }

.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 40;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(15, 22, 37, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.nav-item {
  border: none; background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; cursor: pointer; padding: 4px 0;
}
.nav-item.active { color: var(--gold); font-weight: 700; }
.nav-ico { font-size: 19px; }

.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, 0.72);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  width: 100%; max-width: 520px; max-height: 82vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px 20px 0 0; padding: 18px 16px 28px;
}

.toast {
  position: fixed; top: 72px; left: 50%; transform: translateX(-50%);
  z-index: 99; background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 215, 55, 0.5);
  color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 13px; max-width: 90%; text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}
