* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa; color: #1a1a2e; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 640px; margin: 0 auto; padding: 12px 16px 40px; }

header {
  background: linear-gradient(135deg, #2476ff 0%, #1a5cd4 100%);
  color: #fff; border-radius: 16px; padding: 20px 24px; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(36,118,255,0.25);
}
header h1 { font-size: 20px; font-weight: 700; }
#sync-time { font-size: 12px; opacity: 0.85; margin-top: 4px; }

.section-title { font-size: 15px; font-weight: 700; margin: 20px 0 10px; color: #333; }

.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cards-grid.col2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: #fff; border-radius: 12px; padding: 14px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-align: center;
}
.card .label { font-size: 11px; color: #888; margin-bottom: 4px; }
.card .value { font-size: 22px; font-weight: 800; color: #1a1a2e; }
.card .value.green { color: #10b981; }
.card .value.blue { color: #2476ff; }
.card .value.orange { color: #f59e0b; }
.card .sub { font-size: 11px; color: #aaa; margin-top: 2px; }

.platform-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: #fff; border-radius: 10px; margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.platform-row .pname { font-weight: 600; min-width: 48px; }
.platform-row .pnums { font-size: 12px; color: #666; flex: 1; }
.platform-row .pgmv { font-weight: 700; color: #2476ff; }
.platform-row .bar-wrap { flex: 1; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.platform-row .bar-fill { height: 100%; background: #2476ff; border-radius: 3px; }

#trend-chart { background: #fff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.trend-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12px; }
.trend-row .tday { min-width: 40px; text-align: right; font-weight: 600; }
.trend-row .tbar-wrap { flex: 1; height: 20px; background: #f0f4ff; border-radius: 4px; overflow: hidden; display: flex; }
.trend-row .tbar-gmv { background: linear-gradient(90deg, #a0c4ff, #2476ff); border-radius: 4px 0 0 4px; }
.trend-row .tbar-profit { background: #10b981; }
.trend-row .tval { min-width: 50px; font-weight: 600; text-align: right; font-size: 11px; }

.order-row {
  background: #fff; border-radius: 8px; padding: 10px 12px; margin-bottom: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04); font-size: 12px;
}
.order-row .otop { display: flex; justify-content: space-between; margin-bottom: 2px; }
.order-row .oplat { font-weight: 600; color: #2476ff; }
.order-row .otime { color: #999; }
.order-row .oname { color: #666; }
.order-row .obottom { display: flex; justify-content: space-between; margin-top: 4px; }
.order-row .ogmv { font-weight: 700; }
.order-row .oprofit { color: #10b981; font-weight: 600; }

.rank-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #fff; border-radius: 8px; margin-bottom: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.rank-row .rrank { width: 24px; height: 24px; border-radius: 50%; background: #2476ff; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.rank-row .rrank.gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.rank-row .rrank.silver { background: #94a3b8; }
.rank-row .rname { font-weight: 600; flex: 1; }
.rank-row .rnew { font-size: 12px; color: #10b981; font-weight: 600; }
.rank-row .rtotal { font-size: 12px; color: #999; }

footer { margin-top: 30px; text-align: center; padding: 20px 0; }
#logout-btn { padding: 8px 24px; border: 1px solid #ddd; border-radius: 8px; background: #fff; font-size: 13px; color: #999; cursor: pointer; }

.loading { text-align: center; padding: 40px; color: #999; }
.empty { text-align: center; padding: 20px; color: #bbb; font-size: 13px; }

@media (max-width: 400px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
