/* ═══════════════════════════════════════════
   CryptoExchange Demo — 币安暗黑风格
   ═══════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0B0E11;
  --bg-secondary: #1E2329;
  --bg-card: #1B2030;
  --bg-hover: #252A2F;
  --bg-input: #14171F;
  --border: #2B3139;
  --text-primary: #EAECEF;
  --text-secondary: #848E9C;
  --text-muted: #5E6673;
  --accent: #F0B90B;
  --accent-hover: #F8D12F;
  --green: #0ECB81;
  --green-bg: rgba(14,203,129,0.1);
  --red: #F6465D;
  --red-bg: rgba(246,70,93,0.1);
  --cyan: #00D4AA;
  --radius: 6px;
  --radius-lg: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 14px;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

/* ── Navbar ── */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  height: 64px;
  position: sticky; top: 0; z-index: 100;
}
.navbar__brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 700; color: var(--accent);
  margin-right: 36px; text-decoration: none;
}
.navbar__logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #F0B90B, #F8D12F);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900; color: #0B0E11;
}
.navbar__links { display: flex; gap: 24px; list-style: none; }
.navbar__links a {
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  padding: 4px 0; transition: color 0.2s;
}
.navbar__links a:hover, .navbar__links a.active { color: var(--text-primary); }
.navbar__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ── Buttons ── */
.btn {
  padding: 8px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; border: none; display: inline-flex;
  align-items: center; gap: 6px;
}
.btn--outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn--outline:hover { background: rgba(240,185,11,0.1); }
.btn--primary { background: var(--accent); color: #0B0E11; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--green { background: var(--green); color: #fff; }
.btn--red { background: var(--red); color: #fff; }
.btn--sm { padding: 6px 14px; font-size: 13px; }
.btn--block { width: 100%; justify-content: center; }

/* ── Hero ── */
.hero {
  background: linear-gradient(180deg, #0B0E11 0%, #131822 100%);
  padding: 80px 24px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; left: -20%;
  width: 140%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(240,185,11,0.05) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(0,212,170,0.03) 0%, transparent 60%);
  pointer-events: none;
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(240,185,11,0.1); border: 1px solid rgba(240,185,11,0.2);
  color: var(--accent); padding: 6px 16px; border-radius: 20px;
  font-size: 13px; font-weight: 600; margin-bottom: 24px;
}
.hero__badge .dot {
  width: 8px; height: 8px; background: var(--green); border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.4; } }
.hero h1 { font-size: 48px; font-weight: 800; line-height: 1.2; margin-bottom: 20px; position: relative; }
.hero h1 .gradient {
  background: linear-gradient(135deg, #F0B90B, #F8D12F);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 17px; color: var(--text-secondary); max-width: 600px; margin: 0 auto 36px; }
.hero__buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero__stats {
  display: flex; gap: 60px; justify-content: center;
  margin-top: 60px; position: relative;
}
.hero__stat { text-align: center; }
.hero__stat .num { font-size: 32px; font-weight: 800; color: var(--text-primary); }
.hero__stat .label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ── Section ── */
.section { padding: 80px 24px; }
.section--alt { background: var(--bg-secondary); }
.section__title { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.section__subtitle { font-size: 15px; color: var(--text-secondary); text-align: center; margin-bottom: 48px; }

/* ── Features ── */
.features { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; max-width: 1100px; margin: 0 auto; }
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px 24px; transition: all 0.3s;
}
.feature-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: 0 8px 32px rgba(240,185,11,0.08); }
.feature-card__icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
}
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* ── Market Table ── */
.market-table { max-width: 1100px; margin: 0 auto; }
.market-table__header {
  display: grid; grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 1fr;
  padding: 12px 16px; color: var(--text-muted); font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.market-table__row {
  display: grid; grid-template-columns: 2fr 1.5fr 1fr 1fr 1fr 1fr;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  align-items: center; transition: background 0.2s; font-size: 14px;
}
.market-table__row:hover { background: var(--bg-hover); }
.market-table__pair { display: flex; align-items: center; gap: 10px; }
.market-table__pair img {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-card);
}
.market-table__pair .name { font-weight: 600; }
.market-table__pair .vol { font-size: 12px; color: var(--text-muted); }
.market-table__change {
  padding: 4px 10px; border-radius: 4px; font-weight: 700; font-size: 13px;
  text-align: center; width: fit-content;
}
.market-table__change--up { background: var(--green-bg); color: var(--green); }
.market-table__change--down { background: var(--red-bg); color: var(--red); }
.market-table__btn { padding: 6px 16px; font-size: 13px; border-radius: 4px; cursor: pointer; border: none; font-weight: 600; }

/* ── Footer ── */
.footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 48px 24px 24px; color: var(--text-secondary); font-size: 13px;
}
.footer__grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 36px; max-width: 1100px; margin: 0 auto 36px; }
.footer__col h4 { color: var(--text-primary); font-size: 15px; margin-bottom: 16px; }
.footer__col a { display: block; color: var(--text-secondary); margin-bottom: 10px; font-size: 13px; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom { text-align: center; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-muted); }

/* ── Trade Page Specific ── */
.trade-layout {
  display: grid; grid-template-columns: 240px 1fr 300px; gap: 0;
  height: calc(100vh - 64px); overflow: hidden;
}
.trade-sidebar {
  background: var(--bg-secondary); border-right: 1px solid var(--border);
  overflow-y: auto; padding: 0;
}
.trade-sidebar__search {
  padding: 12px; border-bottom: 1px solid var(--border);
}
.trade-sidebar__search input {
  width: 100%; padding: 8px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 13px; outline: none;
}
.trade-sidebar__item {
  padding: 10px 16px; display: flex; align-items: center;
  justify-content: space-between; cursor: pointer; transition: background 0.2s;
  border-bottom: 1px solid rgba(43,49,57,0.5);
}
.trade-sidebar__item:hover { background: var(--bg-hover); }
.trade-sidebar__item.active { background: var(--bg-hover); border-left: 2px solid var(--accent); }
.trade-sidebar__item .pair { font-weight: 600; font-size: 13px; }
.trade-sidebar__item .price { font-size: 13px; }
.trade-sidebar__item .change { font-size: 12px; }

.trade-main { display: flex; flex-direction: column; overflow: hidden; }
.trade-main__header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 20px;
}
.trade-main__pair { font-size: 20px; font-weight: 700; }
.trade-main__price { font-size: 20px; font-weight: 700; }
.trade-main__change { font-size: 13px; padding: 2px 8px; border-radius: 4px; }
.trade-main__info { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); margin-left: auto; }
.trade-main__info span b { color: var(--text-primary); }

.trade-chart {
  flex: 1; background: var(--bg-primary); position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 300px;
}
.trade-chart canvas { width: 100%; height: 100%; }

.trade-orderbook {
  border-top: 1px solid var(--border); max-height: 200px; overflow-y: auto;
}
.trade-orderbook__header {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 8px 16px; font-size: 11px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.trade-orderbook__row {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: 3px 16px; font-size: 12px; position: relative;
}
.trade-orderbook__row--ask .price { color: var(--red); }
.trade-orderbook__row--bid .price { color: var(--green); }
.trade-orderbook__row .depth {
  position: absolute; right: 0; top: 0; bottom: 0; opacity: 0.08;
}
.trade-orderbook__row--ask .depth { background: var(--red); }
.trade-orderbook__row--bid .depth { background: var(--green); }

.trade-form {
  background: var(--bg-secondary); border-left: 1px solid var(--border);
  padding: 16px; overflow-y: auto;
}
.trade-form__tabs {
  display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.trade-form__tab {
  flex: 1; padding: 10px; text-align: center; font-size: 14px;
  font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
  color: var(--text-secondary); transition: all 0.2s; background: none; border-top: none; border-left: none; border-right: none;
}
.trade-form__tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.trade-form__tab--buy { color: var(--green); }
.trade-form__tab--sell { color: var(--red); }
.trade-form__tab--buy.active { color: var(--green); border-bottom-color: var(--green); }
.trade-form__tab--sell.active { color: var(--red); border-bottom-color: var(--red); }
.trade-form__field { margin-bottom: 14px; }
.trade-form__label {
  display: flex; justify-content: space-between; font-size: 12px;
  color: var(--text-secondary); margin-bottom: 6px;
}
.trade-form__input {
  width: 100%; padding: 10px 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 14px; outline: none;
}
.trade-form__input:focus { border-color: var(--accent); }
.trade-form__percent { display: flex; gap: 6px; margin-bottom: 16px; }
.trade-form__percent button {
  flex: 1; padding: 6px; font-size: 12px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s;
}
.trade-form__percent button:hover { border-color: var(--accent); color: var(--accent); }
.trade-form__btn { width: 100%; padding: 12px; border-radius: var(--radius); font-size: 15px; font-weight: 700; cursor: pointer; border: none; }
.trade-form__btn--buy { background: var(--green); color: #fff; }
.trade-form__btn--sell { background: var(--red); color: #fff; }

/* ── Assets Page ── */
.assets-container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.assets-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.assets-header h1 { font-size: 24px; font-weight: 700; }
.assets-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.assets-tabs a {
  padding: 12px 20px; font-size: 14px; font-weight: 600;
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  cursor: pointer; text-decoration: none;
}
.assets-tabs a.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.assets-table { width: 100%; }
.assets-table th {
  text-align: left; padding: 12px 16px; color: var(--text-muted);
  font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border);
}
.assets-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.assets-table tr:hover { background: var(--bg-hover); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .features { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
  .hero__stats { flex-direction: column; gap: 24px; }
  .market-table__header, .market-table__row { font-size: 12px; }
  .trade-layout { grid-template-columns: 1fr; }
  .trade-sidebar, .trade-form { display: none; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
