:root {
  --p5-header-gap: 12px;
  --p5-input-h: 38px;
  --p5-safe-bottom: env(safe-area-inset-bottom, 0px);
  --p5-surface: #ffffff;
  --p5-bg: #f6f9fc;
  --p5-accent: #ff8c00;
  --p5-accent-2: #ff4500;
  --p5-text: #b7410e;
  --p5-gold: #ffb347;

  --p5-panel-closed-h: 64px;
  --p5-panel-open-h: clamp(330px, 48dvh, 430px);
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--p5-bg);
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

.hidden {
  display: none !important;
}

/* 统一避免 iOS 输入框自动放大 */
input,
textarea,
select {
  font-size: 16px;
}

/* 登录层 */
  #p5-auth-root {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    background: var(--page-bg);
  }

  #p5-auth-root.hidden {
    display: none !important;
  }

  .auth-search-wrap {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    transform: translateY(-30px);
  }

  .auth-search-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }

  .auth-search-logo img {
    display: block;
    max-width: min(430px, 80vw);
    height: auto;
  }

  .auth-search-bar {
    width: 100%;
    max-width: 700px;
    display: flex;
    align-items: stretch;
    justify-content: center;
  }

  #p5-auth-password {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    font-size: 16px;
    border: 1px solid var(--search-border);
    border-right: none;
    outline: none;
    box-sizing: border-box;
    background: #fff;
    color: var(--text-color);
    border-radius: 0;
    margin: 0;
    line-height: 46px;
  }

  #p5-auth-password:focus {
    border-color: #b7b7b7;
    box-shadow: none;
  }

  .auth-search-btn {
    height: 46px;
    width: 128px;
    border: 1px solid #2b78ff;
    background: #fff;
    color: #2b78ff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 0;
    padding: 0 12px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  .auth-search-btn:hover {
    background: #f4f8ff;
  }

  #p5-auth-cancel {
    display: none;
  }

  #p5-auth-msg {
    min-height: 18px;
    font-size: 13px;
    color: #666;
    margin-top: 0;
    text-align: center;
  }

  @media (max-width: 520px) {
    .auth-search-wrap {
      transform: translateY(-16px);
      gap: 22px;
    }

    .auth-search-logo img {
      max-width: 280px;
    }

    .auth-search-bar {
      max-width: 100%;
    }

    .auth-search-btn {
      width: 96px;
      font-size: 15px;
    }

    #p5-auth-password {
      height: 44px;
      line-height: 44px;
      font-size: 15px;
    }

    .auth-search-btn {
      height: 44px;
    }
  }






/* 主界面根容器 */
#p5-sim-root {
  height: 100dvh;
  background: var(--p5-bg);
  overflow: hidden;
}

.p5-sim-root {
  width: 100%;
  max-width: 960px;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  color: var(--p5-text);
  background: var(--p5-surface) !important;
  overflow: hidden;
}

/* 顶部 */
.p5-header {
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--p5-header-gap);
  background: linear-gradient(180deg, #12a7c7 0%, #0f8ecf 100%);
  border: none;
  box-shadow: none;
  color: #fff;
  flex: 0 0 auto;
}

.p5-header-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.p5-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap; /* 保证标题和账号在同一行 */
}

.p5-title {
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  white-space: nowrap;
}

.p5-user-name {
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

#p5-points-label,
#p5-winloss {
  display: block;
  margin: 0;  /* 避免多余间距 */
}

.p5-meta {
  display: flex;
  flex-direction: column; /* 分两行 */
  justify-content: center; /* 垂直居中对齐右侧按钮 */
  gap: 2px;
}

.p5-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.p5-time {
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
}

.p5-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 菜单容器 */
.p5-menu-wrap {
  position: relative;
}

/* 下拉菜单 */
.p5-menu-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 5px;
  background: #fff;
  border-radius: 10px;
  box-shadow:
    0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid rgba(0,0,0,0.08);
  z-index: 999;
}

/* 显示 */
.p5-menu-popup.show {
  display: flex;
}

/* 小菜单按钮 */
.p5-menu-popup .menu-item {
  width: 72px;
}

.p5-btn.small {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 8px;
  border: none;
  background: #fff;
  color: #0f8ecf;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  font-weight: 700;
}

.p5-btn.small:hover {
  opacity: 0.95;
}

/* 当前期号区域 */
.p5-last-issue {
  position: relative;
  overflow: visible;
  padding: 0;
  font-size: 14px;
  display: block;
  border: none;
  background: #fff;
  color: var(--p5-text);
  flex: 0 0 auto;
}

.p5-last-issue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid #edf2f6;
  color: #243444;
}

.p5-last-issue-head > div:first-child {
  min-width: 0;
  white-space: nowrap;
  font-size: 14px;
}

#p5-market-period {
  font-weight: 700;
  color: #17324d;
}

.p5-last-codes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ff7a00;
  white-space: nowrap;
}

.p5-last-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 10px;
}

#p5-sim-root .p5-last-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px 10px;
}

#p5-sim-root .p5-countdown-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

#p5-sim-root .p5-countdown-label {
  font-weight: 600;
  white-space: nowrap;
  color: #17324d;
}

#p5-sim-root .p5-count-box {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  background: #0f8ecf;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 15px;
}

#p5-sim-root .p5-count-sep {
  font-weight: 800;
  color: #17324d;
}

#p5-sim-root .p5-expand-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 2px solid #17324d;
  border-radius: 50%;
  background: #fff;
  color: #0f8ecf;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#p5-sim-root .p5-bottom-panel {
  margin-top: auto;
}

#p5-sim-root .p5-last-issue {
  box-shadow: none !important;
}

#p5-sim-root .p5-last-issue-head {
  border-bottom: 1px solid #edf2f6 !important;
}

#p5-sim-root .p5-last-result-row {
  box-shadow: none !important;
  border-bottom: none !important;
}

.p5-expand-btn {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 2px solid #17324d;
  border-radius: 50%;
  background: #fff;
  color: #0f8ecf;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.p5-expand-btn:hover {
  background: rgba(15, 135, 201, 0.08);
}

.p5-expand-btn[aria-expanded="true"] {
  transform: rotate(180deg);
}

/* 历史展开：覆盖层，不挤压聊天区 */
.p5-history-panel {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  z-index: 50;
  background: #fff;
  border-top: 1px solid #edf2f6;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.10);
  padding: 0 12px 10px;
  max-height: min(60vh, 460px);
  overflow: auto;
  color: #243444;
  font-size: 14px;
  line-height: 1.4;
}

.p5-history-panel.open {
  display: block;
}

.p5-history-panel > div {
  padding: 4px 0;
}

#p5-market-history {
  margin-top: 8px;
}

.history-empty {
  padding: 10px 0 4px;
  color: #5b6773;
  font-size: 13px;
}

/* 历史表格 */
.history-table,
.p5-history-panel table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 6px;
}

.history-table thead th,
.p5-history-panel thead th {
  font-size: 13px;
  font-weight: 600;
  color: #5e6d7c;
  padding: 7px 4px;
  border-bottom: 1px solid #edf2f6;
  background: #fff;
  white-space: nowrap;
}

.history-table td,
.p5-history-panel td {
  padding: 6px 4px;
  border-bottom: 1px solid #f2f5f8;
  vertical-align: middle;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

.history-table th,
.p5-history-panel th {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

/* 期数列 */
.history-table .col-period,
.p5-history-panel .col-period {
  width: 92px;
  color: #5b6773;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: left;
  padding-left: 0;
}

/* 每个球列，固定宽度，避免挤压 */
.history-table .col-ball,
.p5-history-panel .col-ball {
  width: 42px;
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

/* 开奖结果列 */
.history-table .col-result,
.p5-history-panel .col-result {
  text-align: center;
}

/* 结果类型列 */
.history-table .col-type,
.p5-history-panel .col-type {
  width: 92px;
  text-align: left;
  white-space: nowrap;
}

/* 颜色文字 */
.history-type-blue,
.p5-history-panel .type-blue {
  color: #0f8ecf;
}

.history-type-red,
.p5-history-panel .type-red {
  color: #e53935;
}

/* 历史行（如果你页面里还有这种布局） */
.history-row {
  display: grid;
  grid-template-columns: 92px 1fr 92px;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid #f2f5f8;
}

.history-period {
  color: #5b6773;
  font-variant-numeric: tabular-nums;
}

.history-nums {
  color: #17324d;
  letter-spacing: 1px;
  white-space: nowrap;
}

.history-time {
  color: #5b6773;
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

/* 彩球 */
.p5-ball,
.p5-mini-ball,
.history-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
  box-sizing: border-box;
  flex: 0 0 auto;
  vertical-align: middle;
}

.p5-ball,
.history-ball {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.p5-mini-ball {
  width: 24px;
  height: 24px;
  font-size: 13px;
  border-width: 2px;
}

.p5-ball.red,
.p5-mini-ball.red,
.history-ball.red {
  border: 3px solid #e53935;
  color: #e53935;
}

.p5-ball.green,
.p5-mini-ball.green,
.history-ball.green {
  border: 3px solid #14a44d;
  color: #14a44d;
}

.p5-ball.orange,
.p5-mini-ball.orange,
.history-ball.orange {
  border: 3px solid #f39c12;
  color: #f39c12;
}

.p5-ball.purple,
.p5-mini-ball.purple,
.history-ball.purple {
  border: 3px solid #b23abf;
  color: #b23abf;
}

.p5-ball.blue,
.p5-mini-ball.blue,
.history-ball.blue {
  border: 3px solid #2f80ed;
  color: #2f80ed;
}

.p5-ball.gray,
.p5-mini-ball.gray,
.history-ball.gray {
  border: 3px solid #3e4a59;
  color: #3e4a59;
}

/* 球的容器 */
.history-row-balls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

/* 主体：聊天区 + 底部窗口 */
.p5-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: none;
  overflow: hidden;
}

.p5-chat-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  position: relative;
}

/* 聊天记录较长时，一键回到最新消息 */
.p5-scroll-bottom {
  position: absolute;
  right: 16px;
  bottom: 76px;
  z-index: 30;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(34, 45, 58, 0.54);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.2s ease;
  touch-action: manipulation;
}

.p5-scroll-bottom.visible {
  opacity: 0.72;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.p5-scroll-bottom:hover,
.p5-scroll-bottom:focus-visible {
  opacity: 0.96;
  background: rgba(34, 45, 58, 0.72);
}

.p5-scroll-bottom:active {
  transform: translateY(1px) scale(0.96);
}

.p5-scroll-bottom svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 480px) {
  .p5-scroll-bottom {
    right: 12px;
    width: 40px;
    height: 40px;
  }
}

.p5-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-wrap {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 8px 0;
}

.msg-wrap.user {
  justify-content: flex-end;
}

.msg-wrap.robot {
  justify-content: flex-start;
}

.msg-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
}

.msg {
  display: inline-block;
  width: fit-content;
  max-width: min(70vw, 680px);
  padding: 8px 10px;
  border-radius: 13px;
  font-size: 15px;
  line-height: 1.2;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;

  background: #fff;
  color: #000;
  border: 1px solid #ddd;
  box-shadow: none;
}

.msg.user {
  background: #fff;
  color: #000;
  border: 1px solid #ddd;
  box-shadow: none;
}

.msg.robot {
  background: #fff;
  color: #000;
  border: 1px solid #ddd;
}

.msg-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: 2px;
}

.msg-action-btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin-left: 4px;
  color: #16a34a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.msg-action-btn:hover {
  color: #15803d;
  text-decoration: underline;
}

.msg-action-btn:focus {
  outline: none;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex: 0 0 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* 底部统一面板 */
.p5-bottom-panel {
  flex: 0 0 auto;
  width: 100%;
  background: #fff;
  border-top: 1px solid rgba(255, 140, 0, 0.18);
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.06);

  display: flex;
  flex-direction: column;

  /* ✅ 改成这样 */
  min-height: var(--p5-panel-closed-h);
  height: auto;
}

.p5-bottom-panel.keyboard-open {
  min-height: var(--p5-panel-open-h);
}

.p5-send,
.p5-key-toggle {
  flex-shrink: 0;
}

.p5-bottom-panel.keyboard-open {
  height: var(--p5-panel-open-h);
}

.p5-input-area {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;

  align-items: flex-end; /* ✅ 改这里 */

  padding: 6px 8px calc(6px + var(--p5-safe-bottom));
  background: #fff;
  border-top: 2px solid var(--p5-accent);
}

.p5-input-area textarea {
  max-height: 600px; /* 约3~4行 */
}

.p5-key-toggle {
  flex: 0 0 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.p5-input-area textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--p5-input-h);
  padding: 9px 3px;
  border-radius: 16px;
  border: 1px solid var(--p5-accent);
  resize: none;
  overflow: hidden; 
  font-size: 14px;
  line-height: 1;
  background: #fff;
  color: var(--p5-text);
  box-shadow: none;
  outline: none;
}

.p5-send {
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  box-sizing: border-box;
  border-radius: 8px;
  border: none;
  background: linear-gradient(145deg, #ffa500, #ff8c00);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px #ffa500;
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-size: 15px;
  line-height: 1;
  appearance: none;
}


.p5-hiscontext {
  flex: 0 0 40px;
  width: 40px;
  min-width: 40px;
  height: 40px;
  box-sizing: border-box;
  border-radius: 8px;
  border: none;
  background: linear-gradient(145deg, #ffa500, #ff8c00);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px #ffa500;
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  appearance: none;
}

.p5-send:hover,
.p5-hiscontext:hover {
  opacity: 0.95;
}

/* 键盘 */
.p5-virtual-keyboard {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #f7f7f7;
  border-top: 1px solid #e4e4e4;
  display: none;
}

.p5-bottom-panel.keyboard-open .p5-virtual-keyboard {
  display: block;
}

.p5-virtual-keyboard-inner {
  height: 100%;
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.p5-krow {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  gap: 4px;
}

.p5-krow .p5-key {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 7px;
  font-size: 20px;
  cursor: pointer;
  user-select: none;
}

.p5-krow .p5-key.special {
  background: #fff7e6;
  font-weight: 600;
}

.p5-krow .p5-key.action {
  background: #f0f4ff;
  color: #1f6fe0;
  font-weight: 600;
}



.p5-bottom-panel.recent-text-open .p5-virtual-keyboard {
  display: none;
}

.p5-bottom-panel.recent-text-open .p5-hiscontext-panel {
  display: block;
}

.p5-hiscontext-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #f7f7f7;
  border-top: 1px solid #e4e4e4;
  padding: 8px;
}

.p5-hiscontext-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.p5-hiscontext-item {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  word-break: break-word;
}

.p5-bottom-panel.recent-text-open {
  min-height: var(--p5-panel-open-h);
  height: var(--p5-panel-open-h);
}

.p5-hiscontext-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #f7f7f7;
  border-top: 1px solid #e4e4e4;
  padding: 8px;
}

.p5-bottom-panel.recent-text-open .p5-virtual-keyboard {
  display: none;
}

.p5-bottom-panel.recent-text-open .p5-hiscontext-panel {
  display: block;
}

.p5-hiscontext-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.p5-hiscontext-item {
  appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  word-break: break-word;
  cursor: pointer;
}

.p5-hiscontext-empty {
  grid-column: 1 / -1;
  padding: 16px 8px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}
/* 手机端 */
@media (max-width: 768px) {
  :root {
    --p5-input-h: 38px;
    --p5-panel-closed-h: 60px;
    --p5-panel-open-h: clamp(320px, 50dvh, 420px);
  }

  .p5-header {
    padding: 12px;
  }

  .p5-title {
    font-size: 16px;
  }

  .p5-meta,
  .p5-time,
  .p5-user-name {
    font-size: 12px;
  }

  .p5-last-issue {
    font-size: 13px;
  }

  .p5-input-area {
    gap: 5px;
    padding: 5px 7px calc(5px + var(--p5-safe-bottom));
  }

  .p5-krow {
    gap: 3px;
  }

  .p5-virtual-keyboard-inner {
    padding: 5px 7px 7px;
    gap: 3px;
  }

  .p5-krow .p5-key {
    font-size: 15px;
    border-radius: 6px;
  }

  .p5-key-toggle {
    min-width: 38px;
    height: 38px;
  }

  .p5-input-area textarea {
    font-size: 16px;
    border-radius: 14px;
  }

  #zhudan-feedback-panel textarea#zhudan-feedback-content {
    font-size: 16px;
  }
}

#draw-popup.hidden {
  display: none !important;
}

#draw-popup {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.draw-popup-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
}

.draw-popup-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 430px);
  border-radius: 24px;
  background: linear-gradient(180deg, #17111f 0%, #0b0f1a 100%);
  padding: 18px 16px 16px;
  box-sizing: border-box;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.55),
    0 0 28px rgba(255, 183, 3, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.18);
}

.draw-popup-title {
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  color: #ffd86b;
  margin-bottom: 14px;
  text-shadow: 0 0 12px rgba(255, 216, 107, 0.18);
}

.draw-popup-scratch {
  margin-bottom: 14px;
}

.draw-popup-scratch-top {
  position: relative;
  border-radius: 18px;
  padding: 12px;
  background: linear-gradient(180deg, #14101d 0%, #0c1018 100%);
  border: 1px solid rgba(255, 215, 0, 0.16);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.draw-popup-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.draw-slot {
  position: relative;
  height: 92px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #0f1320 0%, #090d16 100%);
  border: 1px solid rgba(255, 215, 0, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.draw-slot-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  font-size: 80px;
  font-weight: 300;
  color: #ff4d6d;
  opacity: 1;
  transform: none;
  font-family: "DIN Condensed", "Impact", sans-serif;
  text-shadow:
    0 0 10px rgba(255, 77, 109, 0.35),
    0 0 22px rgba(255, 77, 109, 0.18);
}

.draw-slot-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(180deg, #6a5f4b 0%, #3c3328 50%, #272018 100%);
  border-radius: 14px;
  transform: translateY(calc(100% * var(--cover-progress, 0)));
  transition: transform 0.05s linear, opacity 0.2s ease;
  will-change: transform;
}

.draw-slot-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18px 18px, rgba(255, 215, 0, 0.22) 0 6px, transparent 7px),
    radial-gradient(circle at 52px 52px, rgba(255, 255, 255, 0.10) 0 6px, transparent 7px);
  background-size: 72px 72px;
  opacity: 0.8;
}

.draw-slot-cover.done {
  opacity: 0.05;
  pointer-events: none;
}

@keyframes slotNumberIn {
  0% {
    transform: translateY(10px) scale(0.85);
    opacity: 0;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.draw-popup-subtitle {
  margin-top: 8px;
  text-align: center;
  font-size: 14px;
  color: #cbd5e1;
}

.draw-popup-countdown {
  margin-top: 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #ffb703;
  text-shadow: 0 0 10px rgba(255, 183, 3, 0.18);
}

.draw-popup-btn {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 12px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.draw-popup-refresh {
  background: linear-gradient(180deg, #ffd86b 0%, #ffb703 100%);
  color: #1b1224;
}

.draw-popup-back {
  background: linear-gradient(180deg, #ff5c7a 0%, #d81b60 100%);
  color: #fff;
}

.draw-popup-auto {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  color: #cbd5e1;
}

/* 注单反馈弹窗 */
#zhudan-feedback-panel {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.2s ease;
}

#zhudan-feedback-panel.hidden {
  display: none;
}

#zhudan-feedback-panel .zhudan-feedback-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 25, 0.62);
  backdrop-filter: blur(8px);
}

#zhudan-feedback-panel .zhudan-feedback-card {
  position: relative;
  width: min(720px, 100%);
  max-height: min(88vh, 860px);
  overflow: auto;
  background: linear-gradient(180deg, rgba(20, 24, 38, 0.98), rgba(15, 18, 30, 0.98));
  color: #f4f7fb;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.45),
    0 2px 0 rgba(255, 255, 255, 0.04) inset;
  padding: 22px;
  transform: translateY(8px) scale(0.98);
  animation: zhudan-pop 0.18s ease-out forwards;
}

@keyframes zhudan-pop {
  to {
    transform: translateY(0) scale(1);
  }
}

#zhudan-feedback-panel .zhudan-feedback-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#zhudan-feedback-panel .zhudan-feedback-title::before {
  content: "💬";
  font-size: 22px;
}

#zhudan-feedback-panel textarea#zhudan-feedback-content {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.10);
  outline: none;
  border-radius: 18px;
  padding: 16px 16px 14px;
  font-size: 16px;
  line-height: 1.65;
  color: #f7f9fc;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

#zhudan-feedback-panel textarea#zhudan-feedback-content::placeholder {
  color: rgba(255, 255, 255, 0.40);
}

#zhudan-feedback-panel textarea#zhudan-feedback-content:focus {
  border-color: rgba(96, 165, 250, 0.70);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.14);
  background: rgba(255, 255, 255, 0.055);
}

#zhudan-feedback-panel .zhudan-feedback-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 14px;
}

#zhudan-feedback-panel .emoji-btn {
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

#zhudan-feedback-panel .emoji-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

#zhudan-feedback-panel .emoji-btn:active {
  transform: translateY(0);
}

#zhudan-feedback-panel input#zhudan-feedback-files {
  width: 100%;
  margin-top: 4px;
  padding: 12px 14px;
  color: #dce5f2;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

#zhudan-feedback-panel input#zhudan-feedback-files::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  color: #0f172a;
  background: linear-gradient(180deg, #dbeafe, #bfdbfe);
  cursor: pointer;
  font-weight: 700;
}

#zhudan-feedback-panel #zhudan-feedback-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

#zhudan-feedback-panel .preview-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#zhudan-feedback-panel .preview-item img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
}

#zhudan-feedback-panel .remove-img-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(239, 68, 68, 0.92);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

#zhudan-feedback-panel .remove-img-btn:hover {
  background: rgba(220, 38, 38, 0.98);
}

#zhudan-feedback-panel .zhudan-feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}

#zhudan-feedback-panel .zhudan-feedback-actions button {
  min-width: 96px;
  height: 44px;
  border: 0;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

#zhudan-feedback-panel .zhudan-feedback-actions button:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

#zhudan-feedback-panel #zhudan-feedback-cancel {
  color: #d7def0;
  background: rgba(255, 255, 255, 0.08);
}

#zhudan-feedback-panel #zhudan-feedback-submit {
  color: #0f172a;
  background: linear-gradient(180deg, #93c5fd, #60a5fa);
  box-shadow: 0 12px 26px rgba(96, 165, 250, 0.22);
}

#zhudan-feedback-panel #zhudan-feedback-submit:hover {
  box-shadow: 0 14px 30px rgba(96, 165, 250, 0.28);
}

@media (max-width: 640px) {
  #zhudan-feedback-panel {
    padding: 12px;
    align-items: flex-end;
  }

  #zhudan-feedback-panel .zhudan-feedback-card {
    width: 100%;
    max-height: 92vh;
    border-radius: 22px 22px 18px 18px;
    padding: 16px;
  }

  #zhudan-feedback-panel textarea#zhudan-feedback-content {
    min-height: 140px;
    font-size: 16px;
  }

  #zhudan-feedback-panel #zhudan-feedback-preview {
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  }

  #zhudan-feedback-panel .preview-item img {
    height: 92px;
  }

  #zhudan-feedback-panel .zhudan-feedback-actions {
    gap: 10px;
  }

  #zhudan-feedback-panel .zhudan-feedback-actions button {
    flex: 1;
    min-width: 0;
  }
}
html, body, button, input, textarea, select, a, .p5-key, .p5-btn, .msg-action-btn {
  touch-action: manipulation;
}
html, body {
  touch-action: manipulation;
}




//包包
/* 红包遮罩层：JS 动态创建，无需 HTML */
#redPacketModal.rp-modal {
  position: fixed !important;
  transform: none !important;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  z-index: 999999999 !important;
  pointer-events: auto;
}

#redPacketModal.hidden {
  display: none !important;
}

/* 消息里的红包卡片 */
.red-packet-card.wx-style {
  width: 285px;
  min-height: 88px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #e73a2f 0%, #c91919 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  color: #fff;
  position: relative;
  user-select: none;
}

.red-packet-card.wx-style.clickable {
  cursor: pointer;
}

.red-packet-card.wx-style.disabled {
  opacity: 0.78;
  cursor: not-allowed;
}

.wx-rp-closed {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
  min-height: 88px;
  box-sizing: border-box;
  position: relative;
}

.wx-rp-closed::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 28%),
    radial-gradient(circle at 80% 25%, rgba(255,255,255,0.05), transparent 24%),
    radial-gradient(circle at 50% 80%, rgba(255,255,255,0.05), transparent 30%);
  pointer-events: none;
}

.wx-rp-left-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.10);
  display: grid;
  place-items: center;
  font-size: 24px;
  position: relative;
  z-index: 1;
}

.wx-rp-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.wx-rp-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 8px;
  color: #fff7d6;
  letter-spacing: 0.2px;
}

.wx-rp-tip {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255, 247, 214, 0.92);
}

/* 已领取后的消息卡片 */
.wx-rp-opened {
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, #fffefb 0%, #fff6ea 100%);
  color: #a51c17;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.wx-rp-opened-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.wx-rp-opened-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffe7b8;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.wx-rp-opened-title {
  font-size: 15px;
  font-weight: 700;
}

.wx-rp-money {
  font-size: 26px;
  font-weight: 800;
  color: #c61d17;
  margin-bottom: 4px;
}

.wx-rp-account {
  font-size: 12px;
  color: #8f5f2a;
}

/* 弹出的红包封面 */
.rp-sheet {
  width: min(88vw, 326px);
  height: 438px;
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ff5a4f 0%, #de1d18 38%, #c81616 100%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  animation: rpPopIn 0.18s ease-out;
  transform-origin: center center;
  color: #fff;
  pointer-events: auto;
}

@keyframes rpPopIn {
  from {
    transform: scale(0.82);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.rp-x {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: auto;
}

.rp-banner {
  text-align: center;
  padding-top: 32px;
  position: relative;
  z-index: 2;
}

.rp-banner-avatar {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 30px;
}

.rp-banner-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
}

.rp-banner-blessing {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}

.rp-envelope {
  position: absolute;
  left: 0;
  right: 0;
  top: 120px;
  bottom: 86px;
  z-index: 2;
}

.rp-envelope-top {
  position: absolute;
  left: 50%;
  top: 0;
  width: 100%;
  height: 128px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #e3352c 0%, #c81818 100%);
  clip-path: polygon(0 0, 100% 0, 100% 76%, 50% 100%, 0 76%);
  opacity: 0.98;
}

.rp-envelope-seal {
  position: absolute;
  left: 50%;
  top: 58px;
  width: 180px;
  height: 180px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #ffeaa3 0%, #f2d46b 48%, #e0b93c 100%);
  opacity: 0.14;
}

.rp-envelope-center {
  position: absolute;
  left: 0;
  right: 0;
  top: 105px;
  display: grid;
  place-items: center;
}

.rp-envelope-circle {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe39a 0%, #f3cf66 100%);
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 5;
}

.rp-envelope-circle:active {
  transform: scale(0.98);
}

.rp-envelope-open-text {
  font-size: 38px;
  font-weight: 800;
  color: #3d1a00;
  line-height: 1;
  transform: translateY(-1px);
}

.rp-loading-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 32px;
  display: grid;
  place-items: center;
  gap: 10px;
  z-index: 3;
}

.rp-loading {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rpSpin 0.75s linear infinite;
}

@keyframes rpSpin {
  to {
    transform: rotate(360deg);
  }
}

.rp-loading-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

/* 打开后的结果页 */
.rp-opened-sheet {
  background: linear-gradient(180deg, #d91f18 0%, #bf1515 100%);
}

.rp-opened-header {
  text-align: center;
  padding: 58px 20px 0;
}

.rp-opened-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
  font-size: 30px;
}

.rp-opened-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
}

.rp-opened-amount {
  font-size: 34px;
  font-weight: 900;
  line-height: 1.1;
  color: #fff2bf;
  margin-bottom: 8px;
}

.rp-opened-account {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.92);
}

.rp-close-btn {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  border: 0;
  height: 38px;
  padding: 0 22px;
  border-radius: 999px;
  background: #fff;
  color: #bf1515;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  z-index: 20;
  pointer-events: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.rp-close-btn:active {
  transform: translateX(-50%) scale(0.98);
}

/* 失败页 */
.rp-sheet-fail {
  background: linear-gradient(180deg, #d91f18 0%, #bf1515 100%);
  display: grid;
  place-items: center;
  padding: 30px 20px;
  text-align: center;
}

.rp-fail-text {
  font-size: 16px;
  color: #fff;
  padding: 0 16px;
  margin-top: 140px;
  margin-bottom: 18px;
}

/* ===============================
   五星彩快选
   =============================== */

/* iPhone/手机端防止点击输入框自动放大 */
#wuxing-generator-root {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  height: var(--vvh, 100dvh) !important;
  z-index: 99999 !important;
  background: rgba(0, 0, 0, 0.45) !important;
  overflow: hidden !important;
}

#wuxing-generator-root.hidden {
  display: none !important;
}

#wuxing-generator-root .wuxing-wrap,
.p5-modal-card {
  width: 100% !important;
  height: 100% !important;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#wuxing-generator-root .panel,
.p5-modal-body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

/* 关键：所有可输入控件都保持 16px 以上，避免 iOS 自动放大 */
#wuxing-generator-root input,
#wuxing-generator-root textarea,
#wuxing-generator-root select {
  font-size: 16px !important;
  line-height: 1.2;
}

#wuxing-generator-root .wuxing-input,
#wuxing-generator-root .p5-form-input,
#wuxing-generator-root textarea,
#wuxing-generator-root input[type="text"] {
  font-size: 16px !important;
  line-height: 1.2;
}

#wuxing-generator-root .wuxing-wrap {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  background: #fff;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#wuxing-generator-root .wuxing-row {
  font-size: 14px;
  padding: 0 10px;
}

#wuxing-generator-root .wuxing-row:has(.top-status) {
  padding: 0 !important;
}

#wuxing-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 10;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
}

#wuxing-generator-root .wuxing-row input,
#wuxing-generator-root .wuxing-row label {
  margin-right: 0;
  margin-left: 0;
}

#wuxing-generator-root .wuxing-title-row,
#wuxing-generator-root .top-status {
  background: #d64500;
  border-radius: 0;
  margin-bottom: 0;
  padding-left: 20px;
  padding-right: 20px;
  box-sizing: border-box;
}

#wuxing-generator-root .wuxing-row.wuxing-title-row {
  padding-top: 0px;
  padding-bottom: 8px;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  flex: 0 0 auto;
}

#wuxing-generator-root .wuxing-title {
  color: #fff;
  font-weight: 700;
}

#wuxing-close-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

#wuxing-generator-root .top-status {
  padding: 8px 14px;
  font-size: 13px;
  color: #fff;
  background: #d64500;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  position: relative;
  left: auto;
  transform: none;
  box-shadow: 0 3px 12px #d64500, 0 -1px 0 #d64500;
  box-sizing: border-box;
  flex: 0 0 auto;
}

#wuxing-generator-root .top-status span {
  white-space: nowrap;
  flex-shrink: 0;
}

#wuxing-generator-root .wux-display {
  color: #fff;
  font-weight: 700;
}

#wuxing-generator-root .wuxing-open-m {
  display: flex;
  justify-content: center;
  margin: 10px auto;
  padding: 4px 14px;
  background: #ffffff;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  box-sizing: border-box;
  flex: 0 0 auto;
}

#wuxing-generator-root .btn-open-m {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #333;
  font-weight: 600;
}

#wuxing-generator-root .wux-openplay {
  color: #d64500;
  font-weight: bold;
}

#wuxing-generator-root .selector-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 60px);
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  border: 1px solid #28a745;
  box-sizing: border-box;
  gap: 0;
  flex: 0 0 auto;
}

#wuxing-generator-root .selector-6 .mode-btn {
  border: none;
  border-radius: 0;
  background: #fff;
  color: #28a745;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  box-sizing: border-box;
  border-right: 1px solid #28a745;
  border-bottom: 1px solid #28a745;
  height: 100%;
  width: 100%;
}

#wuxing-generator-root .selector-6 .mode-btn:nth-child(3),
#wuxing-generator-root .selector-6 .mode-btn:nth-child(6) {
  border-right: none;
}

#wuxing-generator-root .selector-6 .mode-btn:nth-child(n+4) {
  border-bottom: none;
}

#wuxing-generator-root .selector-6 .mode-btn:hover,
#wuxing-generator-root .selector-6 .mode-btn:focus {
  background-color: #28a745;
  color: #fff;
}

#wuxing-generator-root .selector-6 .mode-btn.active {
  background-color: #28a745;
  color: #fff;
  border: 1px solid #28a745;
}

#wuxing-generator-root .selector-6 .mode-btn:active {
  background-color: #1e7e34;
  color: #fff;
}

/* 面板：内部滚动 */
#wuxing-generator-root .panel {
  display: none;
  margin-top: 4px;
  padding: 4px 0;
  background: #fff;
  border-radius: 6px;
  width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

#wuxing-generator-root .panel.active {
  display: block;
}

#wuxing-generator-root .position-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 32px;
  max-width: 280px;
  margin: 0 auto;
}

#wuxing-generator-root .position-grid label {
  flex: 0 0 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#wuxing-generator-root .position-grid label input.wuxing-input {
  width: 100px !important;
  box-sizing: border-box;
}

#wuxing-generator-root .row-hr {
  border: none;
  height: 1px;
  background-color: rgba(0, 128, 0, 0.2);
  margin: 10px;
}

#wuxing-generator-root .wuxing-btn {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  justify-content: center;
  transition: background-color 0.3s, transform 0.2s ease;
  border: 2px solid #FF6F00;
  background-color: #FF8F00;
  color: #fff;
  margin-bottom: 16px;
}

#wuxing-generator-root .wuxing-btn.primary {
  background-color: #FF6F00;
}

#wuxing-generator-root .wuxing-btn:hover {
  background-color: #FF8F00;
  transform: scale(1.0);
}

#wuxing-generator-root .wuxing-input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 60px !important;
  height: 19px !important;
  padding: 0 8px !important;
  margin: 0 !important;
  border: 1px solid #ccc !important;
  border-radius: 0 !important;
  font-size: 16px !important;
  line-height: 18px !important;
  background: transparent !important;
  outline: none !important;
  box-sizing: border-box;
}

#wuxing-generator-root .wuxing-input.small {
  width: 48px !important;
}

#wuxing-generator-root input,
#wuxing-generator-root textarea {
  min-height: auto !important;
}

#wuxing-generator-root .output-box {
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0 !important;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 220px;
  -webkit-overflow-scrolling: touch;
}

#wuxing-generator-root .number-list {
  display: grid;
  width: 100%;
  padding: 0 !important;
  margin: 0 !important;
  list-style: none;
  gap: 0;
  box-sizing: border-box;
  align-content: start;
}

#wuxing-generator-root .output-box {
  scrollbar-gutter: stable;
}

#wuxing-generator-root .number-list[data-col="6"] {
  grid-template-columns: repeat(6, 1fr);
}

#wuxing-generator-root .number-list[data-col="7"] {
  grid-template-columns: repeat(7, 1fr);
}

#wuxing-generator-root .number-list li {
  background: #fff;
  border: 1px solid #ddd;
  padding: 2px 0;
  text-align: center;
  color: #333;
  border-radius: 0;
  box-sizing: border-box;
  word-break: break-word;
}

#wuxing-generator-root .output-box.disabled {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}

#wuxing-generator-root .output-box.disabled::after {
  content: "已关盘";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  color: red;
  font-weight: bold;
  background: rgba(255,255,255,0.9);
  padding: 10px 20px;
  border-radius: 6px;
}

#wuxing-generator-root .bet-info {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 14px;
  color: #6b3a00;
  user-select: none;
  font-weight: 600;
  flex-wrap: wrap;
}

#wuxing-generator-root .bet-info span span#erzd-count {
  color: #ff7a00;
  font-weight: 700;
}

#wuxing-generator-root .bet-info input[type="text"] {
  width: 60px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1.5px solid #ffb870;
  background: #fff8e1;
  color: #6b3a00;
  font-weight: 600;
  box-shadow: inset 0 1px 3px #ffe3a7;
  transition: background 0.3s ease, border-color 0.3s ease;
  outline: none;
  box-sizing: border-box;
  font-size: 16px !important;
}

#wuxing-generator-root .bet-info input[type="text"]:focus {
  background: #fff1b8;
  border-color: #ff8a00;
}

#wuxing-generator-root .inline-checkbox {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

#wuxing-generator-root .exclusive-pair {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

#wuxing-generator-root .wuxing-row > * {
  vertical-align: middle;
}

/* 主页面输入框辅助修正 */
#p5-sim-root input[type="text"],
#p5-sim-root textarea {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* 压缩内容区，但不动六大面板按钮 */
#wuxing-generator-root .panel {
  padding-top: 4px;
  padding-bottom: 4px;
  margin-top: 4px;
}

#wuxing-generator-root .panel .wuxing-row {
  margin: 0;
  padding: 0 10px;
  min-height: 22px;
}

#wuxing-generator-root .panel .row-hr {
  margin: 4px 10px;
}

#wuxing-generator-root .panel .inline-checkbox,
#wuxing-generator-root .panel .exclusive-pair {
  gap: 3px;
}

#wuxing-generator-root .panel .position-grid {
  gap: 6px 12px;
}

#wuxing-generator-root .panel .position-grid label {
  gap: 4px;
}

/* 二字定 / 三字定 / 四字定：配数输入与合分控件整体居中 */
#wuxing-generator-root #erziding-qz-inputs,
#wuxing-generator-root #sanzd-qz-inputs,
#wuxing-generator-root #sizd-qz-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

#wuxing-generator-root #panel-erzd .wuxing-row:has(> input[id^="erzd-g"][id$="-inp"]),
#wuxing-generator-root #panel-sanzd .wuxing-row:has(> input[id^="sanzd-g"][id$="-inp"]),
#wuxing-generator-root #panel-sizd .wuxing-row:has(> input[id^="sizd-g"][id$="-inp"]) {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

#wuxing-generator-root .panel .wuxing-input {
  height: 19px !important;
  padding: 0 6px !important;
  font-size: 16px !important;
}

#wuxing-generator-root .panel .bet-info {
  margin-top: 6px;
  gap: 10px;
  font-size: 13px;
}

#wuxing-generator-root .panel .bet-info input[type="text"] {
  width: 44px;
  padding: 3px 6px;
  font-size: 16px !important;
}




.p5-modal.hidden {
  display: none;
}

.p5-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.p5-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.p5-modal-card {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: #f6f7fb;
  display: flex;
  flex-direction: column;
}

.p5-modal-header {
  height: 56px;
  background: linear-gradient(90deg, #0f78c8, #13b9cc);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.p5-modal-title {
  font-size: 18px;
  font-weight: 700;
}

.p5-back-btn {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 30px;
  line-height: 28px;
  padding: 0;
}

.p5-modal-body {
  padding: 12px 10px 18px;
  overflow: auto;
  flex: 1;
  box-sizing: border-box;
}

.p5-balance-card,
.p5-tip-box {
  background: #fff;
  border-radius: 8px;
  padding: 14px 12px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.p5-balance-card {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.p5-balance-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: #4d78ff;
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
}

.p5-balance-card strong {
  color: #ff8a00;
  font-size: 15px;
}

.p5-tip-box {
  color: #999;
  font-size: 13px;
  line-height: 1.5;
}

.p5-form-row {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

.p5-form-label {
  width: 44px;
  flex: 0 0 44px;
  font-weight: 700;
  color: #5b6380;
  text-align: center;
  line-height: 40px;
}

.p5-form-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.p5-form-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 40px;
  border: 1px solid #d9d9df;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
  background: #fff;
  outline: none;
  box-sizing: border-box;
}

.p5-orange-mini-btn,
.p5-submit-btn {
  border: 0;
  background: #ffa133;
  color: #fff;
  font-weight: 700;
  border-radius: 10px;
}

.p5-orange-mini-btn {
  flex: 0 0 60px;
  width: 60px;
  height: 40px;
  padding: 0;
  font-size: 12px;
  white-space: nowrap;
}

.p5-form-hint {
  text-align: center;
  color: #999;
  margin: 6px 0 10px;
  font-size: 13px;
}

.p5-radio-row {
  background: #fff;
  border-radius: 8px;
  padding: 12px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  color: #666;
  font-size: 13px;
  box-sizing: border-box;
}

.p5-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.p5-submit-btn {
  width: 100%;
  height: 46px;
  border-radius: 999px;
  font-size: 16px;
}

.p5-number-row {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  box-sizing: border-box;
}

.p5-number-box {
  width: 100%;
  min-height: 92px;
  border: 1px solid #d9d9df;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  background: #fff;
  color: #333;
  box-sizing: border-box;
  display: block;
}

@media (max-width: 360px) {
  .p5-orange-mini-btn {
    flex-basis: 54px;
    width: 54px;
    font-size: 11px;
  }

  .p5-form-input {
    padding: 0 8px;
    font-size: 13px;
  }
}


.p5-modal-body {
  padding: 14px 12px 18px;
  overflow: auto;
  flex: 1;
  box-sizing: border-box;
  background: linear-gradient(180deg, #f6f7fb 0%, #f3f5fa 100%);
}

.p5-balance-card,
.p5-tip-box,
.p5-form-row,
.p5-number-row,
.p5-radio-row,
.p5-plan-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(20, 35, 90, 0.06);
  border: 1px solid rgba(120, 130, 160, 0.12);
  box-sizing: border-box;
}

.p5-balance-card,
.p5-tip-box {
  padding: 14px 12px;
  margin-bottom: 12px;
}

.p5-balance-card {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #334155;
}

.p5-balance-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4d78ff, #6f8cff);
  color: #fff;
  font-weight: 700;
  flex: 0 0 auto;
  box-shadow: 0 6px 14px rgba(77, 120, 255, 0.22);
}

.p5-balance-card strong {
  color: #ff8a00;
  font-size: 16px;
  font-weight: 800;
}

.p5-tip-box {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.6;
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
}

.p5-form-row {
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.p5-form-label {
  width: 52px;
  flex: 0 0 52px;
  font-weight: 700;
  color: #475569;
  text-align: center;
  line-height: 40px;
  font-size: 14px;
}

.p5-form-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.p5-form-input {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  height: 42px;
  border: 1px solid #d7dce6;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fff;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.p5-form-input:focus {
  border-color: #4d78ff;
  box-shadow: 0 0 0 3px rgba(77, 120, 255, 0.12);
}

.p5-orange-mini-btn,
.p5-submit-btn,
#p5-plan-refresh,
#p5-plan-stop-selected {
  border: 0;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.p5-orange-mini-btn:hover,
.p5-submit-btn:hover,
#p5-plan-refresh:hover,
#p5-plan-stop-selected:hover {
  transform: translateY(-1px);
}

.p5-orange-mini-btn:active,
.p5-submit-btn:active,
#p5-plan-refresh:active,
#p5-plan-stop-selected:active {
  transform: translateY(0);
  opacity: 0.92;
}

.p5-orange-mini-btn {
  flex: 0 0 64px;
  width: 64px;
  height: 42px;
  padding: 0;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffb14a 0%, #ff9a1f 100%);
  box-shadow: 0 6px 14px rgba(255, 161, 51, 0.18);
}

.p5-form-hint {
  text-align: center;
  color: #94a3b8;
  margin: 6px 0 10px;
  font-size: 12px;
  line-height: 1.4;
}

.p5-number-row {
  padding: 10px;
  margin-bottom: 10px;
}

.p5-number-box {
  width: 100%;
  min-height: 96px;
  border: 1px solid #d7dce6;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  line-height: 1.6;
  resize: none;
  outline: none;
  background: #fbfcfe;
  color: #334155;
  box-sizing: border-box;
  display: block;
}

.p5-number-box:focus {
  border-color: #4d78ff;
  box-shadow: 0 0 0 3px rgba(77, 120, 255, 0.12);
}

.p5-radio-row {
  padding: 12px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  color: #475569;
  font-size: 13px;
  align-items: center;
}

.p5-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  line-height: 1;
  white-space: nowrap;
}

.p5-radio-row input[type="radio"] {
  accent-color: #4d78ff;
}

.p5-submit-btn {
  width: 100%;
  height: 48px;
  border-radius: 999px;
  font-size: 16px;
  background: linear-gradient(180deg, #ffb14a 0%, #ff9a1f 100%);
  box-shadow: 0 10px 22px rgba(255, 161, 51, 0.22);
  margin: 2px 0 14px;
}

.p5-plan-box {
  padding: 12px;
  margin-top: 2px;
}

.p5-plan-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.p5-plan-toolbar button {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, #64748b 0%, #475569 100%);
  box-shadow: 0 6px 14px rgba(71, 85, 105, 0.14);
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.p5-plan-toolbar button:hover {
  transform: translateY(-1px);
}

#p5-plan-stop-selected {
  background: linear-gradient(180deg, #ef6f6c 0%, #e64b47 100%);
}

#p5-plan-running-count {
  margin-left: auto;
  font-size: 13px;
  color: #64748b;
  font-weight: 700;
}

.p5-plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 计划项样式，配合你后面动态插入的内容 */
.p5-plan-item {
  background: #f8fbff;
  border: 1px solid #e6edf7;
  border-radius: 14px;
  padding: 12px;
  box-sizing: border-box;
}

.p5-plan-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.p5-plan-item-title {
  font-size: 14px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.4;
}

.p5-plan-item-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e8f3ff;
  color: #2563eb;
}

.p5-plan-item-meta {
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
  display: grid;
  gap: 2px;
}

.p5-plan-item-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.p5-plan-item-actions button {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #eef2ff;
  color: #4f46e5;
}

.p5-plan-item-actions button.danger {
  background: #ffecec;
  color: #dc2626;
}

@media (max-width: 360px) {
  .p5-form-label {
    width: 46px;
    flex-basis: 46px;
    font-size: 13px;
  }

  .p5-orange-mini-btn {
    flex-basis: 56px;
    width: 56px;
    font-size: 11px;
  }

  .p5-form-input {
    padding: 0 10px;
    font-size: 13px;
  }

  .p5-radio-row {
    gap: 8px;
  }

  .p5-radio-row label {
    padding: 7px 9px;
  }

  #p5-plan-running-count {
    width: 100%;
    margin-left: 0;
  }
}

.p5-plan-empty {
  padding: 24px 12px;
  text-align: center;
  color: #94a3b8;
  background: #f8fafc;
  border: 1px dashed #dbe3f0;
  border-radius: 14px;
}

.p5-plan-empty-icon {
  width: 34px;
  height: 34px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.p5-plan-empty-text {
  font-size: 13px;
}

.p5-plan-item-status.is-running {
  background: #e8f3ff;
  color: #2563eb;
}

.p5-plan-item-status.is-stopped {
  background: #f1f5f9;
  color: #64748b;
}

.plan-btn {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: #eef2ff;
  color: #4f46e5;
}

.plan-btn.danger {
  background: #ffecec;
  color: #dc2626;
}




.p5-bill-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.55);
}

.p5-bill-panel {
  width: 100%;
  height: 100%;
  background: #f7f7fb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.p5-bill-header {
  padding: 14px 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
}

.p5-bill-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.p5-bill-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}

.p5-bill-filters {
  padding: 12px 16px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid #eee;
  align-items: center;
}

.p5-bill-tab {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

.p5-bill-tab.is-active {
  border-color: #ef4444;
  color: #ef4444;
  font-weight: 700;
}

.p5-bill-date-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.p5-bill-date {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
}

.p5-bill-btn {
  border: none;
  background: #ef4444;
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

.p5-bill-summary {
  padding: 14px 16px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-bottom: 1px solid #eee;
}

.p5-bill-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.p5-bill-card-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.p5-bill-card-value {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.p5-bill-list-wrap {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 18px;
}

.p5-bill-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.55);
}

.p5-bill-panel {
  width: 100%;
  height: 100%;
  background: #f7f7fb;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.p5-bill-header {
  padding: 14px 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
}

.p5-bill-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.p5-bill-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #666;
}

.p5-bill-filters {
  padding: 12px 16px;
  background: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid #eee;
  align-items: center;
}

.p5-bill-tab {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

.p5-bill-tab.is-active {
  border-color: #ef4444;
  color: #ef4444;
  font-weight: 700;
}

.p5-bill-date-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.p5-bill-date {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 14px;
}

.p5-bill-btn {
  border: none;
  background: #ef4444;
  color: #fff;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

.p5-bill-summary {
  padding: 14px 16px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border-bottom: 1px solid #eee;
}

.p5-bill-card {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.p5-bill-card-label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 8px;
}

.p5-bill-card-value {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.p5-bill-list-wrap {
  flex: 1;
  overflow: auto;
  padding: 12px 16px 18px;
}

.p5-bill-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

.p5-bill-table th,
.p5-bill-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
  font-size: 13px;
}

.p5-bill-table th {
  background: #fafafa;
  color: #374151;
  font-weight: 700;
}

.p5-bill-nums-btn {
  border: none;
  background: transparent;
  color: #ef4444;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.p5-bill-empty {
  padding: 40px 16px;
  text-align: center;
  color: #6b7280;
}

/* 只作用于“号码详情弹窗” */
#p5-nums-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  padding: 24px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  isolation: isolate;
}

#p5-nums-modal .p5-nums-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

#p5-nums-modal .p5-nums-modal-panel {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

#p5-nums-modal .p5-nums-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
}

#p5-nums-modal .p5-nums-modal-title {
  font-weight: 600;
}

#p5-nums-modal .p5-nums-modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f3f3f3;
  font-size: 22px;
  line-height: 32px;
  cursor: pointer;
}

#p5-nums-modal .p5-nums-modal-body {
  padding: 16px;
  overflow: auto;
  flex: 1;
}

#p5-nums-modal .p5-nums-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#p5-nums-modal .p5-nums-table td {
  border: 1px solid #ddd;
  padding: 8px 4px;
  text-align: center;
  font-size: 14px;
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 悬浮按钮 */
#drawPopupBtn {
  position: fixed;
  width: 50px;
  height: 50px;
  right: 10px;
  top: 45%;
  transform: translateY(-50%);
  border-radius: 50%;
  overflow: hidden;
  z-index: 99999;
  touch-action: none;
}

#floatBtn img {
  width: 100%;
  height: 100%;
  display: block;
}

#floatBtn {
  position: fixed;
  width: 50px;
  height: 50px;
  right: 10px;
  top: calc(45% + 60px);
  transform: translateY(-50%);
  border-radius: 50%;
  overflow: hidden;
  z-index: 99999;
  touch-action: none;
}

#drawPopupBtn img {
  width: 100%;
  height: 100%;
  display: block;
}

/* 遮罩 */
#sheetMask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: none;
  z-index: 9998;
}

/* 全屏面板 */
#sheet {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #fff;
  border-radius: 0;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}
#sheet.show {
  transform: translateY(0);
}

#sheetHeader {
  height: 50px;
  background: #000;
  color: #fff;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
}

#sheetHeader span {
  cursor: pointer;
}

#sheetContent {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#sheetContent iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

#iframeFallback {
  position: absolute;
  inset: 0;
  display: none;
  text-align: center;
  padding: 20px;
  background: #f5f5f5;
  z-index: 1;
}


/* 回水 */
.p5-rebate-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.p5-rebate-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.24);
}

.p5-rebate-panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #1d2433;
  overflow: hidden;
}

.p5-rebate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf0f5;
  background: #fff;
}

.p5-rebate-title {
  font-size: 17px;
  font-weight: 700;
  color: #1d2433;
}

.p5-rebate-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: #7b8596;
}

.p5-rebate-close,
.p5-rebate-query,
.p5-rebate-tab,
.p5-rebate-switch-btn {
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #1d2433;
  box-sizing: border-box;
}

.p5-rebate-close {
  background: #f3f5f8;
}

.p5-rebate-query {
  background: #2f6bff;
  color: #fff;
  flex: 0 0 auto;
  white-space: nowrap;
}

.p5-rebate-tab {
  background: #eef2f7;
  color: #334155;
  flex: 0 0 auto;
  white-space: nowrap;
}

.p5-rebate-tab.is-active {
  background: #2f6bff;
  color: #fff;
}

.p5-rebate-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 0;
}

.p5-rebate-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.p5-rebate-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  width: 100%;
}

.p5-rebate-date-row input {
  min-width: 0;
  flex: 1 1 0;
  border: 1px solid #dbe2ec;
  background: #fff;
  color: #1d2433;
  border-radius: 10px;
  padding: 8px 8px;
  outline: none;
  font-size: 13px;
  box-sizing: border-box;
}

.p5-rebate-date-split {
  color: #7b8596;
  flex: 0 0 auto;
}

.p5-rebate-range-text {
  font-size: 12px;
  color: #7b8596;
}

.p5-rebate-summary {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 14px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.p5-rebate-card {
  flex: 1 0 0;
  min-width: 0;
  border-radius: 12px;
  padding: 11px 8px;
  background: #f7f9fc;
  border: 1px solid #edf0f5;
  box-sizing: border-box;
}

.p5-rebate-card .k {
  font-size: 11px;
  color: #7b8596;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p5-rebate-card .v {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
  color: #1d2433;
  white-space: nowrap;
}

.p5-rebate-switch {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px 12px;
  margin-top: 4px;
  margin-bottom: 2px;
}

.p5-rebate-switch-btn {
  background: #eef2f7;
  color: #334155;
}

.p5-rebate-switch-btn.is-active {
  background: #2f6bff;
  color: #fff;
}

.p5-rebate-view {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px;
}

.p5-rebate-view.is-active {
  display: flex;
}

.p5-rebate-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.p5-rebate-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1d2433;
}

.p5-rebate-section-subtitle,
.p5-rebate-section-count {
  font-size: 12px;
  color: #7b8596;
}

.p5-rebate-table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #edf0f5;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.p5-rebate-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.p5-rebate-table col.col-time { width: 28%; }
.p5-rebate-table col.col-type { width: 16%; }
.p5-rebate-table col.col-user { width: 24%; }
.p5-rebate-table col.col-amount { width: 16%; }
.p5-rebate-table col.col-mode { width: 16%; }

.p5-rebate-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  color: #667085;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 8px;
  border-bottom: 1px solid #edf0f5;
  white-space: nowrap;
  vertical-align: middle;
}

.p5-rebate-table tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid #f0f3f8;
  font-size: 12px;
  color: #1d2433;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  line-height: 1.2;
}

.p5-rebate-table tbody td:nth-child(2),
.p5-rebate-table tbody td:nth-child(5) {
  text-align: center;
}

.p5-rebate-table tbody tr:hover {
  background: #fafcff;
}

.p5-rebate-badge {
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  height: auto;
  line-height: 1.2;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.p5-rebate-badge.self {
  color: #2f6bff;
}

.p5-rebate-badge.pull {
  color: #13a56b;
}

.p5-rebate-badge.auto {
  color: #c98a00;
}

.p5-rebate-badge.manual {
  color: #334155;
}

.p5-rebate-empty,
.p5-rebate-loading,
.p5-rebate-error {
  padding: 22px 14px;
  text-align: center;
  color: #7b8596;
}

@media (max-width: 780px) {
  .p5-rebate-header {
    padding: 10px 12px;
  }

  .p5-rebate-title {
    font-size: 16px;
  }

  .p5-rebate-toolbar {
    padding: 10px 12px 0;
  }

  .p5-rebate-tabs {
    gap: 6px;
  }

  .p5-rebate-tab {
    padding: 8px 10px;
    font-size: 12px;
  }

  .p5-rebate-date-row {
    gap: 5px;
  }

  .p5-rebate-date-row input {
    font-size: 12px;
    padding: 7px 7px;
  }

  .p5-rebate-query {
    padding: 8px 10px;
    font-size: 12px;
  }

  .p5-rebate-summary {
    gap: 5px;
    padding: 8px 12px 5px;
  }

  .p5-rebate-card {
    padding: 8px 6px;
  }

  .p5-rebate-card .k {
    font-size: 10px;
  }

  .p5-rebate-card .v {
    font-size: 14px;
  }

  .p5-rebate-switch {
    justify-content: center;
    padding: 12px 12px 10px;
    margin-top: 6px;
    margin-bottom: 4px;
  }

  .p5-rebate-view {
    padding: 0 12px 12px;
  }

  .p5-rebate-table thead th,
  .p5-rebate-table tbody td {
    padding: 8px 6px;
    font-size: 11px;
  }

  .p5-rebate-table col.col-time { width: 31%; }
  .p5-rebate-table col.col-type { width: 15%; }
  .p5-rebate-table col.col-user { width: 24%; }
  .p5-rebate-table col.col-amount { width: 15%; }
  .p5-rebate-table col.col-mode { width: 15%; }
}
/* 快选 - 二字定 / 三字定 / 四字定：标题选项与合分选项整组居中 */
#wuxing-generator-root #panel-erzd .ding-option-row,
#wuxing-generator-root #panel-sanzd .ding-option-row,
#wuxing-generator-root #panel-sizd .ding-option-row,
#wuxing-generator-root #panel-erzd .ding-he-row,
#wuxing-generator-root #panel-sanzd .ding-he-row,
#wuxing-generator-root #panel-sizd .ding-he-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3px;
  text-align: center;
}

/* 配数模式：隐藏位置输入所在整行后，让配数框在两条分隔线之间上下、左右都居中 */
#wuxing-generator-root #panel-erzd .ding-qz-row,
#wuxing-generator-root #panel-sanzd .ding-qz-row,
#wuxing-generator-root #panel-sizd .ding-qz-row {
  align-items: center !important;
  justify-content: center !important;
  min-height: 58px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 1;
  box-sizing: border-box;
}

#wuxing-generator-root #panel-erzd .ding-qz-row > *,
#wuxing-generator-root #panel-sanzd .ding-qz-row > *,
#wuxing-generator-root #panel-sizd .ding-qz-row > * {
  align-self: center;
}

/* 快选参考图重构样式已迁移到 quickpick.css；此处不再叠加 V2/V3 覆盖。 */

/* ============================================================
   聊天室.png 视觉版（2026-08）
   - 去掉顶部店招 / 账号 / 计时器 / 开奖倒计时
   - 半透明悬浮菜单仅保留：倍投 / 账单 / 注单
   - 底部输入栏与 5x9 虚拟键盘按参考图重排
   ============================================================ */

:root {
  --p5-panel-closed-h: 62px;
  --p5-panel-open-h: clamp(270px, 31dvh, 306px);
}

.p5-runtime-meta,
.p5-last-issue {
  display: none !important;
}

.p5-sim-root,
.p5-body,
.p5-chat-wrap {
  background: #f4f4f6 !important;
}

.p5-body {
  border-radius: 0 !important;
}

.p5-chat-wrap {
  padding: 10px 9px 12px !important;
}

/* 右上角半透明菜单 */
.p5-floating-menu {
  position: fixed !important;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: max(10px, calc((100vw - 960px) / 2 + 10px));
  z-index: 2500;
}

.p5-menu-trigger.p5-btn.small {
  min-width: 48px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 17px;
  background: rgba(44, 50, 58, .34);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.p5-menu-trigger.p5-btn.small:active {
  background: rgba(44, 50, 58, .5);
}

.p5-floating-menu .p5-menu-popup {
  top: calc(100% + 7px);
  right: 0;
  min-width: 92px;
  gap: 3px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 12px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.p5-floating-menu .p5-menu-popup .menu-item {
  width: 100%;
  min-width: 80px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  color: #252525;
  font-size: 14px;
  font-weight: 700;
}

.p5-floating-menu .p5-menu-popup .menu-item:active {
  background: rgba(225, 228, 234, .92);
}

/* 消息气泡更接近参考图 */
.p5-messages {
  gap: 3px !important;
}

.msg-wrap {
  gap: 7px !important;
  margin: 5px 0 !important;
}

.avatar {
  width: 59px !important;
  height: 59px !important;
  flex-basis: 59px !important;
  border-radius: 5px !important;
  background: #e9f4ff !important;
  font-size: 34px;
}

.msg {
  max-width: min(76vw, 680px) !important;
  padding: 8px 10px !important;
  border: 1px solid #cfd1d5 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #222 !important;
  font-size: 18px !important;
  line-height: 1.22 !important;
}

/* 底部输入工具条 */
.p5-bottom-panel {
  background: #f7f7f8 !important;
  border-top: 1px solid #d7d8dc !important;
  box-shadow: none !important;
}

.p5-bottom-panel.keyboard-open,
.p5-bottom-panel.recent-text-open {
  height: var(--p5-panel-open-h) !important;
  min-height: var(--p5-panel-open-h) !important;
}

.p5-input-area {
  min-height: 61px;
  gap: 7px !important;
  align-items: center !important;
  padding: 7px 10px calc(7px + var(--p5-safe-bottom)) !important;
  border-top: 0 !important;
  background: #f7f7f8 !important;
}

.p5-key-toggle {
  flex: 0 0 34px !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border: 1.5px solid #ff7a00 !important;
  border-radius: 50% !important;
  background: #fff !important;
  box-shadow: none !important;
  position: relative;
}

.p5-key-toggle .p5-keypad-dots {
  width: 19px;
  height: 19px;
  display: block;
  border-radius: 50%;
  background-image: radial-gradient(circle, #f47b16 1.8px, transparent 2px);
  background-size: 6px 6px;
  background-position: .5px .5px;
}

.p5-input-area textarea {
  flex: 1 1 auto !important;
  min-height: 37px !important;
  height: 37px;
  max-height: 74px !important;
  padding: 8px 10px !important;
  border: 1px solid #d9dadd !important;
  border-radius: 11px !important;
  background: #fff !important;
  color: #222 !important;
  font-size: 16px !important;
  line-height: 20px !important;
}

.p5-quickpick-bottom,
.p5-send {
  flex: 0 0 auto !important;
  width: auto !important;
  min-width: 64px !important;
  height: 36px !important;
  padding: 0 12px !important;
  border: 1px solid #087d10 !important;
  border-radius: 4px !important;
  background: #13a51d !important;
  color: #fff !important;
  box-shadow: none !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  line-height: 34px !important;
  white-space: nowrap;
  cursor: pointer;
}

.p5-quickpick-bottom:active,
.p5-send:active {
  transform: translateY(1px);
  background: #0c9516 !important;
}

.p5-hiscontext {
  flex: 0 0 36px !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  border: 1px solid #aeb1b8 !important;
  border-radius: 50% !important;
  background: #f5f5f6 !important;
  color: #8b8e95 !important;
  box-shadow: none !important;
  font-size: 31px !important;
  font-weight: 300 !important;
  line-height: 32px !important;
}

/* 参考图 5 行 x 9 列虚拟键盘 */
.p5-virtual-keyboard {
  background: #d1d5df !important;
  border-top: 1px solid #c4c8d1 !important;
}

.p5-virtual-keyboard-inner {
  padding: 6px 10px calc(8px + var(--p5-safe-bottom)) !important;
  gap: 5px !important;
  background: #d1d5df !important;
}

.p5-krow {
  gap: 8px !important;
}

.p5-krow .p5-key,
.p5-krow .p5-key.special,
.p5-krow .p5-key.action {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: #fff !important;
  color: #050505 !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .13) !important;
  font-size: clamp(15px, 3.05vw, 19px) !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

.p5-krow .p5-key:active {
  background: #eceef2 !important;
  transform: translateY(1px);
}

.p5-krow .p5-key-backspace {
  color: #f12a20 !important;
}

.p5-krow .p5-key-enter {
  background: #ff9d00 !important;
  color: #fff !important;
}

/* 历史注单面板沿用底部区域尺寸，但底色跟键盘一致 */
.p5-hiscontext-panel {
  background: #d1d5df !important;
}

@media (max-width: 620px) {
  :root {
    --p5-panel-closed-h: 61px;
    --p5-panel-open-h: clamp(258px, 31dvh, 296px);
  }

  .p5-chat-wrap {
    padding: 8px 8px 10px !important;
  }

  .avatar {
    width: 58px !important;
    height: 58px !important;
    flex-basis: 58px !important;
  }

  .msg {
    font-size: 17px !important;
  }

  .p5-input-area {
    gap: 6px !important;
    padding-left: 10px !important;
    padding-right: 7px !important;
  }

  .p5-quickpick-bottom,
  .p5-send {
    min-width: 64px !important;
    padding: 0 9px !important;
    font-size: 17px !important;
  }

  .p5-krow {
    gap: 7px !important;
  }

  .p5-virtual-keyboard-inner {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
}

@media (max-width: 440px) {
  .p5-input-area {
    gap: 4px !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }

  .p5-key-toggle {
    flex-basis: 31px !important;
    width: 31px !important;
    min-width: 31px !important;
    height: 31px !important;
  }

  .p5-key-toggle .p5-keypad-dots {
    transform: scale(.9);
  }

  .p5-quickpick-bottom,
  .p5-send {
    min-width: 52px !important;
    height: 35px !important;
    padding: 0 7px !important;
    font-size: 15px !important;
  }

  .p5-hiscontext {
    flex-basis: 33px !important;
    width: 33px !important;
    min-width: 33px !important;
    height: 33px !important;
  }

  .p5-krow {
    gap: 5px !important;
  }

  .p5-virtual-keyboard-inner {
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

/* 参考图基准宽度为 590px；桌面端居中展示，手机端铺满。 */
#p5-sim-root .p5-sim-root {
  max-width: 590px !important;
}

.p5-floating-menu {
  right: max(10px, calc((100vw - 590px) / 2 + 10px)) !important;
}


/* ============================================================
   聊天输入区微调 V2（2026-08）
   - 快选 / 发送按钮缩小
   - 输入框默认更矮，内容增多时向上自动增高
   - 输入框不出现内部上下滚动条
   - 虚拟键盘使用独立固定高度，不被输入框挤压
   ============================================================ */
:root {
  --p5-panel-closed-h: 50px;
  --p5-keyboard-fixed-h: clamp(197px, calc(31dvh - 61px), 235px);
}

/* 键盘开启时，底部面板总高度跟随“输入区 + 固定键盘”自然增长。 */
.p5-bottom-panel.keyboard-open {
  height: auto !important;
  min-height: 0 !important;
}

.p5-bottom-panel.keyboard-open .p5-virtual-keyboard {
  flex: 0 0 var(--p5-keyboard-fixed-h) !important;
  height: var(--p5-keyboard-fixed-h) !important;
  min-height: var(--p5-keyboard-fixed-h) !important;
  max-height: var(--p5-keyboard-fixed-h) !important;
}

.p5-input-area {
  min-height: 50px !important;
  align-items: flex-end !important;
  padding: 5px 8px calc(5px + var(--p5-safe-bottom)) !important;
  gap: 6px !important;
}

.p5-input-area textarea {
  min-height: 32px !important;
  height: 32px;
  max-height: none !important;
  padding: 6px 9px !important;
  border-radius: 10px !important;
  line-height: 20px !important;
  overflow-y: hidden !important;
  overflow-x: hidden !important;
  resize: none !important;
  scrollbar-width: none;
}

.p5-input-area textarea::-webkit-scrollbar {
  display: none;
}

.p5-key-toggle {
  flex-basis: 31px !important;
  width: 31px !important;
  min-width: 31px !important;
  height: 31px !important;
}

.p5-key-toggle .p5-keypad-dots {
  transform: scale(.9);
}

.p5-quickpick-bottom,
.p5-send {
  min-width: 56px !important;
  height: 32px !important;
  padding: 0 9px !important;
  border-radius: 4px !important;
  font-size: 16px !important;
  line-height: 30px !important;
}

@media (max-width: 440px) {
  .p5-input-area {
    min-height: 48px !important;
    padding-top: 4px !important;
    padding-bottom: calc(4px + var(--p5-safe-bottom)) !important;
    gap: 4px !important;
  }

  .p5-input-area textarea {
    min-height: 31px !important;
    height: 31px;
    padding: 5px 8px !important;
    line-height: 20px !important;
  }

  .p5-quickpick-bottom,
  .p5-send {
    min-width: 49px !important;
    height: 31px !important;
    padding: 0 6px !important;
    font-size: 15px !important;
    line-height: 29px !important;
  }
}

/* =========================================================
   幸运五 / 倍投：传统直角版（2026-08）
   仅作用于倍投面板，不影响账单、注单和翻滩。
   ========================================================= */
#beitou-panel-root .p5-modal-card {
  background: #fff !important;
}

#beitou-panel-root .p5-modal-header {
  height: 48px;
  min-height: 48px;
  padding: 0 10px;
  background: #315d82 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#beitou-panel-root .p5-modal-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
}

#beitou-panel-root .p5-beitou-traditional {
  padding: 10px 12px 18px !important;
  background: #fff !important;
  color: #222;
}

#beitou-panel-root .p5-trad-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 38px;
  padding: 4px 0;
  margin: 0 0 7px;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

#beitou-panel-root .p5-trad-label {
  flex: 0 0 42px;
  width: 42px;
  text-align: right;
  color: #222;
  font-size: 13px;
  font-weight: 700;
  line-height: 32px;
}

#beitou-panel-root .p5-form-input,
#beitou-panel-root .p5-trad-input {
  height: 34px;
  min-width: 0;
  padding: 0 8px;
  border: 1px solid #999 !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
  color: #222;
  font-size: 13px;
  transition: none !important;
}

#beitou-panel-root .p5-form-input:focus,
#beitou-panel-root .p5-trad-input:focus {
  border-color: #315d82 !important;
  box-shadow: none !important;
  outline: 1px solid #315d82;
  outline-offset: -1px;
}

#beitou-panel-root .p5-content-line .p5-trad-input {
  flex: 1 1 auto;
}

#beitou-panel-root .p5-trad-btn,
#beitou-panel-root #p5-plan-refresh,
#beitou-panel-root #p5-plan-stop-selected {
  flex: 0 0 auto;
  height: 34px !important;
  padding: 0 11px !important;
  border: 1px solid #888 !important;
  border-radius: 0 !important;
  background: #ededed !important;
  box-shadow: none !important;
  color: #222 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 32px;
  cursor: pointer;
  transform: none !important;
  white-space: nowrap;
}

#beitou-panel-root .p5-trad-btn:hover,
#beitou-panel-root #p5-plan-refresh:hover,
#beitou-panel-root #p5-plan-stop-selected:hover {
  background: #e2e2e2 !important;
  transform: none !important;
}

#beitou-panel-root .p5-save-btn {
  border-color: #315d82 !important;
  background: #315d82 !important;
  color: #fff !important;
  font-weight: 700 !important;
}

#beitou-panel-root .p5-save-btn:hover {
  background: #274d6c !important;
}

#beitou-panel-root .p5-trad-number-section {
  margin: 2px 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#beitou-panel-root .p5-trad-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 0 2px;
  border-bottom: 1px solid #777;
  font-size: 13px;
  font-weight: 700;
  color: #222;
}

#beitou-panel-root #beitou-decode-hint {
  color: #666;
  font-size: 12px;
  font-weight: 400;
}

#beitou-panel-root .p5-number-table-wrap {
  width: 100%;
  max-height: 250px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#beitou-panel-root .p5-number-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  background: #fff;
}

#beitou-panel-root .p5-number-table td {
  width: 16.666%;
  height: 33px;
  padding: 3px 4px;
  border: 1px solid #a7a7a7;
  border-radius: 0;
  background: #fff;
  color: #111;
  text-align: center;
  vertical-align: middle;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  box-sizing: border-box;
}

#beitou-panel-root .p5-number-table td.is-empty {
  color: transparent;
}

#beitou-panel-root .p5-number-empty td {
  height: 54px;
  color: #888;
  font-size: 12px;
}

#beitou-panel-root .p5-score-input {
  flex: 0 1 210px;
  width: 210px;
}

#beitou-panel-root .p5-xian-check,
#beitou-panel-root .p5-stopmode-inline label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #222;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

#beitou-panel-root .p5-xian-check input,
#beitou-panel-root .p5-stopmode-inline input {
  margin: 0;
  accent-color: #315d82;
}

#beitou-panel-root .p5-inline-note {
  color: #777;
  font-size: 11px;
  white-space: nowrap;
}

#beitou-panel-root .p5-period-line {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

#beitou-panel-root .p5-period-input {
  flex: 0 0 72px;
  width: 72px;
}

#beitou-panel-root .p5-stopmode-inline {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

#beitou-panel-root .p5-plan-section {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 2px solid #666;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#beitou-panel-root .p5-trad-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 34px;
  margin: 0 0 6px;
  padding: 0;
}

#beitou-panel-root .p5-trad-toolbar strong {
  margin-right: 4px;
  color: #222;
  font-size: 13px;
}

#beitou-panel-root #p5-plan-running-count {
  margin: 0 auto 0 0 !important;
  color: #555;
  font-size: 12px;
  font-weight: 400;
}

#beitou-panel-root .p5-plan-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#beitou-panel-root .p5-plan-table {
  width: 100%;
  min-width: 560px;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  background: #fff;
  color: #222;
  font-size: 12px;
}

#beitou-panel-root .p5-plan-table th,
#beitou-panel-root .p5-plan-table td {
  height: 34px;
  padding: 4px 6px;
  border: 1px solid #a7a7a7;
  border-radius: 0;
  background: #fff;
  text-align: center;
  vertical-align: middle;
  box-sizing: border-box;
}

#beitou-panel-root .p5-plan-table th {
  background: #f0f0f0;
  font-weight: 700;
}

#beitou-panel-root .p5-plan-table th:nth-child(1) { width: 42px; }
#beitou-panel-root .p5-plan-table th:nth-child(2) { width: 180px; }
#beitou-panel-root .p5-plan-table th:nth-child(3) { width: 72px; }
#beitou-panel-root .p5-plan-table th:nth-child(4) { width: 64px; }
#beitou-panel-root .p5-plan-table th:nth-child(5) { width: 92px; }
#beitou-panel-root .p5-plan-table th:nth-child(6) { width: 110px; }

#beitou-panel-root .p5-plan-content-cell {
  overflow: hidden;
  text-align: left !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#beitou-panel-root .p5-plan-action-cell {
  white-space: nowrap;
}

#beitou-panel-root .p5-plan-action-cell span {
  margin-right: 5px;
  color: #444;
}

#beitou-panel-root .p5-plan-table tr.is-stopped td {
  color: #888;
  background: #fafafa;
}

#beitou-panel-root .p5-table-action {
  height: 26px;
  padding: 0 7px;
  border: 1px solid #888;
  border-radius: 0;
  background: #eee;
  color: #222;
  font-size: 11px;
  cursor: pointer;
}

#beitou-panel-root .p5-table-action:disabled {
  color: #aaa;
  cursor: default;
}

#beitou-panel-root .p5-plan-empty-row td {
  height: 54px;
  color: #888;
  text-align: center;
}

@media (max-width: 420px) {
  #beitou-panel-root .p5-beitou-traditional {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  #beitou-panel-root .p5-trad-row {
    gap: 5px;
  }

  #beitou-panel-root .p5-trad-label {
    flex-basis: 36px;
    width: 36px;
    font-size: 12px;
  }

  #beitou-panel-root .p5-score-input {
    flex-basis: 155px;
    width: 155px;
  }

  #beitou-panel-root .p5-inline-note {
    display: none;
  }

  #beitou-panel-root .p5-period-input {
    flex-basis: 56px;
    width: 56px;
  }

  #beitou-panel-root .p5-stopmode-inline {
    gap: 5px;
  }

  #beitou-panel-root .p5-stopmode-inline label {
    font-size: 11px;
  }

  #beitou-panel-root .p5-save-btn {
    padding: 0 8px !important;
  }

  #beitou-panel-root .p5-number-table td {
    padding-left: 2px;
    padding-right: 2px;
    font-size: 12px;
  }
}

/* =========================================================
   幸运五倍投 - 第二版传统紧凑排版
   目标：对齐、少装饰、无横向滚动、计划表仅 5 列。
   ========================================================= */
#beitou-panel-root .p5-beitou-traditional {
  padding: 12px 14px 18px !important;
}

#beitou-panel-root .p5-trad-row {
  gap: 8px;
  min-height: 36px;
  padding: 0;
  margin: 0;
}

#beitou-panel-root .p5-trad-label {
  flex: 0 0 44px;
  width: 44px;
  text-align: left;
  line-height: 34px;
}

#beitou-panel-root .p5-content-line {
  margin-bottom: 10px;
}

#beitou-panel-root .p5-content-line .p5-trad-input {
  height: 36px;
}

#beitou-panel-root .p5-content-line .p5-trad-btn {
  height: 36px !important;
  line-height: 34px;
  min-width: 62px;
}

#beitou-panel-root .p5-trad-number-section {
  margin: 0 0 10px;
}

#beitou-panel-root .p5-trad-section-title {
  height: 32px;
  padding: 0;
  border-bottom: 1px solid #777;
}

#beitou-panel-root #beitou-decode-hint {
  color: #555;
  font-variant-numeric: tabular-nums;
}

#beitou-panel-root .p5-number-table-wrap {
  max-height: 205px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

#beitou-panel-root .p5-number-table td {
  height: 30px;
  padding: 2px 3px;
  font-size: 12px;
}

#beitou-panel-root .p5-number-empty td {
  height: 42px;
  color: #8a8a8a;
}

#beitou-panel-root .p5-settings-block {
  margin-top: 8px;
  padding: 8px 0 7px;
  border-top: 1px solid #b7b7b7;
  border-bottom: 1px solid #b7b7b7;
  background: transparent;
}

#beitou-panel-root .p5-score-line {
  margin-bottom: 8px;
}

#beitou-panel-root .p5-score-input {
  flex: 0 0 220px;
  width: 220px;
}

#beitou-panel-root .p5-xian-check {
  min-width: 42px;
  height: 34px;
  gap: 5px;
  font-size: 13px;
}

#beitou-panel-root .p5-xian-check input {
  width: 15px;
  height: 15px;
}

#beitou-panel-root .p5-period-line {
  display: grid;
  grid-template-columns: 44px 72px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow: visible;
}

#beitou-panel-root .p5-period-input {
  width: 72px;
  min-width: 0;
}

#beitou-panel-root .p5-stopmode-inline {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  overflow: hidden;
}

#beitou-panel-root .p5-stopmode-inline label {
  gap: 4px;
  font-size: 12px;
}

#beitou-panel-root .p5-stopmode-inline input {
  width: 14px;
  height: 14px;
}

#beitou-panel-root .p5-save-btn {
  width: 56px;
  min-width: 56px;
  padding: 0 !important;
  justify-self: end;
}

#beitou-panel-root .p5-plan-section {
  margin-top: 14px;
  padding-top: 0;
  border-top: 0;
}

#beitou-panel-root .p5-trad-toolbar {
  min-height: 38px;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #777;
  flex-wrap: nowrap;
}

#beitou-panel-root .p5-plan-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  margin-right: auto;
}

#beitou-panel-root .p5-plan-heading strong {
  margin: 0;
  font-size: 14px;
}

#beitou-panel-root #p5-plan-running-count {
  margin: 0 !important;
  color: #666;
  font-size: 12px;
  white-space: nowrap;
}

#beitou-panel-root .p5-stop-selected-btn {
  height: 30px !important;
  line-height: 28px !important;
  padding: 0 10px !important;
  font-weight: 500 !important;
}

#beitou-panel-root .p5-plan-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

#beitou-panel-root .p5-plan-table {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  table-layout: fixed;
}

#beitou-panel-root .p5-plan-table th,
#beitou-panel-root .p5-plan-table td {
  height: 36px;
  padding: 4px 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#beitou-panel-root .p5-plan-table th:nth-child(1),
#beitou-panel-root .p5-plan-table td:nth-child(1) { width: 10%; }
#beitou-panel-root .p5-plan-table th:nth-child(2),
#beitou-panel-root .p5-plan-table td:nth-child(2) { width: 18%; }
#beitou-panel-root .p5-plan-table th:nth-child(3),
#beitou-panel-root .p5-plan-table td:nth-child(3) { width: 30%; }
#beitou-panel-root .p5-plan-table th:nth-child(4),
#beitou-panel-root .p5-plan-table td:nth-child(4) { width: 18%; }
#beitou-panel-root .p5-plan-table th:nth-child(5),
#beitou-panel-root .p5-plan-table td:nth-child(5) { width: 24%; }

#beitou-panel-root .p5-plan-points-cell {
  font-variant-numeric: tabular-nums;
}

#beitou-panel-root .p5-plan-xian {
  display: inline-block;
  margin-left: 5px;
  color: #315d82;
  font-size: 11px;
}

#beitou-panel-root .p5-plan-status-cell {
  color: #315d82;
  font-weight: 600;
}

#beitou-panel-root .p5-plan-table tr.is-stopped .p5-plan-status-cell {
  color: #888;
}

#beitou-panel-root .p5-plan-empty-row td {
  height: 48px;
}

@media (max-width: 430px) {
  #beitou-panel-root .p5-beitou-traditional {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }

  #beitou-panel-root .p5-trad-label {
    flex-basis: 38px;
    width: 38px;
    font-size: 12px;
  }

  #beitou-panel-root .p5-score-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  #beitou-panel-root .p5-period-line {
    grid-template-columns: 38px 60px minmax(0, 1fr) 50px;
    gap: 6px;
  }

  #beitou-panel-root .p5-period-input {
    width: 60px;
  }

  #beitou-panel-root .p5-stopmode-inline {
    grid-column: 1 / -1;
    padding-left: 44px;
    justify-content: space-between;
    gap: 5px;
    overflow: visible;
  }

  #beitou-panel-root .p5-stopmode-inline label {
    font-size: 11px;
  }

  #beitou-panel-root .p5-save-btn {
    grid-column: 4;
    grid-row: 1;
    width: 50px;
    min-width: 50px;
  }

  #beitou-panel-root .p5-plan-table th,
  #beitou-panel-root .p5-plan-table td {
    padding-left: 2px;
    padding-right: 2px;
    font-size: 11px;
  }
}

/* =========================================================
   幸运五倍投 - 第三版设置区
   两行等高：积分/期数；停止方式/现/保存。
   ========================================================= */
#beitou-panel-root .p5-settings-block {
  padding: 9px 0 8px;
}

#beitou-panel-root .p5-value-line,
#beitou-panel-root .p5-options-line {
  width: 100%;
  min-height: 36px;
  align-items: center;
}

#beitou-panel-root .p5-value-line {
  display: grid;
  grid-template-columns: 44px minmax(150px, 1fr) 44px 112px;
  gap: 8px;
  margin-bottom: 8px;
}

#beitou-panel-root .p5-value-line .p5-trad-label,
#beitou-panel-root .p5-value-line .p5-trad-input,
#beitou-panel-root .p5-options-line .p5-stopmode-inline label,
#beitou-panel-root .p5-options-line .p5-xian-check,
#beitou-panel-root .p5-options-line .p5-save-btn {
  height: 36px !important;
  min-height: 36px !important;
  box-sizing: border-box;
}

#beitou-panel-root .p5-value-line .p5-trad-label {
  width: auto;
  line-height: 1;
  display: flex;
  align-items: center;
}

#beitou-panel-root .p5-value-line .p5-score-input,
#beitou-panel-root .p5-value-line .p5-period-input {
  width: 100%;
  min-width: 0;
}

#beitou-panel-root .p5-options-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px 58px;
  gap: 8px;
}

#beitou-panel-root .p5-options-line .p5-stopmode-inline {
  min-width: 0;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  overflow: visible;
}

#beitou-panel-root .p5-options-line .p5-stopmode-inline label,
#beitou-panel-root .p5-options-line .p5-xian-check {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  line-height: 1;
  white-space: nowrap;
  color: #222;
  font-size: 13px;
  font-weight: 400;
}

#beitou-panel-root .p5-options-line .p5-stopmode-inline input,
#beitou-panel-root .p5-options-line .p5-xian-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: 0 0 auto;
}

#beitou-panel-root .p5-options-line .p5-xian-check {
  min-width: 46px;
  justify-content: center;
}

#beitou-panel-root .p5-options-line .p5-save-btn {
  width: 58px;
  min-width: 58px;
  padding: 0 !important;
  line-height: 34px !important;
  justify-self: end;
}

@media (max-width: 430px) {
  #beitou-panel-root .p5-value-line {
    grid-template-columns: 36px minmax(0, 1fr) 36px 76px;
    gap: 6px;
  }

  #beitou-panel-root .p5-options-line {
    grid-template-columns: minmax(0, 1fr) 40px 50px;
    gap: 5px;
  }

  #beitou-panel-root .p5-options-line .p5-stopmode-inline {
    gap: 7px;
  }

  #beitou-panel-root .p5-options-line .p5-stopmode-inline label,
  #beitou-panel-root .p5-options-line .p5-xian-check {
    font-size: 11px;
    gap: 3px;
  }

  #beitou-panel-root .p5-options-line .p5-stopmode-inline input,
  #beitou-panel-root .p5-options-line .p5-xian-check input {
    width: 13px;
    height: 13px;
  }

  #beitou-panel-root .p5-options-line .p5-xian-check {
    min-width: 40px;
  }

  #beitou-panel-root .p5-options-line .p5-save-btn {
    width: 50px;
    min-width: 50px;
  }
}


/* =========================================================
   幸运五倍投 - 第四版细节
   积分/期数输入更紧凑；号码表有数据才显示。
   ========================================================= */
#beitou-panel-root .p5-number-count-line {
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border: 0 !important;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

#beitou-panel-root #beitou-decode-hint {
  height: 24px;
  line-height: 24px;
  color: #555;
  font-size: 12px;
  font-weight: 400;
}

#beitou-panel-root .p5-number-table-wrap[hidden] {
  display: none !important;
}

#beitou-panel-root .p5-number-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden !important;
  overflow-y: auto;
  scrollbar-gutter: auto !important;
  box-sizing: border-box;
}

#beitou-panel-root .p5-number-table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

#beitou-panel-root .p5-value-line {
  min-height: 30px !important;
  margin-bottom: 8px;
}

#beitou-panel-root .p5-value-line .p5-trad-label,
#beitou-panel-root .p5-value-line .p5-trad-input {
  height: 30px !important;
  min-height: 30px !important;
  box-sizing: border-box;
}

#beitou-panel-root .p5-value-line .p5-trad-label {
  line-height: 30px !important;
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}

#beitou-panel-root .p5-value-line .p5-trad-input {
  line-height: 28px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

@media (max-width: 430px) {
  #beitou-panel-root .p5-value-line {
    grid-template-columns: 36px minmax(0, 1fr) 36px 76px;
    gap: 6px;
  }
}

/* 2026-08 幸运五：倍投规则提示与聊天历史载入状态 */
.p5-history-loading {
  align-self: center;
  margin: 5px auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 247, 250, .92);
  color: #788394;
  font-size: 11px;
  line-height: 1.2;
  pointer-events: none;
}

#beitou-panel-root .p5-beitou-rulebox {
  margin: 10px 0 12px;
  padding: 10px 11px;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  background: #f7f8fa;
  color: #4f5967;
  font-size: 11.5px;
  line-height: 1.55;
}
#beitou-panel-root .p5-beitou-rulebox strong {
  display: block;
  margin-bottom: 4px;
  color: #2f3948;
  font-size: 12px;
}
#beitou-panel-root .p5-beitou-rulebox p { margin: 3px 0; }
#beitou-panel-root .p5-beitou-rulebox b { color: #315d82; }

/* 计划表严格四列：选择控件并入状态格，不额外占列 */
#beitou-panel-root .p5-plan-table th:nth-child(1),
#beitou-panel-root .p5-plan-table td:nth-child(1) { width: 20% !important; }
#beitou-panel-root .p5-plan-table th:nth-child(2),
#beitou-panel-root .p5-plan-table td:nth-child(2) { width: 26% !important; }
#beitou-panel-root .p5-plan-table th:nth-child(3),
#beitou-panel-root .p5-plan-table td:nth-child(3) { width: 20% !important; }
#beitou-panel-root .p5-plan-table th:nth-child(4),
#beitou-panel-root .p5-plan-table td:nth-child(4) { width: 34% !important; }
#beitou-panel-root .p5-plan-status-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  cursor: pointer;
}
#beitou-panel-root .p5-plan-status-select input {
  width: 14px;
  height: 14px;
  margin: 0;
  flex: 0 0 auto;
}
#beitou-panel-root .p5-plan-status-select span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   幸运五开奖弹窗：五个独立“拉窗帘”号码窗
   ============================================================ */
body.player-draw-popup-open {
  overflow: hidden;
}

.player-draw-popup {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.player-draw-popup.hidden {
  display: none !important;
}

.player-draw-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 18, 31, 0.54);
  backdrop-filter: blur(3px);
}

.player-draw-card {
  position: relative;
  width: min(500px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  overflow: auto;
  border: 9px solid #f6a4d4;
  border-radius: 14px;
  background: #ffe3f2;
  box-shadow: 0 20px 60px rgba(46, 18, 39, 0.28);
  padding: 26px 18px 24px;
  text-align: center;
}

.player-draw-close {
  position: absolute;
  top: 7px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #d73b8b;
  font-size: 30px;
  line-height: 30px;
  cursor: pointer;
}

.player-draw-title {
  margin: 0;
  color: #e13791;
  font-size: clamp(24px, 5vw, 31px);
  font-weight: 900;
  letter-spacing: 0.5px;
}

.player-draw-subtitle {
  margin-top: 18px;
  color: #f04e57;
  font-size: 18px;
  font-weight: 800;
}

.player-draw-windows {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px auto 18px;
}

.player-draw-window {
  position: relative;
  aspect-ratio: 0.8 / 1;
  overflow: hidden;
  border: 4px solid #f32191;
  border-radius: 10px;
  background: #fff8fc;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8), 0 5px 12px rgba(192, 45, 119, 0.12);
}

.player-draw-number {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #f14d56;
  font-size: clamp(46px, 11vw, 72px);
  font-weight: 950;
  line-height: .9;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 0 #fff;
}

.player-draw-curtain {
  position: absolute;
  inset: -3px;
  z-index: 2;
  display: block;
  transform: translateY(0);
  transition: transform 560ms cubic-bezier(.22,.78,.18,1);
  transition-delay: calc(var(--draw-index) * 220ms);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 8px, rgba(202,24,120,.10) 8px 16px),
    linear-gradient(180deg, #ff5eae 0%, #ee1d8d 52%, #cc1676 100%);
  box-shadow: inset 0 -10px 18px rgba(117, 3, 60, 0.18);
}

.player-draw-curtain-fold {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent 48%, rgba(110,0,55,.10), transparent);
}

.player-draw-curtain-handle {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 24px;
  height: 7px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #ffe4f3;
  box-shadow: 0 1px 4px rgba(79, 0, 39, .35);
}

.player-draw-popup.is-revealing .player-draw-curtain {
  transform: translateY(106%);
}

.player-draw-result {
  min-height: 27px;
  color: #df3a8e;
  font-size: 20px;
  font-weight: 800;
}

.player-draw-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.player-draw-actions button {
  min-height: 54px;
  border: 0;
  border-radius: 7px;
  font-size: 22px;
  cursor: pointer;
}

.player-draw-replay {
  background: #d2da00;
  color: #181818;
}

.player-draw-back {
  background: #f44f52;
  color: #fff;
  font-weight: 800;
}

.player-draw-auto {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: #db3c91;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
}

.player-draw-auto input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.player-draw-auto-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #ef4e58;
  border-radius: 50%;
  background: #fff;
  color: transparent;
  font-size: 18px;
}

.player-draw-auto input:checked + .player-draw-auto-mark {
  background: #ef4e58;
  color: #fff;
}

.profile-draw-popup-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid rgba(83, 101, 121, 0.18);
  border-radius: 10px;
}

.profile-draw-popup-copy {
  display: grid;
  gap: 3px;
  text-align: left;
}

.profile-draw-popup-copy small {
  opacity: .72;
}

.profile-draw-popup-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  cursor: pointer;
}

@media (max-width: 520px) {
  .player-draw-card {
    padding: 24px 12px 20px;
    border-width: 7px;
  }
  .player-draw-windows { gap: 6px; }
  .player-draw-window { border-width: 3px; border-radius: 8px; }
  .player-draw-actions button { min-height: 49px; font-size: 20px; }
  .player-draw-auto { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .player-draw-curtain {
    transition-duration: 1ms;
    transition-delay: 0ms;
  }
}


/* ============================================================
   幸运五开奖弹窗 v2：手动逐窗上拉 + 可拖动开奖悬浮按钮
   ============================================================ */
.player-draw-manual-hint {
  margin: 7px 0 2px;
  color: #b84682;
  font-size: 13px;
  font-weight: 700;
}

.player-draw-window {
  outline: none;
}

.player-draw-window:focus-visible {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.8),
    0 0 0 3px rgba(243, 33, 145, 0.2),
    0 5px 12px rgba(192, 45, 119, 0.12);
}

.player-draw-curtain {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 260ms cubic-bezier(.22,.78,.18,1);
  transition-delay: 0ms;
  will-change: transform;
}

.player-draw-window.is-dragging .player-draw-curtain {
  cursor: grabbing;
  transition: none;
}

.player-draw-window.is-revealed .player-draw-curtain {
  transform: translateY(106%);
  pointer-events: none;
}

.player-draw-curtain-pull {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.94);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(90, 0, 48, 0.28);
  white-space: nowrap;
}

.player-draw-result {
  min-height: 27px;
  transition: opacity 180ms ease;
}

.player-draw-result:not(.is-complete) {
  color: #a85d87;
  font-size: 15px;
  font-weight: 700;
}

.player-draw-launcher {
  position: fixed;
  top: 50%;
  right: 8px;
  z-index: 3900;
  width: 58px;
  height: 58px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  background: linear-gradient(145deg, #ff65b5, #e51f8b);
  box-shadow: 0 8px 22px rgba(141, 18, 86, 0.32);
  color: #fff;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.player-draw-launcher:hover:not(:disabled) {
  box-shadow: 0 10px 26px rgba(141, 18, 86, 0.4);
}

.player-draw-launcher:focus-visible {
  outline: 3px solid rgba(243, 33, 145, 0.3);
  outline-offset: 3px;
}

.player-draw-launcher.is-dragging {
  cursor: grabbing;
  transition: none;
  box-shadow: 0 12px 30px rgba(141, 18, 86, 0.44);
}

.player-draw-launcher.is-empty,
.player-draw-launcher:disabled {
  opacity: 0.42;
  cursor: default;
}

.player-draw-launcher-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.player-draw-launcher-dot {
  position: absolute;
  right: 1px;
  top: 2px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #f2d800;
}

.player-draw-popup:not(.hidden) ~ .player-draw-launcher {
  pointer-events: none;
}

@media (max-width: 520px) {
  .player-draw-manual-hint {
    font-size: 12px;
  }

  .player-draw-launcher {
    width: 52px;
    height: 52px;
  }

  .player-draw-launcher-icon {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .player-draw-curtain,
  .player-draw-launcher {
    transition-duration: 1ms;
  }
}

body.player-draw-popup-open .player-draw-launcher {
  pointer-events: none;
}
