/* =========================================================
   磁力新视界  ·  全站样式（一糖导航风格改版）
   结构：变量 → 通用 → 顶栏 → 头图 → 布局 → 侧栏 → 模块 → 卡片
         → 文章条目 → 详情页 → 磁力盒 → 分页/面包屑 → 页脚
         → 后台 admin 样式 → 移动端适配
   ========================================================= */

:root {
  --c-black: #0d0e10;          /* 顶栏 / 头图底色 */
  --c-hero: #000;
  --c-red: #ff2453;            /* LOGO / 主强调色 */
  --c-green: #14c964;          /* 搜索按钮绿 */
  --c-orange: #ff6a00;         /* 侧栏激活 / 强调 */
  --c-yellow: #ffd028;         /* 顶栏点缀黄 */
  --c-text: #23262b;
  --c-text2: #6b7280;
  --c-line: #eef0f2;
  --c-bg: #f4f5f7;             /* 内容区浅灰底 */
  --c-card: #ffffff;
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  font-size: 14px;
  line-height: 1.6;
}

/* 基础：避免移动端横向滚动 / 点击闪烁 */
html, body { max-width: 100%; }
body { overflow-wrap: break-word; }
a, button, input, label { -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-orange); }
img { max-width: 100%; border: 0; }
ul, ol { list-style: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0;
}

/* =========================================================
   顶部黑色细导航条
   ========================================================= */
.topbar {
  background: var(--c-black);
  color: rgba(255, 255, 255, .88);
  font-size: 13px;
  height: 42px;
  position: relative;
  z-index: 30;
}

.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-left { margin-right: auto; }

.tb-burger { display: inline-flex; flex-direction: column; gap: 3px; cursor: pointer; }
.tb-burger i { width: 16px; height: 2px; background: #fff; border-radius: 2px; }

.tb-link { color: rgba(255, 255, 255, .82); white-space: nowrap; }
.tb-link:hover { color: #fff; }
.tb-dot::before { content: "●"; color: var(--c-yellow); font-size: 10px; margin-right: 4px; }

.tb-fav { color: var(--c-yellow); }

.tb-login {
  background: var(--c-green);
  color: #fff;
  padding: 3px 14px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
}
.tb-login:hover { color: #fff; opacity: .88; }

.tb-search-ico { color: rgba(255, 255, 255, .85); display: inline-flex; }
.tb-search-ico:hover { color: #fff; }

/* =========================================================
   黑色头图：LOGO + 标签页 + 搜索框
   ========================================================= */
.hero {
  background: var(--c-hero);
  padding: 44px 16px 52px;
  position: relative;
}

.hero.is-compact { padding: 30px 16px 34px; }

.hero-inner { max-width: 720px; margin: 0 auto; text-align: center; }

.hero-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #ff2453, #ff5f45);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 10px 26px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(255, 36, 83, .35);
}
.hero-logo:hover { color: #fff; }

.hero-logo-text { font-size: inherit; font-weight: inherit; letter-spacing: inherit; }

.hero-logo-heart {
  display: inline-flex;
  color: #ffe3ec;
}

.hero-tabs {
  margin-top: 22px;
  display: flex;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
}

.hero-tabs a {
  color: #9aa0a6;
  font-size: 14px;
  padding: 4px 2px 8px;
  position: relative;
}
.hero-tabs a:hover { color: #d7dbe0; }
.hero-tabs a.is-active { color: #fff; font-weight: 600; }
.hero-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 20px; height: 3px;
  border-radius: 2px;
  background: #fff;
}

.hero-search {
  margin-top: 18px;
  display: flex;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

.hero-search input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 13px 18px;
  font-size: 15px;
  color: var(--c-text);
  min-width: 0;
}

.hero-search button {
  width: 66px;
  border: 0;
  cursor: pointer;
  background: var(--c-green);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-search button:hover { background: #12b45a; }

.hero-ad {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 16px;
  color: #8a9096;
  font-size: 12.5px;
}
.hero-ad:hover { color: #c4c9ce; }
.hero-ad-dot { width: 8px; height: 8px; border-radius: 50%; background: #2f7df6; }

/* =========================================================
   主体布局：左侧栏 + 右侧内容
   ========================================================= */
.page { max-width: 1400px; margin: 0 auto; padding: 16px; }

.layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.layout-main { flex: 1; min-width: 0; }

/* =========================================================
   左侧精选导航
   ========================================================= */
.side {
  width: 190px;
  flex: 0 0 190px;
  background: var(--c-card);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: 12px;
}

.side-head {
  padding: 13px 16px;
  font-weight: 700;
  font-size: 14.5px;
  border-bottom: 1px solid var(--c-line);
  color: #b8860b;
  background: linear-gradient(180deg, #fffdf5, #fff);
}

.side-crown { font-size: 15px; }

.side-nav { padding: 8px; display: flex; flex-direction: column; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #3d434b;
  font-size: 13.5px;
  white-space: nowrap;
}

.side-nav a:hover { background: #f6f7f9; color: var(--c-text); }

.side-nav a.is-active {
  background: #fff3e8;
  color: var(--c-orange);
  font-weight: 600;
}

.side-ico { font-size: 15px; width: 18px; text-align: center; }

/* =========================================================
   白色内容卡
   ========================================================= */
.card {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 16.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.card-title .bar {
  width: 4px; height: 16px;
  border-radius: 2px;
  background: var(--c-red);
}

.card-more { margin-left: auto; font-size: 12.5px; color: var(--c-text2); }
.card-more:hover { color: var(--c-orange); }

/* 站点详情页头部：图标 + 标题（小屏自动换行且不溢出） */
.card-head--site { align-items: center; gap: 14px; }
.card-head--site .s-head-body { flex: 1; min-width: 0; }

/* =========================================================
   彩色模块按钮行（首页顶部六宫格按钮）
   ========================================================= */
.quick {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.quick a {
  height: 48px;
  border-radius: 9px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .10);
  transition: transform .15s ease;
}
.quick a:hover { color: #fff; transform: translateY(-2px); }
.quick .q-ico { font-size: 16px; }

.qc-red    { background: linear-gradient(135deg, #ff5043, #f5222d); }
.qc-green  { background: linear-gradient(135deg, #2fd06e, #16a34a); }
.qc-blue   { background: linear-gradient(135deg, #3f8cff, #2563eb); }
.qc-orange { background: linear-gradient(135deg, #ff9440, #f97009); }
.qc-cyan   { background: linear-gradient(135deg, #23c4f5, #0e9de5); }
.qc-pink   { background: linear-gradient(135deg, #ff6aa8, #f0439b); }

/* =========================================================
   最新文章（两块 × 每块4条 × 两列）
   ========================================================= */
.latest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.latest-block { background: var(--c-card); border-radius: var(--radius); padding: 16px 18px; }

.latest-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

/* 关键：网格条目必须允许收缩，否则 nowrap 标题会把整行撑出视口 */
.latest-item, .rel-item { min-width: 0; }
.latest-item > a, .rel-item > a { min-width: 0; }

.latest-item a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
}

.latest-item a:hover { background: #f7f8fa; }

.latest-item .l-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-item .l-date { font-size: 12px; color: #9aa1a9; flex: 0 0 auto; }

/* =========================================================
   站点卡片网格（每日推荐 / 各模块）
   ========================================================= */
.sgrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

/* 详情页相关站点：四列（随屏幕自适应降级，勿用内联样式写死） */
.sgrid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.scard {
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  min-width: 0;
  transition: box-shadow .15s ease, transform .15s ease;
}

.scard:hover {
  box-shadow: 0 6px 18px rgba(30, 35, 45, .10);
  transform: translateY(-2px);
  color: inherit;
}

.scard .s-body { flex: 1; min-width: 0; }

/* 行内元素 overflow 不生效，改块级才能正确截断省略 */
.scard .s-name, .scard .s-desc { display: block; }

.scard .s-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scard .s-desc {
  font-size: 11.5px;
  color: #9aa1a9;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scard .s-arrow { color: #c3c9cf; font-size: 14px; flex: 0 0 auto; }

/* 磁力站点卡片：红色描边 + 磁力徽标，视觉上突出 */
.scard.is-magnet {
  border-color: #ffd3dd;
  background: linear-gradient(180deg, #fff7f9, #fff);
}

.scard.is-magnet .s-name { color: var(--c-red); }

/* 磁力徽标：卡片 / 列表 / 详情标题通用 */
.s-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  background: var(--c-red);
  border-radius: 4px;
  padding: 1px 5px;
  line-height: 1.5;
  vertical-align: 2px;
  white-space: nowrap;
}

/* 详情页标题里的徽标：稍大、圆角胶囊、与标题基线对齐 */
.detail-title .s-badge {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  vertical-align: 3px;
  margin-left: 8px;
}

.lcard-icon { display: inline-flex; }

/* =========================================================
   文章条目（列表页 / 搜索结果）
   ========================================================= */
.alist { display: flex; flex-direction: column; }

.alist-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 6px;
  border-bottom: 1px dashed var(--c-line);
}

.alist-item:last-child { border-bottom: 0; }

.alist-item .a-body { flex: 1; min-width: 0; }

.alist-item .a-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  display: block;
  margin-bottom: 4px;
}
.alist-item .a-title:hover { color: var(--c-orange); }

.alist-item .a-summary {
  font-size: 12.5px;
  color: var(--c-text2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.alist-item .a-meta { margin-top: 6px; font-size: 12px; color: #9aa1a9; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.alist-item .a-meta a { color: var(--c-orange); }

/* =========================================================
   二级页面：详情 / 分类 / 搜索
   ========================================================= */
.crumb {
  font-size: 12.5px;
  color: #9aa1a9;
  padding: 2px 2px 12px;
}
.crumb a { color: #6b7280; }
.crumb a:hover { color: var(--c-orange); }
.crumb-sep { margin: 0 7px; color: #d3d7dc; }
.crumb-cur { color: var(--c-text); }

.detail-title { font-size: 22px; font-weight: 700; line-height: 1.4; }

.detail-meta {
  margin-top: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-line);
  font-size: 12.5px;
  color: #9aa1a9;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.detail-content {
  padding-top: 14px;
  font-size: 15px;
  line-height: 1.9;
  color: #33373d;
  word-break: break-word;
}

.detail-content h2 { font-size: 18px; margin: 20px 0 10px; }
.detail-content h3 { font-size: 16px; margin: 16px 0 8px; }
.detail-content p { margin: 10px 0; }
.detail-content ul, .detail-content ol { margin: 10px 0 10px 22px; list-style: disc; }
.detail-content ol { list-style: decimal; }
.detail-content a { color: #2563eb; }

/* 站内富文本自适应：图片 / 表格 / 嵌入内容为手机端降级 */
.detail-content img {
  max-width: 100% !important;
  height: auto;
  border-radius: 8px;
}
.detail-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 13.5px;
}
.detail-content iframe,
.detail-content video,
.detail-content embed {
  max-width: 100% !important;
  height: auto;
  aspect-ratio: 16 / 9;
}

.tag { 
  display: inline-block;
  font-size: 12px;
  color: var(--c-text2);
  background: #f3f4f6;
  border-radius: 6px;
  padding: 2px 9px;
  margin: 0 6px 6px 0;
}
.tag:hover { color: var(--c-orange); background: #fff3e8; }

/* =========================================================
   磁力链接盒
   ========================================================= */
.magnet-box {
  margin: 18px 0;
  border: 1px solid #ffd3dd;
  background: linear-gradient(180deg, #fff7f9, #fff);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.magnet-box .m-head {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-red);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.magnet-box code {
  display: block;
  font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: #8c4356;
  background: #fdf0f3;
  border-radius: 6px;
  padding: 9px 11px;
  word-break: break-all;
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.magnet-actions { margin-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn-magnet {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #2fd06e, #16a34a);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(22, 163, 74, .28);
}
.btn-magnet:hover { color: #fff; opacity: .92; }

.magnet-tip { font-size: 12px; color: #9aa1a9; }

/* =========================================================
   相关推荐 / 模块小节
   ========================================================= */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.rel-item a {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
}
.rel-item a:hover { background: #f7f8fa; }
.rel-item .r-title { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-item .r-date { font-size: 12px; color: #9aa1a9; }

/* =========================================================
   分页
   ========================================================= */
.pager { margin: 18px 0 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.pg-btn {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  padding: 6px 12px;
  border: 1px solid var(--c-line);
  border-radius: 7px;
  font-size: 13px;
  color: var(--c-text2);
  background: #fff;
}
a.pg-btn:hover { border-color: var(--c-orange); color: var(--c-orange); }
.pg-btn.is-active { background: var(--c-orange); border-color: var(--c-orange); color: #fff; font-weight: 600; }
.pg-btn.is-disabled { color: #c9ced4; cursor: default; }
.pg-gap { color: #c9ced4; }
.pg-info { font-size: 12px; color: #9aa1a9; margin-left: 4px; }

/* =========================================================
   空状态
   ========================================================= */
.empty {
  text-align: center;
  color: #9aa1a9;
  padding: 40px 0;
  font-size: 13.5px;
}

/* =========================================================
   页脚
   ========================================================= */
.footer {
  background: #fff;
  border-top: 1px solid var(--c-line);
  margin-top: 20px;
  padding: 24px 16px 30px;
  color: var(--c-text2);
  font-size: 12.5px;
}

.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }

.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 12px; }
.footer-links a { color: #565d66; }
.footer-links a:hover { color: var(--c-orange); }

.footer-tags { margin-bottom: 12px; }

.footer p { margin: 4px 0; line-height: 1.8; }

/* =========================================================
   后台 admin 样式
   ========================================================= */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
}

.login-box {
  width: 360px;
  background: #fff;
  border-radius: 12px;
  padding: 28px 26px;
  box-shadow: 0 10px 30px rgba(20, 25, 35, .10);
}
.login-box h1 { font-size: 18px; margin-bottom: 18px; text-align: center; }

.adm { display: flex; min-height: 100vh; background: var(--c-bg); }

.adm-side {
  width: 180px;
  flex: 0 0 180px;
  background: #171a1f;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.as-brand { color: #fff; font-weight: 700; padding: 6px 10px 14px; font-size: 15px; }

.adm-side a { color: #b6bcc4; font-size: 13.5px; padding: 9px 12px; border-radius: 8px; }
.adm-side a:hover { background: #24282f; color: #fff; }
.adm-side a.is-active { background: var(--c-red); color: #fff; font-weight: 600; }

.adm-main { flex: 1; padding: 20px 24px; min-width: 0; }

.adm-top { margin-bottom: 16px; }
.adm-top h1 { font-size: 20px; }

.adm-panel {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.adm-panel h2 { font-size: 16px; margin-bottom: 14px; padding-left: 9px; border-left: 4px solid var(--c-red); }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.tbl th { color: #565d66; background: #fafbfc; white-space: nowrap; }
.tbl .col-act { white-space: nowrap; }
.tbl .col-act a { color: #2563eb; margin-right: 8px; }

.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 13px; color: #454c55; margin-bottom: 5px; }
.form-row .hint { color: #9aa1a9; font-size: 12px; margin-left: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }

.inp, .txa, .sel {
  width: 100%;
  border: 1px solid #dfe3e8;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: var(--c-text);
}
.inp:focus, .txa:focus, .sel:focus { border-color: var(--c-red); }
.txa { resize: vertical; line-height: 1.7; }
.txa-code { font-family: SFMono-Regular, Consolas, Menlo, monospace; font-size: 12.5px; }

.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.btn-adm {
  display: inline-block;
  background: var(--c-red);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  border: 0;
  border-radius: 8px;
  padding: 8px 18px;
  cursor: pointer;
}
.btn-adm:hover { opacity: .9; color: #fff; }
.btn-adm--gray { background: #eceff3; color: #454c55; }
.btn-adm--danger { background: #e5484d; }
.btn-adm--sm { padding: 4px 12px; font-size: 12px; }

.alert { border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; }
.alert--ok { background: #ecfdf3; color: #15803d; border: 1px solid #bbf7d0; }
.alert--err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* =========================================================
   移动端适配（覆盖主流机型）
   ========================================================= */
@media (max-width: 1100px) {
  .sgrid { grid-template-columns: repeat(4, 1fr); }
  .sgrid--4 { grid-template-columns: repeat(3, 1fr); }
  .quick { grid-template-columns: repeat(3, 1fr); }
}

/* ≤1024：侧栏收窄 */
@media (max-width: 1024px) {
  .side { width: 160px; flex: 0 0 160px; }
}

/* ≤860：整体切换为移动端 —— 侧栏横向滚动、卡片两列、顶栏抽屉菜单 */
@media (max-width: 860px) {
  .layout { display: block; }
  .side {
    width: auto;
    flex: none;
    position: static;
    margin-bottom: 14px;
  }
  .side-nav { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .side-nav a { flex: 0 0 auto; }
  .sgrid { grid-template-columns: repeat(2, 1fr); }
  .sgrid--4 { grid-template-columns: repeat(2, 1fr); }
  .latest-grid { grid-template-columns: 1fr; }
  .rel-grid { grid-template-columns: 1fr; }

  /* 顶栏：汉堡按钮展开左侧导航，其余入口保持常驻 */
  .topbar { overflow: visible; }
  .topbar-inner { height: 46px; }
  .tb-burger {
    padding: 10px 10px 10px 0;
    cursor: pointer;
    background: none;
    border: 0;
  }
  .topbar-left {
    position: absolute;
    top: 46px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 16px 12px;
    background: #15171b;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
    z-index: 60;
  }
  .topbar.is-open .topbar-left { display: flex; }
  .topbar-left .tb-link {
    display: block !important;
    padding: 12px 0;
    font-size: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    line-height: 1.4;
  }
  .topbar-left .tb-link:last-child { border-bottom: 0; }

  /* 搜索按钮颜色强度和触控区 */
  .hero-search button { width: 60px; min-height: 48px; }
  .hero-search input { padding: 12px 14px; }

  /* 卡片触控友好 */
  .scard { padding: 12px 13px; min-height: 56px; }
  .quick a { height: 52px; }

  .detail-title { font-size: 20px; }
  .detail-content { font-size: 15px; line-height: 1.85; }

  .adm { display: block; }
  .adm-side { width: auto; flex: none; flex-direction: row; flex-wrap: wrap; }
  .adm-main { padding: 16px 14px; }
  .tbl-wrap .tbl th, .tbl-wrap .tbl td { white-space: nowrap; }
}

/* ≤640：中间尺寸（大屏手机横屏 / 平板竖屏） */
@media (max-width: 640px) {
  .latest-items { grid-template-columns: 1fr; }
  .page { padding: 12px; }
  .card { padding: 14px 14px; }
  .card-title { font-size: 15.5px; }
  .footer { padding: 20px 14px 26px; }
}

/* ≤480：主流手机竖屏 */
@media (max-width: 480px) {
  .hero { padding: 28px 14px 34px; }
  .hero-logo { font-size: 22px; padding: 8px 18px; border-radius: 12px; }
  .hero-tabs { gap: 14px; margin-top: 16px; }
  .hero-tabs a { font-size: 13.5px; }
  .hero-search { margin-top: 16px; border-radius: 12px; }
  /* ≥16px 避免 iOS Safari 聚焦时自动放大 */
  .hero-search input { padding: 12px 13px; font-size: 16px; }
  .hero-search button { width: 54px; }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .sgrid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sgrid--4 { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 10px; }
  .card { padding: 12px 12px; border-radius: 10px; }
  .card-head { margin-bottom: 12px; }
  .detail-title { font-size: 18px; }
  .detail-meta { gap: 10px; font-size: 12px; }
  .alist-item { padding: 12px 2px; }
  .alist-item .a-title { font-size: 14.5px; }
  .btn-magnet { width: 100%; justify-content: center; padding: 12px 18px; }
  .magnet-tip { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar-left { gap: 10px; }
  .tb-login { padding: 5px 12px; }
  .adm-panel { padding: 16px 14px; }
  .login-box { width: auto; max-width: 90vw; padding: 24px 20px; }
  .inp, .txa, .sel { font-size: 16px; }
  .footer { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}

/* ≤360：小屏设备 */
@media (max-width: 360px) {
  .sgrid { grid-template-columns: 1fr; }
  .sgrid--4 { grid-template-columns: 1fr; }
  .quick { grid-template-columns: 1fr; }
  .hero-logo { font-size: 20px; padding: 7px 14px; }
}
