/* 体用全学 · PWA 组件样式（2026-10-26）
 * 所有规则一律 .tyx- 前缀，避免与站点既有样式冲突。
 * 配色沿用站点：宣纸 #F7F4EF / 墨 #1C1A17 / 朱 #8B3A2E / 线 #DCD5C8
 */

.tyx-mask {
  position: fixed;
  left: 0; right: 0; top: 0; bottom: 0;
  background: rgba(28, 26, 23, .46);
  z-index: 9998;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.tyx-mask.tyx-center { align-items: center; padding: 20px; }

/* ---------- 底部弹层：装到桌面 ---------- */
.tyx-sheet {
  width: 100%;
  max-width: 520px;
  background: #FBF9F5;
  border-radius: 18px 18px 0 0;
  padding: 22px 22px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 40px rgba(28, 26, 23, .12);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: #1C1A17;
  animation: tyxUp .22s ease-out;
  max-height: 86vh;
  overflow-y: auto;
  box-sizing: border-box;
}
@keyframes tyxUp { from { transform: translateY(18px); opacity: .6; } to { transform: none; opacity: 1; } }

.tyx-sheet h3 {
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: .08em;
  margin: 0 0 6px;
}
.tyx-sheet .tyx-sub {
  font-size: 13px;
  line-height: 1.7;
  color: #5C564C;
  margin: 0 0 18px;
}
.tyx-steps { list-style: none; margin: 0 0 16px; padding: 0; counter-reset: tyxs; }
.tyx-steps li {
  position: relative;
  padding: 0 0 0 34px;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.75;
  color: #1C1A17;
  counter-increment: tyxs;
}
.tyx-steps li::before {
  content: counter(tyxs);
  position: absolute;
  left: 0; top: 2px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #1C1A17;
  color: #F7F4EF;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  font-family: system-ui, sans-serif;
}
.tyx-steps li b { font-weight: 500; color: #8B3A2E; }
.tyx-hint {
  font-size: 12px;
  line-height: 1.7;
  color: #8A8377;
  border-top: 1px solid #DCD5C8;
  padding-top: 12px;
  margin-top: 4px;
}

.tyx-btn {
  display: block;
  width: 100%;
  padding: 13px 16px;
  border: 0;
  border-radius: 10px;
  background: #1C1A17;
  color: #F7F4EF;
  font-size: 15px;
  font-family: inherit;
  letter-spacing: .04em;
  cursor: pointer;
  box-sizing: border-box;
}
.tyx-btn:active { opacity: .82; }
.tyx-btn.tyx-ghost {
  background: transparent;
  color: #8A8377;
  margin-top: 8px;
  font-size: 14px;
}
.tyx-btn.tyx-line {
  background: transparent;
  color: #1C1A17;
  border: 1px solid #DCD5C8;
  margin-top: 10px;
}

/* ---------- 浮钮 ---------- */
.tyx-fab {
  position: fixed;
  right: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 9990;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(251, 249, 245, .96);
  border: 1px solid #DCD5C8;
  color: #5C564C;
  font-size: 12.5px;
  letter-spacing: .04em;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(28, 26, 23, .07);
  -webkit-tap-highlight-color: transparent;
}
.tyx-fab:active { transform: scale(.97); }
.tyx-fab svg { width: 13px; height: 13px; }

/* ---------- 隐私政策弹窗 ---------- */
.tyx-consent {
  width: min(400px, calc(100vw - 40px));
  background: #FBF9F5;
  border-radius: 14px;
  padding: 26px 24px 20px;
  box-sizing: border-box;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: #1C1A17;
  animation: tyxUp .2s ease-out;
}
.tyx-consent h3 {
  font-family: "Songti SC", "Noto Serif SC", STSong, serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .1em;
  margin: 0 0 14px;
}
.tyx-consent p {
  font-size: 13.5px;
  line-height: 1.85;
  color: #5C564C;
  margin: 0 0 12px;
}
.tyx-consent a { color: #8B3A2E; text-decoration: underline; text-underline-offset: 3px; }
.tyx-consent .tyx-actions { margin-top: 18px; }

/* ---------- 提示条 ---------- */
.tyx-toast {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(28, 26, 23, .9);
  color: #F7F4EF;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 16px;
  border-radius: 8px;
  max-width: 80vw;
  text-align: center;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  animation: tyxUp .18s ease-out;
}

/* 已装到桌面时隐藏浮钮 */
@media (display-mode: standalone) {
  .tyx-fab { display: none; }
}

/* ── 二维码（仅桌面端弹层出现）─────────────────────────────
   白底 + 内边距是刻意的：二维码贴深色或花纹底会扫不出，
   无论页面底色如何，这里都保证一块干净的静区。 */
.tyx-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 4px 0 18px;
  padding: 14px 14px 10px;
  background: #FFFFFF;
  border: 1px solid #E4DDD0;
  border-radius: 10px;
}
.tyx-qr img {
  display: block;
  width: 168px;
  height: 168px;
  image-rendering: pixelated;   /* 矢量图不受影响，位图不糊 */
}
.tyx-qr-cap {
  font-size: 12px;
  line-height: 1.5;
  color: #6E6A60;
  letter-spacing: .02em;
}

/* 安卓 APK 下载按钮：.tyx-btn 原本只服务 <button>，
   用作 <a> 时要补回文字居中与去下划线，否则会左对齐且带蓝色下划线 */
a.tyx-btn {
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  line-height: 1.4;
}
.tyx-btn.tyx-apk {
  background: #8B3A2E;   /* 朱印色：与站点主色一致，也和下面的次要按钮区分开 */
  letter-spacing: .04em;
}
