/* ============================================================================
 * subs-panel.css —— 订阅规则面板（T3）
 * ----------------------------------------------------------------------------
 * ## 为什么必须有独立文件
 * ```
 *   CSP: style-src 'self'
 *   ⇒ JS 里 document.createElement('style') 会被直接拒绝
 *     Refused to apply inline style because it violates the following
 *     Content Security Policy directive: "style-src 'self'"
 *   ⇒ 所有样式只能写在这里（先例：rank-btn-row.css / board-optout.css）
 * ```
 *
 * ## 配色纪律
 * ```
 *   · 只用 var(--xxx) 主题变量 + 少量中性色，不引入外部字体/图标
 *   · 深色模式靠 var() 自动适配，⛔ 不写死 #fff / #000 作为大面积背景
 *   · 开关用按钮 + 圆点位移，⛔ 不用图片
 * ```
 *
 * ## 结构
 * ```
 *   .aghs          面板最外层（挂在 [data-view="mine"] 内）
 *   ├─ .aghs-hd    标题 + 状态徽标
 *   ├─ .aghs-guard 非会员受限提示
 *   ├─ .aghs-rows  订阅项列表
 *   │   └─ .aghs-row
 *   │        ├─ .aghs-main  (名称 / 类型 / 规则数)
 *   │        ├─ .aghs-sw    开关按钮
 *   │        └─ .aghs-del   删除（仅自建）
 *   ├─ .aghs-add   新增订阅表单
 *   └─ .aghs-state 底部「当前：xxx」
 * ```
 * ========================================================================== */

/* ---------- 外层卡片 ---------- */
.aghs {
  margin: 14px 0 0;
  padding: 16px 16px 14px;
  border-radius: 16px;
  /* ★★★ 2026-10-31【反馈 5e7d5c69「弹窗背景过淡/透明，文字与背景缺乏对比」】
   *
   * 修前：`var(--fluid-glass-bg, rgba(255, 255, 255, 0.04))`
   *   而**全站没有定义 `--card`**（grep 确认只在 var() 引用处出现）
   *   ⇒ 取兜底值 **4% 白** ⇒ 面板几乎全透明，文字直接压在页面内容上
   *
   * 修后：兜底值改成 94% 的深色底（主题本来就是深色，--fg 默认 #e8eef7）
   *   + 背景模糊（保留"卡片浮在页面上"的观感）
   *   + 一点投影做层次分隔
   *   `--card` 钩子保留：宿主页若将来定义它，仍会覆盖这里。
   */
  background: var(--fluid-glass-bg, rgba(255, 255, 255, 0.92));
  -webkit-backdrop-filter: var(--fluid-glass-blur, blur(14px) saturate(120%));
  backdrop-filter: var(--fluid-glass-blur, blur(14px) saturate(120%));
  box-shadow: var(--fluid-glass-shadow, 0 10px 30px rgba(2, 8, 23, 0.12));
  border: 1px solid var(--fluid-glass-border, rgba(15, 23, 42, 0.12));
  color: var(--rk-ink, #0f172a);
  font-size: 13px;
  line-height: 1.55;
  box-sizing: border-box;
}

/* ---------- 头部 ---------- */
.aghs-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.aghs-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.aghs-badge {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(148, 163, 184, 0.16);
  color: var(--rk-muted, #9fb0c6);
}
.aghs-badge.is-on {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}
.aghs-badge.is-plain {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

.aghs-sub {
  display: block;
  margin: 2px 0 12px;
  font-size: 12px;
  color: var(--rk-muted, #9fb0c6);
}

/* ---------- 非会员受限 ---------- */
.aghs-guard {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.6;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.28);
  color: #fde68a;
}
.aghs-guard b {
  color: #fbbf24;
}

/* ---------- 订阅项列表 ---------- */
.aghs-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aghs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid transparent;
  transition: border-color 0.18s, background 0.18s;
}
.aghs-row.is-off {
  opacity: 0.62;
}
.aghs-row.is-off .aghs-nm {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.aghs-main {
  flex: 1 1 auto;
  min-width: 0;
}
.aghs-nm {
  display: block;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aghs-meta {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--rk-muted, #9fb0c6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aghs-meta.is-url {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.aghs-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  line-height: 16px;
  vertical-align: 1px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--rk-muted, #9fb0c6);
}
.aghs-tag.is-wl { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
.aghs-tag.is-bl { background: rgba(244, 63, 94, 0.18);  color: #fda4af; }
.aghs-tag.is-url { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
.aghs-tag.is-txt { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }

/* ---------- 开关 ---------- */
.aghs-sw {
  flex: 0 0 auto;
  position: relative;
  width: 46px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(148, 163, 184, 0.34);
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.aghs-sw.is-on {
  background: #10b981;
}
.aghs-sw[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}
.aghs-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}
.aghs-sw.is-on .aghs-knob {
  transform: translateX(20px);
}

/* ---------- 删除按钮 ---------- */
.aghs-del {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid rgba(244, 63, 94, 0.36);
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
  font-size: 11.5px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.aghs-del[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

/* ---------- 新增订阅表单 ---------- */
.aghs-add {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.24);
}
.aghs-addtitle {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--rk-muted, #9fb0c6);
}
.aghs-addrow {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.aghs-in {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(2, 8, 23, 0.3);
  color: var(--rk-ink, #0f172a);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.aghs-in::placeholder {
  color: rgba(159, 176, 198, 0.7);
}
.aghs-in:focus {
  border-color: #38bdf8;
}
.aghs-in.is-name {
  flex: 0 0 96px;
}
.aghs-addbtn {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 9px;
  background: #2f6bff;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.aghs-addbtn[disabled] {
  cursor: not-allowed;
  opacity: 0.5;
}

/* ---------- 底部状态 ---------- */
.aghs-state {
  display: block;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.1);
  color: var(--rk-muted, #9fb0c6);
}
.aghs-state.is-plain {
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
}
.aghs-state.is-block {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}

/* ---------- 错误 / 空态 ---------- */
.aghs-err {
  display: block;
  margin-top: 8px;
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 12px;
  background: rgba(244, 63, 94, 0.12);
  color: #fda4af;
}
.aghs-empty {
  display: block;
  padding: 10px 2px;
  font-size: 12px;
  color: var(--rk-muted, #9fb0c6);
}

/* ---------- 窄屏 ---------- */
@media (max-width: 380px) {
  .aghs { padding: 13px 12px 12px; }
  .aghs-in.is-name { flex: 0 0 74px; }
  .aghs-addbtn { padding: 0 11px; }
}


/* ==== 2026-10-30【站长】订阅规则：仅会员 ==== */
.aghs-lock { position: relative; }
.aghs-lockinner { pointer-events: none; user-select: none; }
.aghs-mask {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 3;
}
.aghs-mask-t {
  font-size: 15px; font-weight: 800; letter-spacing: .5px;
  padding: 10px 18px; border-radius: 999px;
  color: var(--rk-ink, #0f172a);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}
html[data-theme="dark"] .aghs-mask { background: rgba(15, 23, 42, 0.55); }
html[data-theme="dark"] .aghs-mask-t {
  color: var(--rk-ink, #e8eef7);
  background: rgba(30, 41, 59, 0.92);
}
/* 只在「看起来是域名」时给这个类，见 trimMdSub() */
.aghs-hidden { display: none !important; }

/* 新增订阅的说明行（2026-10-31：订阅源不可达时不会生效） */
.aghs-addhint {
  display: block;
  margin: 2px 0 8px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--rk-muted, #64748b);
}

/* ★★★ 2026-10-31【站长 55ed0b86】自定义拦截/加白列表
 * 只加布局对齐，⛔ 不新建配色（颜色全部继承已有变量） */
.aghs-my{padding:10px 0 2px;border-top:1px solid var(--ag-hair,rgba(127,127,127,.22));margin-top:10px}
.aghs-mylist{display:flex;flex-direction:column;gap:6px;margin-top:8px}
.aghs-myrow{display:flex;align-items:center;gap:8px;font-size:13px;line-height:1.6}
.aghs-myact{flex:none;font:inherit;font-size:11px;font-weight:800;padding:1px 7px;border:0;border-radius:999px;cursor:pointer;line-height:1.6;-webkit-appearance:none;appearance:none}
.aghs-myact.is-block{background:rgba(244,49,70,.14);color:#f43146}
.aghs-myact.is-allow{background:rgba(13,148,88,.14);color:#0d9458}
.aghs-mydom{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.aghs-myrow.is-off .aghs-myact,.aghs-myrow.is-off .aghs-mydom{opacity:.55}
.aghs-mystate{flex:none;font-size:11px;color:var(--rk-muted,#64748b)}
.aghs-myrow .aghs-sw{width:38px;height:22px}
.aghs-myrow .aghs-knob{width:16px;height:16px;top:3px;left:3px}
.aghs-myrow .aghs-sw.is-on .aghs-knob{transform:translateX(16px)}
.aghs-rowbtn{flex:none;padding:3px 8px;border-radius:7px;border:1px solid rgba(244,63,94,.32);background:rgba(244,63,94,.08);color:#fda4af;font-size:11px;cursor:pointer}
.aghs-rowbtn[data-armed="1"]{background:rgba(244,63,94,.22);border-color:rgba(244,63,94,.65)}

/* 2026-11-19: hide 开通线路 entry card above 订阅规则; keep drawer + member rows */
.subw > .sub-card, .subw > #subCard { display: none !important; }
