: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-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 .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%; }
}