/* =========================================================
   idgen.css (IDGEN MODULE ONLY) - Unified Enhanced
   - 基于你现有版本：去重 + 统一 + 补强（不改变现有结构）
   ========================================================= */

/* ===== Actions ===== */
.idgen-page .idgen-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
}

/* ===== KV ===== */
.idgen-page .idgen-kv{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
.idgen-page .idgen-kv th,
.idgen-page .idgen-kv td{
  border-bottom:1px solid #eee;
  padding:10px;
  vertical-align:middle;
}
.idgen-page .idgen-kv th{
  width:130px;
  text-align:left;
  color:var(--muted);
  white-space:nowrap;
}
.idgen-page .idgen-kv td{ text-align:left; }
.idgen-page .idgen-kv .mono{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing:.2px;
}

/* ===== Grid ===== */
.idgen-page .idgen-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
@media (max-width: 880px){
  .idgen-page .idgen-grid{ grid-template-columns:1fr; }
}

/* ===== Subnote ===== */
.idgen-page .idgen-subnote{
  margin-top:8px;
  font-size:13px;
  color:var(--muted);
}

/* ===== Filters ===== */
.idgen-page .idgen-filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.idgen-page .idgen-filters select,
.idgen-page .idgen-filters input{
  height:40px;
  border-radius:10px;
  border:1px solid #e7e7e7;
  padding:0 12px;
  background:#fff;
}

/* =========================================================
   IDGEN: 标题区（统一）
   - 你原来已有 .idgen-head：保留
   - 新增：tool-sub 同行布局（可选用）
   ========================================================= */
.idgen-page .idgen-head{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  gap:10px;
  margin:4px 0 14px;
  text-align:center;
}
.idgen-page .idgen-head .idgen-head-center h2{ margin:0; }
.idgen-page .idgen-head .idgen-head-center .tool-sub{ margin-top:4px; }
.idgen-page .idgen-head .idgen-head-right{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* ✅ 可复用：副标题同行显示（比如“说明 + 红色提示”） */
.idgen-page .tool-sub-row{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.idgen-page .tool-sub-row .taxfree-note{
  color:#d4380d;
  font-weight:800;
}

/* =========================================================
   IDGEN: 左侧导航 + 右侧内容布局
   - 你文件里重复定义了两遍，这里保留一份（同逻辑）
   ========================================================= */
.idgen-page .idgen-layout{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:14px;
  align-items:start;
}
@media (max-width: 980px){
  .idgen-page .idgen-layout{ grid-template-columns: 1fr; }
}
.idgen-page .idgen-nav{
  position:sticky;
  top:12px;
}
.idgen-page .idgen-nav h3{
  margin:0 0 10px;
  font-size:15px;
}
.idgen-page .idgen-nav .idgen-nav-group{ margin-bottom:12px; }
.idgen-page .idgen-nav .idgen-nav-btns{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.idgen-page .idgen-nav .btn{
  width:100%;
  justify-content:center;
}
.idgen-page .idgen-nav .idgen-nav-note{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
  line-height:1.5;
}
.idgen-page .idgen-nav .btn.is-active{
  box-shadow:0 0 0 2px rgba(11,92,255,.18) inset;
}

/* =========================================================
   IDGEN: Click-to-copy
   ========================================================= */
.idgen-page .copyable{
  cursor:pointer;
  display:inline-block;
  padding:2px 6px;
  border-radius:8px;
  transition: background .15s ease;
  user-select:text;
  position:relative; /* 为气泡定位 */
}
.idgen-page .copyable:hover{ background: rgba(0,0,0,.05); }
.idgen-page .copyable:active{ background: rgba(0,0,0,.08); }

.idgen-page .copy-hint{
  font-size:12px;
  color:var(--muted);
  margin-top:8px;
}

.idgen-copy-toast{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:9999;
  background: rgba(0,0,0,.78);
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  font-size:13px;
  line-height:1;
  opacity:0;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
}
.idgen-copy-toast.show{
  opacity:1;
  transform: translateY(0);
}

.idgen-page .copy-bubble{
  position:absolute;
  left: 100%;
  top: 50%;
  transform: translate(10px, -50%);
  background: rgba(0,0,0,.80);
  color:#fff;
  font-size:12px;
  line-height:1;
  padding:6px 8px;
  border-radius:10px;
  white-space:nowrap;
  pointer-events:none;
  opacity:0;
  transition: opacity .12s ease;
}
.idgen-page .copy-bubble.show{ opacity:1; }
@media (max-width: 980px){
  .idgen-page .copy-bubble{ transform: translate(8px, -50%); }
}

/* =========================================================
   IDGEN Table (统一增强版)
   - 目标：不撑爆 card；横向可拖动；分页与表格留白统一
   ========================================================= */

/* 表格基础 */
.idgen-page .idgen-table{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
.idgen-page .idgen-table th,
.idgen-page .idgen-table td{
  border-bottom:1px solid #eee;
  padding:10px;
  vertical-align:middle;
}
.idgen-page .idgen-table th{
  text-align:left;
  color:var(--muted);
  white-space:nowrap;
}
.idgen-page .idgen-table .nowrap{ white-space:nowrap; }

/* 全边框网格 */
.idgen-page .idgen-table.idgen-table-grid{
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #e7e7e7;
  background:#fff;
}
.idgen-page .idgen-table.idgen-table-grid th,
.idgen-page .idgen-table.idgen-table-grid td{
  border: 1px solid #e7e7e7;
  padding: 10px;
  vertical-align: middle;
}
.idgen-page .idgen-table.idgen-table-grid th{
  color: var(--muted);
  background: rgba(0,0,0,.02);
  white-space: nowrap;
}

/* 合并单元格（rowspan） */
.idgen-page .idgen-table .pref-merged{
  vertical-align: middle !important;
  font-weight: 700;
}

/* ✅ 横向滚动容器（关键修复点） */
.idgen-page .idgen-table-scroll{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;

  /* 让滚动条不贴边，视觉更干净 */
  padding-bottom:6px;

  /* 防止表格阴影/圆角裁切不一致 */
  border-radius:12px;
}

/* ✅ 窄屏时表格保持列宽，触发横向滚动；宽屏时正常铺满 */
.idgen-page .idgen-table{
  min-width: max-content;
}

/* ✅ 默认不换行，列宽更稳定 */
.idgen-page .idgen-table th,
.idgen-page .idgen-table td{
  white-space:nowrap;
}

/* ✅ 分页与表格之间统一留白（避免“贴底”视觉） */
.idgen-page .idgen-table-scroll + div{
  margin-top: 10px; /* 你的 render_pager 外层 div 已有 margin-top:14px，这里只兜底 */
}

/* ✅ 小屏：单元格 padding 稍微紧凑 */
@media (max-width: 860px){
  .idgen-page .idgen-table th,
  .idgen-page .idgen-table td{
    padding: 8px;
  }
}