/* 麒麟金行情 · 页面样式（配色与布局参照参考网页：深色底、金色品名、红色报价、红高绿低） */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  background: #252525;
}

body {
  font-family: Raleway, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #fff;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }

/* ---------------- 顶部 ---------------- */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 94px;
  background: #252525;
  border-bottom: 1px solid #27313e;
  z-index: 100;
  overflow: hidden;
}

.brand {
  position: absolute;
  left: 12px;
  top: 0;
  height: 94px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand .logo { height: 50px; width: auto; }

.brand-seal {
  width: 46px;
  height: 46px;
  border: 2px solid #c69c6d;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-size: 27px;
  font-weight: 700;
  color: #d9b07a;
  line-height: 1;
  box-shadow: inset 0 0 0 3px #252525, inset 0 0 0 4px rgba(198, 156, 109, .55);
}

.brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.brand-cn {
  font-family: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #c69c6d;
  background: linear-gradient(180deg, #f1d39b 0%, #c69c6d 55%, #9a703f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-left: 3px;
}

.brand-en {
  margin-top: 5px;
  font-size: 9px;
  letter-spacing: 4px;
  color: #c69c6d;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 4px;
}

.brand-en::before,
.brand-en::after {
  content: "";
  width: 18px;
  height: 1px;
  background: #c69c6d;
}

#stop_flag {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%); /* 不论显示 2 行还是 3 行，都在顶栏里垂直居中 */
}

#stop_flag p {
  font-size: 14px;
  line-height: 20px;
  height: 20px;
  font-weight: bold;
  white-space: nowrap;
}

#time_bj, #flag { color: #f00; }
#flag.stale { color: #ffbf24; }
#tag { color: #c69c6d; }

/* ---------------- 行情表 ---------------- */
.container {
  padding-top: 95px;
  background: #252525;
  min-height: 100vh;
}

.content_div { width: 100%; }

.paddingP {
  height: 30px;
  line-height: 25px;
  padding-top: 2px;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  background: #000;
  border-bottom: 2px solid #171e27;
  text-align: center;
  letter-spacing: 10px;
  text-indent: 10px; /* 抵消最后一个字后面的字距，让标题真正居中 */
}

.jinjia_tab {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  text-align: center;
  background: #1c2633;
}

.jinjia_tab th {
  width: 25%;
  padding: 0;
  text-align: center;
}

.th {
  height: 20px;
  line-height: 20px;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  background: #000;
  border-bottom: 1px solid #fff;
}

.bottom_line { border-bottom: 1px solid #27313e; }
.row-a { background: #252525; }
.row-b { background: #000; }

.jinjia_tab td {
  height: 55px;
  padding: 0;
  font-size: 17px;
  color: #fff;
  overflow: hidden;
  vertical-align: middle;
}

.content_name_h {
  height: 25px;
  line-height: 25px;
  font-size: 18px;
  color: #ffbf24;
  white-space: nowrap;
}

.content_subname {
  height: 15px;
  line-height: 15px;
  font-size: 13px;
  color: #aaa;
  white-space: nowrap;
}

.jinjia_tab td.price { color: #f00; }

.jinjia_tab td.hl span {
  display: block;
  line-height: 27px;
}

.redColor { color: #f00; }
.greenColor { color: #00fd00; }

/* 价格变动时闪一下：涨红跌绿 */
.flash-up { animation: flash-up 1.2s ease-out; }
.flash-down { animation: flash-down 1.2s ease-out; }

@keyframes flash-up {
  0% { background-color: rgba(255, 0, 0, .45); }
  100% { background-color: transparent; }
}

@keyframes flash-down {
  0% { background-color: rgba(0, 200, 0, .4); }
  100% { background-color: transparent; }
}

/* ---------------- 底部声明 ---------------- */
.footer_states {
  padding: 10px 10px 80px;
  background: #252525;
  font-size: 14px;
  font-weight: bold;
  line-height: 1.6;
}

.footer_states p { margin-bottom: 11px; }
.footer_states .label { color: #9c9c94; }
.footer_states .notice { color: #9c0000; }

.rolling {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 20px;
  line-height: 20px;
  background: #2b3036;
  color: #fff;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  z-index: 100;
}

/* 微信内置浏览器底部条高一点 */
.is-wechat .rolling { height: 30px; line-height: 30px; }

/* ---------------- 小屏手机 ---------------- */
@media (max-width: 360px) {
  .brand-seal { width: 38px; height: 38px; font-size: 22px; }
  .brand-cn { font-size: 26px; }
  #stop_flag p { font-size: 13px; }
  .jinjia_tab td { font-size: 15px; }
  .content_name_h { font-size: 16px; }
}

/* ---------------- 电脑 / 大屏（宽度 ≥ 890px）：紧凑排版，整页一屏看完 ----------------
 * 行高按浏览器窗口高度自动计算：
 *   可用高度 = 窗口高度 - 顶部(53) - 每个分组标题和表头(46×分组数) - 行分隔线(1×行数)
 *              - 底部声明(上下留白 18 + 22×显示的行数)
 *   每行高度 = 可用高度 ÷ 行数，限制在 30～64px 之间
 * 1080p 全屏时每行约 50px，与参考页在电脑上的观感一致；分组数/行数/底部行数由页面模板自动传入。
 */
@media (min-width: 890px) {
  body {
    --rh: clamp(30px, calc((100vh - 71px - var(--foot, 4) * 22px - var(--secs, 3) * 46px - var(--rows, 13) * 1px) / var(--rows, 13)), 64px);
    --fs: clamp(13px, calc(var(--rh) * 0.31), 20px);
  }

  #header { height: 52px; }
  .brand { height: 52px; left: 12px; gap: 6px; }
  .brand .logo { height: 46px; }
  .brand-seal { width: 38px; height: 38px; font-size: 22px; }
  .brand-cn { font-size: 27px; letter-spacing: 3px; padding-left: 3px; }
  .brand-en { font-size: 8px; letter-spacing: 3px; margin-top: 3px; }
  .brand-en::before, .brand-en::after { width: 16px; }

  #stop_flag { right: 14px; }
  #stop_flag p { font-size: 12px; line-height: 14px; height: 14px; }

  .container { padding-top: 53px; min-height: 0; }

  .paddingP {
    height: 25px;
    line-height: 22px;
    padding-top: 1px;
    font-size: 18px;
    letter-spacing: 5px;
    text-indent: 5px;
    border-bottom-width: 1px;
  }

  .th { height: 20px; line-height: 20px; font-size: 15px; }

  .jinjia_tab td { height: var(--rh); font-size: var(--fs); }
  .content_name_h { height: auto; line-height: 1.25; font-size: var(--fs); }
  .content_subname { height: auto; line-height: 1.2; font-size: 10px; }
  .jinjia_tab td.hl span { line-height: calc(var(--rh) / 2 - 1px); }

  .footer_states { font-size: 12px; line-height: 1.5; padding: 8px 12px 10px; }
  .footer_states p { margin-bottom: 4px; }
  .rolling { display: none; }
}
