/* board.css - 参考 yihaozuan.com 鑫韵黄金金价盘风格，黑色底色改为酒红色 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #5a0e12;          /* 酒红主背景 */
  --bg-dark: #3a0709;     /* 更深酒红（头部/分组） */
  --bg-light: #7b1113;    /* 浅酒红（表头） */
  --gold: #f4d07c;        /* 金色文字 */
  --gold2: #d4a84b;       /* 暗金 */
  --red: #ff3333;         /* 价格红色 */
  --red-dark: #cc0000;    /* 深红 */
  --green: #19d28a;       /* 涨跌绿（备用） */
  --text: #f4d07c;        /* 主文字金色 */
  --white: #ffffff;
  --border: #a02a2e;      /* 边框色 */
  --border-light: #c94a4e;
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: "Consolas", "DIN Alternate", monospace;
  --text2: #e6c9a8;       /* 次级文字 */
  --text3: #c79a9c;       /* 三级文字/占位 */
  --red-btn: #ff3333;     /* 按钮红 */
  --red-btn-d: #cc0000;   /* 按钮红(按下) */
}

html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 130px; /* 给底部菜单和声明留空间 */
}

/* ===== 顶部 ===== */
.header {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo img { height: 40px; width: auto; display: block; }
.status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--gold);
}
.clock { font-family: var(--mono); font-size: 18px; letter-spacing: 1px; font-weight: 700; }
.tag { border: 1px solid var(--border-light); padding: 2px 8px; border-radius: 3px; font-size: 12px; }
/* 行情页右上角「后台」跳转按钮：与「实时金价」标签视觉融合 */
.admin-btn {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 3px 12px;
  border: 1px solid var(--gold2);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--bg-dark);
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  text-decoration: none;
  letter-spacing: 1px;
  transition: transform .08s ease, box-shadow .15s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.admin-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(244,208,124,.35); }
.admin-btn:active { transform: translateY(0); }

/* ===== 主体表格 ===== */
.main { padding: 14px 10px 20px; flex: 1; }
.price-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  background: var(--bg-dark);
  font-size: 15px;
}
.price-table th,
.price-table td {
  border: 1px solid var(--border);
  text-align: center;
  vertical-align: middle;
  padding: 10px 6px;
}
.price-table thead th {
  background: var(--bg-light);
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2px;
}
.th-empty { width: 6%; background: var(--bg-dark); }

/* 分组标题列（竖排） */
.group-name {
  background: var(--bg-dark);
  width: 6%;
  padding: 0;
}
.group-name span {
  writing-mode: vertical-rl;
  letter-spacing: 4px;
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  display: inline-block;
  white-space: nowrap;
}

/* 数据行 */
.price-table tbody tr:nth-child(odd) { background: rgba(255,255,255,.02); }
.price-table tbody tr:hover { background: rgba(255,255,255,.05); }
.price-table td.name {
  color: #5a0e12;
  font-weight: 700;
  font-size: 17px;
  background: #ffffff;
}
.price-table td.price.buy {
  color: #5a0e12;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  background: #ffffff;
}
.price-table td.price.sell {
  color: #5a0e12;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  background: #fdf2f3;
}
.price-table td.high-low {
  color: #5a0e12;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  background: #ffffff;
}
.price-table td.high-low .high,
.price-table td.high-low .low {
  display: block;
}
.price-table td.high-low .low { opacity: 0.9; }

/* 高/低列：语义色（高价红、低价绿），覆盖白底默认深红 */
.price-table td.high-low .high.hl-high { color: var(--red) !important; font-weight: 700; }
.price-table td.high-low .low.hl-low { color: var(--green) !important; font-weight: 700; }

/* 价格上涨 - 红色 */
.price-table td.up {
  color: #ff3333 !important;
  text-shadow: 0 0 8px rgba(255,51,51,.4);
}
/* 价格下跌 - 绿色 */
.price-table td.down {
  color: #19d28a !important;
  text-shadow: 0 0 8px rgba(25,210,138,.4);
}

/* 价格更新闪烁 */
.up { animation: flashUp 0.5s ease-out; }
.down { animation: flashDown 0.5s ease-out; }
@keyframes flashUp {
  0% { color: #ff3333; text-shadow: 0 0 16px rgba(255,51,51,.9); transform: scale(1.1); }
  100% { color: #ff3333; text-shadow: 0 0 8px rgba(255,51,51,.4); transform: scale(1); }
}
@keyframes flashDown {
  0% { color: #19d28a; text-shadow: 0 0 16px rgba(25,210,138,.9); transform: scale(1.1); }
  100% { color: #19d28a; text-shadow: 0 0 8px rgba(25,210,138,.4); transform: scale(1); }
}

.loading { color: var(--gold); padding: 30px; font-size: 14px; }
.muted { color: #888; }

/* ===== 底部声明 ===== */
.info {
  text-align: center;
  padding: 16px 10px 24px;
  font-size: 12px;
  color: var(--white);
  line-height: 1.8;
  border-top: 1px solid var(--border);
  margin: 0 10px;
}
.info p { margin: 0; }

/* ===== 底部菜单 ===== */
.footer-menu {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 56px;
  z-index: 20;
}
.footer-menu a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #d9a7a9;
  text-decoration: none;
  font-size: 11px;
  flex: 1;
  height: 100%;
}
.footer-menu a img { width: 22px; height: 22px; opacity: 0.8; }
.footer-menu a.active,
.footer-menu a:hover { color: var(--gold); }
.footer-menu a.active img,
.footer-menu a:hover img { opacity: 1; }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .header { padding: 10px 12px; }
  .logo img { height: 32px; }
  .clock { font-size: 15px; }
  .price-table { font-size: 13px; }
  .price-table th, .price-table td { padding: 7px 3px; }
  .price-table td.price, .price-table td.high-low { font-size: 15px; }
  .group-name span { font-size: 13px; letter-spacing: 2px; }
  .info { font-size: 11px; }
}
