@charset "UTF-8";
/* =============================================================
   磁力引擎  ——  站点样式
   设计说明:
     · 参考竞品「咪咕鱼网址导航」(miguyu.com) 的整体观感二次改版
       (整屏天空背景 / 大时钟 / 居中胶囊搜索框 / 下划线标签栏 / 图标宫格)
     · 差异化处理: 天空改为纯 CSS 渐变 + 云朵（零图片请求，首屏更快），
       宫格文字小图用饱和渐变圆形（无外链图标依赖），
       下方叠加白色内容卡片承载资讯与站内内链
     · 移动端优先, 纯 CSS 实现, 不依赖任何前端框架与 JS 渲染
   ============================================================= */

/* ---------------- 设计变量 ---------------- */
:root {
  /* 本站为固定浅色主题：声明后，Android Chrome / 微信内置浏览器的
     「强制深色」(Force Dark) 不会再自动反转配色，避免手机上出现半黑半白 */
  color-scheme: light;
  --c-bg:         #f4f7fb;
  --c-bg-2:       #eaf1f9;
  --c-card:       #ffffff;
  --c-line:       #e4ebf4;
  --c-line-soft:  #f0f5fb;
  --c-text:       #14324e;
  --c-text-2:     #4a6480;
  --c-sub:        #7d90a6;
  --c-primary:    #1a6fd4;
  --c-primary-2:  #0f9fbf;
  --c-brand-grad: linear-gradient(135deg, #1a6fd4 0%, #12b3c8 100%);
  --c-warm:       #f59e0b;
  --c-radius:     16px;
  --c-radius-sm:  10px;
  --c-shadow:     0 1px 2px rgba(20, 50, 78, .04), 0 10px 30px rgba(20, 50, 78, .07);
  --c-shadow-hov: 0 6px 14px rgba(20, 50, 78, .10), 0 18px 40px rgba(20, 50, 78, .12);
  --wrap:         1240px;
  /* 首屏天空背景高度（含云朵渐变），由宽到窄在响应式一节里降档 */
  --sky-h:        880px;
}

/* ---------------- 基础重置 ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
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: var(--c-bg);
  min-height: 100vh;
  min-height: 100dvh;            /* 新版浏览器：避开移动端地址栏高度抖动 */
  /* 点按时不要出现灰色高亮块；同时去掉 300ms 点击延迟 */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  /* 只加在 body：同时加到 html 会让 body 变成独立滚动容器，顶部 sticky 导航立刻失效 */
  overflow-x: hidden;
}
a { color: var(--c-text-2); text-decoration: none; transition: color .18s, background-color .18s; }
a:hover { color: var(--c-primary); }
/* height:auto 让正文配图按原始比例缩放；图标类规则有明确 width+height，不会被覆盖 */
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: #eef3fa; padding: 1px 5px; border-radius: 4px; font-size: 13px; color: #b02a5b; }

.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: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: saturate(180%) blur(12px);   /* iOS Safari ≤ 15 必须带前缀 */
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-line);
  /* 刘海屏 / 灵动岛：加入「添加到主屏幕」全屏运行时，避免内容钻进状态栏 */
  padding-top: env(safe-area-inset-top);
}
.topbar-inner { display: flex; align-items: center; gap: 14px; height: 58px; }
.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--c-brand-grad);
  color: #fff; font-size: 15px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; letter-spacing: -.5px; box-shadow: 0 4px 10px rgba(26, 111, 212, .3);
}
.brand-name { font-size: 17px; font-weight: 700; color: var(--c-text); white-space: nowrap; }

.topnav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; overflow: hidden; }
.topnav a {
  padding: 6px 12px; border-radius: 8px; font-size: 13.5px; color: var(--c-text-2); white-space: nowrap;
}
.topnav a:hover { background: var(--c-line-soft); color: var(--c-primary); }
.topnav a.is-active { background: #e6f1fe; color: var(--c-primary); font-weight: 600; }

.topbar-search { flex: 0 0 250px; display: flex; }
.topbar-search input {
  flex: 1; min-width: 0; height: 34px; padding: 0 12px; border: 1px solid var(--c-line);
  border-right: 0; border-radius: 9px 0 0 9px; background: #fbfcfe; outline: none; color: var(--c-text);
}
.topbar-search input:focus { border-color: var(--c-primary); background: #fff; }
.topbar-search button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 0 9px 9px 0; cursor: pointer;
  background: var(--c-brand-grad); color: #fff; font-weight: 600;
}

/* 首页头部：浮在天空背景上的极简透明条（不吸顶，让首屏成为一整块） */
.topbar--home {
  position: absolute; top: 0; left: 0; right: 0; z-index: 50;
  background: none; border-bottom: 0;
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.topbar--home .brand-name { color: #0d2f4c; }
.topbar--home .brand-mark { box-shadow: 0 5px 16px rgba(13, 47, 76, .24); }
.hometools { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.hometools a {
  padding: 6px 12px; border-radius: 999px; font-size: 13px; color: #2c5876; white-space: nowrap;
}
.hometools a:hover { background: rgba(255, 255, 255, .78); color: #0d2f4c; }

/* =============================================================
   2. 首屏天空背景（纯 CSS 渐变 + 云朵，无任何图片请求）
   ============================================================= */
.page-home { position: relative; background: var(--c-bg); }
.sky-media {
  position: absolute; top: 0; left: 0; right: 0; height: var(--sky-h);
  z-index: 0; pointer-events: none;
  background-color: #cfe8f8;
  background-image:
    /* 云朵：四团柔和的白色径向渐变，靠 background-position / size 摆位 */
    radial-gradient(closest-side, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0)),
    radial-gradient(closest-side, rgba(255, 255, 255, .82), rgba(255, 255, 255, 0)),
    radial-gradient(closest-side, rgba(255, 255, 255, .68), rgba(255, 255, 255, 0)),
    radial-gradient(closest-side, rgba(255, 255, 255, .52), rgba(255, 255, 255, 0)),
    /* 天空本体：由顶部蓝到内容区底色，末端与 --c-bg 完全衔接 */
    linear-gradient(180deg,
      #57b3e6 0%, #7fc9ee 15%, #a9dcf5 30%, #cfeafa 46%,
      #e6f4fc 62%, #f4f9fd 76%, #f4f7fb 88%, #f4f7fb 100%);
  background-repeat: no-repeat;
  background-position:
    76% 62px, 14% 130px, 58% 272px, 32% 402px,
    0 0;
  background-size:
    300px 138px, 230px 108px, 330px 152px, 250px 116px,
    100% 100%;
}
/* 天空之上的内容统一抬到 z-index 1 */
.page-home main, .page-home .footer, .page-home .topbar { position: relative; z-index: 1; }
.page-home .topbar--home { position: absolute; }

/* =============================================================
   3. 首屏内容：时钟 + 胶囊搜索 + 引擎直达
   ============================================================= */
.hero {
  margin: 22px 0 0; padding: 30px 20px 26px; text-align: center;
  background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: 20px; box-shadow: var(--c-shadow); position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c-brand-grad);
}
/* 首页 hero 去掉卡片外框，直接坐在天空上 */
.page-home .hero {
  margin: 14px 0 0; padding: 22px 0 30px;
  background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible;
}
.page-home .hero::before { display: none; }

.hero-date { font-size: 13px; color: var(--c-sub); letter-spacing: .5px; margin: 0; }
.page-home .hero-date { font-size: 13.5px; color: #2f5b7a; letter-spacing: 1px; }
.hero-clock {
  font-size: 46px; font-weight: 700; letter-spacing: 1px; line-height: 1.15;
  font-variant-numeric: tabular-nums; color: var(--c-text); margin: 2px 0 18px;
}
.hero-clock small { font-size: 20px; font-weight: 500; color: var(--c-sub); margin-left: 4px; }
/* 天空上的大时钟：深海军蓝 + 极淡白色描边，顶部浅蓝底上对比度约 7:1 */
.page-home .hero-clock {
  font-size: 74px; letter-spacing: 2px; margin: 0 0 20px; color: #0d2f4c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 10px 26px rgba(13, 47, 76, .16);
}
.page-home .hero-clock small { font-size: 26px; color: #3d6b8e; margin-left: 6px; }

/* --- 居中胶囊搜索框（左：站点标识 / 中：输入 / 右：放大镜） --- */
.search-form {
  display: flex; align-items: center; max-width: 720px; margin: 0 auto;
  background: #fff; border-radius: 999px; padding: 6px;
  box-shadow: 0 8px 28px rgba(20, 60, 100, .16), 0 0 0 1px rgba(20, 60, 100, .05);
}
.sf-lead {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding: 0 14px 0 8px; border-right: 1px solid var(--c-line);
}
.sf-mark {
  width: 32px; height: 32px; border-radius: 50%; background: var(--c-brand-grad);
  color: #fff; font-style: normal; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.sf-lead em { font-style: normal; font-size: 13.5px; color: var(--c-text-2); white-space: nowrap; }
.search-form input[type=text] {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; font-size: 16px;
  border: 0; background: transparent; outline: none; color: var(--c-text);
}
.search-form input[type=text]::placeholder { color: #9aa9b8; }
.sf-btn {
  flex: 0 0 auto; width: 56px; height: 46px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--c-brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(26, 111, 212, .28); transition: filter .18s;
}
.sf-btn:hover { filter: brightness(1.06); }

/* --- 引擎直达 --- */
.engine-links {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; margin: 16px auto 0; max-width: 780px;
}
.engine-links a {
  display: inline-flex; align-items: center; padding: 5px 14px; font-size: 12.5px;
  border: 1px solid rgba(255, 255, 255, .9); border-radius: 999px;
  color: #2c5876; background: rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.engine-links a:hover { background: #fff; color: var(--c-primary); border-color: #fff; }
.engine-links .eng-label { color: #3d6b8e; padding-left: 0; background: none; border: 0; }

.hero-h1 {
  margin-top: 20px; font-size: 16px; font-weight: 700; color: var(--c-text); letter-spacing: .2px;
}
.hero-h1 em { font-style: normal; color: var(--c-primary); }
.page-home .hero-h1 { color: #0d2f4c; font-size: 17px; }
.page-home .hero-h1 em { color: #0f6ab8; }
.hero-slogan { margin-top: 6px; font-size: 13px; color: var(--c-sub); }
.hero-slogan strong { color: var(--c-primary); font-weight: 600; }
.page-home .hero-slogan { color: #2f5b7a; }
.page-home .hero-slogan strong { color: #0d2f4c; }

/* 区块小标题（H2 层级） */
.section-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--c-sub); font-weight: 400; }

/* =============================================================
   4. 标签栏（本站只有 常用 / 资讯 两个）
   ============================================================= */
.cat-tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 22px 0 0; padding: 14px; background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--c-radius); box-shadow: var(--c-shadow);
}
.cat-tab {
  padding: 6px 15px; border-radius: 999px; font-size: 13.5px; color: var(--c-text-2);
  border: 1px solid transparent; background: var(--c-line-soft);
}
.cat-tab:hover { background: #e6f1fe; color: var(--c-primary); border-color: #cfe2fb; }
.cat-tab.is-active {
  background: var(--c-brand-grad); color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(26, 111, 212, .28);
}
/* 首页标签：去掉胶囊底，改为竞品同款「下划线高亮」 */
.page-home .cat-tabs {
  margin: 18px 0 0; padding: 0; gap: 30px;
  background: none; border: 0; border-radius: 0; box-shadow: none;
}
.page-home .cat-tab {
  position: relative; padding: 4px 2px; font-size: 16px; color: #3d6b8e;
  background: none; border: 0; border-radius: 0;
}
.page-home .cat-tab:hover { color: #0d2f4c; background: none; }
.page-home .cat-tab.is-active { color: #0d2f4c; font-weight: 700; background: none; box-shadow: none; }
.page-home .cat-tab.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 2px; background: var(--c-brand-grad);
}

/* =============================================================
   5. 图标宫格
   -------------------------------------------------------------
   列宽 106px：在 1240 宽的容器里正好排成 10 列（与竞品宫格一致），
   极窄机型用 min() 兜底，240px 屏也不会横向溢出
   ============================================================= */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));            /* 兜底 */
  grid-template-columns: repeat(auto-fill, minmax(min(106px, 100%), 1fr));
  gap: 6px; margin: 14px 0 0; padding: 16px; background: var(--c-card);
  border: 1px solid var(--c-line); border-radius: var(--c-radius); box-shadow: var(--c-shadow);
}
/* 首页宫格：半透明玻璃卡片，浮在天空上 */
.page-home .icon-grid {
  margin-top: 22px; padding: 18px 14px; gap: 4px;
  background: rgba(255, 255, 255, .52);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 20px;
  box-shadow: 0 14px 44px rgba(20, 60, 100, .12);
}
.icon-card {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 11px 6px 9px;
  border-radius: 12px; border: 1px solid transparent; transition: all .18s;
  min-width: 0;   /* 网格项默认 min-width:auto，会被 nowrap 的长站名撑破列宽 */
}
.icon-card:hover {
  background: #f5faff; border-color: #dbe7fb; transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(20, 50, 78, .08);
}
.page-home .icon-card { background: none; border-color: transparent; box-shadow: none; padding: 10px 4px 8px; }
.page-home .icon-card:hover {
  background: rgba(255, 255, 255, .9); border-color: rgba(255, 255, 255, .9);
  box-shadow: 0 8px 22px rgba(20, 60, 100, .12);
}
.icon-name {
  /* 图标宫格里的站名统一居中：站名长度差异大（「磁力猫」到「磁力熊猫 - 最懂你的磁力链接搜索引擎」），
     左对齐会让长名换行后右侧参差不齐，居中后整排观感整齐 */
  font-size: 11.5px; color: var(--c-text-2); text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 100%; min-height: 31px; line-height: 1.35;
  word-break: break-word; overflow-wrap: anywhere;
}
.icon-card:hover .icon-name { color: var(--c-primary); }
.page-home .icon-name { color: #2c5876; }
.page-home .icon-card:hover .icon-name { color: #0d2f4c; }

/* -------------------------------------------------------------
   文字小图：取名称首字（或数据里配置的 mark），做成品牌 App 图标观感
   正圆 + 饱和渐变底 + 白色粗字；尺寸/字号/底色由 PHP 的 icon_html() 内联输出
   ------------------------------------------------------------- */
.ico-char {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; font-weight: 700; line-height: 1;
  border-radius: 50%; color: #fff; font-family: inherit; letter-spacing: 0;
  box-shadow: 0 2px 6px rgba(20, 50, 78, .18);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  text-align: center; user-select: none; -webkit-user-select: none;
  background-repeat: no-repeat;
}
/* 容器内是文字小图时去掉浅色底与外框，避免「方框套圆」的割裂感 */
.lcard-icon:has(.ico-char) { background: transparent; border-color: transparent; }
.icon-card:hover .ico-char {
  box-shadow: 0 5px 14px rgba(20, 50, 78, .28); transform: translateY(-1px);
}

/* =============================================================
   6. 信息条 / 通用区块
   ============================================================= */
.notice-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 16px 0 0; padding: 11px 16px; font-size: 13px; color: var(--c-text-2);
  background: linear-gradient(90deg, #eef7fe 0%, #eff4ff 100%);
  border: 1px solid #daeaf8; border-radius: var(--c-radius-sm);
}
.notice-bar .nb-left { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.notice-bar b { color: var(--c-primary); font-weight: 700; }
.notice-bar a { color: var(--c-primary); }
.notice-bar a:hover { text-decoration: underline; }

.section {
  margin: 16px 0 0; padding: 18px 18px 8px; background: var(--c-card);
  border: 1px solid var(--c-line); border-radius: var(--c-radius); box-shadow: var(--c-shadow);
}
.section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--c-line-soft);
}
.section-title { font-size: 16px; color: var(--c-text); display: flex; align-items: center; gap: 8px; }
.section-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--c-brand-grad);
}
.section-more { font-size: 13px; color: var(--c-sub); }
.section-more:hover { color: var(--c-primary); }

/* =============================================================
   7. 列表 / 文章条目 / 详情
   ============================================================= */
.crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 18px 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: #cbd5e1; }
.crumb-cur { color: var(--c-text-2); font-weight: 600; }

.page-head { margin: 16px 0 0; }
.page-head h1 { font-size: 22px; color: var(--c-text); }
.page-head .ph-desc { margin-top: 8px; font-size: 13.5px; color: var(--c-sub); line-height: 1.75; }
.page-head .ph-meta { margin-top: 8px; font-size: 12.5px; color: var(--c-sub); }

.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; margin-top: 14px;
}
.lcard {
  display: flex; gap: 11px; padding: 13px; background: var(--c-card);
  border: 1px solid var(--c-line); border-radius: var(--c-radius-sm);
  box-shadow: 0 1px 2px rgba(20, 50, 78, .03); transition: all .18s;
}
.lcard:hover { border-color: #cfe2fb; box-shadow: var(--c-shadow-hov); transform: translateY(-2px); }
.lcard-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: #f2f6fd;
  border: 1px solid var(--c-line-soft); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.lcard-icon img { width: 24px; height: 24px; object-fit: contain; }
.lcard-main { min-width: 0; flex: 1; }
.lcard-name { font-size: 14px; font-weight: 600; color: var(--c-text); display: block; }
.lcard:hover .lcard-name { color: var(--c-primary); }
.lcard-desc {
  margin-top: 3px; font-size: 12.5px; color: var(--c-sub); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lcard-cat { margin-top: 6px; font-size: 11.5px; color: var(--c-primary); }

.art-item {
  display: block; padding: 16px 18px; background: var(--c-card); border: 1px solid var(--c-line);
  border-radius: var(--c-radius-sm); margin-top: 12px; box-shadow: 0 1px 2px rgba(20, 50, 78, .03);
  transition: all .18s;
}
.art-item:hover { border-color: #cfe2fb; box-shadow: var(--c-shadow-hov); }
.art-item h2, .art-item h3 { color: var(--c-text); margin-bottom: 6px; }
.art-item:hover h2, .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 8px; border-radius: 999px; background: #eaf3ff; color: var(--c-primary); }
.art-cat:hover { background: #dcebff; color: var(--c-primary); }

/* 首页「最新资讯」条目（复用 a-item 体系） */
.a-item { display: block; padding: 10px 0; border-bottom: 1px dashed var(--c-line); }
.a-item:last-child { border-bottom: 0; }
.a-item-title {
  font-size: 14px; font-weight: 600; color: var(--c-text); line-height: 1.5;
  display: block; margin-bottom: 3px;
}
.a-item:hover .a-item-title { color: var(--c-primary); }
.a-item-desc {
  font-size: 12.5px; color: var(--c-sub); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.a-item-meta { margin-top: 5px; font-size: 11.5px; color: var(--c-sub); display: flex; gap: 10px; }

.tag {
  display: inline-block; padding: 3px 10px; margin: 0 6px 6px 0; font-size: 12px;
  border-radius: 999px; background: var(--c-line-soft); color: var(--c-text-2); border: 1px solid var(--c-line);
}
.tag:hover { background: #e6f1fe; color: var(--c-primary); border-color: #cfe2fb; }
.tag-list { margin-top: 12px; }

/* 详情页 */
.detail {
  margin-top: 16px; 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: 23px; line-height: 1.5; color: var(--c-text); }
.detail-meta {
  margin-top: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--c-line-soft);
  display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--c-sub);
}
.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 pre { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 12px 14px; background: #f5f8fc; border-radius: 10px; font-size: 13px; }
.detail-body a { overflow-wrap: anywhere; }

/* 磁力占位框 */
.magnet-box {
  margin-top: 18px; padding: 15px 16px; background: #f5faff;
  border: 1px dashed #b9d6f7; border-radius: var(--c-radius-sm);
}
.magnet-box .mb-title { font-size: 13px; font-weight: 700; color: var(--c-primary); margin-bottom: 8px; }
.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: var(--c-text-2); word-break: break-all; line-height: 1.6;
}
.magnet-box .mb-tip { margin-top: 8px; font-size: 12px; color: var(--c-sub); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 22px; border-radius: 10px;
  background: var(--c-brand-grad); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 16px rgba(26, 111, 212, .26); border: 0; cursor: pointer;
}
.btn:hover { color: #fff; filter: brightness(1.06); }
.btn--ghost { background: #fff; color: var(--c-primary); border: 1px solid var(--c-line); box-shadow: none; }
.btn--ghost:hover { color: var(--c-primary); border-color: var(--c-primary); }

/* =============================================================
   8. 分页（PHP 直出）
   ============================================================= */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 22px 0 6px; justify-content: center;
}
.pg-btn {
  min-width: 34px; padding: 6px 11px; text-align: center; font-size: 13px;
  border: 1px solid var(--c-line); border-radius: 8px; background: #fff; color: var(--c-text-2);
}
.pg-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pg-btn.is-active { background: var(--c-brand-grad); border-color: transparent; color: #fff; font-weight: 700; }
.pg-btn.is-disabled { color: #c3ccda; background: #fafbfd; 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); }

/* =============================================================
   9. 空状态 / 页脚
   ============================================================= */
.empty {
  padding: 46px 20px; text-align: center; color: var(--c-sub); font-size: 14px;
  background: var(--c-card); border: 1px dashed var(--c-line); border-radius: var(--c-radius); margin-top: 14px;
}

.footer {
  margin: 28px 0 0; padding: 26px 0 34px; border-top: 1px solid var(--c-line);
  background: rgba(255, 255, 255, .66); font-size: 12.5px; color: var(--c-sub); text-align: center;
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-bottom: 12px; }
.footer-links a { color: var(--c-text-2); font-size: 13px; }
.footer-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.footer p { margin: 5px 0; line-height: 1.8; }

/* =============================================================
   10. 后台管理
   ============================================================= */
.adm { display: flex; min-height: 100vh; min-height: 100dvh; background: #f4f7fb; }
.adm-side {
  flex: 0 0 190px; background: #10263d; color: #cbd8e8; padding: 18px 0;
}
.adm-side .as-brand { padding: 0 18px 16px; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid #1d3a58; margin-bottom: 12px; }
.adm-side a { display: block; padding: 10px 18px; color: #a9bcd2; font-size: 13.5px; }
.adm-side a:hover { background: #17324f; color: #fff; }
.adm-side a.is-active { background: #1a6fd4; color: #fff; font-weight: 600; }
.adm-main { flex: 1; 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; }
.adm-panel { background: #fff; border: 1px solid var(--c-line); border-radius: var(--c-radius); padding: 20px; box-shadow: var(--c-shadow); margin-bottom: 18px; }
.adm-panel h2 { font-size: 15px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--c-line-soft); }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; color: var(--c-text-2); margin-bottom: 5px; }
.form-row .hint { font-size: 12px; color: var(--c-sub); font-weight: 400; margin-left: 6px; }
.inp, .sel, .txa {
  width: 100%; padding: 8px 11px; border: 1px solid var(--c-line); border-radius: 8px;
  background: #fbfcfe; 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; gap: 10px; align-items: center; padding-top: 8px; }

.btn-adm {
  display: inline-block; padding: 8px 18px; border: 0; border-radius: 8px; cursor: pointer;
  background: var(--c-brand-grad); color: #fff; font-size: 13.5px; font-weight: 600;
}
.btn-adm:hover { color: #fff; filter: brightness(1.06); }
.btn-adm--gray { background: #eef2f8; color: var(--c-text-2); }
.btn-adm--gray:hover { color: var(--c-text); }
.btn-adm--danger { background: #fee2e2; color: #b91c1c; }
.btn-adm--sm { padding: 4px 10px; 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: #d5dfec; 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; }
.tbl th { background: #f7fafd; font-weight: 600; color: var(--c-text-2); white-space: nowrap; }
.tbl tr:hover td { background: #fbfdff; }
.tbl .col-act { white-space: nowrap; }
.tbl .col-act a { margin-right: 8px; font-size: 12.5px; }

.alert { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 16px; }
.alert--ok  { background: #e7f8f0; color: #12704a; border: 1px solid #bfe8d4; }
.alert--err { background: #fdecec; color: #b91c1c; border: 1px solid #f6c9c9; }

.login-wrap { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eaf3fd, #f7fbfd); padding: 20px; }
/* 固定 340px 在 320px 机型上会横向溢出，改成「不超过容器」；
   用 width+max-width 而非 min()，老内核同样生效 */
.login-box { width: 340px; max-width: 100%; padding: 30px 26px; background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(20, 50, 78, .12); }
.login-box h1 { font-size: 18px; margin-bottom: 20px; text-align: center; }

/* =============================================================
   11. 响应式 / 多机型适配
   -------------------------------------------------------------
   断点梯度（桌面优先，由宽到窄逐级覆盖）：
     ≥1600   2K / 4K 显示器            —— 版面加宽 + 天空加高
     1280+   常规台式机                 —— 默认样式（宫格 10 列）
     1279    小笔记本 / 平板横屏        —— 导航改横向滑动
     1024    iPad / iPad Pro           —— 宫格降档、天空降档
     900     小平板 / 大屏手机横屏      —— 顶部栏改两行
     640     主流手机（iPhone 12-16 / 大部分安卓）
     480     小屏手机（iPhone SE / 老安卓）
     375     极窄屏（iPhone SE1 / 小屏安卓）
     340     超窄屏（小屏安卓分屏）
     300     折叠机外屏（Galaxy Fold 280px）
   另含：手机横屏矮屏兜底 / 触摸设备 / 减弱动态效果偏好
   ============================================================= */

/* ---------------- 2K 及以上：加宽版面，避免两侧过空 ---------------- */
@media (min-width: 1600px) {
  :root { --wrap: 1400px; --sky-h: 900px; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); }
  .lgrid     { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
  .page-home .hero-clock { font-size: 84px; }
  .page-home .hero-clock small { font-size: 30px; }
  .page-home .search-form { max-width: 800px; }
}

/* ---------------- 小笔记本 / 平板横屏 ---------------- */
@media (max-width: 1279px) {
  .topbar-search { flex: 0 0 210px; }
  .icon-grid { gap: 4px; padding: 14px 12px; }
  /* 导航项放不下时改为横向滑动，避免链接被 overflow:hidden 直接裁掉（不可达） */
  .topnav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 6px 10px; }
  .page-home .hero-clock { font-size: 64px; }
}

/* ---------------- 平板（iPad 横竖屏 / iPad Pro） ---------------- */
@media (max-width: 1024px) {
  :root { --sky-h: 800px; }
  .topbar-search { flex: 0 0 200px; }
  .adm-side { flex: 0 0 172px; }
  .lgrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(min(100px, 100%), 1fr)); }
  .hero-clock { font-size: 42px; }
  .page-home .hero-clock { font-size: 58px; }
  .page-home .hero-clock small { font-size: 22px; }
  .page-home .cat-tabs { gap: 24px; }
}

/* ---------------- 小平板 / 大屏手机横屏：顶部栏改为两行 ---------------- */
@media (max-width: 900px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 9px 0; gap: 9px; }
  .topnav { order: 3; flex: 1 1 100%; padding-bottom: 2px; }
  .topbar-search { flex: 1 1 180px; min-width: 0; }
  .detail { padding: 20px 18px; }
  .page-home .hero-clock { font-size: 52px; }
}

/* ---------------- 主流手机（iPhone 12-16 / 大部分安卓 360-430px） ---------------- */
@media (max-width: 640px) {
  :root { --sky-h: 700px; }
  .container {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  /* --- 顶部栏 --- */
  .topbar-inner { padding: 8px 0; gap: 8px; }
  .brand { gap: 7px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; }
  .brand-name { font-size: 16px; }
  .topnav a { padding: 8px 11px; font-size: 13px; }   /* 触控区 ≥ 36px */
  .topbar-search { flex: 1 1 140px; min-width: 0; }
  /* 关键：输入框字号 < 16px 时 iOS Safari 聚焦会自动放大整页，这里强制 16px */
  .topbar-search input { height: 38px; font-size: 16px; padding: 0 10px; }
  .topbar-search button { height: 38px; padding: 0 15px; font-size: 13.5px; }
  .page-home .topbar-inner { padding: 6px 0; height: auto; flex-wrap: nowrap; }
  .hometools a { padding: 6px 9px; font-size: 12.5px; }

  /* --- 首屏 --- */
  .hero { margin-top: 16px; padding: 22px 14px 20px; border-radius: 16px; }
  .hero-date { font-size: 12px; }
  .hero-clock { font-size: 32px; margin-bottom: 14px; }
  .hero-clock small { font-size: 15px; }
  .page-home .hero { margin-top: 8px; padding: 14px 0 22px; }
  .page-home .hero-date { font-size: 12.5px; }
  .page-home .hero-clock { font-size: 44px; margin-bottom: 16px; }
  .page-home .hero-clock small { font-size: 17px; }
  .page-home .search-form { padding: 5px; }
  .search-form input[type=text] { height: 42px; font-size: 16px; padding: 0 11px; }
  .sf-btn { width: 48px; height: 42px; }
  .sf-mark { width: 28px; height: 28px; font-size: 13.5px; }
  .sf-lead { padding: 0 10px 0 5px; gap: 6px; }
  .sf-lead em { font-size: 12.5px; }
  .engine-links { gap: 6px; margin-top: 13px; }
  .engine-links a { padding: 5px 11px; font-size: 12px; }
  .hero-h1 { font-size: 15px; margin-top: 16px; }
  .hero-slogan { font-size: 12.5px; }
  .page-home .hero-h1 { font-size: 15px; }
  .page-home .cat-tabs { margin-top: 16px; gap: 26px; }
  .page-home .cat-tab { font-size: 15px; padding: 6px 2px; }

  /* --- 图标宫格 --- */
  .icon-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(76px, 100%), 1fr));
    gap: 4px; padding: 12px 10px; margin-top: 12px;
  }
  .icon-card { padding: 8px 3px 6px; gap: 6px; }
  .icon-name { font-size: 11px; min-height: 29px; text-align: center; }
  .page-home .icon-grid { margin-top: 16px; padding: 12px 8px; border-radius: 16px; }
  .page-home .icon-card { padding: 8px 3px; }

  /* --- 信息条 --- */
  .notice-bar {
    margin-top: 12px; padding: 10px 13px; font-size: 12.5px;
    flex-direction: column; align-items: flex-start; gap: 6px;
  }
  .notice-bar .nb-left { gap: 10px; }

  /* --- 区块 --- */
  .section { margin-top: 12px; padding: 15px 13px 5px; }
  .section-head { padding-bottom: 10px; gap: 8px; }
  .section-title { font-size: 15px; }
  .section-more { font-size: 12px; white-space: nowrap; }

  /* --- 列表 / 详情 --- */
  .crumb { margin-top: 14px; font-size: 12.5px; }
  .page-head h1 { font-size: 19px; }
  .page-head .ph-desc { font-size: 13px; }
  .lgrid { grid-template-columns: 1fr; gap: 10px; }
  .lcard { padding: 12px; }
  .art-item { padding: 14px; margin-top: 10px; }
  .art-item h2, .art-item h3 { font-size: 15px; }
  .detail { padding: 18px 14px; margin-top: 12px; }
  .detail h1 { font-size: 19px; }
  .detail-body { font-size: 15px; line-height: 1.9; }
  .detail-body h2 { font-size: 17px; }
  .detail-body h3 { font-size: 16px; }
  .magnet-box { padding: 13px 12px; }
  .magnet-box .mb-value { font-size: 12px; padding: 9px 10px; }
  .btn { padding: 10px 20px; }

  /* --- 分页：加大点击区 --- */
  .pager { gap: 6px; margin: 18px 0 6px; }
  .pg-btn { min-width: 38px; padding: 8px 11px; font-size: 13px; }
  .pg-info { flex: 1 1 100%; text-align: center; margin: 6px 0 0; }

  /* --- 页脚 --- */
  .footer { margin-top: 22px; padding: 20px 0 calc(24px + env(safe-area-inset-bottom)); }
  .footer-links { gap: 8px 14px; }
  .footer-links a { font-size: 12.5px; }
  .footer-tags { gap: 6px; }

  /* --- 后台 --- */
  .adm { flex-direction: column; min-height: 100vh; min-height: 100dvh; }
  .adm-side {
    flex: none; display: flex; overflow-x: auto; padding: 8px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    position: sticky; top: 0; z-index: 20;
  }
  .adm-side::-webkit-scrollbar { display: none; }
  .adm-side .as-brand { display: none; }
  .adm-side a { white-space: nowrap; padding: 10px 14px; border-radius: 8px; }
  .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 横向滑动查看（概览那张 4 列小表不加，避免无谓滚动） */
  .tbl-wrap .tbl { min-width: 600px; }
}

/* ---------------- 小屏手机（iPhone SE / 6-8 / 老安卓 320-480px） ---------------- */
@media (max-width: 480px) {
  :root { --sky-h: 640px; }
  .hero { padding: 18px 12px; }
  .hero-clock { font-size: 29px; }
  .page-home .hero-clock { font-size: 38px; }
  .page-home .hero-clock small { font-size: 15px; }
  /* 搜索框：藏掉左侧文字只留站标，保证胶囊仍是一行 */
  .sf-lead em { display: none; }
  .sf-lead { padding: 0 9px 0 5px; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(min(72px, 100%), 1fr)); }
  .icon-name { font-size: 10.5px; }
  .notice-bar .nb-left { flex-direction: column; align-items: flex-start; gap: 4px; }
  .section-title { font-size: 14.5px; }
  .detail-body { font-size: 14.5px; }
  .magnet-box .mb-value { font-size: 11.5px; }
  .pg-btn { min-width: 36px; padding: 8px 10px; }
}

/* ---------------- 极窄屏（iPhone SE 第一代 320px / 小屏安卓） ---------------- */
@media (max-width: 375px) {
  :root { --sky-h: 600px; }
  .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .brand-name { font-size: 15px; }
  .topbar-search button { padding: 0 12px; }
  .hero-clock { font-size: 26px; }
  .hero-clock small { font-size: 13px; }
  .page-home .hero-clock { font-size: 33px; }
  .hero-h1 { font-size: 14px; line-height: 1.5; }
  .cat-tab { padding: 7px 12px; font-size: 12.5px; }
  .page-home .cat-tab { padding: 6px 2px; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(min(66px, 100%), 1fr)); gap: 3px; padding: 10px 7px; }
  .icon-name { font-size: 10px; }
  .pg-btn { min-width: 34px; padding: 7px 9px; font-size: 12.5px; }
}

/* ---------------- 超窄屏（小屏安卓分屏 / 折叠机内屏窄态） ---------------- */
@media (max-width: 340px) {
  .brand-name { font-size: 14px; }
  .hero { padding: 16px 10px; border-radius: 14px; }
  .hero-clock { font-size: 24px; }
  .hero-h1 { font-size: 13.5px; }
  .hero-slogan { font-size: 12px; }
  .engine-links a { padding: 4px 9px; font-size: 11.5px; }
  /* 极窄时固定 4 列，避免 auto-fill 算出过小的格子 */
  .icon-grid { grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 10px 6px; }
  .page-home .icon-grid { padding: 10px 6px; }
  .icon-name { font-size: 10px; min-height: 27px; }
  .section { padding: 13px 10px 4px; }
  .magnet-box .mb-value { font-size: 11px; }
  .pg-gap { display: none; }                          /* 极窄时省略页码省略号，优先保证按钮可点 */
}

/* ---------------- 折叠机外屏（Galaxy Fold 280px 等） ---------------- */
@media (max-width: 300px) {
  :root { --sky-h: 560px; }
  .brand-name { display: none; }                      /* 只留站标，把宽度让给导航 */
  .hometools a { padding: 6px 7px; font-size: 12px; }
  .page-home .hero-clock { font-size: 28px; }
  .sf-lead { display: none; }                         /* 极窄时连站标一起收掉，只留输入与放大镜 */
  .icon-grid { grid-template-columns: repeat(3, 1fr); }
  .pg-info { font-size: 11.5px; }
}

/* ---------------- 手机横屏 / 矮屏：压缩纵向高度，让首屏信息量最大化 ---------------- */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar-inner { padding: 6px 0; gap: 6px; }
  .hero { margin-top: 12px; padding: 14px 16px; }
  .hero-clock { font-size: 28px; margin: 0 0 10px; }
  .page-home .hero-date, .page-home .hero-slogan { display: none; }
  .page-home .hero { padding: 10px 0 16px; }
  .page-home .hero-clock { font-size: 34px; margin-bottom: 12px; }
  .hero-h1 { margin-top: 10px; font-size: 14px; }
  .engine-links { margin-top: 8px; }
  .cat-tabs { margin-top: 12px; }
  .page-home .cat-tabs { margin-top: 12px; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(min(84px, 100%), 1fr)); }
}

/* ---------------- 触摸设备：关闭依赖 hover 的位移，避免「点完状态卡住」 ---------------- */
@media (hover: none) and (pointer: coarse) {
  html { scroll-behavior: auto; }
  .icon-card:hover { transform: none; }
  .icon-card:hover .ico-char { transform: none; }
  .lcard:hover { transform: none; }
  .btn:active, .btn-adm:active, .pg-btn:active, .cat-tab:active { filter: brightness(.94); }
}

/* ---------------- 尊重系统「减弱动态效果」偏好 ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
