/* ============ 共享样式 ============ */
:root {
  --bg: #0e1117;
  --bg-panel: #161b26;
  --bg-card: #1c2333;
  --bg-hover: #232c40;
  --border: #2a3446;
  --text: #e6edf3;
  --text-dim: #8b98ad;
  --text-mute: #5c6b82;
  --red: #f5483f;      /* 涨 */
  --green: #26a69a;    /* 跌 */
  --gold: #f0b429;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --radius: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }

/* 涨跌色（中国市场约定：红涨绿跌） */
.up { color: var(--red); }
.down { color: var(--green); }
.flat { color: var(--text-dim); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); cursor: pointer;
  font-size: 14px; transition: all .15s; white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); border-color: #3a4763; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #2f6fe0; }
.btn-danger { background: #c33b36; border-color: #c33b36; color: #fff; }
.btn-danger:hover { background: #a9312d; }
.btn-buy { background: var(--red); border-color: var(--red); color: #fff; }
.btn-buy:hover { background: #d63d34; }
.btn-sell { background: var(--green); border-color: var(--green); color: #fff; }
.btn-sell:hover { background: #1f8a80; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-ghost { background: transparent; }

/* 输入框 */
.input, .select {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-panel);
  color: var(--text); font-size: 14px; outline: none; transition: border-color .15s;
}
.input:focus, .select:focus { border-color: var(--blue); }
.select { appearance: none; cursor: pointer; }
.input::placeholder { color: var(--text-mute); }
label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 5px; }

/* 卡片 */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
}

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-dim); font-weight: 500; font-size: 12px; position: sticky; top: 0; background: var(--bg-card); }
tbody tr:hover { background: var(--bg-hover); }
.num { font-variant-numeric: tabular-nums; }

/* 徽章 */
.badge {
  display: inline-flex; align-items: center; padding: 2px 8px;
  border-radius: 20px; font-size: 11px; font-weight: 500;
}
.badge-active { background: rgba(38,166,154,.15); color: var(--green); }
.badge-suspended { background: rgba(240,180,41,.15); color: var(--gold); }
.badge-banned { background: rgba(245,72,63,.15); color: var(--red); }
.badge-long { background: rgba(245,72,63,.15); color: var(--red); }
.badge-short { background: rgba(38,166,154,.15); color: var(--green); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; width: 90%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 18px; font-size: 17px; }
.form-row { margin-bottom: 14px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* 提示 */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 8px; font-size: 14px; z-index: 2000;
  background: var(--bg-card); border: 1px solid var(--border);
  box-shadow: 0 8px 30px rgba(0,0,0,.4); animation: fadeIn .2s;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%,-10px); } to { opacity: 1; transform: translate(-50%,0); } }

/* 空状态 */
.empty { text-align: center; color: var(--text-mute); padding: 40px 0; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2c3750; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }
