:root {
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --text: #333333;
  --text-secondary: #999999;
  --gradient: linear-gradient(135deg, #5D69D6 0%, #825DCB 100%);
  --gradient-orange: linear-gradient(135deg, #FF8C37 0%, #FFA500 100%);
  --gradient-green: linear-gradient(135deg, #52A352 0%, #4CAF50 100%);
  --primary: #5D69D6;
  --blue: #5C7CFA;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
input, button, select, textarea { font-family: inherit; font-size: 14px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 14px 20px; border: none; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; color: #fff; background: var(--gradient); }
.btn:active { opacity: .9; }
.btn-secondary { background: #EBF1FF; color: var(--blue); }
.btn-orange { background: var(--gradient-orange); }
.btn-green { background: var(--gradient-green); }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.input-group { margin-bottom: 14px; }
.input-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input-wrap { display: flex; align-items: center; background: #F2F5F9; border-radius: 10px; padding: 0 14px; }
.input-wrap input { flex: 1; border: none; background: transparent; padding: 14px 0; outline: none; }
.page { min-height: 100vh; padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px); }
.page-no-nav { padding-bottom: 16px; }
.page-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff; position: sticky; top: 0; z-index: 100; }
.page-header .title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; }
.page-header .back { font-size: 22px; cursor: pointer; width: 40px; }
.page-header .actions { display: flex; gap: 12px; width: 40px; justify-content: flex-end; }
.sub-header { display: flex; align-items: center; padding: 12px 16px; background: #fff; border-bottom: 1px solid #eee; }
.sub-header .back { font-size: 22px; cursor: pointer; margin-right: 12px; }
.sub-header .title { font-size: 17px; font-weight: 600; flex: 1; text-align: center; margin-right: 34px; }
.container { padding: 16px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.amount { color: var(--blue); font-weight: 700; }
.amount-lg { font-size: 24px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; }
.badge-success { background: #E8F5E9; color: #4CAF50; }
.badge-warning { background: #FFF3E0; color: #F37B1D; }
.badge-danger { background: #FFEBEE; color: #E57373; }
.badge-gray { background: #F3F4F6; color: #666; }
.tabs { display: flex; background: #fff; border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.tab { flex: 1; text-align: center; padding: 10px; border-radius: 10px; font-size: 13px; cursor: pointer; color: var(--text-secondary); }
.tab.active { background: var(--gradient); color: #fff; font-weight: 600; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: calc(var(--nav-height) + var(--safe-bottom)); padding-bottom: var(--safe-bottom); background: rgba(255,255,255,0.92); backdrop-filter: blur(12px); border-top: 1px solid rgba(0,0,0,0.05); display: flex; z-index: 200; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-secondary); cursor: pointer; padding-top: 8px; }
.nav-item.active { color: var(--primary); font-weight: 600; }
.nav-item .icon { font-size: 22px; }
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.75); color: #fff; padding: 10px 20px; border-radius: 8px; z-index: 9999; font-size: 14px; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 360px; overflow: hidden; }
.modal-header { background: var(--gradient); color: #fff; padding: 16px; text-align: center; font-size: 18px; font-weight: 700; }
.modal-body { padding: 16px; }
.modal-footer { display: flex; gap: 10px; padding: 0 16px 16px; }
.modal-footer button { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-card { background: #F5F7FA; border-radius: 12px; padding: 14px; text-align: center; }
.stat-card .label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.stat-card .value { font-size: 20px; font-weight: 700; }
.splash { position: fixed; inset: 0; background: var(--gradient); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 99999; color: #fff; }
.splash .logo { font-size: 28px; font-weight: 800; margin-bottom: 8px; }
.splash .tagline { opacity: .85; margin-bottom: 40px; }
.loader { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lang-overlay { position: fixed; top: 60px; right: 16px; width: 260px; max-height: 400px; overflow-y: auto; background: #fff; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); z-index: 300; }
.lang-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.lang-item:hover { background: #f8f9fb; }
.login-page { min-height: 100vh; background: var(--gradient); padding: 20px; }
.login-hero { text-align: center; color: #fff; padding: 30px 0 20px; }
.login-hero h1 { font-size: 28px; margin-bottom: 8px; }
.login-card { background: #fff; border-radius: 24px; padding: 24px; margin-top: 10px; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product-card { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.product-card .img { height: 140px; background: #f0f0f0; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.product-card .info { padding: 10px; }
.product-card .name { font-size: 13px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card { background: var(--gradient); border-radius: 20px; padding: 20px; color: #fff; margin-bottom: 16px; }
.profile-card .avatar { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; }
.upload-area { border: 2px dashed #DCDFE6; border-radius: 12px; padding: 40px 20px; text-align: center; background: #F2F5F9; cursor: pointer; }
.crypto-card { border: 1px solid #eee; border-radius: 12px; overflow: hidden; margin-bottom: 10px; cursor: pointer; }
.crypto-card.selected { border-color: var(--primary); }
.crypto-card .head { padding: 10px 14px; background: #EDE7F6; font-weight: 600; font-size: 13px; }
.crypto-card.selected .head { background: var(--gradient); color: #fff; }
.crypto-card .addr { padding: 10px 14px; font-family: monospace; font-size: 11px; word-break: break-all; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.empty { text-align: center; padding: 40px; color: var(--text-secondary); }
.list-row { display: flex; align-items: center; padding: 14px 0; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.list-row:last-child { border-bottom: none; }
.list-row .arrow { color: #ccc; margin-left: auto; }

/* ── 0618: carousels & marquees ── */
.banner-carousel { position: relative; }
.banner-track { display: flex; transition: transform 0.5s ease; }
.banner-slide { flex: 0 0 100%; cursor: pointer; }
.banner-slide .img { height: 140px; background-size: cover; background-position: center; }
.banner-dots { display: flex; justify-content: center; gap: 6px; padding: 10px; }
.banner-dots span { width: 6px; height: 6px; border-radius: 50%; background: #ddd; cursor: pointer; transition: all 0.2s; }
.banner-dots span.active { width: 18px; border-radius: 3px; background: var(--primary); }
.marquee-wrap { overflow: hidden; margin: 0 -16px 12px; }
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee-left 40s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }
.marquee-track .product-card { flex: 0 0 140px; margin-bottom: 0; }
.marquee-track .product-card .img { height: 120px; }
.feed-scroll-wrap { overflow: hidden; max-height: 200px; border: 1px solid #E8E0F5; border-radius: var(--radius); background: #fff; }
.feed-scroll-inner { animation: feed-scroll-up 25s linear infinite; }
.feed-scroll-inner:hover { animation-play-state: paused; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #f5f5f5; }
.brand-link { white-space: nowrap; padding: 8px 16px; background: #fff; border-radius: 20px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.brand-link:active { opacity: 0.85; }
.grab-goods-bar { overflow: hidden; background: #111; border-radius: var(--radius); margin-bottom: 12px; padding: 10px 0; }
.grab-goods-track { display: flex; gap: 16px; width: max-content; animation: marquee-left 35s linear infinite; }
.grab-goods-item { flex: 0 0 100px; text-align: center; color: #fff; }
.grab-goods-item img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: #222; }
.grab-goods-item .price { font-size: 11px; margin-top: 4px; color: #FFD54F; font-weight: 700; }
@keyframes marquee-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes feed-scroll-up { from { transform: translateY(0); } to { transform: translateY(-50%); } }
