/* ============ 移动端阅读优化（2026-11-07）============
   目标: 手机上把「能看」变成「好读」。桌面端零影响（全部包在 max-width 断点内）。
   依据: 390px 实测 —— 顶栏 173px 占满 1/4 首屏、正文左内边距 0（文字贴边）、
        正文字号 14.8px 偏小、10 个触摸目标 <40px（"返回"仅 17px）。

   加载位置: 所有页面在 daily-report.css / section-sidebar.css 之后引入。
   ==================================================== */

/* ---------- 基础防溢出（兜底）---------- */
@media(max-width:960px){
  html,body{max-width:100%;overflow-x:hidden}
  /* 长表格与长代码在容器内滚动，不撑宽页面 */
  .report-deep table,.cal{min-width:0}
  .report-deep figure img{max-width:100%}
  pre,code{overflow-wrap:anywhere;word-break:break-word}
}

/* ---------- 顶栏与导航：压成一行 ---------- */
@media(max-width:760px){
  .topbar{position:sticky;top:0;z-index:30;background:#101116;backdrop-filter:blur(14px)}
  /* subpage.css 在窄屏把 .bar 改成纵向排列（品牌一行、菜单一行），
     手机上会撑到 100px 高，吸顶目录随之被完全遮住。这里强制回到单行。 */
  .topbar .bar{flex-direction:row;align-items:center;flex-wrap:nowrap;
    min-height:0;padding:9px 0;gap:10px}
  .brand{font-size:16px;flex:none}
  .brand-mark{width:28px;height:28px;margin-right:8px}
  /* 导航改为单行横向滚动，不再折行占两行 */
  .topbar nav{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;
    scrollbar-width:none;gap:2px;flex:1;justify-content:flex-end}
  .topbar nav::-webkit-scrollbar{display:none}
  .topbar nav a{flex:none;padding:9px 12px;font-size:13px;white-space:nowrap;
    min-height:40px;display:inline-flex;align-items:center}
}

/* ---------- 文章目录：折叠为紧凑横条 ---------- */
@media(max-width:960px){
  .section-sidebar{padding:10px 12px;border-radius:10px}
  .section-side-title{padding-bottom:8px;font-size:14px}
  .section-side-title small{font-size:10px}
  /* 目录项改为紧凑 chip，不再 184px 宽的大卡片 */
  .section-sidebar nav{gap:6px;padding-bottom:4px}
  .section-sidebar nav a{min-width:0;flex:0 0 auto;padding:7px 12px;font-size:13px;
    border-radius:20px;border-left:0;border-bottom:1px solid transparent}
  /* ⚠️ 这里曾经是 `.side-name{display:none}`，只留日期。
   * 后果：同一天发主稿 + 补 + 再补时，侧栏出现三个一模一样的
   * 「2026年11月16日」，用户在手机上完全看不出哪条是补篇，
   * 会直接判定「补篇没同步」。2026-11-16 事故。
   * 现在改为：日期弱化显示，标题保留——后缀（·补 / ·再补）是唯一的区分信息。 */
  .section-sidebar nav a .side-date{font-size:11px;display:inline;opacity:.62}
  .section-sidebar nav a .side-name{display:inline;font-size:12.5px}
  .section-sidebar nav a .side-date+.side-name{margin-left:5px}
  .section-sidebar .side-home{min-width:0;margin:0 6px 0 0;padding:7px 13px;
    font-size:12px;border-radius:20px;border-bottom:1px solid transparent}
  /* 目录条与正文之间留出呼吸感 */
  .section-layout{gap:14px}
}

/* ---------- 正文容器：补上左右留白 ---------- */
@media(max-width:960px){
  .report-shell{padding:20px 0 56px}
  .section-main{padding:20px 0 56px}
  .report-content{padding:0 16px}
  .section-content{padding:0 16px}
  .main{padding:28px 0 56px}
  /* 归档列表行在窄屏改为两列 */
  .archive-row{grid-template-columns:1fr auto;gap:4px 12px;padding:12px 14px}
  .archive-title{grid-column:1;grid-row:1}
  .archive-date{grid-column:1;grid-row:2;font-size:12.5px}
  .archive-stat{grid-column:2;grid-row:2;text-align:right}
  .archive-go{display:none}
}

/* ---------- 阅读体验：字号与行高 ---------- */
@media(max-width:760px){
  /* 正文字号上调到 16px，行高加大，长文更耐读 */
  .report-deep .card p{font-size:16px;line-height:1.95}
  .report p{font-size:16px;line-height:1.95}
  .report-deep .card p.k{font-size:16px}
  .report-deep .analysis p,.report-deep .chef p{font-size:15.5px;line-height:1.9}
  .report-deep .card h3{font-size:19px;line-height:1.5}
  .report-deep .sec{font-size:17px}
  .report-deep .sec-note{font-size:13px}
  .report-deep .card .watch{font-size:14px;line-height:1.85}
  .report-deep .card .caution{font-size:12.5px;line-height:1.8}
  .report-deep figcaption{font-size:12.5px;line-height:1.8}
  .report-deep .src{font-size:12.5px}
  /* 标题在窄屏缩小，防长日期标题溢出 */
  .report-head h1{font-size:24px;line-height:1.35}
  .report-content .report-head h1{font-size:24px}
  .report-meta{font-size:12.5px}
  .report-head .sub{font-size:15px;line-height:1.85}
  /* 卡片内边距收紧但保持呼吸 */
  .report-deep .card{padding:20px 16px;margin:14px 0}
  /* 编辑分析 / 大厨点评侧栏在窄屏改为上下堆叠更好读 */
  .report-deep .analysis{padding:14px 14px}
  .report-deep .chef{padding:14px 14px}
  /* 摘要卡单列 */
  .report-content .lead-grid{grid-template-columns:1fr;gap:10px}
  .report-content .summary h2{font-size:14px}
}

/* ---------- 触摸目标：不小于 44px ---------- */
@media(max-width:760px){
  .topbar nav a{min-height:44px}
  a.back{display:inline-flex;align-items:center;min-height:44px;padding:6px 0;
    font-size:14px}
  .report-mode{gap:10px}
  .report-mode button{min-height:48px;padding:13px 18px;font-size:14px}
  .report-mode #mode-status{flex-basis:100%;order:3;font-size:12px;padding-top:2px}
  .toc a{min-height:44px;display:inline-flex;align-items:center}
  .side-toc a{min-height:44px;display:inline-flex;align-items:center}
  .report-content .lead .go{min-height:44px;display:inline-flex;align-items:center}
  /* 表格内链接也要可点 */
  .report-deep td a{display:inline-block;padding:3px 0}
}

/* ---------- 统计胶囊：窄屏换行更紧凑 ---------- */
@media(max-width:760px){
  .report-content .meta-bar{gap:6px;margin:14px 0 0}
  .report-content .pill{font-size:11.5px;padding:5px 10px}
  .report-content .pill b{font-size:13.5px}
  .report-content .pill svg.icon{width:13px;height:13px}
}

/* ---------- 表格：窄屏可读化 ---------- */
@media(max-width:760px){
  .calendar-scroll{border-radius:8px}
  .report-deep th,.report-deep td{padding:10px;font-size:12.5px}
  .report-deep tbody th{width:auto;font-size:12px}
  .report-deep td:last-child{width:auto}
  .cal th,.cal td{padding:9px 10px;font-size:12.5px}
}

/* ---------- 图片 ---------- */
@media(max-width:760px){
  .report-deep figure{margin:18px 0 0}
  .report-deep figure img{border-radius:6px}
  .report-deep .story-body{max-width:none}
}

/* ---------- 评论组件窄屏 ---------- */
@media(max-width:600px){
  .comments-box{margin:32px 0 0;border-radius:11px}
  .cm-head{padding:15px 17px}
  .cm-list{padding:4px 17px 0}
  .cm-form{padding:16px 17px 18px}
  .cm-nick{max-width:100%}
  .cm-btn{margin-left:0;width:100%;min-height:46px}
  .cm-tip{width:100%}
  .cm-actions{gap:10px}
  .cm-body{font-size:15px}
}

/* ---------- 移动端导航折叠（通用）----------
   桌面端不显示按钮、导航横排；窄屏折叠为下拉面板。
   需要页面顶栏含 <button id="nav-toggle"> 且 <nav id="main-nav">。
   ============================================== */
.nav-toggle{
  display:none;align-items:center;gap:6px;flex:none;
  font:inherit;font-size:13px;color:var(--ink);
  background:transparent;border:1px solid var(--line);
  border-radius:8px;padding:9px 12px;cursor:pointer;
  min-height:44px;
}
@media(max-width:760px){
  .nav-toggle{display:inline-flex}
  .topbar .bar{flex-wrap:nowrap}
  /* 折叠状态下导航隐藏，展开时为纵向面板 */
  .topbar nav{
    display:none;position:absolute;left:0;right:0;top:100%;
    flex-direction:column;gap:0;overflow:visible;
    background:#151318;border-bottom:1px solid #303036;
    padding:6px 14px 12px;z-index:29;
  }
  .topbar nav.open{display:flex}
  .topbar nav a{
    display:flex;align-items:center;min-height:48px;width:100%;
    font-size:15px;padding:12px 10px;border-radius:8px;
  }
  .topbar nav a:hover{background:#2c2028}
}

/* ---------- 栏目专属覆盖（需同等或更高优先级）----------
   ai-deep.css / hardware-deep.css 在 max-width:760px 内用
   `.daily-report-page .ai-deep .card p`（3 class）覆盖字号，
   优先级高于本表的 `.report-deep .card p`（2 class），故在此对齐。
   ============================================== */
@media(max-width:760px){
  .daily-report-page .ai-deep .card p,
  .daily-report-page .ai-deep .card p.k{font-size:16px;line-height:1.95}
  .daily-report-page .ai-deep .card p.k{color:#c1cbd8}
  .daily-report-page .ai-deep .analysis p,
  .daily-report-page .ai-deep .chef p{font-size:15.5px;line-height:1.9}
  .daily-report-page .hardware-deep .card p{font-size:16px;line-height:1.95}
  .daily-report-page .hardware-deep .card p.k{font-size:16px}
  .daily-report-page .hardware-deep .analysis p,
  .daily-report-page .hardware-deep .chef p{font-size:15.5px;line-height:1.9}
  .daily-report-page .ai-deep .card h3,
  .daily-report-page .hardware-deep .card h3{font-size:19px}
}
