/* ============================================================
   Tap Mahj Pal — 全数据链样式层（仪表盘数值 / Standings / Frenemies / 空态）
   黑金主题，复用 --pal-* 变量；红绿沿用全站既约定（赢/正=绿 #10B981，负=红 #FF3B30）。
   ============================================================ */

/* ---- 仪表盘：红绿数值（与 pal-friends 美股式约定一致：正绿 / 负红） ---- */
.pal-stat-val.is-pos, .pal-mtd-num.is-pos { color: #10B981; }
.pal-stat-val.is-neg, .pal-mtd-num.is-neg { color: #FF3B30; }

/* ---- 首页战况条空态 ---- */
.lg-empty {
  padding: 18px 14px; text-align: center;
  font-family: var(--pal-sans); font-size: 13px; line-height: 1.5;
  color: rgba(243,223,168,.55);
}

/* ============================================================
   Standings 子页
   ============================================================ */
.stn-chart-wrap {
  flex: none;                 /* 八哥令 2026-10-23 八修：列表改滚动容器后，图表/胶囊
                                 必须钉死不参与压缩，否则 flex 会把曲线压扁 */
  width: 100%;
  overflow-x: auto;            /* K 线可左右滑动看趋势 */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 10px 0 4px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
  border-bottom: 1px solid rgba(212,175,55,.14);
}
/* 八哥令：曲线支持手指左右拖动看历史；不拖动时脚本会滚到最右（最新）。
   注意：主站 common.css 有全局 canvas{max-width:100}，会把画布压在容器内导致永远滑不动，
   这里用 ID 选择器覆盖解除压制（仅 pal 内生效，主站零波及）。 */
#stnChart { display: block; touch-action: pan-x; max-width: none; }
.stn-chart-wrap::-webkit-scrollbar { display: none; }
.stn-chart-wrap { scrollbar-width: none; }

/* 八哥令 2026-10-22：时间预设四枚胶囊——必须落在【曲线图下方、排名列表上方】，
   点击即按周期（本周=周一起/本月=1号起/本年/全量）重算下方排名与走势。
   样式与 Me 页 .me-preset 同语言：黑金描边 + 激活香槟金填充。
   八哥令（同日二次）：按钮与字整体缩小（后续还要加内容）——flex 改按内容自适应可收缩。 */
.stn-presets {
  flex: none;                 /* 八哥令 2026-10-23 八修：胶囊行同钉死不压缩 */
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 8px 2px 2px;
}
.stn-preset {
  flex: 0 1 auto; min-width: 0; padding: 5px 7px;
  background: var(--pal-panel-2, #1B1B1E);
  border: 1.5px solid var(--pal-line, rgba(243,223,168,.28));
  border-radius: 9px;
  color: var(--pal-txt, #F2F2F2);
  font-family: var(--pal-sans, 'Nunito', system-ui, sans-serif);
  font-size: 11px; font-weight: 700; letter-spacing: 0; white-space: nowrap;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.stn-preset.is-on {
  background: linear-gradient(180deg, rgba(243,223,168,.92), rgba(212,175,55,.92));
  border-color: rgba(243,223,168,.95);
  color: #1A140A; text-shadow: 0 1px 0 rgba(255,255,255,.25);
  box-shadow: 0 0 12px rgba(212,175,55,.28);
}
.stn-preset:active { border-color: var(--pal-gold, #D4AF37); }

/* 八哥令（2026-10-22 同日二次）：All-Time 右侧按顺序三件套——
   ① 抽象小笑脸（金色线条，与全站线条图标同语言）
   ② 绿字 Roast 'Em（与好友录/详情页 Roast 同源 --pal-msg 深绿）
   ③ 精致转发小图标（金色线条）
   三者均【先不链接】任何行为；笑脸 margin-left:auto 把三件套推到行右端。 */
/* 八哥令（2026-10-22 三修）：All-Time 右侧三件套——
   ① 「大圣坏笑」小猴（好友录原版手绘 SVG）：比原笑脸放大一倍，歪着头上下跳，
      跳起来探到上面曲线也无所谓（八哥令原话）；动画 transform-origin 靠下，像踮脚蹦。
   ② 绿字 Roast 'Em（--pal-msg 深绿）
   ③ 全站共用分享图标 #palShare（Lucide 官方 share：盒子底座 + 向上伸出箭头），做大醒目。 */
@keyframes stnMonkeyJump {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50%      { transform: translateY(-7px) rotate(8deg); }
}
.stn-monkey {
  flex: none; margin-left: auto; margin-top: -8px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  animation: stnMonkeyJump 1.5s ease-in-out infinite;
  transform-origin: 50% 85%;
  pointer-events: none; user-select: none;
}
.stn-monkey svg { width: 36px; height: 36px; display: block; }
.stn-roast {
  flex: none; background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--pal-sans, 'Nunito', system-ui, sans-serif);
  font-size: 11.5px; font-weight: 800; letter-spacing: 0; white-space: nowrap;
  /* 八哥令（2026-10-22 六修）：文案 Flexing 是炫耀，用金色（与分享图标同一支香槟金） */
  color: var(--pal-gold-l, #F3DFA8);
  -webkit-tap-highlight-color: transparent;
}
.stn-roast:active { opacity: .72; }
/* 八哥令（2026-10-22 四修）：分享图标换微软 Fluent 官方「share」——
   底下盒子基座 + 弯箭头向右飞出去（Windows 11 分享键同款，一眼即懂）。
   加一个周期性「向右飞」小动画强化裂变感；颜色香槟金 + 金晕（可随用随改）。 */
@keyframes stnShareFly {
  0%, 55%, 100% { transform: translateX(0); }
  65%           { transform: translateX(3px); }
  75%           { transform: translateX(.5px); }
  85%           { transform: translateX(2px); }
}
/* 八哥令（2026-10-23 六修·纠偏）：转发小图标一律是 button——宿敌详情页 .stn-share
   从纯展示 span 升为唯一分享入口（曾误把分享链挂在 Roast 字上，已被八哥令揪出）；
   按钮 reset + 按压感（:active 缩放淡出）+ 咔哒音进 pal-touch ACTION_SEL 白名单。 */
.stn-share {
  flex: none; width: 24px; height: 24px;
  display: grid; place-items: center; color: var(--pal-gold-l, #F3DFA8);
  filter: drop-shadow(0 0 6px rgba(212,175,55,.35));
  background: none; border: 0; padding: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease, opacity .12s ease;
}
.stn-share:active { transform: scale(.86); opacity: .7; }
.stn-share svg { width: 22px; height: 22px; display: block; animation: stnShareFly 2.2s ease-in-out infinite; }

/* 【八哥令 2026-10-23 八修·致命修复】排名列表必须是滚动容器：
   曾因 .stn-list 无 flex/overflow 裸奔，11~12 条起直接溢出盖住
   .pal-subtabs 文字签（八哥实测「把导航栏下面的导航栏全部挡住了」）。
   修法与 Logbook .lg-list 完全同款：flex:1 + min-height:0 + overflow-y:auto，
   列表在自己肚子里下滑，图表/胶囊/文字签永不被碰。 */
.stn-list {
  /* 八哥令（iOS 阴影层排雷）：height:0 显式归零基线——iOS WebKit 对纯
     flex:1 的嵌套滚动容器偶发按内容撑高（min-height:0 失灵），列表底缘
     越过裁剪线把行画进分页签条区域。height:0 + flex-grow 是 iOS 最稳写法。 */
  flex: 1 1 0; height: 0; min-height: 0; width: 100%; max-width: 420px;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  /* 八哥令（iOS 阴影层·最后一道锁）：translateZ(0) 强制本容器就地合成——
     iOS 上 -webkit-overflow-scrolling:touch 会把滚动内容提到独立合成层，
     此时父级 overflow:hidden 对它形同虚设（内容能画到按钮条上方成灰黑带）。
     强制自带合成层后，裁剪链重新生效，内容严格消失在自己的边界线上。 */
  transform: translateZ(0); -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  padding: 6px 0 24px;
}
.stn-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-family: var(--pal-sans);
}
.stn-rank {
  width: 22px; text-align: center; flex: none;
  font-size: 14px; font-weight: 700; color: rgba(243,223,168,.7);
}
.stn-crown { font-size: 18px; flex: none; line-height: 1; }
.stn-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 15px; font-weight: 600; color: #F4F4F2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 八哥令：Standings 净分/胜率与 Frenemies 同款——17px logo 衬线、等宽数字；
   色调同款：Net 正绿负红；Win% >50 绿、=50 白、<50 红。 */
.stn-net {
  flex: none; font-family: var(--pal-serif); font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stn-net.is-win { color: #10B981; }
.stn-net.is-lose { color: #FF3B30; }
.stn-net.is-even { color: #FFFFFF; }   /* 八哥令（2026-10-22）：净分 0 = 纯白（此前漏定义，0 分吃继承色） */
.stn-win {
  flex: none; width: 54px; text-align: right;
  font-family: var(--pal-serif); font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #FFFFFF;
}
.stn-win.is-win { color: #10B981; }
.stn-win.is-lose { color: #FF3B30; }
.stn-win.is-even { color: #FFFFFF; }
/* YOU 行：微微发光 + 金色文字，一眼看到自己位置 */
.stn-row.is-me {
  background: linear-gradient(90deg, rgba(212,175,55,.16), rgba(212,175,55,.04));
  box-shadow: inset 0 0 0 1px rgba(212,175,55,.35), 0 0 18px rgba(212,175,55,.18);
}
.stn-row.is-me .stn-name { color: var(--pal-gold-l); }
.stn-row.is-me .stn-rank { color: var(--pal-gold); }
.stn-empty, .fr-detail-empty {
  padding: 26px 18px; text-align: center;
  font-family: var(--pal-sans); font-size: 13px; line-height: 1.6;
  color: rgba(243,223,168,.55);
}

/* 八哥令：Frenemies 内容必须自己滚，严禁溢出画到 Logbook/Standings/Frenemies
   栏目条底下（与 Logbook 的 .lg-list 同款滚动容器） */
.fr-detail {
  /* 八哥令（iOS 阴影层排雷）：同 .stn-list——height:0 归零基线，iOS 不再撑高外泄 */
  flex: 1 1 0; height: 0; min-height: 0; width: 100%; max-width: 420px;
  display: flex; flex-direction: column;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  /* 八哥令（iOS 阴影层·最后一道锁）：translateZ(0) 强制本容器就地合成——
     iOS 上 -webkit-overflow-scrolling:touch 会把滚动内容提到独立合成层，
     此时父级 overflow:hidden 对它形同虚设（内容能画到按钮条上方成灰黑带）。
     强制自带合成层后，裁剪链重新生效，内容严格消失在自己的边界线上。 */
  transform: translateZ(0); -webkit-transform: translateZ(0);
  backface-visibility: hidden;
  margin-top: 16px;
  /* 八哥令 2026-10-24：呼吸移入肚内（同 .lg-list）——.d-page 底部 padding 收紧到
     正好 52px，滚到底的留白由容器自身给，栏目条顶线上方零死黑带。 */
  padding-bottom: 20px;
}

/* ============================================================
   Frenemies 子页（列表 + 专属交战详情）
   ============================================================ */
.fn-list { display: flex; flex-direction: column; gap: 12px; padding: 8px 0 24px; }
/* 八哥令：金框卡片行——金边框住、圆角、去底部分隔线与右箭头 */
.fn-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; cursor: pointer;
  border: 1px solid rgba(212,175,55,.32);
  border-radius: 16px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.fn-row:active { background: rgba(243,223,168,.07); }
.fn-av {
  width: 48px; height: 48px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--pal-serif); font-size: 20px; font-weight: 700;
  color: var(--pal-ink);
  background: linear-gradient(100deg,var(--pal-gold-l),var(--pal-gold));
  /* 八哥令 2026-10-25：去 overflow + position:relative——圆裁交给 img 自身
     border-radius，真人绿勾 .real-check 探出圆角外（Frenemies 同权）。 */
  position: relative;
}
/* 好友照片头像：铺满圆框（img 自裁圆，父级不再 overflow——给绿勾让路） */
/* #474：img absolute 盖面——首字母底层常驻，图裂/加载失败自隐后露出字母金圆 */
.fn-av img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.fn-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.fn-name {
  font-family: var(--pal-sans); font-size: 17px; font-weight: 700;
  color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 八哥令：三个数据各占一行（Games / Net Pts / Your Win），竖杠冒号全去掉；
   标签在前加大（13px）且定宽，数字列全部对齐、行距统一；
   数字 17px 衬线：正/超 50% 绿 #10B981、负/低于 50% 红 #FF3B30、恰 50% 白。 */
.fn-stats {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.fn-line { display: flex; align-items: baseline; }
.fn-lbl {
  flex: none; width: 78px;
  font-family: var(--pal-sans); font-size: 13px;
  color: rgba(243,223,168,.65); white-space: nowrap;
}
.fn-num {
  font-family: var(--pal-serif); font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: #FFFFFF;
}
.fn-num.is-win { color: #10B981; }
.fn-num.is-lose { color: #FF3B30; }
.fn-num.is-even { color: #FFFFFF; }

/* 八哥令：Frenemies 行后排固定徽标——绑定位次不随玩家走；logo 同款衬线，美股式红绿，
   淡色为稍浅一档；竖排居中、靠右框、不挡数据与点击。 */
.fn-badge {
  flex: none; align-self: center; margin-left: auto; padding-left: 14px;
  font-family: var(--pal-serif); font-weight: 700; font-size: 16px;
  letter-spacing: .02em; line-height: 1; white-space: nowrap;
  pointer-events: none; user-select: none;
}
/* 八哥令：徽标首字前加一抹金竖线，与首字母留约 1.2 字符(Georgia 16px≈10px)间隙，显高级 */
.fn-badge::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 2px; height: .92em; margin-right: 10px; border-radius: 1px;
  background: linear-gradient(180deg, var(--pal-gold-l), var(--pal-gold));
  transform: translateY(-1px);
}
.fn-badge.bdg-rival  { font-size: 18px; color: #FF3B30; }   /* 第1 · 美股红 */
.fn-badge.bdg-red-soft   { color: #FF7A75; }                 /* 第2 · 淡美股红 */
.fn-badge.bdg-green-soft { color: #4FD9AF; }                 /* 倒数第2 · 淡美股绿 */
.fn-badge.bdg-cow    { color: #10B981; }                     /* 末位 · 美股绿 */

.fr-detail-head {
  display: flex; align-items: center; gap: 0;
  padding: 12px 16px; border-bottom: 1px solid rgba(212,175,55,.14);
}
/* 八哥令（2026-10-22）二次精修：面包屑「Frenemies」字样去掉——详情页如同
   弹窗，不必提醒用户身处哪个页面；姓名成为头部第一个元素。 */
.fr-detail-name {
  font-family: var(--pal-serif); font-size: 17px; font-weight: 700; color: var(--pal-gold-l);
  /* 姓名后隔约 3-4 字符再接白色大叉 */
  margin-right: 12px;
}
/* 白色大叉 ×：八哥令「叉必须要大、直接用白色、形状参考导航栏关闭钮」——
   与 .ibd-close 同款形式（&times; 字符），去掉金边圆底，纯白。
   八哥令（五修）：叉再加大一档（30px 字 + 44×44 触控区），用户点起来更顺手。 */
.fr-detail-x {
  flex: none; background: none; border: 0; padding: 0; cursor: pointer;
  width: 44px; height: 44px; margin-right: -2px;
  display: grid; place-items: center;
  font-family: var(--pal-sans); font-size: 30px; font-weight: 300; line-height: 1;
  color: #FFFFFF;
  -webkit-tap-highlight-color: transparent;
}
.fr-detail-x:active { opacity: .68; }
/* 总指挥令 2026-10-24（图标统一令）：× 为全站白色 SVG 大叉，26px 视觉
   （原 30px 字符同档；44×44 触控区不变，仍好点按） */
.fr-detail-x svg { width: 26px; height: 26px; display: block; }
/* 八哥令（2026-10-22 五修）：详情页头部原封搬入 Standings 三件套——
   跳动小猴（#palMonkeyGrin）→ 绿字 Roast 'Em（.stn-roast）→ Fluent 分享图标（#palShare），
   大小与 Standings 完全一致；此处只调间距不改大小：
   monkey 去掉 Standings 的 margin-left:auto / -8px 上探（那是曲线行专用），
   三件套依次紧跟大叉之后。Roast 'Em 沿用 fnRoast 原生分享链路；分享图标纯展示。 */
.fr-detail-head .stn-monkey { margin-left: 12px; margin-top: 0; }
.fr-detail-head .stn-roast { margin-left: 10px; }
.fr-detail-head .stn-share { margin-left: 14px; }
.fr-game {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; border-bottom: 1px solid rgba(255,255,255,.05);
  font-family: var(--pal-sans);
}
.fr-game-date { font-size: 13px; color: rgba(243,223,168,.6); font-variant-numeric: tabular-nums; }
.fr-game-net { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
/* 八哥令（2026-10-22）第四点：详情页对局分数红绿白三色分明——
   赢绿（#10B981）/ 输红（#FF3B30）/ 平白（#FFFFFF），与 .stn-net/.fn-num
   同句式。此前 is-win/is-lose/is-even 在 .fr-game-net 上漏定义，分数全白。 */
.fr-game-net.is-win  { color: #10B981; }
.fr-game-net.is-lose { color: #FF3B30; }
.fr-game-net.is-even { color: #FFFFFF; }
