/* ===== 全局基础 ===== */
:root {
  --bg: #0b0e1a;
  --bg-soft: #121629;
  --bg-card: #161b2e;
  --border: #232a44;
  --text: #e8ecf5;
  --text-dim: #9aa3bd;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --up: #16c784;   /* 涨 - 绿 */
  --down: #ea3943; /* 跌 - 红 */
  --radius: 14px;
  --maxw: 1180px;
}

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

html, body { height: 100%; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== 顶部导航 ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,14,26,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center; font-size: 16px;
}
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  padding: 8px 14px; border-radius: 9px; color: var(--text-dim); font-size: 14px; font-weight: 500;
  transition: .15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-soft); }
.nav-links a.active { color: var(--text); background: var(--bg-card); }
.nav-cta { display: flex; gap: 8px; align-items: center; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }

/* ===== Hero / 首页 ===== */
.hero { position: relative; overflow: hidden; padding: 90px 0 70px; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(700px 360px at 75% -10%, rgba(124,92,255,.28), transparent 60%),
    radial-gradient(600px 320px at 10% 10%, rgba(79,140,255,.22), transparent 55%);
  pointer-events: none;
}
.hero-grid { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow {
  display: inline-block; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); background: rgba(79,140,255,.1); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: 52px; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; }
.hero h1 .grad { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--text-dim); font-size: 17px; margin: 18px 0 26px; max-width: 520px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; }
.hero-stats .s-num { font-size: 26px; font-weight: 800; }
.hero-stats .s-lbl { font-size: 13px; color: var(--text-dim); }

/* 装饰面板 */
.panel {
  background: linear-gradient(160deg, rgba(79,140,255,.10), rgba(124,92,255,.06));
  border: 1px solid var(--border); border-radius: 18px; padding: 22px;
}
.panel .row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.panel .row:last-child { border-bottom: 0; }
.coin { display: flex; align-items: center; gap: 10px; }
.coin img { width: 26px; height: 26px; border-radius: 50%; }
.coin .sym { color: var(--text-dim); font-size: 12px; }

/* ===== 区块通用 ===== */
.section { padding: 70px 0; }
.section h2 { font-size: 32px; font-weight: 800; letter-spacing: -.01em; }
.section .sub { color: var(--text-dim); margin-top: 10px; margin-bottom: 34px; max-width: 640px; }
.center { text-align: center; }
.center .sub { margin-left: auto; margin-right: auto; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px;
}
.feature .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 20px;
  background: rgba(79,140,255,.12); margin-bottom: 14px; }
.feature h3 { font-size: 17px; margin-bottom: 8px; }
.feature p { color: var(--text-dim); font-size: 14px; }

/* ===== 行情表 ===== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.search { position: relative; }
.search input {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 10px 14px 10px 38px; border-radius: 10px; width: 280px; font-size: 14px; outline: none;
}
.search input:focus { border-color: var(--accent); }
.search .si { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); }
.refresh-state { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); }
.dot.err { background: var(--down); }

.table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: right; padding: 14px 16px; color: var(--text-dim); font-weight: 600; font-size: 13px;
  border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; white-space: nowrap;
}
thead th:first-child, thead th.left { text-align: left; }
thead th .arr { opacity: .5; font-size: 11px; }
tbody td { padding: 14px 16px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody td:first-child, tbody td.left { text-align: left; }
tbody tr:hover { background: var(--bg-soft); }
.t-coin { display: flex; align-items: center; gap: 12px; }
.t-coin img { width: 28px; height: 28px; border-radius: 50%; }
.t-coin .name { font-weight: 600; }
.t-coin .sym { color: var(--text-dim); font-size: 12px; }
.up { color: var(--up); }
.down { color: var(--down); }
.rank { color: var(--text-dim); }

/* 状态层 */
.state { padding: 50px 20px; text-align: center; color: var(--text-dim); }
.state .big { font-size: 30px; margin-bottom: 8px; }
.spinner {
  width: 30px; height: 30px; border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 表单 / 认证 ===== */
.auth-wrap { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; padding: 32px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card .desc { color: var(--text-dim); font-size: 14px; margin-bottom: 24px; }
.tabs { display: flex; gap: 6px; background: var(--bg-soft); padding: 5px; border-radius: 11px; margin-bottom: 22px; }
.tabs button { flex: 1; padding: 9px; border: 0; background: transparent; color: var(--text-dim); border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.tabs button.active { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; }
.field input, .field select {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text);
  padding: 11px 13px; border-radius: 10px; font-size: 14px; outline: none;
}
.field select { cursor: pointer; }
.field input:focus { border-color: var(--accent); }
.form-msg { font-size: 13px; margin-top: 4px; min-height: 18px; }
.form-msg.err { color: var(--down); }
.form-msg.ok { color: var(--up); }
.auth-foot { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 18px; }
.warn-box {
  background: rgba(234,57,67,.08); border: 1px solid rgba(234,57,67,.35); color: #ffb4ba;
  font-size: 12.5px; padding: 10px 12px; border-radius: 10px; margin-bottom: 18px; line-height: 1.5;
}

/* 管理后台内联控件 */
.t-in { width: 86px; background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.t-sel { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.btn-mini { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--text); cursor: pointer; font-size: 13px; }
.btn-mini:hover { border-color: var(--accent); color: var(--accent); }
.inline { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.admin-sec { margin-bottom: 28px; }
.admin-sec h3 { font-size: 17px; margin-bottom: 12px; }

/* ===== 账户中心 ===== */
.acct-head { display: flex; align-items: center; gap: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; }
.acct-head .meta .name { font-size: 18px; font-weight: 700; }
.acct-head .meta .mail { color: var(--text-dim); font-size: 14px; }
.acct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .lbl { color: var(--text-dim); font-size: 13px; }
.stat-card .val { font-size: 26px; font-weight: 800; margin-top: 6px; }
.watch { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.watch h3 { font-size: 16px; margin-bottom: 14px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 30px 0; color: var(--text-dim); font-size: 13px; margin-top: 40px; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer a:hover { color: var(--text); }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
  .features, .acct-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .search input { width: 100%; }
  .search { width: 100%; }
  thead th.hide-sm, tbody td.hide-sm { display: none; }
}


/* H5 responsive layout */
#nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 14, 26, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.page-content {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 20px;
}

.home-page .page-content { padding-top: 16px; }
.carousel { position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--border); aspect-ratio: 16 / 7; background: var(--bg-card); }
.carousel-img { width: 100%; height: 100%; object-fit: cover; }
.carousel-dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 7px; }
.carousel-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.5); cursor: pointer; }
.carousel-dots button.active { width: 22px; background: #fff; }
.home-notice-bar { display: flex; gap: 8px; align-items: center; margin: 14px 0 20px; padding: 11px 13px; background: rgba(79,140,255,.1); color: var(--text-dim); border: 1px solid rgba(79,140,255,.22); border-radius: 12px; font-size: 13px; }
.section-heading-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.market-title { font-size: 22px; }
.text-link { color: var(--accent); font-size: 14px; font-weight: 600; }
.market-list .panel { padding: 10px 16px; }
.market-list .panel .row { gap: 14px; }
.market-list .panel .row > div:last-child { text-align: right; font-size: 13px; }
.market-toolbar { display: grid; gap: 12px; margin-bottom: 14px; }
.market-toolbar .search { width: 100%; }
.market-toolbar .search input { width: 100%; }
.market-sort { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.market-sort button { min-height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-card); color: var(--text-dim); font: inherit; font-size: 13px; cursor: pointer; }
.market-sort button:active, .market-sort button:hover { color: var(--text); border-color: var(--accent); }
.table-card { -webkit-overflow-scrolling: touch; }
.table-card table { min-width: 600px; }

.auth-page { min-height: 100vh; background: radial-gradient(circle at top, rgba(79,140,255,.2), transparent 42%), var(--bg); }
.login-container { width: min(100% - 32px, 440px); margin: 0 auto; padding: 24px 0 40px; }
.login-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; }
.back-btn, .lang-mark { color: var(--text); font-size: 24px; }
.demo-pill { padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); font-size: 12px; }
.login-title { display: flex; gap: 9px; margin-bottom: 20px; font-size: clamp(34px, 12vw, 52px); line-height: 1; font-weight: 800; }
.login-title span:last-child { color: var(--accent); }
.auth-warning { margin-bottom: 18px; }
.login-form { padding: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px; }
.input-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 0 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; color: var(--text-dim); }
.input-row input { width: 100%; min-height: 46px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
.remember-row { display: flex; gap: 8px; align-items: center; margin: 14px 0; color: var(--text-dim); font-size: 13px; }
.login-btn, .register-btn { width: 100%; min-height: 46px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; }
.login-btn { border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.register-btn { margin-top: 10px; border: 1px solid var(--border); color: var(--text); background: transparent; }

@media (max-width: 720px) {
  body { font-size: 14px; }
  #nav .nav-inner { height: 58px; padding: 0 14px; }
  #nav .brand { font-size: 16px; }
  #nav .brand .logo { width: 27px; height: 27px; }
  #nav .nav-links { display: none; }
  #nav .nav-cta .btn { padding: 8px 10px; font-size: 12px; }
  .page-content { padding: 14px; }
  .carousel { border-radius: 14px; aspect-ratio: 16 / 9; }
  .home-notice-bar { margin: 12px 0 16px; font-size: 12px; }
  .market-title { font-size: 20px; }
  .market-list .panel { border-radius: 14px; }
  .market-list .panel .row { padding: 11px 0; }
  .coin img { width: 30px; height: 30px; }
  .section { padding: 28px 0; }
  .section h2 { font-size: 25px; }
  .toolbar { gap: 10px; }
  .acct-head { padding: 16px; align-items: flex-start; flex-wrap: wrap; }
  .acct-head > div:last-child { width: 100%; margin-left: 0 !important; }
  .acct-head > div:last-child .btn { width: 100%; }
  .acct-grid { grid-template-columns: 1fr; gap: 10px; }
  .stat-card, .watch { padding: 16px; }
  .admin-sec { margin-bottom: 22px; }
  .admin-sec h3 { font-size: 16px; }
  .table-card { border-radius: 12px; }
  .footer { margin-top: 24px; padding: 20px 0; }
  .footer .wrap { padding: 0 16px; display: grid; gap: 6px; }
  .auth-wrap { padding: 20px 14px; align-items: start; }
  .auth-card { padding: 22px 18px; border-radius: 16px; }
}
