@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #1A3C6E;
  --primary-light: #2554A0;
  --primary-soft: #EBF0FB;
  --accent-green: #00C48C;
  --accent-green-soft: #E6F9F4;
  --accent-red: #FF4757;
  --accent-red-soft: #FFF0F1;
  --accent-gold: #F5A623;
  --bg: #F4F6FB;
  --bg-card: #FFFFFF;
  --text-primary: #0D1B2E;
  --text-secondary: #6B7A99;
  --text-muted: #A0AABF;
  --border: #E4E9F2;
  --border-soft: #F0F3FA;
  --shadow-sm: 0 1px 4px rgba(26,60,110,0.07);
  --shadow-md: 0 4px 16px rgba(26,60,110,0.10);
  --shadow-lg: 0 8px 32px rgba(26,60,110,0.13);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --navbar-h: 60px;
  --bottombar-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.35rem; font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
p { font-size: 0.9rem; line-height: 1.6; color: var(--text-secondary); }
small { font-size: 0.75rem; color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 24px; border-radius: var(--radius-full);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  border: none; outline: none; transition: all 0.2s;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-light); transform: scale(0.98); }
.btn-secondary { background: var(--primary-soft); color: var(--primary); }
.btn-secondary:active { opacity: 0.8; transform: scale(0.98); }
.btn-green { background: var(--accent-green); color: #fff; }
.btn-red { background: var(--accent-red); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text-primary); }
.btn-full { width: 100%; }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

.card {
  background: var(--bg-card); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); padding: 16px;
  border: 1px solid var(--border-soft);
}

.navbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  height: var(--navbar-h); background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.navbar-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.navbar-logo { width: 32px; height: 32px; background: var(--primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.navbar-logo svg { width: 18px; height: 18px; }
.navbar-title { font-size: 0.85rem; font-weight: 800; color: var(--primary); letter-spacing: 0.3px; }
.navbar-title span { color: var(--accent-gold); }
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.navbar-icon-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; }
.navbar-icon-btn svg { width: 18px; height: 18px; color: var(--text-secondary); }
.badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--accent-red); border-radius: 50%; border: 1.5px solid #fff; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; cursor: pointer; text-decoration: none; }

.bottom-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; height: var(--bottombar-h);
  background: var(--bg-card); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around;
  z-index: 100; box-shadow: 0 -4px 16px rgba(26,60,110,0.07);
}
.bb-item { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; cursor: pointer; text-decoration: none; padding: 8px 0; }
.bb-item svg { width: 20px; height: 20px; color: var(--text-muted); transition: color 0.2s; }
.bb-item span { font-size: 0.65rem; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }
.bb-item.active svg { color: var(--primary); }
.bb-item.active span { color: var(--primary); font-weight: 700; }

.page { padding-top: calc(var(--navbar-h) + 16px); padding-bottom: calc(var(--bottombar-h) + 16px); padding-left: 16px; padding-right: 16px; min-height: 100vh; display: none; }
.page.active { display: block; }

.form-group { margin-bottom: 16px; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.form-input { width: 100%; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text-primary); outline: none; transition: border-color 0.2s; }
.form-input:focus { border-color: var(--primary); background: #fff; }
.form-input-icon { position: relative; }
.form-input-icon .form-input { padding-left: 44px; }
.form-input-icon .input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 600; }
.tag-green { background: var(--accent-green-soft); color: var(--accent-green); }
.tag-red { background: var(--accent-red-soft); color: var(--accent-red); }
.tag-blue { background: var(--primary-soft); color: var(--primary); }
.tag-gold { background: #FFF8EC; color: var(--accent-gold); }

.divider { height: 1px; background: var(--border-soft); margin: 16px 0; }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.section-link { font-size: 0.8rem; font-weight: 600; color: var(--primary); text-decoration: none; }

.ticker-wrap { background: var(--primary); padding: 8px 0; overflow: hidden; border-radius: var(--radius-sm); margin-bottom: 16px; }
.ticker-track { display: flex; gap: 32px; animation: ticker 20s linear infinite; white-space: nowrap; padding: 0 16px; }
.ticker-item { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ticker-item span { font-size: 0.75rem; font-weight: 600; color: rgba(255,255,255,0.8); }
.ticker-item .ticker-price { color: #fff; font-weight: 700; }
.ticker-item .ticker-up { color: #5EFFC8; }
.ticker-item .ticker-dn { color: #FF8A95; }
@keyframes ticker { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

.coin-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); cursor: pointer; text-decoration: none; }
.coin-row:last-child { border-bottom: none; }
.coin-icon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 800; flex-shrink: 0; }
.coin-info { flex: 1; }
.coin-name { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.coin-symbol { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.coin-price-wrap { text-align: right; min-width: 80px; }
.coin-price { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.coin-change { font-size: 0.75rem; font-weight: 600; }
.coin-change.up { color: var(--accent-green); }
.coin-change.dn { color: var(--accent-red); }

.stat-card { background: var(--bg-card); border-radius: var(--radius-md); padding: 16px; border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); }
.stat-label { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-bottom: 4px; }
.stat-value { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); }
.stat-sub { font-size: 0.75rem; font-weight: 600; margin-top: 2px; }

.locked-banner { background: linear-gradient(135deg, #FFF8EC 0%, #FFF3E0 100%); border: 1.5px solid var(--accent-gold); border-radius: var(--radius-md); padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.locked-banner svg { width: 20px; height: 20px; color: var(--accent-gold); flex-shrink: 0; margin-top: 1px; }
.locked-banner-text h4 { font-size: 0.85rem; color: var(--accent-gold); }
.locked-banner-text p { font-size: 0.78rem; color: #8B6914; margin-top: 2px; }

#chart-container { border-radius: var(--radius-md); overflow: hidden; background: var(--bg-card); }

.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.tab-btn { flex: 1; padding: 8px; border: none; background: transparent; border-radius: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.tab-btn.active { background: var(--bg-card); color: var(--primary); box-shadow: var(--shadow-sm); }

.tf-row { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; }
.tf-row::-webkit-scrollbar { display: none; }
.tf-pill { padding: 5px 12px; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border); color: var(--text-secondary); background: var(--bg-card); white-space: nowrap; transition: all 0.2s; }
.tf-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.order-form { background: var(--bg-card); border-radius: var(--radius-md); padding: 16px; border: 1px solid var(--border-soft); }
.order-tabs { display: flex; gap: 0; margin-bottom: 16px; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--border); }
.order-tab { flex: 1; padding: 10px; text-align: center; font-size: 0.85rem; font-weight: 700; cursor: pointer; border: none; background: transparent; transition: all 0.2s; }
.order-tab.buy { color: var(--accent-green); }
.order-tab.sell { color: var(--accent-red); }
.order-tab.buy.active { background: var(--accent-green); color: #fff; }
.order-tab.sell.active { background: var(--accent-red); color: #fff; }

.notif-panel { position: fixed; top: var(--navbar-h); right: 0; left: 0; max-width: 430px; margin: 0 auto; background: var(--bg-card); border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 99; padding: 16px; transform: translateY(-100%); opacity: 0; transition: all 0.3s ease; pointer-events: none; }
.notif-panel.open { transform: translateY(0); opacity: 1; pointer-events: all; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.notif-item:last-child { border-bottom: none; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 5px; flex-shrink: 0; }
.notif-dot.read { background: var(--border); }

.profile-avatar-lg { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; color: #fff; margin: 0 auto; box-shadow: var(--shadow-md); background-size: cover; background-position: center; overflow: hidden; }

.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--primary); animation: spin 0.7s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-page { max-width: 430px; margin: 0 auto; min-height: 100vh; background: #fff; display: none; }
.auth-page.active { display: flex; flex-direction: column; }
.auth-header { padding: 48px 24px 24px; }
.auth-body { padding: 0 24px; flex: 1; }
.auth-footer { padding: 24px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; }
.auth-logo-icon { width: 40px; height: 40px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; }

.landing-page { max-width: 430px; margin: 0 auto; min-height: 100vh; background: #fff; display: none; flex-direction: column; }
.landing-page.active { display: flex; }
.landing-hero { background: linear-gradient(160deg, var(--primary) 0%, #2554A0 60%, #1A3C6E 100%); padding: 56px 24px 40px; position: relative; overflow: hidden; }
.landing-hero::before { content: ''; position: absolute; top: -60px; right: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.05); }
.landing-hero::after { content: ''; position: absolute; bottom: -40px; left: -40px; width: 150px; height: 150px; border-radius: 50%; background: rgba(245,166,35,0.12); }

.method-card { border: 1.5px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin-bottom: 12px; cursor: pointer; transition: all 0.2s; }
.method-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.method-header { display: flex; align-items: center; justify-content: space-between; }
.method-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--primary-soft); display: flex; align-items: center; justify-content: center; }

.portfolio-hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); border-radius: var(--radius-lg); padding: 24px 20px; color: #fff; margin-bottom: 16px; }
.portfolio-hero .label { font-size: 0.78rem; opacity: 0.7; font-weight: 500; }
.portfolio-hero .amount { font-size: 2rem; font-weight: 800; margin: 4px 0; }
.portfolio-hero .sub { font-size: 0.82rem; opacity: 0.8; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.text-primary-color { color: var(--primary); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.bb-icon-wrap{width:36px;height:36px;border-radius:12px;display:flex;align-items:center;justify-content:center;transition:all .18s}
.bb-item svg{width:20px;height:20px;color:#A0AABF;transition:color .18s}
.bb-item span{font-size:0.6rem;font-weight:600;color:#A0AABF;transition:color .18s}
.bb-item.active .bb-icon-wrap{background:#EEF3FF}
.bb-item.active svg{color:#0E4BF1}
.bb-item.active span{color:#0E4BF1;font-weight:800}
