* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-input: #0f1629;
  --border: #2a3550;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.15);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 导航 */
.navbar {
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.logo-icon { width: 36px; height: 36px; background: var(--gradient); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }
.btn-admin { background: var(--accent-light); color: var(--accent) !important; padding: 6px 16px; border-radius: 8px; font-weight: 500; }

/* Hero */
.hero { padding: 60px 0 40px; text-align: center; }
.hero-badge { display: inline-block; background: var(--accent-light); color: var(--accent); padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; margin-bottom: 20px; }
.hero h1 { font-size: 42px; font-weight: 800; margin-bottom: 16px; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { color: var(--text-secondary); font-size: 17px; max-width: 600px; margin: 0 auto; }

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}
.card-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.card-title .icon { width: 32px; height: 32px; background: var(--accent-light); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; }

/* 进度条 */
.progress-section { margin-bottom: 8px; }
.progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.progress-label { font-size: 14px; color: var(--text-secondary); }
.progress-value { font-size: 24px; font-weight: 800; color: var(--accent); }
.progress-bar { height: 12px; background: var(--bg-input); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gradient); border-radius: 6px; transition: width 0.8s ease; }
.progress-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 20px; }
.stat-item { text-align: center; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 表单 */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; font-weight: 500; }
.form-input {
  width: 100%; padding: 12px 16px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text-primary);
  font-size: 15px; outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: none; border-radius: 10px; font-size: 15px;
  font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.btn-primary { background: var(--gradient); color: white; width: 100%; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* 钱包信息 */
.wallet-info { background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; }
.wallet-address { font-family: monospace; font-size: 14px; color: var(--text-primary); word-break: break-all; }
.wallet-status { font-size: 12px; color: var(--success); display: flex; align-items: center; gap: 6px; }
.wallet-status::before { content: ''; width: 8px; height: 8px; background: var(--success); border-radius: 50%; }

/* 兑换预览 */
.exchange-preview { background: var(--accent-light); border: 1px solid rgba(59,130,246,0.3); border-radius: 10px; padding: 16px; margin: 16px 0; }
.exchange-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.exchange-label { font-size: 14px; color: var(--text-secondary); }
.exchange-value { font-size: 18px; font-weight: 700; color: var(--accent); }

/* 项目信息网格 */
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.info-item { background: var(--bg-input); border-radius: 10px; padding: 14px 16px; }
.info-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.info-value { font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* 表格 */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 12px; font-size: 13px; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); }
.table td { padding: 14px 12px; font-size: 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.table tr:hover td { background: rgba(59,130,246,0.05); }

/* 状态标签 */
.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-failed { background: rgba(239,68,68,0.15); color: var(--danger); }

/* Toast */
.toast { position: fixed; top: 80px; right: 20px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 20px; z-index: 1000; box-shadow: 0 10px 40px rgba(0,0,0,0.3); animation: slideIn 0.3s ease; max-width: 360px; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* 倒计时 */
.countdown { display: flex; gap: 12px; justify-content: center; margin: 20px 0; }
.countdown-item { background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; text-align: center; min-width: 70px; }
.countdown-num { font-size: 28px; font-weight: 800; color: var(--accent); }
.countdown-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* 规则列表 */
.rules-list { list-style: none; }
.rules-list li { padding: 8px 0; color: var(--text-secondary); font-size: 14px; padding-left: 20px; position: relative; }
.rules-list li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 700; }

/* 布局 */
.main-grid { display: grid; grid-template-columns: 1fr 420px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .main-grid { grid-template-columns: 1fr; } .hero h1 { font-size: 30px; } .progress-stats { grid-template-columns: repeat(2, 1fr); } }

/* 加载 */
.loading { text-align: center; padding: 40px; color: var(--text-muted); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tab */
.tabs { display: flex; gap: 4px; background: var(--bg-input); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.tab { flex: 1; padding: 10px; text-align: center; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text-secondary); transition: all 0.2s; border: none; background: transparent; }
.tab.active { background: var(--accent); color: white; font-weight: 600; }

/* ============ 回购 / 新增组件 ============ */
.sticky-card { position: sticky; top: 80px; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-stat { background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.mini-stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.mini-stat-value { font-size: 16px; font-weight: 700; color: var(--accent); word-break: break-all; }
.limit-row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-muted); gap: 8px; flex-wrap: wrap; }
.input-with-btn { display: flex; gap: 8px; align-items: center; }
.input-with-btn .form-input { flex: 1; min-width: 0; }
.input-with-btn .btn { white-space: nowrap; }
.tip-box { margin-top: 16px; padding: 12px; background: var(--bg-input); border-radius: 8px; font-size: 12px; color: var(--text-muted); line-height: 1.7; }
.empty-tip { color: var(--text-muted); text-align: center; padding: 20px; font-size: 14px; }
.buyback-preview { background: rgba(16,185,129,0.12); border-color: rgba(16,185,129,0.3); }
.buyback-preview .exchange-value { color: var(--success); }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .table { min-width: 520px; }

/* ============ 移动端适配 ============ */
@media (max-width: 900px) {
  .sticky-card { position: static; top: auto; }
  .navbar .nav-inner { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .nav-links { gap: 14px; flex-wrap: wrap; }
  .nav-links a { font-size: 13px; }
  .hero { padding: 32px 0 24px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
  .card { padding: 20px 16px; border-radius: 14px; }
  .countdown-item { min-width: 58px; padding: 10px 12px; }
  .countdown-num { font-size: 22px; }
  .info-grid { grid-template-columns: 1fr; }
  .toast { left: 20px; right: 20px; max-width: none; }
}
@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .progress-value { font-size: 18px; }
  .progress-stats { gap: 8px; }
  .stat-value { font-size: 17px; }
  .mini-stats { grid-template-columns: 1fr; }
}

/* ============ 代币转让 ============ */
.transfer-preview { background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.3); }
.transfer-preview .exchange-value { color: #a78bfa; }
.badge-in { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-out { background: rgba(245,158,11,0.15); color: var(--warning); }
.balance-bar {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 16px;
  padding: 12px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13px; color: var(--text-secondary);
}
.balance-bar b { color: var(--accent); font-weight: 700; }

/* ============ 测试账号条 ============ */
.test-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 16px 0 0; padding: 12px 16px;
  background: rgba(245,158,11,0.10); border: 1px dashed rgba(245,158,11,0.45);
  border-radius: 12px; font-size: 13px;
}
.test-bar-title { color: var(--warning); font-weight: 600; white-space: nowrap; }
.test-bar-list { display: flex; flex-wrap: wrap; gap: 8px; }
.test-account-btn {
  padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-secondary);
  transition: all 0.2s;
}
.test-account-btn:hover { border-color: var(--warning); color: var(--warning); }
.test-account-btn.active { background: var(--warning); border-color: var(--warning); color: #1a1206; font-weight: 700; }

/* ============ 登录验证码 ============ */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row .form-input { flex: 1; min-width: 0; }
.captcha-img {
  width: 120px; height: 44px; flex: 0 0 120px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--bg-input);
}
.captcha-img svg { display: block; width: 120px; height: 44px; }
.captcha-img:hover { border-color: var(--accent); }

/* ============ 行情图 ============ */
.chart-wrap { position: relative; width: 100%; }
.chart-canvas { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; font-size: 13px; color: var(--text-secondary); }
.chart-legend b { color: var(--text-primary); }
.chart-legend .up { color: #10b981; }
.chart-legend .down { color: #ef4444; }

/* ============ 白皮书 ============ */
.doc-body { line-height: 1.9; color: var(--text-secondary); font-size: 15px; }
.doc-body h1, .doc-body h2, .doc-body h3 { color: var(--text-primary); margin: 22px 0 10px; }
.doc-body h1 { font-size: 24px; }
.doc-body h2 { font-size: 20px; }
.doc-body h3 { font-size: 17px; }
.doc-body p { margin: 10px 0; }
.doc-body ul { margin: 10px 0 10px 22px; }
.doc-body li { margin: 4px 0; }
.doc-body strong { color: var(--text-primary); }

/* ============ 语言切换 ============ */
.lang-switch { display: flex; gap: 4px; background: var(--bg-input); border-radius: 8px; padding: 3px; }
.lang-switch button {
  border: none; background: transparent; color: var(--text-secondary); cursor: pointer;
  padding: 5px 10px; border-radius: 6px; font-size: 12px;
}
.lang-switch button.active { background: var(--accent); color: #fff; font-weight: 600; }

/* ============ 行情卡片 ============ */
.market-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.market-price { font-size: 28px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.market-unit { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.market-change { font-size: 14px; font-weight: 700; margin-top: 4px; }
.market-change.up { color: var(--success); }
.market-change.down { color: var(--danger); }
.range-switch { display: flex; gap: 4px; background: var(--bg-input); border-radius: 8px; padding: 3px; }
.range-switch button {
  border: none; background: transparent; color: var(--text-secondary); cursor: pointer;
  padding: 5px 12px; border-radius: 6px; font-size: 12px;
}
.range-switch button.active { background: var(--accent); color: #fff; font-weight: 600; }

/* ============ 收款地址 ============ */
.pay-address {
  background: rgba(16,185,129,0.10); border: 1px solid rgba(16,185,129,0.35);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 18px;
}
.pay-address-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }
.pay-address-row { display: flex; align-items: center; gap: 10px; }
.pay-address-value {
  flex: 1; font-family: monospace; font-size: 13px; color: var(--text-primary);
  word-break: break-all; line-height: 1.5;
}

/* ============ 收款二维码 ============ */
.pay-address-tag {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 6px;
  background: rgba(59,130,246,0.18); color: var(--accent); font-size: 11px; font-weight: 600;
}
.pay-address-right { flex: 1; min-width: 0; }
.pay-qr {
  flex: 0 0 132px; width: 132px; background: #fff; border-radius: 10px; padding: 6px;
  cursor: zoom-in; line-height: 0;
}
.pay-qr svg { width: 100%; height: auto; display: block; }
.pay-qr-large {
  display: inline-block; width: 300px; max-width: 100%; background: #fff;
  border-radius: 12px; padding: 12px; line-height: 0;
}
.pay-qr-large svg { width: 100%; height: auto; display: block; }
.pay-note { margin-top: 10px; font-size: 12px; color: var(--text-muted); line-height: 1.7; }

/* 后台收款二维码 */
.qr-wrap { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.qr-box {
  width: 260px; background: #fff; border-radius: 12px; padding: 12px; line-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.qr-box svg { width: 100%; height: auto; display: block; }
.qr-box .empty-tip { color: #64748b; line-height: 1.6; }
.qr-caption {
  margin-top: 10px; font-family: monospace; font-size: 11px; color: #334155;
  word-break: break-all; text-align: center; line-height: 1.5;
}
.qr-side { flex: 1; min-width: 240px; }
@media (max-width: 520px) {
  .pay-address-row { align-items: flex-start; }
  .pay-qr { flex: 0 0 110px; width: 110px; }
  .pay-qr-large { width: 240px; }
}

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(5,8,16,0.75); backdrop-filter: blur(3px);
  z-index: 500; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 820px; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  font-size: 17px; font-weight: 700; color: var(--text-primary);
}
.modal-close { cursor: pointer; color: var(--text-muted); font-size: 18px; padding: 0 4px; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 22px; overflow-y: auto; }
@media (max-width: 640px) {
  .modal { max-height: 92vh; }
  .modal-head { padding: 14px 16px; font-size: 15px; }
  .modal-body { padding: 16px; }
  .market-price { font-size: 22px; }
  .pay-address-row { flex-direction: column; align-items: stretch; }
}
