@charset "UTF-8";
/* =============================================================
   磁力狗 (cildog.com)  ——  站点样式
   版式来源：参考站 cilidiqiu.lat 的骨架
             深色顶栏（横向导航 + 紧凑搜索）→ 深色头图带 → 白色圆角大卡 → 浅灰页脚
   二级页面（/site/{id}.html）在卡内沿用「面包屑 + 左大图标 + 站名 H1 + 简介 +
             标签 + 直接访问按钮 + 相关导航」结构，与首页同一套视觉语言。
   差异化：参考站主色是深蓝系，本站改为「赤橙 → 暖金」+ 深炭底，
             圆角、间距、hover 反馈一并调整，版式同构、观感可区分。
   规范：
     · 移动端优先，纯 CSS，不依赖任何前端框架；零外部字体 / 零外链图标
     · 首页专用 class（schcon / logo / main-search / hotcol / homelinks / home-about）
       与内页通用组件（crumb / page-head / section / lgrid / lcard / detail / pager / 后台）
       分区书写，互不覆盖
     · 所有列表 / 正文 / 分页内容均为 PHP 服务端直出，不依赖 JS 渲染
   ============================================================= */

/* ---------------- 设计变量 ---------------- */
:root {
  /* 固定浅色主题：声明后 Android Chrome / 微信内置浏览器不会把表单控件按暗色渲染 */
  color-scheme: light;

  --c-bg:          #eef0f3;
  --c-bg-2:        #e4e7ec;
  --c-card:        #ffffff;
  --c-card-2:      #f6f7f9;
  --c-line:        #e6e8eb;
  --c-line-soft:   #f0f2f4;
  --c-text:        #1b2430;
  --c-text-2:      #3d4b5c;
  --c-sub:         #7b8794;

  /* 品牌主色：赤橙 → 暖金（磁力狗） */
  --c-primary:     #e2571f;
  --c-primary-2:   #0f8a7a;
  --c-accent:      #f08a24;
  --c-brand-grad:  linear-gradient(135deg, #e2571f 0%, #f08a24 100%);
  --c-warm-grad:   linear-gradient(135deg, #f59e0b 0%, #f97316 100%);

  /* 深色顶栏 / 头图带 */
  --c-bar:         rgba(18, 22, 30, .72);
  --c-hero:        #151b24;
  --c-hero-grad:   linear-gradient(115deg, #12171f 0%, #1d2735 44%, #35281c 76%, #4a2c12 100%);

  --c-radius:      14px;
  --c-radius-sm:   10px;
  --c-shadow:      0 1px 2px rgba(24, 30, 40, .05), 0 8px 22px rgba(24, 30, 40, .06);
  --c-shadow-hov:  0 5px 12px rgba(24, 30, 40, .09), 0 16px 34px rgba(24, 30, 40, .11);
  --c-glow:        0 8px 24px rgba(226, 87, 31, .26);

  --wrap:          1040px;  /* 白色大卡最大宽度 */
  --top-h:         46px;    /* 顶栏高度 */
  --hero-h:        190px;   /* 头图带高度 */
  --card-overlap:  30px;    /* 大卡向上叠压头图带的高度 */
}

/* ---------------- 基础重置 ---------------- */
*, *::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: #f2eeea; padding: 1px 5px; border-radius: 4px; font-size: 13px; color: #b4471a; }
::placeholder { color: #9aa4ae; }

.grey { color: var(--c-sub); }
p.grey { width: 100%; line-height: 1.5; }
.hl { color: var(--c-primary); font-weight: 700; }
.cl::after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.cl { zoom: 1; }

.container {
  width: 100%; max-width: var(--wrap); margin: 0 auto;
  padding: 0 26px;                                        /* 兜底：不支持 max()/env() 的老内核 */
  padding-left: max(26px, env(safe-area-inset-left));
  padding-right: max(26px, 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: var(--c-bar);
  -webkit-backdrop-filter: saturate(150%) blur(8px);      /* iOS ≤15 必须带 -webkit- 前缀 */
  backdrop-filter: saturate(150%) blur(8px);
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px;
  height: var(--top-h); max-width: var(--wrap); margin: 0 auto;
  padding: 0 26px;
  padding-left: max(26px, env(safe-area-inset-left));
  padding-right: max(26px, env(safe-area-inset-right));
}

/* 横向导航：装不下时横向滑动而不是被裁掉 */
.topnav {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.topnav::-webkit-scrollbar { display: none; }
.topnav a {
  flex: 0 0 auto; display: block; padding: 7px 13px; border-radius: 8px;
  font-size: 14px; color: #d7dde4; white-space: nowrap; transition: background-color .18s, color .18s;
}
.topnav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.topnav a.is-active { background: rgba(255, 255, 255, .16); color: #fff; font-weight: 700; }

/* 紧凑搜索框 */
.topbar-search { flex: 0 0 auto; display: flex; justify-content: flex-end; }
.topbar-search form {
  display: flex; width: 254px; height: 32px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
  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: 30px; padding: 0 14px; border: 0; outline: none;
  background: transparent; color: #fff; font-size: 13px;
}
.topbar-search input::placeholder { color: rgba(255, 255, 255, .72); }
.topbar-search form:focus-within input { color: var(--c-text); }
.topbar-search form:focus-within input::placeholder { color: #9aa4ae; }
.topbar-search button {
  flex: 0 0 auto; padding: 0 16px; border: 0; cursor: pointer;
  background: var(--c-brand-grad); color: #fff; font-size: 13px; font-weight: 700;
  transition: filter .18s;
}
.topbar-search button:hover { filter: brightness(1.07); }

/* =============================================================
   2. 深色头图带（顶栏压在它上方）
   ============================================================= */
.topbg {
  height: var(--hero-h);
  margin-top: calc(-1 * var(--top-h));      /* 顶到视口顶部，与固定顶栏叠在一起 */
  background-color: var(--c-hero);
  background-image:
    radial-gradient(760px 300px at 16% 8%, rgba(240, 138, 36, .22), transparent 66%),
    radial-gradient(680px 280px at 88% 18%, rgba(226, 87, 31, .18), transparent 62%),
    var(--c-hero-grad);
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}
.topbg .shadow {
  height: 100%;
  background: linear-gradient(180deg, rgba(0, 0, 0, .34) 0%, rgba(0, 0, 0, .10) 52%, rgba(0, 0, 0, .30) 100%);
}

/* =============================================================
   3. 白色圆角大卡（页面主体全部在卡内，向上叠压头图带）
   ============================================================= */
.mainbox {
  position: relative; z-index: 2;
  max-width: var(--wrap); margin: calc(-1 * var(--card-overlap)) auto 0;
  background: var(--c-card); border-radius: var(--c-radius);
  box-shadow: 0 2px 10px rgba(24, 30, 40, .10);
}
.conbox { padding: 26px 0 34px; }
.layout { display: block; }
.main { min-height: 40vh; padding: 0; }

/* =============================================================
   4. 首页（参考站骨干：logo + 主域名 + 搜索框 + 榜单两列）
   ============================================================= */
.schcon { max-width: 768px; margin: 0 auto; text-align: center; }

/* 站标：整页唯一的 H1（图片 + 品牌字，两者都真实可见，利于 SEO） */
.logo { margin: 4px 0 0; }
.logo a { display: inline-flex; align-items: center; gap: 12px; }
.logo-img { width: 64px; height: 64px; display: block; flex: 0 0 auto; }
.logo-text { font-size: 33px; font-weight: 800; letter-spacing: 3px; color: var(--c-primary); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .logo-text {
    background: var(--c-brand-grad);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}
.logo-domain { margin: 10px 0 0; font-size: 12.5px; }

/* 主搜索框 */
.main-search { display: flex; max-width: 640px; margin: 20px auto 0; }
.main-search .search-query {
  flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 20px;
  border: 1px solid var(--c-line); border-right: 0;
  border-radius: 12px 0 0 12px; background: #fff; outline: none;
  color: var(--c-text); font-size: 15px;
  transition: border-color .18s, box-shadow .18s;
}
.main-search .search-query:focus { border-color: var(--c-primary); box-shadow: inset 0 0 0 3px rgba(226, 87, 31, .12); }
.main-search .btn-search {
  flex: 0 0 auto; height: 48px; padding: 0 30px; border: 0; cursor: pointer;
  border-radius: 0 12px 12px 0; background: var(--c-brand-grad); color: #fff;
  font-size: 15px; font-weight: 700; letter-spacing: 1px;
  box-shadow: var(--c-glow); transition: filter .18s;
}
.main-search .btn-search:hover { filter: brightness(1.06); }
.sch-tip { margin: 10px 0 0; font-size: 12.5px; }

/* 榜单两列（参考站三列，本站按批注改为两列：搜索神器 / 文章热榜） */
.top {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; margin: 24px auto 0; text-align: left;
}
.hotcol {
  min-width: 0; padding: 12px 15px 6px;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--c-radius-sm); box-shadow: 0 1px 2px rgba(24, 30, 40, .04);
}
.hotcol dt {
  padding: 2px 0 10px; margin-bottom: 2px;
  border-bottom: 1px solid var(--c-line-soft);
  font-size: 14px; font-weight: 700; letter-spacing: .5px;
}
.hotcol dd { margin: 0; }
.hotcol p {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 0; border-bottom: 1px dotted var(--c-line-soft);
}
.hotcol p:last-child { border-bottom: 0; }
.hotcol p a {
  position: relative; flex: 1 1 auto; min-width: 0;
  padding-right: 16px; font-size: 13.5px; color: var(--c-text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hotcol p a .fr {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
}
.hotcol p a .fr::before {
  content: "\203A"; display: block; font-size: 15px; line-height: 12px;
  text-align: right; font-style: normal; color: #c9d2d8;
}
.hotcol p a:hover .fr::before { color: var(--c-primary); }

/* 序号徽章：每列用自己的强调色（照参考站红/绿分列上色的做法） */
.hotcol .idx {
  flex: 0 0 auto; width: 17px; height: 17px; line-height: 17px;
  border-radius: 4px; background: #98a3ad; color: #fff;
  font-size: 11px; font-weight: 700; text-align: center; font-style: normal;
}
.hotcol--tool dt { color: var(--c-primary); }
.hotcol--tool .idx { background: var(--c-primary); }
.hotcol--art dt { color: var(--c-primary-2); }
.hotcol--art .idx { background: var(--c-primary-2); }
.hotcol-empty { display: block; padding: 12px 0; font-size: 13px; color: var(--c-sub); }

/* 卡内分类内链 */
.homelinks {
  margin: 22px 0 0; padding-top: 16px;
  border-top: 1px solid var(--c-line-soft); text-align: center;
}
.homelinks-cap { margin: 0 0 9px; font-size: 12.5px; color: var(--c-sub); }
.homelinks .tag-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 0; }
.homelinks .tag { margin: 0; }

/* 首页说明段（对爬虫友好的正文，视觉上沿用参考站那句灰色说明的版式语言） */
.home-about {
  margin: 22px 0 0; padding: 20px 22px;
  background: var(--c-card-2); border: 1px solid var(--c-line); border-radius: var(--c-radius);
}
.home-about h2 { font-size: 16px; color: var(--c-text); margin-bottom: 10px; }
.home-about p { margin: 9px 0; font-size: 13.5px; color: var(--c-sub); line-height: 1.9; }
.home-about a { color: var(--c-primary); }
.home-about-note { font-size: 12.5px !important; color: #a3adb6 !important; }

/* =============================================================
   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(24, 30, 40, .04); transition: all .18s;
}
.lcard:hover {
  border-color: rgba(226, 87, 31, .42); 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(24, 30, 40, .04); transition: all .18s;
}
.art-item:hover { border-color: rgba(226, 87, 31, .42); 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(15, 138, 122, .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(226, 87, 31, .09); color: var(--c-primary); border-color: rgba(226, 87, 31, .32); }
.tag-list { margin-top: 12px; }

/* 图标：尺寸 / 圆角 / 底色 / 居中全部由 includes/functions.php 的 icon_html() 内联输出，
   这里只保留悬停动效这类「增强」表现 —— 即使外部 CSS 命中了旧缓存也不会让图标崩坏 */
.ico-char { transition: transform .18s ease; }
.lcard:hover .ico-char,
.a-item:hover .ico-char { transform: translateY(-1px) scale(1.05); }

/* =============================================================
   6. 二级页（站点详情）—— 隐藏第三方网址，只留「直接访问」按钮
   ============================================================= */
.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; }

.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; }

.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(226, 87, 31, .42); 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: #f5f6f8; 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-accent); }

/* 磁力框（后台填写了 magnet 字段时才渲染） */
.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(226, 87, 31, .42); 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(226, 87, 31, .45); 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); }

/* 内页搜索表单（搜索结果页用；首页那版见 .main-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(226, 87, 31, .13); }
.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-2); border: 1px dashed var(--c-line); border-radius: var(--c-radius);
}
.empty a { color: var(--c-primary); }

/* =============================================================
   9. 页脚（浅灰居中式，照参考站页脚条）
   ============================================================= */
.footer {
  margin: 26px 0 0; padding: 24px 0 30px;
  background: #f2f3f5; border-top: 1px solid var(--c-line);
  font-size: 12.5px; color: var(--c-sub);
}
.footer-inner {
  max-width: var(--wrap); margin: 0 auto; text-align: center;
  padding: 0 26px;
  padding-left: max(26px, env(safe-area-inset-left));
  padding-right: max(26px, env(safe-area-inset-right));
}
.footer-brandline { margin: 0 0 13px; padding-bottom: 12px; border-bottom: 1px solid #e6e8eb; font-size: 13px; color: var(--c-text-2); }
.footer-brandline a { color: var(--c-text-2); }
.footer-brandline a:hover { color: var(--c-primary); }
.footer-brandline b { color: var(--c-primary); }
.fl-sep { margin: 0 6px; color: #c3ced4; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-bottom: 11px; }
.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: 13px; }
.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, #1a1410 0%, #4a2c12 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: #dcbfa8; }
.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(226, 87, 31, .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(226, 87, 31, .16), transparent 62%),
              radial-gradient(700px 400px at 92% 6%, rgba(240, 138, 36, .14), 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 显示器            —— 大卡加宽
     1280+  常规台式机                 —— 基准
     1100   小笔记本 / 平板横屏        —— 列表降档
     1024   iPad / iPad Pro           —— 顶栏导航横向滑动
     760    小平板 / 大屏手机横屏      —— 列表 2 列
     640    主流手机 360-430px        —— 榜单两列改上下堆叠，字号 16px
     480    小屏手机（SE / 老安卓）    —— 搜索框改上下堆叠
     375    极窄屏
     340    分屏 / 折叠内屏窄态
     300    折叠机外屏（280px）
   另含：手机横屏矮屏 / 触摸设备 / 减弱动态效果偏好
   ============================================================= */

@media (min-width: 1600px) {
  :root { --wrap: 1140px; }
  .lgrid { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
}

@media (max-width: 1100px) {
  .rgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lgrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* iPad 及以下：顶栏导航横向滑动，压缩搜索框 */
@media (max-width: 1024px) {
  .topbar-search form { width: 190px; }
  .topnav a { padding: 7px 11px; font-size: 13.5px; }
}

@media (max-width: 900px) {
  /* 窄屏把宽度全让给导航（卡内已经有主搜索框） */
  .topbar-search { display: none; }
}

/* 小平板 / 大屏手机横屏 */
@media (max-width: 760px) {
  .rgrid { grid-template-columns: 1fr; }
  .sd-top { gap: 14px; }
  .sdetail h1 { font-size: 21px; }
}

/* 主流手机（iPhone 12-16 / 大部分安卓 360-430px） */
@media (max-width: 640px) {
  :root { --top-h: 44px; --hero-h: 150px; --card-overlap: 20px; }

  .container {
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
  }
  .topbar-inner, .footer-inner {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .topnav a { padding: 6px 9px; font-size: 13px; }

  .mainbox { border-radius: 12px; }
  .conbox { padding: 20px 0 24px; }

  /* --- 首页 --- */
  .schcon { max-width: none; }
  .main-search { margin-top: 16px; }
  .main-search .search-query { height: 44px; padding: 0 16px; font-size: 16px; }
  .main-search .btn-search { height: 44px; padding: 0 20px; font-size: 14px; }
  .top { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
  .hotcol { padding: 10px 13px 4px; }
  /* 窄屏榜单条目标题允许换行，避免长标题被省略号吃掉 */
  .hotcol p a { font-size: 13.5px; line-height: 1.6; white-space: normal; }
  .homelinks, .home-about { margin-top: 18px; }
  .home-about { padding: 16px 15px; }

  /* --- 通用区块 --- */
  .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: 20px; padding: 20px 0 calc(24px + 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) {
  .topnav a { padding: 6px 8px; font-size: 12.5px; }
  /* 搜索框在窄屏改为上下堆叠，更好点按与输入 */
  .main-search { flex-wrap: wrap; }
  .main-search .search-query {
    flex: 1 1 100%; height: 42px; border-right: 1px solid var(--c-line); border-radius: 12px;
  }
  .main-search .btn-search { flex: 1 1 100%; margin-top: 8px; border-radius: 12px; height: 42px; }
  .logo-domain { font-size: 12px; }
  .sch-tip { font-size: 12px; }
  .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));
  }
  .topnav a { padding: 6px 7px; font-size: 12px; }
  .hotcol p a { font-size: 13px; }
  .pg-btn { min-width: 36px; padding: 7px 9px; font-size: 12.5px; }
}

/* 超窄屏（分屏 / 折叠机内屏窄态） */
@media (max-width: 340px) {
  .logo-text { font-size: 24px; }
  .panel, .section { padding: 13px 10px 13px; }
  .home-about { padding: 14px 12px; }
  .pg-gap { display: none; }                               /* 极窄时省略页码省略号，优先保证按钮可点 */
}

/* 折叠机外屏（Galaxy Fold 280px 等） */
@media (max-width: 300px) {
  .logo-img { width: 44px; height: 44px; }
  .logo-text { font-size: 21px; letter-spacing: 1px; }
  .homelinks-cap { display: none; }
  .pg-info { font-size: 11.5px; }
}

/* 手机横屏 / 矮屏：压缩纵向高度，让首屏信息量最大化 */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --hero-h: 110px; }
  .home-about { display: none; }
  .footer { padding-top: 16px; }
}

/* 触摸设备：关闭依赖 hover 的位移，避免「点完状态卡住」 */
@media (hover: none) and (pointer: coarse) {
  html { scroll-behavior: auto; }
  .lcard:hover { transform: none; }
  .rcard:hover { transform: none; }
  .btn:active, .btn-adm:active, .pg-btn: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; }
}
