@charset "UTF-8";
/* =============================================================
   BT磁力搜索 (btclss.com)  ——  站点样式
   版式来源：参考站 bashi5.net 的骨架（顶部渐变工具条 + 左侧分组抽屉 +
             按分组铺开的链接卡片网格 + 底部文章区 + 简洁页脚），按 PHP SSR 站群规范重写。
   二级页面（/site/{id}.html）版式来源：参考站 qiankun6.com/sites/{id}.html，
             取其「面包屑 + 左大图标 + 站名 H1 + 简介 + 标签 + 直接访问按钮 + 相关导航网格」
             的结构，配色与首页统一，两套版式衔接不突兀。
   差异化：参考站主色是 indigo(#3f51b5)，本站改为「深海青蓝 → 青绿」渐变 + 琥珀点缀。
   规范：
     · 移动端优先，纯 CSS 实现，不依赖任何前端框架
     · 首页专用 class（topbar / drawer / intro / group / grid4 / gcard）与
       内页通用组件（crumb / page-head / section / lgrid / lcard / detail / pager / 后台）
       分区书写，互不覆盖
     · 所有可点元素的触控区、窄屏断点见文末「响应式」一节
   ============================================================= */

/* ---------------- 设计变量 ---------------- */
:root {
  /* 固定浅色主题：声明后 Android Chrome / 微信内置浏览器不会把表单控件按暗色渲染 */
  color-scheme: light;
  --c-bg:          #f2f5f7;
  --c-bg-2:        #e8eef1;
  --c-card:        #ffffff;
  --c-card-2:      #f6f9fa;
  --c-line:        #e3e9ec;
  --c-line-soft:   #eef2f4;
  --c-text:        #17282e;
  --c-text-2:      #3f5a63;
  --c-sub:         #788f98;
  --c-primary:     #0e7490;
  --c-primary-2:   #0d9488;
  --c-accent:      #f59e0b;
  --c-brand-grad:  linear-gradient(135deg, #0e7490 0%, #0d9488 100%);
  --c-bar-grad:    linear-gradient(100deg, #0a2b3f 0%, #10506a 42%, #0e7490 76%, #0d9488 100%);
  --c-warm-grad:   linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --c-radius:      14px;
  --c-radius-sm:   10px;
  --c-shadow:      0 1px 2px rgba(20, 45, 55, .05), 0 8px 22px rgba(20, 45, 55, .06);
  --c-shadow-hov:  0 5px 12px rgba(20, 45, 55, .09), 0 16px 34px rgba(20, 45, 55, .11);
  --c-glow:        0 8px 24px rgba(14, 116, 144, .26);
  --wrap:          1280px;
  --nav-w:         222px;   /* 左侧分组抽屉宽度（桌面常驻） */
  --top-h:         58px;    /* 顶部工具条高度 */
}

/* ---------------- 基础重置 ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--top-h) + 12px);   /* 锚点跳转不被固定顶栏挡住 */
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  color: var(--c-text);
  background-color: var(--c-bg);
  padding-top: var(--top-h);         /* 让出固定顶栏 */
  min-height: 100vh;
  min-height: 100dvh;                /* 新版浏览器：避开移动端地址栏高度抖动 */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;                /* 只加在 body 上，两个都加会让 sticky 失效 */
}
a { color: var(--c-text-2); text-decoration: none; transition: color .18s, background-color .18s; }
a:hover { color: var(--c-primary); }
img { border: 0; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.4; overflow-wrap: break-word; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, button, select, textarea { font-family: inherit; font-size: inherit; }
code { background: #eaf1f3; padding: 1px 5px; border-radius: 4px; font-size: 13px; color: #b4471a; }
::placeholder { color: #9aacb3; }

.container {
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding: 0 16px;                                        /* 兜底：不支持 max()/env() 的老内核 */
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* =============================================================
   1. 顶部工具条（固定）—— 汉堡菜单 + 站标 + 站内搜索 + 账号图标
   ============================================================= */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background-image: var(--c-bar-grad);
  box-shadow: 0 2px 14px rgba(10, 43, 63, .28);
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px;
  height: var(--top-h); max-width: none; padding: 0 16px;
}

/* 汉堡按钮：桌面端折叠侧栏，移动端开合抽屉 */
.nav-toggle {
  flex: 0 0 auto; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; cursor: pointer; background: rgba(255, 255, 255, .12); color: #fff;
  transition: background-color .18s;
}
.nav-toggle:hover { background: rgba(255, 255, 255, .24); }
.nav-toggle svg { width: 20px; height: 20px; display: block; }

.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; min-width: 0; }
.brand-icon {
  width: 32px; height: 32px; flex: 0 0 auto; display: block;
  border-radius: 9px; object-fit: contain; background: rgba(255, 255, 255, .92);
}
.brand-name {
  font-size: 17px; font-weight: 800; color: #fff; white-space: nowrap; letter-spacing: .4px;
  text-shadow: 0 1px 10px rgba(4, 24, 36, .5);
}

/* 搜索框：占满中段（对齐参考站「工具条中间放搜索框」的做法） */
.topbar-search { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.topbar-search form {
  display: flex; width: 100%; max-width: 560px;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px; overflow: hidden;
  transition: background-color .18s, border-color .18s;
}
.topbar-search form:focus-within { background: rgba(255, 255, 255, .96); border-color: #fff; }
.topbar-search input {
  flex: 1 1 auto; min-width: 0; height: 38px; padding: 0 16px; border: 0; outline: none;
  background: transparent; color: #fff;
}
.topbar-search input::placeholder { color: rgba(255, 255, 255, .78); }
.topbar-search form:focus-within input { color: var(--c-text); }
.topbar-search form:focus-within input::placeholder { color: #9aacb3; }
.topbar-search button {
  flex: 0 0 auto; height: 38px; padding: 0 20px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%); color: #fff;
  font-size: 13.5px; font-weight: 700; letter-spacing: .5px;
  transition: filter .18s;
}
.topbar-search button:hover { filter: brightness(1.07); }

.topbar-user {
  flex: 0 0 auto; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
  transition: background-color .18s;
}
.topbar-user:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.topbar-user svg { width: 21px; height: 21px; display: block; }

/* =============================================================
   2. 左侧分组抽屉（桌面常驻 / 移动端抽屉式）
   ============================================================= */
.drawer {
  position: fixed; top: var(--top-h); bottom: 0; left: 0; z-index: 50;
  width: var(--nav-w); overflow-y: auto; overflow-x: hidden;
  background: var(--c-card); border-right: 1px solid var(--c-line);
  padding: 10px 10px 24px;
  transition: transform .22s ease;
}
.drawer-title {
  margin: 4px 8px 8px; padding: 0 0 9px;
  border-bottom: 1px solid var(--c-line-soft);
  font-size: 11.5px; font-weight: 600; color: var(--c-sub); letter-spacing: 1.4px;
}
.drawer-list { display: block; }
.drawer-list a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 3px; border-radius: var(--c-radius-sm);
  font-size: 14px; color: var(--c-text-2); line-height: 1.4;
}
.drawer-list a:hover { background: var(--c-card-2); color: var(--c-primary); }
.drawer-list a.is-active {
  background: var(--c-brand-grad); color: #fff; font-weight: 700;
  box-shadow: var(--c-glow);
}
.drawer-list .di {
  flex: 0 0 auto; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; color: var(--c-primary);
}
.drawer-list a.is-active .di { color: #fff; }
.drawer-list .di svg { width: 17px; height: 17px; display: block; }
.drawer-list .dn { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-list .dc {
  flex: 0 0 auto; font-size: 11px; color: var(--c-sub);
  background: var(--c-card-2); border: 1px solid var(--c-line);
  padding: 0 7px; border-radius: 999px;
}
.drawer-list a.is-active .dc { color: #fff; background: rgba(255, 255, 255, .2); border-color: transparent; }
.drawer-foot {
  margin: 14px 8px 0; padding-top: 12px; border-top: 1px solid var(--c-line-soft);
  font-size: 11.5px; color: var(--c-sub); line-height: 1.7;
}

/* 移动端抽屉遮罩 */
.mask {
  position: fixed; inset: var(--top-h) 0 0 0; z-index: 45;
  background: rgba(10, 28, 38, .45); opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility .22s;
}
body.nav-open .mask { opacity: 1; visibility: visible; }
/* 桌面端侧栏是常驻的，不需要遮罩（断点与 app.js 的 DESKTOP 判断保持一致） */
@media (min-width: 1025px) { .mask { display: none; } }

/* =============================================================
   3. 主体布局（让出常驻侧栏宽度）
   ============================================================= */
.layout { margin-left: var(--nav-w); transition: margin-left .22s ease; }
.main { min-height: 60vh; padding: 16px 0 0; }
.main .container { max-width: 1320px; }

/* 桌面端折叠侧栏：汉堡按钮切换，折叠态记在 localStorage（见 header.php 的内联脚本） */
html.nav-collapsed .drawer { transform: translateX(-100%); box-shadow: none; }
html.nav-collapsed .layout { margin-left: 0; }

/* 首页导语：整页唯一的 H1 + 一句定位语（参考站此处为空，为 SEO 补一条细带） */
.intro {
  margin: 0 0 14px; padding: 14px 18px;
  background: var(--c-card); border: 1px solid var(--c-line); border-left: 3px solid var(--c-primary);
  border-radius: var(--c-radius-sm); box-shadow: var(--c-shadow);
}
.intro h1 { font-size: 19px; color: var(--c-text); }
.intro h1 .ih-ico { display: inline-block; vertical-align: -3px; margin-right: 7px; color: var(--c-primary); }
.intro h1 .ih-ico svg { width: 20px; height: 20px; display: block; }
.intro p { margin: 6px 0 0; font-size: 13px; color: var(--c-sub); line-height: 1.75; }

/* =============================================================
   4. 首页分组：分组标题行 + 4 列卡片网格
   ============================================================= */
.group { margin: 0 0 18px; }
.group-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--c-line);
}
.group-title { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.group-title h2 { font-size: 16.5px; color: var(--c-text); white-space: nowrap; }
.group-title:hover h2 { color: var(--c-primary); }
.gt-ico { flex: 0 0 auto; display: flex; color: var(--c-primary); }
.gt-ico svg { width: 18px; height: 18px; display: block; }
.group-cap {
  min-width: 0; font-size: 12.5px; color: var(--c-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.group-cap::before { content: "·"; margin-right: 8px; color: #bccad0; }
.group-more {
  margin-left: auto; flex: 0 0 auto; font-size: 12.5px; color: var(--c-sub); white-space: nowrap;
}
.group-more b { color: var(--c-primary); font-weight: 600; }
.group-more:hover { color: var(--c-primary); }

/* 链接卡片网格：桌面 4 列 × N 行（与参考站 mdui-col-lg-3 一致） */
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));   /* 兜底：老内核 */
  grid-template-columns: repeat(4, minmax(min(210px, 100%), 1fr));
  gap: 10px;
}

/* 单张链接卡片：图标 + 名称 + 两行简介，整卡可点（进站内二级页，不外跳） */
.gcard {
  display: block; min-width: 0; padding: 12px 13px 13px;
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--c-radius-sm);
  box-shadow: 0 1px 2px rgba(20, 45, 55, .04);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.gcard:hover {
  border-color: rgba(14, 116, 144, .45); box-shadow: var(--c-shadow-hov);
  transform: translateY(-2px);
}
.gcard-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gcard-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 14px; font-weight: 700; color: var(--c-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gcard:hover .gcard-name { color: var(--c-primary); }
.gcard-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 7px 0 0; font-size: 12.5px; color: var(--c-sub); line-height: 1.6;
  min-height: 40px;                                    /* 两行高度固定，同排卡片对齐 */
}

/* 底部「文章」区块 */
.art-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 26px; }
.art-li {
  display: flex; align-items: baseline; gap: 9px; min-width: 0;
  padding: 9px 0; border-bottom: 1px dashed var(--c-line-soft);
}
.art-li a {
  flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--c-text-2); line-height: 1.6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.art-li a:hover { color: var(--c-primary); }
.art-li .al-date { flex: 0 0 auto; font-size: 11.5px; color: var(--c-sub); }

/* =============================================================
   5. 内页通用区块（分类页 / 标签页 / 搜索页 / 文章页 / 详情页共用）
   ============================================================= */
.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 2px 0 0; font-size: 13px; color: var(--c-sub);
}
.crumb a { color: var(--c-sub); }
.crumb a:hover { color: var(--c-primary); }
.crumb-sep { color: #c3ced4; }
.crumb-cur { color: var(--c-text-2); font-weight: 600; }

.page-head { margin: 14px 0 0; }
.page-head h1 { font-size: 23px; color: var(--c-text); }
.page-head .ph-desc { margin: 9px 0 0; font-size: 13.5px; color: var(--c-sub); line-height: 1.75; }
.page-head .ph-meta { margin: 8px 0 0; font-size: 12.5px; color: var(--c-sub); }
.page-head .ph-meta b { color: var(--c-primary); }

.panel, .section {
  margin: 16px 0 0; padding: 18px 20px 20px;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--c-radius); box-shadow: var(--c-shadow);
}
.panel-head, .section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--c-line-soft);
}
.panel-title, .section-title { display: flex; align-items: center; gap: 9px; font-size: 16px; color: var(--c-text); }
.section-title::before {
  content: ""; width: 5px; height: 18px; border-radius: 999px; background: var(--c-brand-grad);
}
.pt-ico {
  width: 24px; height: 24px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--c-brand-grad); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1;
}
.panel-meta { font-size: 12.5px; color: var(--c-sub); }
.panel-meta b { color: var(--c-primary); }
.panel-more, .section-more { font-size: 13px; color: var(--c-sub); white-space: nowrap; }
.panel-more:hover, .section-more:hover { color: var(--c-primary); }

/* 站点 / 文章列表卡片 */
.lgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));            /* 兜底 */
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 12px;
}
.lcard {
  display: flex; gap: 11px; padding: 13px; min-width: 0;
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--c-radius-sm);
  box-shadow: 0 1px 2px rgba(20, 45, 55, .04); transition: all .18s;
}
.lcard:hover {
  border-color: rgba(14, 116, 144, .45); box-shadow: var(--c-shadow-hov);
  transform: translateY(-2px);
}
.lcard-icon { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.lcard-icon img { object-fit: contain; }
.lcard-main { min-width: 0; flex: 1 1 auto; }
.lcard-name { display: block; font-size: 14px; font-weight: 600; color: var(--c-text); }
.lcard:hover .lcard-name { color: var(--c-primary); }
.lcard-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 3px; font-size: 12.5px; color: var(--c-sub); line-height: 1.55;
}
.lcard-cat { display: block; margin-top: 6px; font-size: 11.5px; color: var(--c-primary-2); }

/* 文章条目（详情页「相关教程」等处） */
.a-item { display: block; padding: 11px 0; border-bottom: 1px dashed var(--c-line-soft); }
.a-item:last-child { border-bottom: 0; }
.a-item-title { display: block; margin-bottom: 3px; font-size: 13.5px; font-weight: 600; color: var(--c-text); line-height: 1.5; }
.a-item:hover .a-item-title { color: var(--c-primary); }
.a-item-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12.5px; color: var(--c-sub); line-height: 1.6;
}
.a-item-meta { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--c-sub); }

/* 文章列表卡片 */
.art-item {
  display: block; margin-top: 12px; padding: 16px 18px;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--c-radius-sm); box-shadow: 0 1px 2px rgba(20, 45, 55, .04); transition: all .18s;
}
.art-item:hover { border-color: rgba(14, 116, 144, .45); box-shadow: var(--c-shadow-hov); }
.art-item h3 { margin-bottom: 6px; font-size: 16px; color: var(--c-text); }
.art-item:hover h3 { color: var(--c-primary); }
.art-item p { margin: 0; font-size: 13.5px; color: var(--c-sub); line-height: 1.7; }
.art-meta { margin-top: 9px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: var(--c-sub); }
.art-cat {
  padding: 1px 9px; border-radius: 999px; background: rgba(13, 148, 136, .12); color: var(--c-primary-2);
}

.tag {
  display: inline-block; margin: 0 6px 6px 0; padding: 3px 11px; font-size: 12px;
  border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-card-2); color: var(--c-text-2);
}
.tag:hover { background: rgba(14, 116, 144, .10); color: var(--c-primary); border-color: rgba(14, 116, 144, .35); }
.tag-list { margin-top: 12px; }

/* 图标：尺寸 / 圆角 / 底色 / 居中全部由 includes/functions.php 的 icon_html() 内联输出，
   这里只保留悬停动效这类「增强」表现 —— 即使外部 CSS 命中了旧缓存也不会让图标崩坏 */
.ico-char { transition: transform .18s ease; }
.lcard:hover .ico-char,
.gcard:hover .ico-char,
.a-item:hover .ico-char { transform: translateY(-1px) scale(1.05); }

/* =============================================================
   6. 二级页（站点详情）—— 融合 qiankun6.com/sites/{id}.html 的版式
   ============================================================= */
.sdetail {
  margin: 14px 0 0; padding: 22px 24px;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--c-radius); box-shadow: var(--c-shadow);
}
/* 顶部：左大图标 + 右侧站名 / 简介 / 标签 / 按钮（窄屏自动堆叠） */
.sd-top { display: flex; gap: 20px; align-items: flex-start; }
.sd-logo { flex: 0 0 auto; }
.sd-main { flex: 1 1 auto; min-width: 0; }
.sd-cat { font-size: 12.5px; color: var(--c-sub); }
.sd-cat a { color: var(--c-primary); }
.sd-cat .sd-sep { margin: 0 6px; color: #c3ced4; }
.sdetail h1 { margin: 6px 0 0; font-size: 24px; line-height: 1.45; color: var(--c-text); }
.sd-intro { margin: 9px 0 0; font-size: 14px; color: var(--c-text-2); line-height: 1.85; }
.sd-tags { margin: 12px 0 0; font-size: 12.5px; color: var(--c-sub); }
.sd-tags .tag { margin-bottom: 0; }
/* 「直接访问」按钮区：页面上不出现第三方网址本身，只有这一颗按钮 */
.sd-go { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 0; }
.sd-go .btn { min-width: 186px; justify-content: center; }
.sd-tip { margin: 10px 0 0; font-size: 12px; color: var(--c-sub); line-height: 1.7; }

/* 详情正文（使用建议等，复用 .detail-body 的排版规则） */
.sd-body { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--c-line-soft); }
.sd-body h2 { margin: 0 0 8px; font-size: 16px; color: var(--c-text); }
.sd-body h3 { margin: 18px 0 6px; font-size: 15px; color: var(--c-text); }
.sd-body p { margin: 8px 0; font-size: 14px; color: var(--c-text-2); line-height: 1.9; }
.sd-body ul { margin: 8px 0 8px 20px; list-style: disc; }
.sd-body li { margin: 5px 0; font-size: 14px; color: var(--c-text-2); line-height: 1.8; }

/* 相关导航卡片：左圆形小图标 + 名称 + 一行简介（对齐乾坤磁力的 url-card） */
.rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rcard {
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 12px 13px;
  background: var(--c-card-2); border: 1px solid var(--c-line); border-radius: var(--c-radius-sm);
  transition: border-color .18s, background-color .18s, transform .18s;
}
.rcard:hover { background: #fff; border-color: rgba(14, 116, 144, .45); transform: translateY(-2px); }
.rcard-main { min-width: 0; flex: 1 1 auto; }
.rcard-name { display: block; font-size: 13.5px; font-weight: 600; color: var(--c-text); }
.rcard:hover .rcard-name { color: var(--c-primary); }
.rcard-desc {
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  margin: 2px 0 0; font-size: 12px; color: var(--c-sub);
}

/* =============================================================
   7. 文章正文页 / 磁力占位框 / 按钮
   ============================================================= */
.detail {
  margin: 14px 0 0; padding: 24px;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--c-radius); box-shadow: var(--c-shadow);
}
.detail h1 { font-size: 24px; line-height: 1.5; color: var(--c-text); }
.detail-meta {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; padding-bottom: 14px;
  border-bottom: 1px solid var(--c-line-soft); font-size: 12.5px; color: var(--c-sub);
}
.detail-meta a { color: var(--c-primary); }
.detail-body { margin-top: 18px; font-size: 15px; line-height: 1.95; color: var(--c-text-2); }
.detail-body h2 { margin: 24px 0 8px; font-size: 18px; color: var(--c-text); }
.detail-body h3 { margin: 22px 0 8px; font-size: 17px; color: var(--c-text); }
.detail-body h4 { margin: 18px 0 6px; font-size: 15px; color: var(--c-text); }
.detail-body p { margin: 10px 0; }
.detail-body ul, .detail-body ol { margin: 10px 0 10px 22px; list-style: disc; }
.detail-body ol { list-style: decimal; }
.detail-body li { margin: 5px 0; }
.detail-body strong { color: var(--c-text); }
.detail-body img { border-radius: 10px; margin: 10px 0; }
/* 正文里的宽内容（表格 / 代码块 / 长链接）在窄屏改为块级横向滚动，不撑破页面 */
.detail-body table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; }
.detail-body th, .detail-body td { padding: 8px 10px; border: 1px solid var(--c-line); }
.detail-body pre {
  overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px;
  background: #f2f7f8; border: 1px solid var(--c-line); border-radius: 10px; font-size: 13px; color: #2b3c42;
}
.detail-body a { color: var(--c-primary); overflow-wrap: anywhere; }
.detail-body a:hover { color: var(--c-primary-2); }

/* 磁力占位框 */
.magnet-box {
  margin-top: 18px; padding: 15px 16px;
  background: #fff8ee; border: 1px dashed rgba(245, 158, 11, .5);
  border-radius: var(--c-radius-sm);
}
.magnet-box .mb-title { margin-bottom: 8px; font-size: 13px; font-weight: 700; color: #b45309; }
.magnet-box .mb-value {
  display: block; padding: 10px 12px; background: #fff; border: 1px solid var(--c-line);
  border-radius: 8px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
  color: #33454e; word-break: break-all; line-height: 1.6;
}
.magnet-box .mb-tip { margin: 8px 0 0; font-size: 12px; color: var(--c-sub); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 26px; cursor: pointer;
  border: 0; border-radius: 11px; background: var(--c-brand-grad); color: #fff;
  font-size: 15px; font-weight: 700; box-shadow: var(--c-glow);
}
.btn:hover { color: #fff; filter: brightness(1.06); }
.btn--warm { background: var(--c-warm-grad); box-shadow: 0 8px 24px rgba(249, 115, 22, .28); }
.btn--ghost {
  background: #fff; color: var(--c-text-2);
  border: 1px solid var(--c-line); box-shadow: none; font-weight: 600;
}
.btn--ghost:hover { color: var(--c-primary); border-color: rgba(14, 116, 144, .45); background: var(--c-card-2); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* =============================================================
   8. 分页（PHP 直出）/ 空状态 / 搜索表单
   ============================================================= */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin: 22px 0 6px; }
.pg-btn {
  min-width: 36px; padding: 7px 11px; text-align: center; font-size: 13px;
  border: 1px solid var(--c-line); border-radius: 9px; background: #fff; color: var(--c-text-2);
}
.pg-btn:hover { border-color: rgba(14, 116, 144, .5); color: var(--c-primary); }
.pg-btn.is-active { border-color: transparent; background: var(--c-brand-grad); color: #fff; font-weight: 700; box-shadow: var(--c-glow); }
.pg-btn.is-disabled { color: #b6c2c8; background: var(--c-card-2); cursor: not-allowed; }
.pg-gap { padding: 0 3px; color: var(--c-sub); }
.pg-info { margin-left: 8px; font-size: 12.5px; color: var(--c-sub); }

/* 内页搜索表单（搜索结果页用；页头那一版见 .topbar-search） */
.search-form { display: flex; max-width: 560px; margin: 16px 0 0; }
.search-form input[type=text] {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px; font-size: 15px;
  border: 1px solid var(--c-line); border-right: 0; border-radius: 11px 0 0 11px;
  background: #fff; outline: none; color: var(--c-text);
}
.search-form input[type=text]:focus { border-color: var(--c-primary); box-shadow: inset 0 0 0 3px rgba(14, 116, 144, .14); }
.search-form button {
  height: 46px; padding: 0 26px; border: 0; border-radius: 0 11px 11px 0; cursor: pointer;
  background: var(--c-brand-grad); color: #fff; font-size: 14.5px; font-weight: 700; letter-spacing: 1px;
  box-shadow: var(--c-glow); transition: filter .18s;
}
.search-form button:hover { filter: brightness(1.06); }

.empty {
  margin-top: 14px; padding: 46px 20px; text-align: center; font-size: 14px; color: var(--c-sub);
  background: var(--c-card); border: 1px dashed var(--c-line); border-radius: var(--c-radius);
}
.empty a { color: var(--c-primary); }

/* =============================================================
   9. 页脚
   ============================================================= */
.footer {
  margin: 30px 0 0; padding: 26px 0 34px;
  border-top: 1px solid var(--c-line); background: #fff;
  font-size: 12.5px; color: var(--c-sub);
}
.footer .container { text-align: center; }
.footer-slogan {
  margin: 0 0 14px; padding-bottom: 13px; border-bottom: 1px solid var(--c-line-soft);
  font-size: 14px; font-weight: 700; color: var(--c-text-2); letter-spacing: .3px;
}
.footer-slogan b { color: var(--c-primary); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-bottom: 12px; }
.footer-links a { font-size: 13px; color: var(--c-text-2); }
.footer-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.footer p { margin: 5px 0; line-height: 1.8; }
.footer-copy { color: var(--c-text-2); }
.footer-note { max-width: 760px; margin-left: auto !important; margin-right: auto !important; }

/* =============================================================
   10. 后台管理
   ============================================================= */
.adm { display: flex; min-height: 100vh; min-height: 100dvh; }
.adm-side {
  flex: 0 0 190px; padding: 18px 0;
  background: linear-gradient(180deg, #0c2a3a 0%, #12465c 100%);
  border-right: 1px solid var(--c-line);
}
.adm-side .as-brand {
  padding: 0 18px 16px; margin-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-size: 16px; font-weight: 700; color: #fff;
}
.adm-side a { display: block; padding: 10px 18px; font-size: 13.5px; color: #a9c6d2; }
.adm-side a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.adm-side a.is-active { background: var(--c-brand-grad); color: #fff; font-weight: 600; }
.adm-main { flex: 1 1 auto; min-width: 0; padding: 20px 24px 60px; }
.adm-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.adm-top h1 { font-size: 20px; color: var(--c-text); }
.adm-panel {
  margin-bottom: 18px; padding: 20px;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--c-radius); box-shadow: var(--c-shadow);
}
.adm-panel h2 { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--c-line-soft); font-size: 15px; color: var(--c-text); }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--c-text-2); }
.form-row .hint { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--c-sub); }
.inp, .sel, .txa {
  width: 100%; padding: 9px 12px; border: 1px solid var(--c-line); border-radius: 9px;
  background: var(--c-card-2); outline: none; color: var(--c-text);
}
.inp:focus, .sel:focus, .txa:focus { border-color: var(--c-primary); background: #fff; }
.txa { min-height: 110px; resize: vertical; line-height: 1.7; }
.txa-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid .form-row.full { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 8px; }

.btn-adm {
  display: inline-block; padding: 9px 18px; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--c-brand-grad); color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: var(--c-glow);
}
.btn-adm:hover { color: #fff; filter: brightness(1.06); }
.btn-adm--gray { background: var(--c-card-2); color: var(--c-text-2); border: 1px solid var(--c-line); box-shadow: none; }
.btn-adm--gray:hover { color: var(--c-primary); }
.btn-adm--danger { background: #fff1f2; color: #d22f4b; border: 1px solid #ffd9df; box-shadow: none; }
.btn-adm--danger:hover { color: #b01f39; }
.btn-adm--sm { padding: 5px 11px; font-size: 12.5px; }

/* 表格外层滚动容器：窄屏横向滑动查看，避免撑破页面 */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl-wrap::-webkit-scrollbar { height: 6px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: rgba(14, 116, 144, .3); border-radius: 3px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 10px; border-bottom: 1px solid var(--c-line-soft); text-align: left; vertical-align: middle; color: var(--c-text-2); }
.tbl th { background: var(--c-card-2); font-weight: 600; color: var(--c-text); white-space: nowrap; }
.tbl tr:hover td { background: var(--c-card-2); }
.tbl .col-act { white-space: nowrap; }
.tbl .col-act a { margin-right: 8px; font-size: 12.5px; }

.alert { margin-bottom: 16px; padding: 10px 14px; border-radius: 9px; font-size: 13.5px; }
.alert--ok  { background: #eefaf6; color: #14765a; border: 1px solid #c8efdf; }
.alert--err { background: #fff1f2; color: #c0243f; border: 1px solid #ffd9df; }

.login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100dvh; padding: 20px;
  background: radial-gradient(760px 420px at 12% -6%, rgba(14, 116, 144, .18), transparent 62%),
              radial-gradient(700px 400px at 92% 6%, rgba(13, 148, 136, .16), transparent 60%),
              var(--c-bg);
}
/* 固定 340px 在 320px 机型上会横向溢出，改成「不超过容器」 */
.login-box {
  width: 340px; max-width: 100%; padding: 30px 26px;
  background: #fff; border: 1px solid var(--c-line);
  border-radius: var(--c-radius); box-shadow: var(--c-shadow-hov);
}
.login-box h1 { margin-bottom: 20px; font-size: 18px; text-align: center; color: var(--c-text); }

/* =============================================================
   11. 响应式 / 多机型适配
   -------------------------------------------------------------
   断点梯度（桌面优先，由宽到窄逐级覆盖）：
     ≥1600  2K / 4K 显示器            —— 版面加宽到 1440
     1280+  常规台式机                 —— 侧栏常驻 + 卡片 4 列
     1100   小笔记本 / 平板横屏        —— 卡片 3 列
     1024   iPad / iPad Pro           —— 侧栏收进抽屉，内容占满
     760    小平板 / 大屏手机横屏      —— 卡片 2 列
     640    主流手机 360-430px        —— 卡片 1 列，触控区放大，字号 16px
     480    小屏手机（SE / 老安卓）    —— 搜索框改上下堆叠
     375    极窄屏
     340    分屏 / 折叠内屏窄态
     300    折叠机外屏（280px）
   另含：手机横屏矮屏 / 触摸设备 / 减弱动态效果偏好
   ============================================================= */

@media (min-width: 1600px) {
  :root { --wrap: 1440px; --nav-w: 240px; }
  .lgrid { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
  .grid4 { gap: 12px; }
}

@media (max-width: 1279px) {
  .topbar-search form { max-width: 460px; }
  .art-grid { column-gap: 22px; }
}

@media (max-width: 1100px) {
  .grid4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lgrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* iPad 及以下：左侧常驻侧栏收进抽屉，内容区占满 */
@media (max-width: 1024px) {
  .layout { margin-left: 0; }
  .drawer { transform: translateX(-100%); box-shadow: 0 8px 30px rgba(10, 28, 38, .18); }
  body.nav-open .drawer { transform: translateX(0); }
  /* ≤1024 起，汉堡按钮只负责开合抽屉，不再做「桌面折叠」 */
  .group-cap { display: none; }
  .group-cap::before { content: none; }
}

@media (max-width: 900px) {
  .topbar-search form { max-width: none; }
}

/* 小平板 / 大屏手机横屏 */
@media (max-width: 760px) {
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rgrid { grid-template-columns: 1fr; }
  .art-grid { grid-template-columns: 1fr; }
  .group-cap { display: inline; }
  .sd-top { gap: 14px; }
  .sdetail h1 { font-size: 21px; }
}

/* 主流手机（iPhone 12-16 / 大部分安卓 360-430px） */
@media (max-width: 640px) {
  :root { --top-h: 54px; }

  .container {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  /* --- 顶部工具条 --- */
  .topbar-inner { gap: 8px; padding: 0 12px; }
  .nav-toggle { width: 36px; height: 36px; }
  .brand { gap: 7px; }
  .brand-icon { width: 28px; height: 28px; }
  .brand-name { font-size: 15px; }
  .topbar-user { display: none; }                          /* 窄屏省掉账号图标，把宽度让给搜索框 */
  /* 关键：输入框字号 < 16px 时 iOS Safari 聚焦会自动放大整页，这里强制 16px */
  .topbar-search input { height: 36px; padding: 0 13px; font-size: 16px; }
  .topbar-search button { height: 36px; padding: 0 14px; font-size: 13px; }

  /* --- 抽屉 --- */
  .drawer { width: 250px; padding: 8px 8px calc(20px + env(safe-area-inset-bottom)); }
  .drawer-list a { padding: 12px 12px; font-size: 15px; }  /* 触控区 ≥ 44px */
  .drawer-foot { display: none; }

  /* --- 首页 --- */
  .intro { padding: 12px 14px; margin-bottom: 12px; }
  .intro h1 { font-size: 17px; }
  .intro p { font-size: 12.5px; }
  .group { margin-bottom: 14px; }
  .group-head { margin-bottom: 9px; gap: 3px 8px; }
  .group-title h2 { font-size: 15.5px; }
  .group-cap { display: none; }                            /* 窄屏标题行只留「组名 + 更多」 */
  .group-cap::before { content: none; }
  .group-more { font-size: 12px; }
  .grid4 { grid-template-columns: 1fr; gap: 9px; }
  .gcard { padding: 11px 12px 12px; }
  .gcard-desc { min-height: 0; -webkit-line-clamp: 2; }
  .art-li a { font-size: 13.5px; }

  /* --- 通用区块 --- */
  .crumb { margin-top: 0; font-size: 12.5px; }
  .page-head h1 { font-size: 19px; }
  .page-head .ph-desc { font-size: 13px; }
  .panel, .section { margin-top: 12px; padding: 15px 13px 15px; border-radius: 12px; }
  .panel-head, .section-head { padding-bottom: 11px; margin-bottom: 11px; gap: 8px; }
  .panel-title, .section-title { font-size: 15px; }
  .panel-more, .section-more { font-size: 12px; }
  .panel-meta { display: none; }                           /* 窄屏省掉统计文字 */

  /* --- 列表 / 详情 --- */
  .lgrid { grid-template-columns: 1fr; gap: 10px; }
  .lcard { padding: 12px; }
  .art-item { padding: 14px; margin-top: 10px; }
  .art-item h3 { font-size: 15px; }
  .detail { padding: 18px 14px; margin-top: 12px; border-radius: 12px; }
  .detail h1 { font-size: 19px; }
  .detail-body { font-size: 15px; line-height: 1.9; }
  .detail-body h3 { font-size: 16px; }
  .magnet-box { padding: 13px 12px; }
  .magnet-box .mb-value { padding: 9px 10px; font-size: 12px; }

  /* --- 二级页 --- */
  .sdetail { padding: 16px 14px; margin-top: 12px; border-radius: 12px; }
  .sd-top { flex-direction: column; gap: 12px; }
  .sdetail h1 { font-size: 20px; }
  .sd-intro { font-size: 13.5px; }
  .sd-go .btn { flex: 1 1 100%; min-width: 0; }
  .rgrid { grid-template-columns: 1fr; gap: 9px; }

  /* --- 分页：加大点击区 --- */
  .pager { gap: 6px; margin: 18px 0 6px; }
  .pg-btn { min-width: 40px; padding: 9px 11px; font-size: 13px; }
  .pg-info { flex: 1 1 100%; margin: 6px 0 0; text-align: center; }

  /* --- 页脚 --- */
  .footer { margin-top: 22px; padding: 20px 0 calc(26px + env(safe-area-inset-bottom)); }
  .footer-links { gap: 8px 14px; }
  .footer-links a { font-size: 12.5px; }

  /* --- 后台 --- */
  .adm { flex-direction: column; }
  .adm-side {
    position: sticky; top: 0; z-index: 20; flex: none; display: flex;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    padding: 8px; border-right: 0; border-bottom: 1px solid var(--c-line);
  }
  .adm-side::-webkit-scrollbar { display: none; }
  .adm-side .as-brand { display: none; }
  .adm-side a { padding: 10px 14px; border-radius: 8px; white-space: nowrap; }
  .adm-main { padding: 14px 12px calc(48px + env(safe-area-inset-bottom)); }
  .adm-top h1 { font-size: 18px; }
  .adm-panel { padding: 15px 13px; }
  .form-grid { grid-template-columns: 1fr; }
  .inp, .sel, .txa { font-size: 16px; }                    /* 防 iOS 聚焦缩放 */
  .login-box { padding: 26px 20px; }
  /* 多列宽表：给足最小宽度后由外层 .tbl-wrap 横向滑动查看 */
  .tbl-wrap .tbl { min-width: 600px; }
}

/* 小屏手机（iPhone SE / 6-8 / 老安卓 320-480px） */
@media (max-width: 480px) {
  .brand-name { font-size: 14px; }
  .nav-toggle { width: 34px; height: 34px; }
  /* 搜索框在窄屏改为上下堆叠，更好点按与输入 */
  .topbar-search form { flex-wrap: wrap; border-radius: 12px; }
  .topbar-search input { flex: 1 1 100%; height: 34px; }
  .topbar-search button { flex: 1 1 100%; height: 34px; border-radius: 0 0 11px 11px; }
  .topbar { height: calc(var(--top-h) + 30px + env(safe-area-inset-top)); }
  body { padding-top: calc(var(--top-h) + 30px); }
  .drawer { top: calc(var(--top-h) + 30px); }
  .mask { inset: calc(var(--top-h) + 30px) 0 0 0; }
  .intro h1 { font-size: 16px; }
  .group-title h2 { font-size: 15px; }
  .pg-btn { min-width: 38px; padding: 8px 10px; }
  .sd-tags .tag { font-size: 11.5px; }
}

/* 极窄屏（iPhone SE 第一代 320px / 小屏安卓） */
@media (max-width: 375px) {
  .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .brand-name { font-size: 13.5px; }
  .intro h1 { font-size: 15px; }
  .intro p { font-size: 12px; }
  .gcard-name { font-size: 13.5px; }
  .art-li a { font-size: 13px; }
  .pg-btn { min-width: 36px; padding: 7px 9px; font-size: 12.5px; }
}

/* 超窄屏（分屏 / 折叠机内屏窄态） */
@media (max-width: 340px) {
  .brand-name { font-size: 13px; }
  .drawer { width: 224px; }
  .intro { padding: 11px 12px; }
  .intro h1 { font-size: 14.5px; }
  .panel, .section { padding: 13px 10px 13px; }
  .pg-gap { display: none; }                               /* 极窄时省略页码省略号，优先保证按钮可点 */
}

/* 折叠机外屏（Galaxy Fold 280px 等） */
@media (max-width: 300px) {
  .brand-name { display: none; }                           /* 只留站标，把宽度让给搜索框 */
  .intro p { display: none; }                              /* 说明文字收起，只留 H1 */
  .pg-info { font-size: 11.5px; }
}

/* 手机横屏 / 矮屏：压缩纵向高度，让首屏信息量最大化 */
@media (max-height: 500px) and (orientation: landscape) {
  .intro { display: none; }
  .group { margin-bottom: 12px; }
  .group-head { margin-bottom: 8px; }
  .footer { padding-top: 16px; }
}

/* 触摸设备：关闭依赖 hover 的位移，避免「点完状态卡住」 */
@media (hover: none) and (pointer: coarse) {
  html { scroll-behavior: auto; }
  .gcard:hover { transform: none; }
  .lcard:hover { transform: none; }
  .rcard:hover { transform: none; }
  .btn:active, .btn-adm:active, .pg-btn:active, .nav-toggle:active { filter: brightness(.95); }
}

/* 尊重系统「减弱动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
