/*
 * t10 模板响应式适配
 * 断点: ≤768px (手机 / 平板竖屏)
 *       ≤480px (小屏手机)
 */

/* ══════════════════════════════════════════════
   PC端 logo 文字显示修正（覆盖 56zw.css 的图片 logo 规则）
══════════════════════════════════════════════ */
.logo a {
  text-indent: 0 !important;
  background-image: none !important;
  line-height: 60px;
}

/* ══════════════════════════════════════════════
   汉堡按钮 - PC端隐藏
══════════════════════════════════════════════ */
.nav-toggle {
  display: none;
}

/* ══════════════════════════════════════════════
   手机端
══════════════════════════════════════════════ */
@media (max-width: 768px) {

  *, *::before, *::after {
    box-sizing: border-box;
  }

  body {
    font-size: 14px;
    background-color: #f5f5f5;
  }

  /* ── 顶部登录栏、手机版按钮：隐藏 ── */
  .ywtop    { display: none !important; }
  .userpanel { display: none !important; }

  /* ══════════════════════════════════════════
     头部：Logo 左 + 汉堡按钮 右，搜索框第二行
  ══════════════════════════════════════════ */
  .header {
    width: 100% !important;
    height: auto !important;
    padding: 8px 12px !important;
    overflow: visible !important;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #dde8f0;
  }

  /* Logo：占左侧剩余空间 */
  .logo {
    float: none !important;
    width: auto !important;
    height: auto !important;
    flex: 1;
    min-width: 0;
  }

  .logo a {
    float: none !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    line-height: 1.2 !important;
    padding: 4px 0 !important;
    font-size: 22px !important;
    overflow: visible !important;
  }

  /* 汉堡按钮：显示在右侧 */
  .nav-toggle {
    display: flex !important;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    background: #3487dd;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
    order: 1;
    margin-left: 8px;
  }

  .nav-toggle:active {
    background: #2a6db5;
  }

  /* 搜索框：换行占满整行 */
  .header_search {
    float: none !important;
    width: 100% !important;
    flex-basis: 100%;
    order: 2;
    margin: 8px 0 0 !important;
    position: static !important;
    overflow: visible !important;
    display: block !important;   /* 只需占满整行 */
  }

  .header_search ._17mb_searchtype {
    display: none !important;
  }

  /* form 是 input 和 button 的真正父容器，改为 flex */
  .header_search form {
    display: flex !important;
    align-items: stretch;
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
  }

  .header_search input.search {
    position: static !important;
    left: auto !important;
    flex: 1 !important;
    width: auto !important;
    min-width: 0;
    height: 38px !important;
    font-size: 15px !important;
    border-radius: 4px 0 0 4px !important;
    border-right: none !important;
    padding: 4px 10px !important;
    margin: 0 !important;
    box-sizing: border-box;
  }

  .header_search button {
    flex-shrink: 0 !important;
    float: none !important;
    width: 68px !important;
    height: 38px !important;
    font-size: 13px !important;
    border-radius: 0 4px 4px 0 !important;
    background: #3487dd !important;
    color: #fff !important;
    border: none !important;
    cursor: pointer;
    margin: 0 !important;
  }

  /* ══════════════════════════════════════════
     导航菜单：默认折叠，点击展开
  ══════════════════════════════════════════ */
  .dealList {
    display: none !important;    /* 默认折叠 */
    width: 100% !important;
    height: auto !important;
    overflow: hidden !important;
    margin: 0 !important;
    border-top: 1px solid #6db4d8;
  }

  /* 展开状态 */
  .dealList.nav-open {
    display: block !important;
  }

  .dealList ul {
    display: flex;
    flex-wrap: wrap;
    padding: 4px 0;
    margin: 0;
    width: auto;
  }

  .dealList ul li {
    float: none !important;
    display: inline-block;
    line-height: 38px !important;
  }

  .dealList ul li a {
    font-size: 14px !important;
    padding: 0 12px !important;
    white-space: nowrap;
    display: block;
  }

  /* ══════════════════════════════════════════
     主内容区
  ══════════════════════════════════════════ */
  #mainlist,
  #newscontent,
  .box_con,
  .content_read,
  #firendlink,
  .novelslist,
  .novelslist2,
  .novellist,
  .footer,
  #footer {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
  }

  /* ══════════════════════════════════════════
     首页：精品连载 .l 区域（修复图文间隙）
  ══════════════════════════════════════════ */
  #hotcontent {
    width: 100% !important;
  }

  /* 精品连载左栏容器：全宽、高度自适应 */
  #hotcontent .l {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    padding-bottom: 8px !important;
    border-bottom: none;
  }

  /* 每个书目条目：全宽，图文横排 flexbox */
  #hotcontent .l .item {
    float: none !important;
    width: 100% !important;
    display: flex !important;
    align-items: flex-start;
    padding: 8px 10px !important;
    border-bottom: 1px solid #e8f4fb;
    overflow: visible !important;
  }

  /* 封面图：固定宽度，不压缩 */
  #hotcontent .l .item .image {
    float: none !important;
    width: 80px !important;
    flex-shrink: 0;
    margin-right: 10px;
  }

  #hotcontent .l .item .image img {
    width: 78px !important;
    height: 98px !important;
    display: block;
  }

  /* 描述区：填满剩余宽度 */
  #hotcontent .l .item dl {
    float: none !important;
    width: auto !important;
    flex: 1;
    min-width: 0;
    padding: 0 !important;
    overflow: hidden;
  }

  #hotcontent .l .item dl dt {
    font-size: 14px;
    height: auto !important;
    line-height: 1.4 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #hotcontent .l .item dl dd {
    height: auto !important;
    max-height: 72px;
    overflow: hidden;
    line-height: 1.6 !important;
    font-size: 12px;
    color: #888;
  }

  /* 精品推荐右栏 */
  #hotcontent .r {
    float: none !important;
    width: 100% !important;
    margin-top: 0;
    border-top: none;
  }

  /* 列表页精品连载 */
  #hotcontent .ll {
    width: calc(100% - 10px) !important;
    height: auto !important;
    float: none !important;
    overflow: visible !important;
  }

  #hotcontent .ll .item {
    float: none !important;
    width: 100% !important;
    display: flex !important;
    align-items: flex-start;
    padding: 8px 5px !important;
    border-bottom: 1px solid #e8f4fb;
  }

  #hotcontent .ll .item .image {
    float: none !important;
    width: 80px !important;
    flex-shrink: 0;
    margin-right: 10px;
  }

  #hotcontent .ll .item .image img {
    width: 78px !important;
    height: 98px !important;
    display: block;
  }

  #hotcontent .ll .item dl {
    float: none !important;
    width: auto !important;
    flex: 1;
    min-width: 0;
    padding: 0 !important;
  }

  #hotcontent .ll .item dl dd {
    height: auto !important;
    max-height: 72px;
    overflow: hidden;
  }

  /* ══════════════════════════════════════════
     首页：分类小说模块
  ══════════════════════════════════════════ */
  .novelslist {
    overflow-x: hidden;
    border: none !important;
    padding: 0 !important;
  }

  .novelslist .content {
    float: none !important;
    width: 100% !important;
    border-right: none !important;
    border-bottom: 2px solid #a6d3e8;
    padding-bottom: 8px;
    margin-bottom: 4px;
  }

  .novelslist .border {
    border-bottom: none !important;
  }

  .novelslist .content ul li {
    width: 48% !important;
  }

  /* ══════════════════════════════════════════
     最近更新 & 最新入库（重写为 flex 行布局）
  ══════════════════════════════════════════ */
  #newscontent .l,
  #newscontent .r {
    float: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 8px;
  }

  /* li 改为 flex 行，取消固定高度与 overflow:hidden */
  #newscontent .l li,
  #newscontent .r li {
    display: flex !important;
    align-items: center !important;
    height: auto !important;
    min-height: 28px !important;
    overflow: hidden !important;
    padding: 3px 0 !important;
  }

  /* 所有 span 取消 float，参与 flex */
  #newscontent .l li span,
  #newscontent .r li span {
    float: none !important;
    display: inline-block !important;
    flex-shrink: 0;
  }

  /* 分类标签：自适应宽度，强制不换行 */
  #newscontent .l li .s1,
  #newscontent .r li .s1 {
    width: auto !important;
    min-width: 36px !important;
    white-space: nowrap !important;
    font-size: 11px !important;
    text-align: center !important;
    color: #888 !important;
    flex-shrink: 0 !important;
  }

  /* 书名：flex:1 撑满剩余空间，超长截断 */
  #newscontent .l li .s2,
  #newscontent .r li .s2 {
    flex: 1 !important;
    width: auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }

  /* 最新章节、作者（.s3/.s4）：隐藏，节省空间 */
  #newscontent .l li .s3,
  #newscontent .l li .s4 { display: none !important; }

  /* 日期/作者（.s5）：固定 56px，右对齐小字 */
  #newscontent .l li .s5,
  #newscontent .r li .s5 {
    width: 56px !important;
    font-size: 11px !important;
    text-align: right !important;
    color: #aaa !important;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
  }

  /* ══════════════════════════════════════════
     小说列表页
  ══════════════════════════════════════════ */
  .novelslist li .s3 { display: none !important; }
  .novelslist li .s1 { width: 12% !important; }
  .novelslist li .s2 { width: calc(100% - 30%) !important; }
  .novelslist li .s5 { width: auto !important; }

  /* ══════════════════════════════════════════
     搜索结果
  ══════════════════════════════════════════ */
  .novelslist2 li > span:nth-child(2),
  .novelslist2 li > span:nth-child(4),
  .novelslist2 li > span:nth-child(5),
  .novelslist2 li > span:nth-child(6) {
    display: none !important;
  }

  .novelslist2 li > span:nth-child(1) { width: 70% !important; }
  .novelslist2 li > span:nth-child(3) { width: 30% !important; }

  .novelslist2 li {
    height: auto !important;
    min-height: 36px;
    line-height: 36px !important;
  }

  /* ══════════════════════════════════════════
     小说详情页（CSS Grid 布局）
  ══════════════════════════════════════════ */
  #book_info {
    grid-template-columns: 110px 1fr !important;
    gap: 0 12px !important;
  }

  #info {
    font-size: 14px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  #info h1 {
    font-size: 16px !important;
    text-align: left;
    margin: 0 0 6px !important;
  }

  #info p {
    float: none !important;
    width: 100% !important;
    height: auto !important;
    line-height: 22px !important;
    margin: 0 !important;
    padding: 1px 0 !important;
    font-size: 12px !important;
  }

  .detail-btns a {
    padding: 9px 20px !important;
    font-size: 14px !important;
  }

  #intro { width: 100% !important; font-size: 14px; }

  .lm {
    white-space: normal !important;
    line-height: 1.8;
    font-size: 13px;
    padding: 6px 8px !important;
  }

  #list dl { float: none !important; width: 100% !important; }
  #list dt { width: 100% !important; font-size: 13px; }
  #list dd {
    display: block !important;
    float: left !important;
    width: 50% !important;
    height: 30px !important;
    line-height: 30px !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    font-size: 13px;
    margin-bottom: 2px;
    box-sizing: border-box;
  }
  #list dd a {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* ══════════════════════════════════════════
     章节阅读页
  ══════════════════════════════════════════ */
  .content_read { background: #fff; }

  .box_con { border: none !important; }

  .con_top {
    font-size: 12px !important;
    line-height: 32px !important;
    height: auto !important;
    padding: 0 10px !important;
    white-space: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .bookname { padding: 10px 12px 8px !important; }

  .bookname h1 {
    font-size: 18px !important;
    line-height: 1.4 !important;
    text-align: center;
  }

  /* 正文：font-size/line-height 由 chapter.html 的 CSS 变量控制，此处不覆盖 */
  .box_con #content,
  .box_con #content a,
  .box_con #content div {
    letter-spacing: 0.05em !important;
    width: 100% !important;
    padding: 10px 14px !important;
    margin: 0 !important;
  }

  /* 翻页按钮 */
  .page_chapter {
    width: 100% !important;
    margin: 10px 0 !important;
    padding: 0 10px;
  }

  .page_chapter ul {
    display: flex;
    width: 100%;
  }

  .page_chapter li {
    float: none !important;
    flex: 1;
    width: auto !important;
    margin: 0 3px !important;
    min-height: 44px !important;
    line-height: 44px !important;
    font-size: 14px;
    border-radius: 4px !important;
  }

  .page_chapter li a {
    display: block;
    min-height: 44px;
    line-height: 44px;
    font-size: 14px;
  }

  /* 侧边快速翻页：手机上隐藏 */
  .reader_mark0, .reader_mark1 { display: none !important; }

  /* ══════════════════════════════════════════
     翻页组件
  ══════════════════════════════════════════ */
  .page, .page_b, .page_b2 { width: 100% !important; padding: 5px 0 !important; }

  .page a, .page b {
    margin: 0 3px 6px !important;
    font-size: 13px !important;
    padding: 0 8px !important;
    min-height: 36px;
    line-height: 36px !important;
    display: inline-block;
  }

  .pagelink a, .pagelink strong, .pagelink em {
    padding: 4px 8px !important;
    margin: 2px 2px 6px !important;
    min-height: 34px;
    line-height: 26px !important;
    font-size: 13px;
  }

  /* 手机端翻页：flex 单行，只显示 当前页±1 + 上下页 */
  .pagelink {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
  }
  /* 隐藏窗口内的普通页码 */
  .pagelink a.pg-num,
  .pagelink strong.pg-num {
    display: none !important;
    visibility: hidden !important;
  }
  /* 只显示当前页、前后页 */
  .pagelink a.pg-adj,
  .pagelink strong.pg-cur {
    display: inline-block !important;
    visibility: visible !important;
  }
  /* 隐藏末页数字和跳页输入框 */
  .pagelink .pg-last,
  .pagelink .pg-end,
  .pagelink input {
    display: none !important;
    visibility: hidden !important;
  }
  /* 下一页高亮：蓝底白字 */
  .pagelink a.next {
    background: #3487dd !important;
    color: #fff !important;
    border-color: #3487dd !important;
    font-weight: bold !important;
    padding: 4px 12px !important;
  }
  /* 上一页：灰底 */
  .pagelink a.prev {
    background: #e0e0e0 !important;
    color: #555 !important;
    border-color: #ccc !important;
    font-weight: bold !important;
    padding: 4px 12px !important;
  }

  /* ══════════════════════════════════════════
     排行榜页
  ══════════════════════════════════════════ */
  #tops_nav { width: 100% !important; }

  #tops_nav ol { width: 100% !important; display: flex; margin: 0; }

  #tops_nav ol li {
    flex: 1;
    width: auto !important;
    float: none !important;
    font-size: 12px;
    padding: 0 !important;
  }

  #main {
    width: 100% !important;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    padding: 0 4px;
  }

  .box {
    float: none !important;
    width: calc(50% - 8px) !important;
    min-height: auto !important;
    margin: 6px 4px !important;
  }

  /* ══════════════════════════════════════════
     页脚
  ══════════════════════════════════════════ */
  .footer_link {
    width: 100% !important;
    height: auto !important;
    white-space: normal;
    line-height: 1.8;
    padding: 6px 10px;
  }

  .footer_link a { display: inline-block; margin: 2px 4px; font-size: 12px; }

  .footer_cont p { width: 100% !important; font-size: 11px; line-height: 1.6; padding: 0 10px; }

} /* end @media 768px */


/* ══════════════════════════════════════════════
   小屏手机 ≤480px
══════════════════════════════════════════════ */
@media (max-width: 480px) {

  .box { width: calc(100% - 8px) !important; margin: 6px 4px !important; }

  #hotcontent .l .item,
  #hotcontent .ll .item { width: 100% !important; }

  .box_con #content,
  .box_con #content a,
  .box_con #content div {
    padding: 8px 12px !important;
  }

}
