/* ===== 日志解析页共用响应式（Nginx 访问 / Nginx 错误 / Java 日志） =====
   断点：>=1201 宽屏 · 901-1200 中屏 · 601-900 窄屏 · <=600 手机
   三页统一：统计卡列数、筛选块换行、表格容器滚动、工具栏成组换行。
   本文件必须在各页内联 <style> 之后加载，才能覆盖页面基础样式。 */

/* 统计数字不允许被裁切：允许换行，单位可另起一行 */
.nl-stat .v,
.ne-stat .v,
.lp-stat .v {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

/* 错误页表格：表头在容器滚动时固定 */
.ne-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
}

@media (max-width: 1200px) {
    .nl-stats,
    .lp-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ne-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nl-kv-grid,
    .lp-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* Java 日志：中屏隐藏 logger 列，给消息留足空间 */
    .lp-row { grid-template-columns: 148px 52px 120px minmax(0, 1fr) 40px; }
    .lp-logger { display: none; }
}

@media (max-width: 900px) {
    .nl-stats,
    .lp-stats,
    .ne-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nl-dist-more { grid-template-columns: 1fr; }
    .nl-compare,
    .lp-compare { grid-template-columns: 1fr; }
    .nl-file-name,
    .lp-file-name { max-width: 100%; }
    .nl-filebar-ops,
    .lp-filebar-ops { margin-left: 0; }
    /* 表格改为容器内横向滚动，不硬挤列宽 */
    .nl-table { min-width: 900px; }
    .ne-table { min-width: 640px; }
    .nl-wb-actions,
    .lp-wb-actions { margin-left: 0; width: 100%; }
    .nl-wb-actions .nl-wb-btn,
    .lp-wb-actions .lp-wb-btn { flex: 0 0 auto; }
    .ne-filters .ne-input.sm { flex: 1 1 calc(50% - 8px); width: auto; }
}

@media (max-width: 600px) {
    /* 统计卡：一列 */
    .nl-stats,
    .lp-stats,
    .ne-stats { grid-template-columns: 1fr; }
    .nl-kv-grid,
    .lp-kv-grid { grid-template-columns: 1fr; }
    .nl-stat .v,
    .lp-stat .v { font-size: 18px; }
    .ne-stat .v { font-size: 19px; }

    /* 卡片与标题收紧一档 */
    .nl-card,
    .ne-card,
    .lp-loader { padding: 14px; }
    .nl-step,
    .ne-step,
    .lp-step { font-size: 13px; }
    .nl-tip,
    .ne-tip,
    .lp-loader-tip { font-size: 11.5px; }
    .nl-privacy,
    .ne-privacy,
    .lp-privacy { padding: 10px 12px; font-size: 12.5px; }
    .nl-page .tool-title-row,
    .ne-page .tool-title-row,
    .lp-page .tool-title-row { gap: 10px; }
    .nl-page .tool-title-row .tool-icon,
    .ne-page .tool-title-row .tool-icon,
    .lp-page .tool-title-row .tool-icon { width: 42px; height: 42px; font-size: 20px; }
    .nl-page .tool-title-line h1,
    .ne-page .tool-title-line h1,
    .lp-page .tool-title-line h1 { font-size: 20px !important; }
    .nl-page .tool-title-row > div > p,
    .ne-page .tool-title-row > div > p,
    .lp-page .tool-title-row > div > p { font-size: 12.5px !important; }

    /* 筛选块：标签独占一行，控件占满 */
    .nl-filter-row,
    .lp-filter-row { flex-direction: column; gap: 4px; }
    .nl-filter-label,
    .lp-filter-label { flex-basis: auto; width: auto; padding-top: 0; }
    .nl-filter-body,
    .lp-filter-body { flex-basis: auto; width: 100%; }
    .nl-input,
    .nl-input.wide,
    .ne-input.sm { width: 100%; }
    .ne-input.sm { flex-basis: 100%; }
    .nl-format-row .nl-select,
    .nl-custom-format textarea { width: 100%; }
    .nl-sample-btn { width: 100%; }

    /* 工具栏 / 导出按钮：单列成组换行 */
    .nl-wb-actions .nl-wb-btn,
    .lp-wb-actions .lp-wb-btn { flex: 1 1 100%; }
    .nl-wb-head { gap: 8px; }
    .nl-wb-sub,
    .lp-wb-sub { flex-basis: 100%; }

    /* 文件栏、更多统计、问题清单、错误事件允许换行 */
    .nl-filebar { padding: 10px 12px; }
    .nl-more-toggle { width: 100%; justify-content: space-between; }
    .nl-issue summary { flex-wrap: wrap; }
    .nl-issue-sum { flex-basis: 100%; white-space: normal; overflow: visible; }
    .nl-dist-card { padding: 12px; }
    .ne-event { flex-wrap: wrap; }
    .ne-event .t { flex-basis: 100%; }
    .ne-orphan-item { flex-wrap: wrap; }
    .ne-orphan-ln { flex-basis: 100%; }
    .ne-lvl-note { padding: 10px 12px; }
    .ne-lvl-note dl { grid-template-columns: 54px minmax(0, 1fr); }
    .ne-lvl-help { width: 30px; height: 30px; }

    /* Java 日志：行内多列改块级单行 */
    .lp-row { display: block; padding: 7px 12px; font-size: 11.5px; }
    .lp-time,
    .lp-level,
    .lp-thread { display: inline-block; margin-right: 7px; vertical-align: middle; }
    .lp-thread { max-width: 46%; }
    .lp-msg { display: block; margin-top: 3px; }
    .lp-line-no { display: none; }
    .lp-sql-head { gap: 6px; }
    .lp-sql-head .lp-sql-ops { margin-left: 0; width: 100%; }
    .lp-sql-thread { max-width: 100%; }
    .lp-pager { gap: 6px; }
    .lp-test-table th:nth-child(2),
    .lp-test-table td:nth-child(2) { display: none; }
    .lp-sample-btn { width: 100%; }

    /* 说明区文字下调一档 */
    .tool-seo { padding: 16px; }
    .tool-seo h2 { font-size: 16px; }
    .tool-seo p,
    .tool-seo ol { font-size: 13px; }
    .nl-plan { padding: 12px 14px; }
}
