/* ============================================================================
   Css/share.css —— 玩家分享弹层 / 分享按钮（2026-11-17）
   独立文件，改样式只换本文件版本号，不动 portal/hall/player 现有样式。
   ============================================================================ */
.tshare { position: relative; }

/* 详情页底部有游戏站复用的 PWA 安装提示（.frdt-pwa-hint，z-index 2147483000）。
   浅色/编辑风皮肤下详情页操作行靠下，提示条会盖住分享按钮导致点不到。
   只把详情页的分享组件抬到提示之上，其它页面不动。 */
body.pl-detail .tshare { z-index: 2147483001; }

/* 详情页手机端：分享入口由 JS 移到 body 并固定到右下角，
   彻底脱离 .wrap 层叠上下文，也不会被 PWA 安装提示条盖住 */
body.pl-detail .tshare-detail-float {
  position: fixed; right: 16px; bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  z-index: 2147483001; margin: 0;
}
body.pl-detail .tshare-detail-float .tshare-btn {
  width: 52px; height: 52px; padding: 0; border-radius: 50%;
  flex-direction: column; gap: 1px; font-size: 10px; font-weight: 600;
  background: #1b1812; color: #e8cf92;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 0 0 1px rgba(176, 141, 52, .35);
}

/* 玩家中心页头右侧的分享按钮 */
.ph-share { margin-top: 10px; }

.tshare-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 19px; cursor: pointer;
  border: 1px solid rgba(176, 141, 52, .55);
  background: rgba(176, 141, 52, .10);
  color: var(--t1, #e8cf92); font: 600 14px/1 "Microsoft YaHei", system-ui, sans-serif;
  transition: background .2s, border-color .2s, transform .2s;
  flex: 0 0 auto; white-space: nowrap;
}
.tshare-btn:hover { background: rgba(176, 141, 52, .22); border-color: #ddb85c; transform: translateY(-1px); }
.tshare-btn:active { transform: translateY(0); }
.tshare-btn-ico { display: inline-flex; width: 17px; height: 17px; }
.tshare-btn-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

/* 大厅右下角浮层：与「福利中心」错开，不压住内容；底部按安全区抬升，避免被手势条遮住 */
.tshare-btn-float {
  position: fixed; right: 30px; bottom: calc(212px + env(safe-area-inset-bottom, 0px)); z-index: 61;
  width: 58px; height: 58px; padding: 0; border-radius: 50%;
  flex-direction: column; gap: 1px; font-size: 11px; font-weight: 600;
  background: #1b1812; color: #e8cf92;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45), 0 0 0 1px rgba(176, 141, 52, .35);
}
.tshare-btn-float .tshare-btn-ico { width: 20px; height: 20px; }
.tshare-btn-float:hover { background: #262116; }

/* 弹层
   2026-11-18：.tshare-mask 由 share.js 在打开时搬到 <body>（portal）。
   原因：详情页 .d-banner 带 transform / backdrop-filter / 动画，形成层叠上下文与 fixed 包含块，
   弹层留在里面时 position:fixed 会退化成相对 banner 定位，遮罩只盖住 banner 高度，
   下面的内容把弹层下半截压住（真机「分享被挡住」）。搬到 body 后固定铺满视口。
   z-index 取 2147483002：高于 .frdt-pwa-hint(2147483000) 与详情页浮动分享按钮(2147483001)。 */
.tshare-mask {
  position: fixed; inset: 0; z-index: 2147483002;
  background: rgba(6, 5, 3, .66); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow: auto; -webkit-overflow-scrolling: touch;
  animation: tshareFade .18s ease-out;
}
.tshare-mask[hidden] { display: none; }
@keyframes tshareFade { from { opacity: 0; } to { opacity: 1; } }

.tshare-dlg {
  width: 430px; max-width: 94vw; margin: auto;
  max-height: 86vh; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  overflow: auto; -webkit-overflow-scrolling: touch;
  background: #1a1711; color: #f2e7cf; border: 1px solid #3d3423; border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .65);
  padding: 22px 22px 18px;
  animation: tshareUp .2s ease-out;
}
@keyframes tshareUp { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.tshare-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.tshare-hd b { font-size: 17px; letter-spacing: .5px; color: #f3dfae; }
.tshare-x {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid #453b28;
  background: transparent; color: #bdb29c; font-size: 20px; line-height: 1; cursor: pointer;
}
.tshare-x:hover { color: #fff; border-color: #8d7433; }

/* 主按钮：支持系统分享时=系统分享；不支持时=复制链接。始终可见、可点 */
.tshare-primary {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 46px; margin: 0 0 12px; padding: 8px 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid #c9a244; background: #b08d34; color: #241a05;
  font: 700 15px/1.25 "Microsoft YaHei", system-ui, sans-serif; text-align: center;
  transition: background .18s, transform .18s;
}
.tshare-primary:hover { background: #c9a244; }
.tshare-primary:active { transform: translateY(1px); }
.tshare-primary:focus-visible { outline: 2px solid #f3dfae; outline-offset: 2px; }

/* 环境提示：微信/QQ 内明确告诉用户点右上角菜单，不静默失效 */
.tshare-env {
  margin: 0 0 14px; padding: 9px 11px; border-radius: 10px;
  border: 1px solid #3a3223; background: #241f15; color: #cfc3a6;
  font-size: 12px; line-height: 1.7; word-break: break-word;
}
.tshare-env[hidden] { display: none; }

.tshare-chn { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tshare-ch {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 13px 4px 11px; border-radius: 12px; cursor: pointer;
  border: 1px solid #3a3223; background: #221e16; color: #e7dcc4;
  font: 500 12px/1 "Microsoft YaHei", system-ui, sans-serif;
  transition: border-color .18s, background .18s, transform .18s;
}
.tshare-ch:hover { border-color: #b08d34; background: #2a2418; transform: translateY(-2px); }
.tshare-ch-ico { width: 30px; height: 30px; display: inline-flex; }
.tshare-ch-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.tshare-ch-qq .tshare-ch-ico { color: #6cb8ff; }
.tshare-ch-qzone .tshare-ch-ico { color: #f0c24b; }
.tshare-ch-wechat .tshare-ch-ico { color: #4fd06a; }
.tshare-ch-forum .tshare-ch-ico { color: #d9a86c; }

/* 「添加到主屏幕」区块：iOS 三步引导 / Android 真安装按钮 / 内置浏览器提示
   与弹层同一套深色令牌，六套皮肤和明暗模式下都能保持一致的对比度 */
.tshare-inst {
  margin-top: 14px; padding: 11px 12px 12px; border-radius: 12px;
  border: 1px solid #3a3223; background: #201c14;
}
.tshare-inst[hidden] { display: none; }
.tshare-inst-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tshare-inst-hd b { font-size: 13px; letter-spacing: .4px; color: #f3dfae; }
.tshare-inst-os { font-size: 11px; color: #a29880; white-space: nowrap; }
.tshare-inst-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin: 10px 0 0; padding: 0; list-style: none;
}
.tshare-inst-steps[hidden] { display: none; }
.tshare-inst-steps li {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 4px 7px; border-radius: 9px; text-align: center;
  border: 1px solid #322b1d; background: #17140f;
  font-size: 11px; line-height: 1.35; color: #cfc3a6;
}
.tshare-inst-ico { display: inline-flex; width: 20px; height: 20px; color: #e8cf92; }
.tshare-inst-ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tshare-inst-txt { margin: 9px 0 0; font-size: 11.5px; line-height: 1.65; color: #cfc3a6; word-break: break-word; }
.tshare-inst-txt[hidden] { display: none; }
.tshare-inst-btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: 38px; margin: 10px 0 0; padding: 6px 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid #c9a244; background: rgba(176, 141, 52, .16); color: #f3dfae;
  font: 600 13px/1.3 "Microsoft YaHei", system-ui, sans-serif; text-align: center;
  transition: background .18s;
}
.tshare-inst-btn[hidden] { display: none; }
.tshare-inst-btn:hover { background: rgba(176, 141, 52, .3); }
.tshare-inst-btn:active { transform: translateY(1px); }
.tshare-inst-btn:focus-visible { outline: 2px solid #f3dfae; outline-offset: 2px; }
.tshare-inst-note { margin: 8px 0 0; font-size: 10.5px; line-height: 1.6; color: #a29880; }
.tshare-inst-note[hidden] { display: none; }

.tshare-qr { margin-top: 16px; text-align: center; }
.tshare-qr[hidden] { display: none; }
.tshare-qr-box {
  width: 172px; height: 172px; margin: 0 auto; padding: 8px; border-radius: 10px;
  background: #fff; display: flex; align-items: center; justify-content: center;
}
.tshare-qr-box img, .tshare-qr-box canvas, .tshare-qr-box svg { width: 100%; height: 100%; }
.tshare-qr-tip { margin: 9px 0 0; font-size: 12px; color: #b9ad93; }

.tshare-link { display: flex; gap: 8px; margin-top: 16px; }
.tshare-link input {
  flex: 1; min-width: 0; height: 38px; padding: 0 11px; border-radius: 9px;
  border: 1px solid #3a3223; background: #14110c; color: #d8cdb5; font-size: 12px;
}
.tshare-copy {
  height: 38px; padding: 0 15px; border-radius: 9px; cursor: pointer;
  border: 1px solid #b08d34; background: #b08d34; color: #241a05;
  font: 700 13px/1 "Microsoft YaHei", system-ui, sans-serif; white-space: nowrap;
}
.tshare-copy:hover { background: #c9a244; }

.tshare-tip { margin: 12px 0 0; font-size: 11px; line-height: 1.7; color: #8f8672; }
.tshare-toast {
  position: fixed; left: 50%; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 2147483003; max-width: 88vw; padding: 10px 18px; border-radius: 20px; font-size: 13px;
  background: rgba(28, 24, 16, .96); color: #f3e6c8; border: 1px solid #5a4a24;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); text-align: center;
  animation: tshareFade .15s ease-out;
}
.tshare-toast.err { border-color: #8d3b32; color: #ffd9d3; }

@media (max-width: 640px) {
  .tshare-chn { grid-template-columns: repeat(2, 1fr); }
  .tshare-dlg { padding: 18px 16px 14px; max-height: calc(100dvh - 32px); }
  .tshare-btn { height: 36px; padding: 0 13px; font-size: 13px; }
  .tshare-btn-float { right: 16px; bottom: calc(178px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; font-size: 10px; }
  .tshare-primary { min-height: 48px; font-size: 15px; }
  /* 安装引导在窄屏收紧，避免把弹层撑高 */
  .tshare-inst { margin-top: 12px; padding: 10px 10px 11px; }
  .tshare-inst-steps { gap: 5px; margin-top: 9px; }
  .tshare-inst-steps li { padding: 7px 3px 6px; font-size: 10.5px; }
  .tshare-inst-btn { min-height: 40px; font-size: 12.5px; }
  /* 安装区块出现时：渠道收成一行、藏掉底部说明，让 375×667 也能一屏放下
     标记打在 .tshare-dlg 上（弹层打开时 mask 会被搬到 body，.tshare 的类选不中它） */
  .tshare-dlg.tshare-inst-on .tshare-chn { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .tshare-dlg.tshare-inst-on .tshare-ch { padding: 10px 2px 9px; font-size: 11px; }
  .tshare-dlg.tshare-inst-on .tshare-ch-ico { width: 26px; height: 26px; }
  .tshare-dlg.tshare-inst-on .tshare-tip { display: none; }
}
