/* ==========================================================================
   老王水贝黄金 · 行情 / 快讯 单页应用
   视觉方案：卡片流（现代 App 风）
   品牌 / 公告 / 品种 / 二维码 / 底部导航全部来自 site.json
   ========================================================================== */

/* 数字专用字体（Inter latin，SIL OFL 许可可商用）
   unicode-range 把范围锁死成 0-9 与小数点，中文与字母完全不受影响 */
@font-face {
  font-family: "NumSans";
  src: url("/static/num.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0030-0039, U+002E, U+002D, U+002C;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --gold: #c9922a;
  --gold-lt: #f2c45c;
  --up: #d92b26;          /* 涨 = 红（国内习惯） */
  --down: #0a8f5c;        /* 跌 = 绿 */
  --txt: #151a23;
  --dim: #9aa2b0;
  --line: #e9edf3;
}

html, body { background: #eef1f6; }

body {
  /* 西文优先、中文兜底：避免数字被中文字体接管（雅黑数字偏粗偏钝） */
  font-family: "NumSans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display",
               "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "HarmonyOS Sans SC", "MiSans",
               "OPPO Sans", "vivo Sans", "Noto Sans CJK SC", "Source Han Sans SC", "Hiragino Sans GB",
               "Microsoft YaHei", Arial, sans-serif;
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.phone { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #eef1f6; padding-bottom: 96px; }

/* ---------------- 品牌大卡 ---------------- */
.hero {
  position: relative;
  margin: 14px 14px 0;
  padding: 18px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1f2b, #2a3140 55%, #3b3122);
  box-shadow: 0 10px 30px rgba(24, 30, 44, .2);
}
.hero::after {
  content: ""; position: absolute; right: -46px; top: -52px; width: 168px; height: 168px;
  border-radius: 50%; background: radial-gradient(circle, rgba(242, 196, 92, .3), transparent 70%);
}
.hero-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand     { display: flex; align-items: center; gap: 11px; min-width: 0; }
.mark      { width: 34px; height: 34px; flex: none; }
.cn        { font-size: 20px; font-weight: 700; letter-spacing: .07em; line-height: 1.25;
             background: linear-gradient(135deg, #fff5cf, #f2c45c 45%, #d3a13a);
             -webkit-background-clip: text; background-clip: text; color: transparent; }
.en        { font-size: 9px; letter-spacing: .16em; color: #8b93a3; margin-top: 3px; }

.qr-row    { display: flex; gap: 10px; flex: none; }
.hero-qr   { flex: none; text-align: center; }
.hero-qr img  { width: 54px; height: 54px; display: block; border-radius: 10px; background: #fff; padding: 3px; }
.hero-qr span { display: block; font-size: 9px; color: #9aa2b0; margin-top: 4px; }

.hero .strip { position: relative; display: flex; align-items: center; gap: 7px; margin-top: 14px;
               font-size: 10.5px; color: #9aa2b0; }
.dot  { width: 6px; height: 6px; border-radius: 50%; background: #12d67f; box-shadow: 0 0 8px #12d67f;
        animation: breath 1.8s ease-in-out infinite; flex: none; }
@keyframes breath { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.hero .tag { margin-left: auto; color: #f2c45c; border: 1px solid rgba(242, 196, 92, .3);
             border-radius: 20px; padding: 2px 9px; font-size: 9.5px; white-space: nowrap; }

/* ---------------- 推广按钮 ---------------- */
.cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 14px 0; padding: 14px; border-radius: 14px;
  background: linear-gradient(135deg, #f6d98a, #e0ac3c 55%, #c9922a);
  color: #241a05; font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 20px rgba(224, 172, 60, .22);
}
.cta svg { opacity: .7; animation: ctanudge 1.6s ease-in-out infinite; }
@keyframes ctanudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(3px); } }
.cta.hide { display: none; }

/* ---------------- 公告（无缝跑马灯，内容需两份） ---------------- */
.ticker { display: flex; align-items: center; gap: 9px; margin: 10px 14px 0; padding: 10px 12px;
          border-radius: 13px; background: #fff; box-shadow: 0 1px 3px rgba(20, 24, 33, .05); }
.tk-ico { flex: none; font-size: 10px; color: #a8761a; background: #fdf7e8; border-radius: 5px;
          padding: 2px 7px; letter-spacing: .1em; }
.tk-view { overflow: hidden; flex: 1; height: 18px; }
.tk-txt  { white-space: nowrap; font-size: 12.5px; line-height: 18px; color: #6b7484;
           display: inline-block; letter-spacing: .02em; animation: roll 30s linear infinite; }
.tkgap   { display: inline-block; width: 46px; }
@keyframes roll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---------------- 行情卡片网格 ---------------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 0 14px; margin-top: 11px; }
.card {
  position: relative; background: #fff; border-radius: 16px; padding: 12px 13px 11px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(20, 24, 33, .06), 0 6px 18px rgba(20, 24, 33, .045);
}
.card.main { background: linear-gradient(160deg, #fffdf7, #fff); }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
                background: linear-gradient(180deg, #f0d48a, #c9922a); opacity: 0; }
.card.main::before { opacity: 1; }

.ctop { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.cnm  { font-size: 12.5px; font-weight: 600; color: #5c6675; letter-spacing: .03em; }
.pill { font-size: 9.5px; font-weight: 700; border-radius: 20px; padding: 2px 7px; line-height: 1.6; flex: none; }
.pill.up   { background: #fdeceb; color: #d92b26; }
.pill.down { background: #e7f7f0; color: #0a8f5c; }
.pill.flat { background: #f0f2f6; color: #98a0ad; }
.nt   { display: block; font-size: 9px; color: #a8761a; margin: -5px 0 6px; }

.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pbox   { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.plabel { align-self: flex-start; font-size: 9.5px; font-weight: 700; letter-spacing: .06em;
          border-radius: 5px; padding: 1px 6px; }
.plabel.bid { background: #fdf6e6; color: #a8761a; }
.plabel.ask { background: #eef1f6; color: #6b7484; }
.pval { font-size: 18px; font-weight: 700; letter-spacing: -.012em; line-height: 1.2;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-feature-settings: "tnum" 1; }

.hl { display: flex; gap: 9px; margin-top: 8px; font-size: 10px; font-weight: 600; }
.hl span { white-space: nowrap; }

.up   { color: var(--up); }
.down { color: var(--down); }
.flat { color: #7d8797; }

/* ---------------- 声明 ---------------- */
.memo { margin: 16px 16px 0; list-style: none; font-size: 10.5px; color: #9aa2b0; line-height: 1.9; }
.memo .red { color: #d92b26; }

/* ---------------- 快讯 ---------------- */
.fh    { display: flex; align-items: center; gap: 8px; padding: 18px 16px 12px; }
.fdot  { width: 6px; height: 6px; border-radius: 50%; background: #d92b26;
         box-shadow: 0 0 0 3px rgba(217, 43, 38, .13); animation: breath 1.6s ease-in-out infinite; flex: none; }
.ft    { font-size: 15px; font-weight: 700; color: #151a23; letter-spacing: .06em; }
.fu    { margin-left: auto; font-size: 10px; color: #a8b0bd; white-space: nowrap; }
.flist { padding: 0 14px; }
.fitem { padding: 13px 15px; border-radius: 14px; background: #fff; margin-bottom: 9px;
         box-shadow: 0 1px 3px rgba(20, 24, 33, .05); }
.fitem.imp { border-left: 3px solid #d92b26; }
.fmeta { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #a8b0bd; margin-bottom: 6px; }
.ftime { color: #a8761a; font-weight: 700; }
.fimp  { background: #d92b26; color: #fff; border-radius: 4px; padding: 0 5px; font-size: 9px; }
.fsrc  { color: #a8b0bd; }
.ftitle { font-size: 12.5px; font-weight: 700; margin-bottom: 3px; }
.fbody  { font-size: 12.5px; line-height: 1.75; color: #49505e; white-space: pre-line; }
.flash-pic  { width: 100%; display: block; border-radius: 10px; margin-top: 9px; }
.flash-foot { padding: 14px 4px 8px; text-align: center; font-size: 10.5px; color: #a8b0bd; }

/* ---------------- 悬浮底部导航 ---------------- */
.tb {
  position: fixed; left: 0; right: 0; bottom: 12px; width: calc(100% - 28px); max-width: 452px;
  margin: 0 auto; display: flex; padding: 7px; border-radius: 22px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(24, 30, 44, .16), 0 0 0 1px rgba(20, 24, 33, .04);
  padding-bottom: calc(7px + env(safe-area-inset-bottom));
}
.tb a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: #9aa2b0; text-decoration: none; padding: 6px 0;
  border-radius: 16px; font-weight: 600;
}
.tb a svg { width: 18px; height: 18px; fill: currentColor; }
.tb a.on  { color: #8a6520; background: linear-gradient(180deg, #fdf7e9, #faf1dc); }

/* ---------------- 状态 ---------------- */
.view[hidden] { display: none !important; }
.loading { padding: 28px 16px; text-align: center; font-size: 12px; color: #9aa2b0; }
.offline { margin: 14px 14px 0; padding: 11px 14px; border-radius: 12px; background: #fdeceb;
           color: #d92b26; font-size: 11.5px; text-align: center; }
.offline[hidden] { display: none !important; }


/* ==========================================================================
   点击「了解更多」→ 加微信浮层
   说明：网页无法直接唤起微信「添加好友」页面，采用业界通用做法 ——
   放大二维码（微信内长按即识别 / 截图后扫一扫）+ 一键复制微信号 + 唤起微信 App
   ========================================================================== */
.wxm            { position: fixed; inset: 0; z-index: 9999; display: none;
                  align-items: center; justify-content: center; padding: 22px;
                  overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wxm.on         { display: flex; }
.wxm-mask       { position: absolute; inset: 0; background: rgba(9, 11, 16, .72);
                  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
                  animation: wxfade .22s ease-out; }
@keyframes wxfade { from { opacity: 0; } to { opacity: 1; } }
.wxm-card       { position: relative; width: 100%; max-width: 318px; background: #fff;
                  border-radius: 22px; padding: 24px 20px 20px; text-align: center;
                  box-shadow: 0 24px 60px rgba(0, 0, 0, .34);
                  animation: wxpop .28s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes wxpop { from { opacity: 0; transform: translateY(14px) scale(.95); } to { opacity: 1; transform: none; } }
.wxm-x          { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px;
                  border: 0; background: transparent; color: #b6bcc7; font-size: 22px;
                  line-height: 1; cursor: pointer; border-radius: 50%; padding: 0; }
.wxm-x:active   { background: #f0f2f6; }
.wxm-badge      { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .14em;
                  color: #a8761a; background: #fdf7e8; border-radius: 20px; padding: 3px 10px;
                  margin-bottom: 11px; }
.wxm-ttl        { font-size: 16.5px; font-weight: 700; color: #151a23; letter-spacing: .03em; }
.wxm-sub        { font-size: 11.5px; color: #8b93a2; margin-top: 7px; line-height: 1.6; }
.wxm-qrwrap     { position: relative; width: 208px; margin: 15px auto 0; }
.wxm-qr         { width: 208px; height: 208px; border-radius: 16px; background: #fff;
                  border: 1px solid #e9edf3; padding: 9px; box-shadow: 0 6px 20px rgba(20, 24, 33, .07); }
.wxm-qr img     { width: 100%; height: 100%; display: block; border-radius: 9px; }
.wxm-corner     { position: absolute; width: 19px; height: 19px; border: 2px solid #e0ac3c; border-radius: 3px; }
.wxm-qrwrap .c1 { left: -5px;  top: -5px;    border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.wxm-qrwrap .c2 { right: -5px; top: -5px;    border-left: 0;  border-bottom: 0; border-radius: 0 6px 0 0; }
.wxm-qrwrap .c3 { left: -5px;  bottom: -5px; border-right: 0; border-top: 0;    border-radius: 0 0 0 6px; }
.wxm-qrwrap .c4 { right: -5px; bottom: -5px; border-left: 0;  border-top: 0;    border-radius: 0 0 6px 0; }
.wxm-tip1       { font-size: 12.5px; font-weight: 700; color: #151a23; margin-top: 15px; }
.wxm-tip2       { font-size: 10.5px; color: #9aa2b0; margin-top: 6px; line-height: 1.65; }
.wxm-id         { display: none; align-items: center; justify-content: center; gap: 8px;
                  margin-top: 14px; background: #f5f7fa; border-radius: 12px; padding: 9px 12px; }
.wxm-id.on      { display: flex; }
.wxm-id b       { font-size: 13px; color: #151a23; letter-spacing: .04em; font-weight: 700; }
.wxm-id span    { font-size: 10.5px; color: #8b93a2; }
.wxm-copy       { border: 0; background: #fdf1d8; color: #a8761a; font-size: 10.5px; font-weight: 700;
                  border-radius: 7px; padding: 4px 9px; cursor: pointer; flex: none; }
.wxm-copy:active { background: #f8e6bf; }
.wxm-open       { display: flex; align-items: center; justify-content: center; gap: 7px;
                  margin-top: 13px; padding: 13px; border-radius: 14px;
                  background: linear-gradient(135deg, #1aad19, #12910f); color: #fff;
                  font-size: 13.5px; font-weight: 700; text-decoration: none;
                  box-shadow: 0 6px 18px rgba(26, 173, 25, .24); }
.wxm-open:active { opacity: .9; }
.wxm-open svg   { width: 17px; height: 17px; fill: #fff; }
.wxm-done       { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 10000;
                  background: rgba(20, 24, 33, .9); color: #fff; font-size: 12.5px;
                  border-radius: 10px; padding: 11px 18px; opacity: 0; pointer-events: none;
                  transition: opacity .22s; }
.wxm-done.on    { opacity: 1; }

/* 矮屏手机（如 iPhone SE 667px）收紧，保证「打开微信」按钮不被挤出屏幕 */
@media (max-height: 720px) {
  .wxm         { padding: 12px; }
  .wxm-card    { padding: 18px 16px 16px; border-radius: 20px; }
  .wxm-qrwrap,
  .wxm-qr      { width: 170px; }
  .wxm-qr      { height: 170px; padding: 7px; }
  .wxm-tip1    { margin-top: 11px; }
  .wxm-id      { margin-top: 10px; padding: 7px 11px; }
  .wxm-open    { margin-top: 10px; padding: 11px; }
}

/* 超窄屏（≤360px）再收一点，防止品牌名与二维码挤在一起 */
@media (max-width: 360px) {
  .cn          { font-size: 18px; }
  .hero-qr img { width: 48px; height: 48px; }
  .pval        { font-size: 16.5px; }
  .grid        { gap: 8px; padding: 0 11px; }
  .card        { padding: 11px 11px 10px; }
}
