@charset "UTF-8";
/* =============================================================
   流星雨磁力  ——  站点样式
   页面骨架:
     · 白色品牌顶栏（Logo + 分类导航）
     · 居中搜索框 + 磁力 / 百度 / 必应 引擎切换标签
     · 三列分组目录：每组「主分类 · 子分类」标题 + 3×3 链接方块
     · 极简居中页脚
   差异化改版（与参考站 btclmao.com 的区别）:
     · 参考站用靛蓝紫(#667eea→#764ba2) + 冷灰底 + 2px 直角白块；
       本站改用珊瑚橙暖色体系 + 暖灰底 + 8px 圆角卡片，
       悬浮态由「深灰底反白」换成品牌渐变 + 轻微上浮，
       配色、圆角、悬浮反馈三处均不同，避免与参考站撞脸。
     · 版面宽度、分组列数、方块行高、标题层级与参考站保持一致，
       保证同为「hao123 式导航目录」的观感与信息密度。
   移动端优先，纯 CSS 实现，列表内容全部由 PHP 直出，不依赖 JS。
   ============================================================= */

/* ---------------- 设计变量 ---------------- */
:root {
  /* 声明为固定浅色主题：避免 Android Chrome / 微信内核对页面做「强制深色」反转 */
  color-scheme: light;

  --c-bg:        #f6f5f3;
  --c-bg-2:      #f1efec;
  --c-card:      #ffffff;
  --c-line:      #e9e5e0;
  --c-line-soft: #f4f1ed;
  --c-text:      #2f3439;
  --c-text-2:    #5c6470;
  --c-sub:       #949aa2;
  --c-primary:   #ef5f37;
  --c-primary-2: #f89b2e;
  --c-brand-grad: linear-gradient(135deg, #ef5f37 0%, #f89b2e 100%);
  --c-tint:      #fff3ec;
  --c-tint-2:    #fffaf6;
  --c-warm:      #c8501f;
  --c-radius:    12px;
  --c-radius-sm: 8px;
  /* 目录页方块是主角，阴影只做极轻的浮起暗示，避免整页发脏 */
  --c-shadow:    0 1px 2px rgba(90, 70, 55, .05), 0 6px 18px rgba(90, 70, 55, .05);
  --c-shadow-hov:0 3px 8px rgba(90, 70, 55, .08), 0 14px 30px rgba(90, 70, 55, .10);
  --wrap:        1100px;
}

/* ---------------- 基础重置 ---------------- */
*, *::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);
  /* 内容不足时把页脚压到视口底部（与参考站一致） */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}
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: var(--c-tint); padding: 1px 5px; border-radius: 4px; font-size: 13px; color: #b8451f; }

.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: #fff;
  border-bottom: 1px solid var(--c-line);
  box-shadow: 0 1px 3px rgba(90, 70, 55, .04);
  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: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--c-brand-grad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(239, 95, 55, .26);
}
.brand-mark svg { display: block; }
/* 品牌文字用品牌渐变裁切，和参考站的渐变字处理一致但色相完全不同 */
.brand-name {
  font-size: 20px; font-weight: 700; color: var(--c-text); white-space: nowrap;
  background: var(--c-brand-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* min-width:0 必须显式给：flex 项默认 min-width:auto，导航文字又是 nowrap，
   280px 折叠外屏上会撑破容器（实测 280 / 320 各溢出 1-2 个链接） */
.topnav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; justify-content: flex-end; overflow: hidden; }
.topnav a {
  padding: 6px 11px; border-radius: 999px; font-size: 13px; color: var(--c-text-2); white-space: nowrap;
}
.topnav a:hover { background: var(--c-tint); color: var(--c-primary); }
.topnav a.is-active { background: var(--c-tint); color: var(--c-warm); font-weight: 600; }

/* =============================================================
   2. 首页搜索区（居中、轻量）
   ============================================================= */
.main-wrap { padding-top: 28px; padding-bottom: 50px; flex: 1 0 auto; }

.search-card {
  background: transparent; text-align: center;
  max-width: 640px; margin: 0 auto;
}
/* 参考站是「白底描边输入条 + 右侧图标按钮」，这里保留结构、换成 10px 圆角与暖色聚焦环 */
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--c-line); border-radius: 10px;
  padding: 4px 6px 4px 12px; background: #fff;
  box-shadow: 0 2px 10px rgba(90, 70, 55, .05);
  transition: border-color .2s, box-shadow .2s;
}
.search-input-wrap:focus-within {
  border-color: rgba(239, 95, 55, .55);
  box-shadow: 0 0 0 4px rgba(239, 95, 55, .10);
}
.search-icon { flex: none; width: 26px; height: 26px; display: inline-flex; }
.search-input {
  flex: 1 1 auto; min-width: 0; border: 0; outline: 0; font-size: 15px;
  color: var(--c-text); height: 40px; padding: 0 4px; background: transparent;
}
.search-input::placeholder { color: #aab0b8; }
.search-btn {
  flex: none; border: 0; border-radius: 8px; background: transparent; color: #aab0b8;
  width: 40px; height: 40px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s;
}
.search-btn:hover { color: var(--c-primary); background: var(--c-tint-2); }

.search-tab { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.tab {
  font-size: 13px; padding: 5px 15px; border-radius: 999px;
  background: #edeae6; color: var(--c-sub); cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s;
  user-select: none; -webkit-user-select: none;
}
.tab:hover { color: var(--c-primary); }
.tab.active {
  background: var(--c-brand-grad); color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(239, 95, 55, .26);
}

/* 首页 H1 + 站点定位描述（参考站无 H1，这里补上以规范层级并承载关键词） */
.home-h1 { margin-top: 22px; font-size: 17px; font-weight: 700; letter-spacing: .2px; text-align: center; }
.home-sub {
  max-width: 780px; margin: 6px auto 0; font-size: 13px; color: var(--c-sub);
  line-height: 1.8; text-align: center;
}

/* =============================================================
   3. 三列分组目录（首页主体）
   ============================================================= */
.nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px 30px;
  margin-top: 26px;
}
.link-group { min-width: 0; }

/* 分组标题：「主分类 · 子分类」，30px 下方右对齐可放「更多 >」 */
.lg-title {
  display: flex; align-items: baseline; min-width: 0;
  margin: 0 0 6px; padding: 0 3px;
  font-size: 12.5px; font-weight: 400; color: #b3b7bd;
}
.lg-title .lt-main { color: #9aa0a8; }
.lg-title .lt-main::after { content: "·"; margin: 0 5px; color: #d7dadf; }
.lg-title .lt-sub { color: #b3b7bd; }
.lg-title .lt-more { margin-left: auto; font-size: 12.5px; color: #b3b7bd; white-space: nowrap; }
.lg-title .lt-more:hover { color: var(--c-primary); }

.lg-list {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.lg-list > li { min-width: 0; padding: 0 3px; }
/* 链接方块：白底、44px 行高、居中省略号；悬浮换成品牌渐变（参考站是深灰反白） */
.lg-item {
  display: block; background: #fff;
  margin-bottom: 10px; padding: 0 8px; line-height: 44px;
  border-radius: var(--c-radius-sm);
  font-size: 13.5px; color: #5c6470; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .22s ease, color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.lg-item:hover {
  background: var(--c-brand-grad); color: #fff; font-weight: 600;
  transform: translateY(-1px); box-shadow: 0 6px 14px rgba(239, 95, 55, .28);
}

/* =============================================================
   4. 内页通用：面包屑 / 页头 / 区块
   ============================================================= */
.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: #d9d5cf; }
.crumb-cur { color: var(--c-text-2); font-weight: 600; }

.page-head {
  margin: 14px 0 0; padding: 20px; background: #fff;
  border: 1px solid var(--c-line); border-radius: var(--c-radius); box-shadow: var(--c-shadow);
}
.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); }
.page-head .ph-meta b { color: var(--c-primary); }

.section {
  margin: 16px 0 0; padding: 18px 18px 6px; 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;
  margin: -18px -18px 12px; padding: 12px 18px;
  background: var(--c-tint-2);
  border-bottom: 1px solid var(--c-line);
  border-radius: var(--c-radius) var(--c-radius) 0 0;
}
.section-title { font-size: 16px; color: var(--c-text); display: flex; align-items: center; gap: 8px; }
.section-title::before {
  content: ""; width: 6px; height: 18px; border-radius: 3px; background: var(--c-brand-grad);
}
.section-more { font-size: 13px; color: var(--c-sub); white-space: nowrap; }
.section-more:hover { color: var(--c-primary); }
.section-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--c-sub); font-weight: 400; }

/* 无图标时的「文字小图」：取名称首字做成 App 图标观感，尺寸由 PHP 内联输出 */
.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(24, 39, 75, .18);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  text-align: center; user-select: none; -webkit-user-select: none;
}
/* 容器内是文字小图时去掉浅色底与外框，避免「方框套圆」的割裂感 */
.lcard-icon:has(.ico-char) { background: transparent; border-color: transparent; }

/* =============================================================
   5. 列表卡片 / 文章 / 详情
   ============================================================= */
.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(90, 70, 55, .03); transition: border-color .18s, box-shadow .18s, transform .18s;
}
.lcard:hover { border-color: #f5cdba; box-shadow: var(--c-shadow-hov); transform: translateY(-2px); }
.lcard-icon {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; background: var(--c-tint);
  border: 1px solid #fae3d5; 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-warm); }

.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(90, 70, 55, .03);
  transition: border-color .18s, box-shadow .18s;
}
.art-item:hover { border-color: #f5cdba; box-shadow: var(--c-shadow-hov); }
.art-item h3 { font-size: 16px; color: var(--c-text); margin-bottom: 6px; }
.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: var(--c-tint); color: #b8451f; }

.tag {
  display: inline-block; padding: 3px 10px; margin: 0 6px 6px 0; font-size: 12px;
  border-radius: 999px; background: #fff; color: var(--c-text-2); border: 1px solid var(--c-line);
}
.tag:hover { background: var(--c-tint); color: var(--c-primary); border-color: #f8d2be; }
.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 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: #faf7f4; border-radius: 10px; font-size: 13px; }
.detail-body a { overflow-wrap: anywhere; }

.magnet-box {
  margin-top: 18px; padding: 15px 16px; background: var(--c-tint-2);
  border: 1px dashed #f2c7ac; border-radius: var(--c-radius-sm);
}
.magnet-box .mb-title { font-size: 13px; font-weight: 700; color: #b8451f; 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: 999px;
  background: var(--c-brand-grad); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 18px rgba(239, 95, 55, .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); }

/* =============================================================
   6. 分页（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: #d5d1cb; background: #fbfaf9; 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); }

/* =============================================================
   7. 空状态 / 页脚
   ============================================================= */
.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-top: auto; padding: 22px 0 calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-line); background: #fff;
  font-size: 13px; color: var(--c-sub); text-align: center;
}
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-bottom: 10px;
  padding-bottom: 12px; border-bottom: 1px dashed var(--c-line-soft);
}
.footer-links a { color: var(--c-text-2); font-size: 12.5px; }
.footer-links a:hover { color: var(--c-primary); }
.footer-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
.footer p { margin: 4px 0; line-height: 1.7; }

/* =============================================================
   8. 后台管理
   ============================================================= */
.adm { display: flex; min-height: 100vh; min-height: 100dvh; background: var(--c-bg); }
.adm-side {
  flex: 0 0 190px; background: #2b2e33; color: #d3d6da; padding: 18px 0;
}
.adm-side .as-brand { padding: 0 18px 16px; font-size: 16px; font-weight: 700; color: #fff; border-bottom: 1px solid #3d4148; margin-bottom: 12px; }
.adm-side a { display: block; padding: 10px 18px; color: #adb2b9; font-size: 13.5px; }
.adm-side a:hover { background: #363a41; color: #fff; }
.adm-side a.is-active { background: var(--c-primary); 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: #fff; outline: none; color: var(--c-text);
}
.inp:focus, .sel:focus, .txa:focus { border-color: var(--c-primary); }
.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: #f0eeeb; 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: #ddd9d3; 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: #faf9f7; font-weight: 600; color: var(--c-text-2); white-space: nowrap; }
.tbl tr:hover td { background: #fdfcfb; }
.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: var(--c-bg-2); 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(90, 70, 55, .14); }
.login-box h1 { font-size: 18px; margin-bottom: 20px; text-align: center; }

/* =============================================================
   9. 响应式 / 多机型适配
   -------------------------------------------------------------
   断点梯度（桌面优先，由宽到窄逐级覆盖）：
     ≥1600   2K / 4K 显示器            —— 版面加宽
     1280+   常规台式机                 —— 默认样式（3 列分组）
     980     小笔记本 / 平板横屏        —— 分组改 2 列，格子才够宽放站名
     760     小平板 / 大屏手机横屏      —— 顶部栏改两行
     620     主流手机                   —— 分组改 1 列（一行 3 个方块）
     480     小屏手机
     375     极窄屏（iPhone SE1）
     340     超窄屏（小屏安卓分屏）
     300     折叠机外屏（Galaxy Fold 280px）
   另含：手机横屏矮屏兜底 / 触摸设备 / 减弱动态效果偏好
   ============================================================= */

/* ---------------- 2K 及以上：加宽版面，避免两侧过空 ---------------- */
@media (min-width: 1600px) {
  :root { --wrap: 1320px; }
  .nav-grid { gap: 40px 34px; }
  .lg-item  { line-height: 46px; }
  .lgrid    { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
}

/* ---------------- 小笔记本 / 平板横屏 ---------------- */
@media (max-width: 1279px) {
  .topnav { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { padding: 6px 9px; }
}

/* ---------------- 平板 / 窄桌面：分组 2 列 ---------------- */
@media (max-width: 980px) {
  .nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 22px; }
  .adm-side { flex: 0 0 172px; }
  .lgrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ---------------- 小平板 / 大屏手机横屏：顶部栏改为两行 ---------------- */
@media (max-width: 760px) {
  .topbar-inner { height: auto; flex-wrap: wrap; padding: 9px 0; gap: 9px; }
  .topnav { order: 3; flex: 1 1 100%; justify-content: flex-start; padding-bottom: 2px; }
  .detail { padding: 20px 18px; }
}

/* ---------------- 主流手机（iPhone 12-16 / 大部分安卓 360-430px） ---------------- */
@media (max-width: 640px) {
  .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: 8px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .brand-name { font-size: 17px; }
  .topnav a { padding: 8px 11px; font-size: 13px; }   /* 触控区 ≥ 36px */

  /* --- 搜索区 --- */
  .main-wrap { padding-top: 20px; padding-bottom: 40px; }
  /* 关键：输入框字号 < 16px 时 iOS Safari 聚焦会自动放大整页，这里强制 16px */
  .search-input { font-size: 16px; }
  .search-tab { margin-top: 12px; }
  .tab { padding: 6px 16px; font-size: 13.5px; }
  .home-h1 { margin-top: 18px; font-size: 16px; }
  .home-sub { font-size: 12.5px; }

  /* --- 分组目录：单列，一行 3 个方块 --- */
  .nav-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 20px; }
  .lg-title { margin-bottom: 5px; font-size: 12px; }
  .lg-item { line-height: 42px; font-size: 13.5px; }

  /* --- 列表 / 详情 --- */
  .crumb { margin-top: 14px; font-size: 12.5px; }
  .page-head { padding: 15px 14px; }
  .page-head h1 { font-size: 19px; }
  .page-head .ph-desc { font-size: 13px; }
  .section { margin-top: 12px; padding: 15px 13px 4px; }
  .section-head { margin: -15px -13px 12px; padding: 10px 13px; gap: 8px; }
  .section-title { font-size: 15px; }
  .section-title::before { height: 16px; }
  .section-more { font-size: 12px; }
  .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; }
  .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 { 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 { padding: 20px 0 calc(22px + env(safe-area-inset-bottom)); }
  .footer-links { gap: 6px 12px; }
  .footer-links a { font-size: 12px; }

  /* --- 后台 --- */
  .adm { flex-direction: column; }
  .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 横向滑动查看 */
  .tbl-wrap .tbl { min-width: 600px; }
}

/* ---------------- 小屏手机（iPhone SE / 6-8 / 老安卓 320-480px） ---------------- */
@media (max-width: 480px) {
  .search-card { max-width: 100%; }
  .search-input { font-size: 16px; }
  .lg-item { line-height: 40px; font-size: 13px; }
  .lg-list > li { padding: 0 2px; }
  .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) {
  .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .brand-name { font-size: 16px; }
  .brand-mark { width: 28px; height: 28px; }
  .lg-item { line-height: 38px; font-size: 12.5px; padding: 0 6px; }
  .lg-list > li { padding: 0 2px; }
  .home-h1 { font-size: 15px; line-height: 1.5; }
  .home-sub { font-size: 12px; }
  .pg-btn { min-width: 34px; padding: 7px 9px; font-size: 12.5px; }
}

/* ---------------- 超窄屏（小屏安卓分屏 / 折叠机内屏窄态） ---------------- */
@media (max-width: 340px) {
  .brand-name { font-size: 15px; }
  .brand-mark { width: 26px; height: 26px; border-radius: 8px; }
  .lg-item { line-height: 34px; font-size: 12px; padding: 0 4px; }
  .section { padding: 13px 10px 2px; }
  .section-head { margin: -13px -10px 10px; padding: 9px 10px; }
  .magnet-box .mb-value { font-size: 11px; }
  .pg-gap { display: none; }                          /* 极窄时省略页码省略号，优先保证按钮可点 */
}

/* ---------------- 折叠机外屏（Galaxy Fold 280px 等） ---------------- */
@media (max-width: 300px) {
  .brand-mark { width: 24px; height: 24px; }
  .brand-name { font-size: 14px; }
  .lg-item { line-height: 32px; font-size: 11.5px; }
  .lg-title { font-size: 11.5px; }
  .pg-info { font-size: 11.5px; }
}

/* ---------------- 手机横屏 / 矮屏：压缩纵向高度 ---------------- */
@media (max-height: 500px) and (orientation: landscape) {
  .topbar-inner { padding: 6px 0; gap: 6px; }
  .main-wrap { padding-top: 16px; }
  .home-h1 { margin-top: 14px; font-size: 15px; }
  .home-sub { display: none; }
  .nav-grid { gap: 20px 18px; margin-top: 16px; }
}

/* ---------------- 触摸设备：关闭依赖 hover 的位移，避免「点完状态卡住」 ---------------- */
@media (hover: none) and (pointer: coarse) {
  html { scroll-behavior: auto; }
  .lg-item:hover { transform: none; }
  .lcard:hover { transform: none; }
  .btn:active, .btn-adm:active, .pg-btn:active, .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; }
}
