:root {
  --bg: #0a0e27;
  --bg-soft: #131836;
  --card: #1a1f3d;
  --card-hover: #222850;
  --border: #232a52;
  --text: #f1f3ff;
  --text-2: #a8b0d6;
  --text-3: #6f78a3;
  --primary: #f7b500;
  --primary-2: #ff7a00;
  --green: #16c784;
  --red: #ea3943;
  --blue: #4f8bff;
  --purple: #a78bfa;
  --gradient: linear-gradient(135deg, #f7b500 0%, #ff7a00 100%);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }

/* ============ Header ============ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 39, 0.92);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  background: var(--gradient);
  border-radius: 8px;
  font-weight: 800;
  color: #1a1300;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(247, 181, 0, 0.35);
}
.logo-text { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }

.header-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-2);
  transition: background 0.2s;
}
.icon-btn:active { background: rgba(255,255,255,0.08); }

/* ============ Ticker ============ */
.ticker {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.18);
  padding: 8px 0;
}
.ticker-track {
  display: flex;
  gap: 24px;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  padding-left: 100%;
}
.ticker-item { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.ticker-symbol { color: var(--text-2); font-weight: 600; }
.ticker-price { color: var(--text); font-weight: 600; }
.ticker-change { font-size: 12px; font-weight: 600; }
.up { color: var(--green); }
.down { color: var(--red); }

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============ Tabs ============ */
.tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.tab.active {
  color: #1a1300;
  background: var(--gradient);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(247,181,0,0.3);
}

/* ============ Feed ============ */
.feed {
  padding: 12px 12px 90px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Banner card (hero/breaking) */
.hero-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #2a1a4a 0%, #4a1a2a 100%);
  padding: 18px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.hero-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% -10%, rgba(247,181,0,0.4), transparent 60%),
              radial-gradient(circle at 0% 100%, rgba(255,122,0,0.25), transparent 50%);
  pointer-events: none;
}
.hero-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 1px;
  margin-bottom: 10px;
  position: relative;
}
.hero-tag::after {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-left: 6px;
  vertical-align: middle;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.hero-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  position: relative;
}
.hero-meta {
  font-size: 12px;
  color: var(--text-2);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* News card */
.news-card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.news-card:active { transform: scale(0.98); background: var(--card-hover); }

.news-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.category {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(79,139,255,0.15);
  color: var(--blue);
}
.category.market { background: rgba(22,199,132,0.15); color: var(--green); }
.category.defi { background: rgba(167,139,250,0.15); color: var(--purple); }
.category.nft { background: rgba(255,122,0,0.15); color: var(--primary-2); }
.category.overseas { background: rgba(247,181,0,0.15); color: var(--primary); }

.source {
  font-size: 12px;
  color: var(--text-3);
}
.timeago { font-size: 12px; color: var(--text-3); margin-left: auto; }

.news-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.news-text { flex: 1; min-width: 0; }
.news-title {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-summary {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 10px;
  background: var(--bg-soft);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.news-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-3);
}
.foot-item { display: inline-flex; align-items: center; gap: 4px; }

/* Coin highlight inline */
.coin-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  background: rgba(247,181,0,0.12);
  color: var(--primary);
  border-radius: 4px;
}

/* Section title */
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  margin: 8px 4px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-title::before {
  content: '';
  width: 3px;
  height: 12px;
  background: var(--gradient);
  border-radius: 2px;
}

/* ============ Bottom nav ============ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  background: rgba(10,14,39,0.95);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  font-size: 11px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-item:active { color: var(--primary); }
.nav-item.active { color: var(--primary); }

/* ============ Article detail page ============ */
.article-page { background: var(--bg); }

.detail-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px;
  background: rgba(10,14,39,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.detail-title { font-size: 16px; font-weight: 600; }

.article-body {
  padding: 16px 18px 100px;
  max-width: 100%;
}
.article-body h1 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 14px;
}
.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1300;
  font-weight: 700;
}
.author-info { flex: 1; }
.author-name { font-size: 13px; font-weight: 600; }
.author-meta { font-size: 11px; color: var(--text-3); }
.follow-btn {
  padding: 5px 14px;
  border-radius: 16px;
  background: var(--gradient);
  color: #1a1300;
  font-size: 12px;
  font-weight: 700;
}

.article-body p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 16px;
}
.article-body h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 22px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}
.article-body blockquote {
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  background: rgba(247,181,0,0.06);
  margin: 14px 0;
  font-size: 14px;
  color: var(--text-2);
  border-radius: 0 8px 8px 0;
}
.article-body strong { color: var(--primary); }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}
.tag-row .tag {
  padding: 4px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 12px;
  color: var(--text-2);
}

/* Action bar */
.action-bar {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(10,14,39,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 50;
}
.comment-input {
  flex: 1;
  padding: 9px 14px;
  border-radius: 18px;
  background: var(--card);
  color: var(--text-3);
  font-size: 13px;
}
.action-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-2);
  font-size: 11px;
  gap: 1px;
  min-width: 36px;
}
.action-icon.liked { color: var(--red); }
.action-icon .count { font-size: 11px; }

/* ============ Market page ============ */
.market-summary {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.18);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.summary-label { font-size: 11px; color: var(--text-3); }
.summary-value { font-size: 15px; font-weight: 700; color: var(--text); }
.summary-change { font-size: 11px; font-weight: 600; }

.market-main { padding-bottom: 80px; }

.market-list-head {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 78px;
  gap: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.market-list-head .col-price,
.market-list-head .col-change { text-align: right; }

.market-list { display: flex; flex-direction: column; }

.coin-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: center;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.coin-row:active { background: var(--card); }

.col-coin { display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; }
.coin-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.coin-meta { min-width: 0; overflow: hidden; }
.coin-symbol { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-vol { font-size: 11px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.col-price { text-align: right; min-width: 0; overflow: hidden; }
.coin-price {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.4s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coin-price.flash-up { color: var(--green); }
.coin-price.flash-down { color: var(--red); }
.coin-cap { font-size: 11px; color: var(--text-3); margin-top: 1px; white-space: nowrap; }

.col-change { text-align: right; }
.change-pill {
  display: inline-block;
  width: 78px;
  padding: 6px 0;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-sizing: border-box;
}
.change-pill.up { background: var(--green); color: #fff; }
.change-pill.down { background: var(--red); color: #fff; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

/* ============ Profile page ============ */
.profile-hero {
  position: relative;
  padding: 24px 18px 56px;
  background: linear-gradient(135deg, #2a1a4a 0%, #1a1f3d 60%, #4a1a2a 100%);
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 0%, rgba(247,181,0,0.35), transparent 55%),
              radial-gradient(circle at 0% 100%, rgba(255,122,0,0.18), transparent 55%);
  pointer-events: none;
}
.profile-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--gradient);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1a1300;
  font-size: 26px;
  font-weight: 800;
  border: 3px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.profile-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  font-weight: 700;
}
.vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--gradient);
  color: #1a1300;
  font-size: 10px;
  font-weight: 800;
}
.profile-bio { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.profile-id { font-size: 11px; color: var(--text-3); margin-top: 4px; font-family: ui-monospace, monospace; }

.profile-stats {
  position: relative;
  display: flex;
  margin: -28px 14px 0;
  padding: 16px 0;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.stat-item {
  flex: 1;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 18px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.asset-card {
  margin: 14px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7b500 0%, #ff7a00 100%);
  color: #1a1300;
  position: relative;
  overflow: hidden;
}
.asset-card::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.asset-label { font-size: 12px; font-weight: 600; opacity: 0.85; }
.asset-value { font-size: 26px; font-weight: 800; margin: 6px 0 4px; }
.asset-sub { font-size: 12px; opacity: 0.8; }
.asset-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  position: relative;
}
.asset-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.25);
  color: #1a1300;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.3);
}

.menu-list {
  margin: 14px;
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.menu-row {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text);
  text-decoration: none;
}
.menu-row:last-child { border-bottom: none; }
.menu-row:active { background: var(--card-hover); }
.menu-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-right: 12px;
  flex-shrink: 0;
}
.menu-text { flex: 1; font-size: 14px; }
.menu-extra { font-size: 12px; color: var(--text-3); margin-right: 8px; }
.menu-arrow { color: var(--text-3); }

.menu-section-title {
  margin: 18px 18px 8px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

/* ============ Community page ============ */
.community-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.community-tabs::-webkit-scrollbar { display: none; }

.publish-card {
  margin: 14px;
  padding: 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.publish-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 18px;
  background: var(--bg-soft);
  color: var(--text-3);
  font-size: 13px;
}
.publish-actions { display: flex; gap: 8px; color: var(--text-2); }

.post-card {
  padding: 14px 16px;
  border-bottom: 8px solid var(--bg);
  background: var(--bg-soft);
}
.post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.post-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 15px;
}
.post-author { flex: 1; min-width: 0; }
.post-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.post-name .badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(247,181,0,0.15);
  color: var(--primary);
  font-weight: 600;
}
.post-time { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.post-follow {
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}

.post-body { font-size: 14.5px; line-height: 1.6; color: var(--text); }
.post-body .mention { color: var(--blue); }
.post-body .topic { color: var(--primary); font-weight: 500; }

.post-coins {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.post-coin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(247,181,0,0.1);
  color: var(--primary);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
}
.post-coin .pct { color: var(--green); margin-left: 4px; }
.post-coin .pct.down { color: var(--red); }

.post-image {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  border: 1px solid var(--border);
}

.post-foot {
  display: flex;
  margin-top: 12px;
  color: var(--text-3);
  font-size: 12px;
}
.post-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}
.post-action:active { color: var(--primary); }
.post-action.liked { color: var(--red); }

/* container width on larger screens */
@media (min-width: 640px) {
  body { max-width: 480px; margin: 0 auto; box-shadow: 0 0 60px rgba(0,0,0,0.5); }
  .bottom-nav, .action-bar { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
