/* ============================================================================
 * dx_popup_glass_v26112510 — 全站弹窗「液态玻璃」统一层
 * 覆盖：所有 Discuz 弹窗 div[id^="fwin_"] （删除/移动/置顶/警告/标签/评分/举报/
 *       登录/快捷回复/附件付费/魔法/勋章/活动/分享…全部共用同一套 .fwin 结构）
 *       以及站内下拉菜单 .p_pop / .p_pof
 *
 * 设计要点：
 *   1) 玻璃由 table.fwin 承载（容器 div 只负责定位，保持透明）
 *   2) 标题栏：淡蓝→蓝的渐变 + 白字，圆角与卡片一致，关闭图标反白
 *   3) 内容区：内边距统一 16/18，底部按钮条右对齐胶囊按钮
 *   4) 遮罩层由 JS 注入 #dx-fwin-dim（pointer-events:none，不挡点击）
 *   5) #fwin_mods 被 dx_c19 用单 ID 高特异规则覆盖，这里用双 ID 压回统一观感
 * ==========================================================================*/

/* ---------- 0. 基础变量 ---------- */
html:root {
  --dxpop-accent: #2f6fed;
  --dxpop-line: rgba(120, 152, 200, .26);
  --dxpop-text: #263a58;
  --dxpop-muted: #6b83a4;
}

/* ---------- 1. 弹窗容器：去底色，交给 table.fwin ---------- */
html:root body div[id^="fwin_"] {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  max-width: calc(100vw - 20px) !important;
  box-sizing: border-box !important;
}

html:root body div[id^="fwin_"][id] > table.fwin {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background-color: rgba(246, 251, 255, .93) !important;
  background-image: linear-gradient(158deg, rgba(255, 255, 255, .96) 0%, rgba(230, 240, 255, .90) 100%) !important;
  -webkit-backdrop-filter: blur(26px) saturate(185%) !important;
  backdrop-filter: blur(26px) saturate(185%) !important;
  border-radius: 20px !important;
  box-shadow:
    0 30px 72px -20px rgba(18, 42, 82, .46),
    0 0 0 1px rgba(255, 255, 255, .60),
    inset 0 1px 0 rgba(255, 255, 255, .92) !important;
  overflow: hidden !important;
}

/* 装饰边框格全部隐藏（t_/m_/b_ 的左右格原本是圆角贴图） */
html:root body div[id^="fwin_"][id] > table.fwin > tbody > tr > td.t_l,
html:root body div[id^="fwin_"] > table.fwin > tbody > tr > td.t_c,
html:root body div[id^="fwin_"] > table.fwin > tbody > tr > td.t_r,
html:root body div[id^="fwin_"] > table.fwin > tbody > tr > td.m_l,
html:root body div[id^="fwin_"] > table.fwin > tbody > tr > td.m_r,
html:root body div[id^="fwin_"] > table.fwin > tbody > tr > td.b_l,
html:root body div[id^="fwin_"] > table.fwin > tbody > tr > td.b_c,
html:root body div[id^="fwin_"] > table.fwin > tbody > tr > td.b_r {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: none !important;
}

/* 内容单元格 */
html:root body div[id^="fwin_"][id] > table.fwin > tbody > tr > td.m_c {
  display: table-cell !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--dxpop-text) !important;
  max-height: calc(100vh - 40px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  text-align: left;
}

/* ---------- 2. 标题栏 ---------- */
html:root body div[id^="fwin_"] > table.fwin .m_c > .flb {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 52px !important;
  margin: 0 !important;
  padding: 0 12px 0 18px !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, .26) !important;
  border-radius: 20px 20px 0 0 !important;
  background: linear-gradient(135deg, rgba(108, 166, 255, .97) 0%, rgba(47, 111, 237, .95) 58%, rgba(37, 95, 214, .96) 100%) !important;
  box-shadow: 0 10px 26px -16px rgba(22, 58, 128, .60), inset 0 1px 0 rgba(255, 255, 255, .34) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: .01em !important;
  text-shadow: 0 1px 2px rgba(10, 32, 72, .26) !important;
  cursor: move;
}

html:root body div[id^="fwin_"] > table.fwin .m_c > .flb > em {
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 15px !important;
  font-style: normal !important;
  font-weight: 600 !important;
}

/* 标题栏右侧关闭图标：反白，避免深色图标压在蓝底上看不见 */
html:root body div[id^="fwin_"] > table.fwin .m_c > .flb > .y {
  margin-left: auto !important;
  flex: 0 0 auto !important;
  opacity: .92 !important;
  filter: brightness(0) invert(1) !important;
}
html:root body div[id^="fwin_"] > table.fwin .m_c > .flb > .y:hover {
  opacity: 1 !important;
}

/* ---------- 3. 内容区 ---------- */
html:root body div[id^="fwin_"] > table.fwin .m_c > .c,
html:root body div[id^="fwin_"] > table.fwin .m_c > .c.bart,
html:root body div[id^="fwin_"] > table.fwin .m_c .bart {
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 16px 18px !important;
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html:root body div[id^="fwin_"] > table.fwin .m_c .c > p {
  margin: 0 0 10px !important;
  line-height: 1.7 !important;
  font-size: 13px !important;
  color: var(--dxpop-text) !important;
}
html:root body div[id^="fwin_"] > table.fwin .m_c .c > p:last-child {
  margin-bottom: 0 !important;
}

html:root body div[id^="fwin_"] > table.fwin .m_c .xg1,
html:root body div[id^="fwin_"] > table.fwin .m_c .xg2 {
  color: var(--dxpop-muted) !important;
  -webkit-text-fill-color: var(--dxpop-muted) !important;
}

/* ---------- 4. 底部按钮条 ---------- */
html:root body div[id^="fwin_"] > table.fwin .m_c > .o,
html:root body div[id^="fwin_"] > table.fwin .m_c > .o.pns,
html:root body div[id^="fwin_"] > table.fwin .m_c .o.pns {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  width: 100% !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 11px 18px !important;
  border: 0 !important;
  border-top: 1px solid var(--dxpop-line) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(236, 245, 255, .62) 100%) !important;
  box-shadow: none !important;
}

/* ---------- 5. 按钮 / 输入控件 ---------- */
html:root body div[id^="fwin_"] > table.fwin .m_c .pn,
html:root body div[id^="fwin_"] > table.fwin .m_c button.pn {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 36px !important;
  min-height: 36px !important;
  margin: 0 !important;
  padding: 0 18px !important;
  border: 1px solid var(--dxpop-line) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .90) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 2px 6px -2px rgba(30, 58, 100, .12) !important;
  color: #2b4463 !important;
  -webkit-text-fill-color: #2b4463 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  text-shadow: none !important;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .12s ease;
}
html:root body div[id^="fwin_"] > table.fwin .m_c .pn > strong {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  text-shadow: none !important;
}
html:root body div[id^="fwin_"] > table.fwin .m_c .pn:hover {
  border-color: rgba(47, 111, 237, .42) !important;
  background: rgba(255, 255, 255, .98) !important;
}
html:root body div[id^="fwin_"] > table.fwin .m_c .pn:active {
  transform: translateY(1px);
}

/* 主按钮 */
html:root body div[id^="fwin_"] > table.fwin .m_c .pn.pnc,
html:root body div[id^="fwin_"] > table.fwin .m_c .pn.pnc > strong {
  border-color: rgba(41, 101, 226, .92) !important;
  background: linear-gradient(135deg, #5f9bff 0%, #2f6fed 100%) !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: 0 6px 16px -8px rgba(30, 84, 190, .70), inset 0 1px 0 rgba(255, 255, 255, .34) !important;
}

html:root body div[id^="fwin_"] > table.fwin .m_c input.px,
html:root body div[id^="fwin_"] > table.fwin .m_c input.txt,
html:root body div[id^="fwin_"] > table.fwin .m_c input[type="text"],
html:root body div[id^="fwin_"] > table.fwin .m_c input[type="password"],
html:root body div[id^="fwin_"] > table.fwin .m_c textarea,
html:root body div[id^="fwin_"] > table.fwin .m_c select {
  box-sizing: border-box !important;
  max-width: 100% !important;
  min-height: 36px !important;
  padding: 0 12px !important;
  border: 1px solid var(--dxpop-line) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .88) !important;
  box-shadow: inset 0 1px 2px rgba(39, 77, 133, .06) !important;
  color: #24395a !important;
  -webkit-text-fill-color: #24395a !important;
  font-size: 13px !important;
  line-height: 34px !important;
}
html:root body div[id^="fwin_"] > table.fwin .m_c textarea {
  min-height: 90px !important;
  padding: 9px 12px !important;
  line-height: 1.7 !important;
  resize: vertical;
}
html:root body div[id^="fwin_"] > table.fwin .m_c input.px:focus,
html:root body div[id^="fwin_"] > table.fwin .m_c textarea:focus,
html:root body div[id^="fwin_"] > table.fwin .m_c select:focus {
  border-color: rgba(47, 111, 237, .55) !important;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .14) !important;
  outline: none !important;
}

/* 弹窗内表格不撑破 */
html:root body div[id^="fwin_"] > table.fwin .m_c table {
  max-width: 100% !important;
}
html:root body div[id^="fwin_"] > table.fwin .m_c img {
  max-width: 100% !important;
  height: auto !important;
}

/* ---------- 6. #fwin_mods：压回统一观感（dx_c19 用单 ID 高特异覆盖） ---------- */
/* dx_c19 把 table.fwin 背景置为 transparent，必须用双 ID 才能把玻璃底补回来 */
html:root body #fwin_mods#fwin_mods > table.fwin {
  background-color: rgba(246, 251, 255, .93) !important;
  background-image: linear-gradient(158deg, rgba(255, 255, 255, .96) 0%, rgba(230, 240, 255, .90) 100%) !important;
  box-shadow:
    0 30px 72px -20px rgba(18, 42, 82, .46),
    0 0 0 1px rgba(255, 255, 255, .60),
    inset 0 1px 0 rgba(255, 255, 255, .92) !important;
}
html:root body #fwin_mods#fwin_mods > table.fwin > tbody > tr > td.m_c {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 20px !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}
html:root body #fwin_mods#fwin_mods > table.fwin .m_c > .flb {
  min-height: 52px !important;
  padding: 0 12px 0 18px !important;
  border-radius: 20px 20px 0 0 !important;
  background: linear-gradient(135deg, rgba(108, 166, 255, .97) 0%, rgba(47, 111, 237, .95) 58%, rgba(37, 95, 214, .96) 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, .26) !important;
}
html:root body #fwin_mods#fwin_mods > table.fwin .m_c > .flb > em {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}
html:root body #fwin_mods#fwin_mods > table.fwin .m_c > .o.pns {
  min-height: 58px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(236, 245, 255, .62) 100%) !important;
  border-top: 1px solid var(--dxpop-line) !important;
}

/* ---------- 7. 站内下拉菜单（我的/积分/用户组/主题分类…） ---------- */
html:root body .p_pop {
  box-sizing: border-box !important;
  border: 1px solid rgba(255, 255, 255, .78) !important;
  border-radius: 12px !important;
  background-color: rgba(250, 253, 255, .94) !important;
  background-image: linear-gradient(158deg, rgba(255, 255, 255, .95) 0%, rgba(238, 246, 255, .92) 100%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  box-shadow: 0 18px 42px -16px rgba(20, 44, 84, .34), inset 0 1px 0 rgba(255, 255, 255, .92) !important;
  padding: 6px !important;
  overflow: hidden !important;
}
html:root body .p_pop > li > a {
  border-radius: 8px !important;
}

/* 发帖页编辑器面板已由 dx_editor_dialogs 独立设计，这里不重复上底色 */
html:root body.pg_post .p_pof {
  background-clip: padding-box;
}

/* ---------- 8. 移动端 ---------- */
@media screen and (max-width: 720px) {
  html:root body div[id^="fwin_"] {
    max-width: calc(100vw - 16px) !important;
  }
  html:root body div[id^="fwin_"][id] > table.fwin {
    border-radius: 16px !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c > .flb {
    min-height: 46px !important;
    padding: 0 10px 0 14px !important;
    border-radius: 16px 16px 0 0 !important;
    font-size: 14px !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c > .flb > em {
    font-size: 14px !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c > .c,
  html:root body div[id^="fwin_"] > table.fwin .m_c .bart {
    padding: 12px 14px !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c > .o,
  html:root body div[id^="fwin_"] > table.fwin .m_c > .o.pns,
  html:root body div[id^="fwin_"] > table.fwin .m_c .o.pns {
    min-height: 54px !important;
    padding: 9px 14px calc(9px + env(safe-area-inset-bottom)) !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c .pn {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 16px !important;
    font-size: 14px !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c .pn > strong {
    font-size: 14px !important;
  }
  html:root body #fwin_mods#fwin_mods > table.fwin .m_c > .flb {
    min-height: 46px !important;
    border-radius: 16px 16px 0 0 !important;
  }
}

/* ---------- 10. 页面细节修正（错位） ---------- */

/* 10.1 帮助页：搜索框与「搜索」按钮同高、贴右内边距，避免按钮顶出卡片下沿 */
html:root body.pg_faq #ct .bm > form.y.pns {
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  height: auto !important;
  /* 卡片头高 58、控件 36 → 上下各 11 垂直居中 */
  margin: 11px 14px 0 0 !important;
  padding: 0 !important;
  float: right !important;
}
html:root body.pg_faq #ct .bm > form.y.pns input.px {
  margin: 0 !important;
  height: 36px !important;
  min-height: 36px !important;
  line-height: 34px !important;
}
html:root body.pg_faq #ct .bm > form.y.pns button.pn {
  margin: 0 !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 16px !important;
  border-radius: 10px !important;
}

/* 10.2 提示类页面（功能未开启/无权限等）：信息卡加宽居中，避免又窄又空 */
html:root body #ct > .nfl > .f_c.altw {
  max-width: 760px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  border-radius: 16px !important;
}
html:root body #ct > .nfl > .f_c.altw #messagetext {
  border-radius: 12px !important;
}

/* ---------- 8.5 移动端：把内容彻底锁在弹窗宽度内 ---------- */
@media screen and (max-width: 720px) {
  html:root body div[id^="fwin_"] > table.fwin {
    table-layout: fixed !important;
    width: 100% !important;
  }
  html:root body div[id^="fwin_"] > table.fwin > tbody > tr > td.m_c {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c > .c,
  html:root body div[id^="fwin_"] > table.fwin .m_c .bart,
  html:root body div[id^="fwin_"] > table.fwin .m_c > .o,
  html:root body div[id^="fwin_"] > table.fwin .m_c > .o.pns,
  html:root body div[id^="fwin_"] > table.fwin .m_c .o.pns {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c input.px,
  html:root body div[id^="fwin_"] > table.fwin .m_c input.txt,
  html:root body div[id^="fwin_"] > table.fwin .m_c input[type="text"],
  html:root body div[id^="fwin_"] > table.fwin .m_c input[type="password"],
  html:root body div[id^="fwin_"] > table.fwin .m_c select,
  html:root body div[id^="fwin_"] > table.fwin .m_c textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c p {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }
}

/* ---------- 9. 遮罩层（JS 注入） ---------- */
#dx-fwin-dim {
  position: fixed;
  inset: 0;
  z-index: 190;
  background-color: rgba(14, 30, 58, .30);
  background-image: radial-gradient(125% 100% at 50% 0%, rgba(26, 46, 80, .18) 0%, rgba(14, 30, 58, .34) 100%);
  -webkit-backdrop-filter: blur(3px) saturate(120%);
  backdrop-filter: blur(3px) saturate(120%);
  opacity: 0;
  transition: opacity .18s ease;
  pointer-events: none;
}
#dx-fwin-dim.on {
  opacity: 1;
}

/* 10.3 弹窗内「?」帮助图标与输入框同一行（移动端 input 占满整行时会掉到下一行） */
@media screen and (max-width: 720px) {
  html:root body div[id^="fwin_"] > table.fwin .m_c .c > p:has(> .fico-help) {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c .c > p:has(> .fico-help) > input.px,
  html:root body div[id^="fwin_"] > table.fwin .m_c .c > p:has(> .fico-help) > input.txt {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }
  html:root body div[id^="fwin_"] > table.fwin .m_c .c > p > .fico-help {
    flex: 0 0 auto !important;
    margin: 0 !important;
  }
}
