/**
 * E· 软件 · 全站流体自适应（字号由 html rem 缩放，此处补宽屏布局）
 * 配合 brand-theme.css 的 --page-width
 */

@media (min-width: 768px) {
  :root {
    --input-h: var(--input-h-fluid);
  }

  .btn-primary,
  .btn.primary {
    width: auto;
    min-width: 12rem;
    font-size: 1rem;
    min-height: var(--input-h);
  }

  .btn.secondary,
  .btn-secondary {
    font-size: 1rem;
    min-height: var(--input-h);
  }

  .panel,
  .card,
  .worksheet {
    padding: 1.125rem 1.25rem;
  }

  .panel-title,
  .card h2 {
    font-size: 1.0625rem;
  }

  .hint,
  .note {
    font-size: 0.875rem;
  }

  label,
  .field label {
    font-size: 0.9375rem;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  .main-tabs {
    max-width: min(560px, 50vw);
  }

  .main-tab {
    font-size: clamp(14px, 13px + 0.2vw, 16px);
    min-height: clamp(44px, 42px + 0.3vw, 48px);
  }

  .confirm-row,
  .screener-toolbar-run {
    display: flex;
    justify-content: flex-start;
  }

  .confirm-row .btn-primary,
  .screener-toolbar-run .screener-run,
  .screener-toolbar-run .btn-primary {
    width: auto;
    min-width: clamp(200px, 18vw, 280px);
  }
}

@media (min-width: 1280px) {
  .charts-grid {
    gap: clamp(12px, 1vw, 18px);
  }
}

/* ── 手机端贴边全宽 · 去内层双框 · 表格横铺满（标配 §5.7 · 条款 M-3.4.6）── */
@media (max-width: 767px) {
  :root {
    --page-width: 100%;
    --page-gutter: 12px;
    --page-pad-bottom: max(28px, env(safe-area-inset-bottom, 0px));
  }

  .wrap,
  .top,
  main.wrap {
    width: 100%;
    max-width: 100%;
    padding-inline: 0;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
  }

  header.site-head,
  .head-actions,
  .main-tabs,
  .lock-banner,
  .license-zone {
    padding-inline: var(--page-gutter);
  }

  .panel,
  .card,
  .worksheet,
  .license-zone {
    border-left: none;
    border-right: none;
    border-radius: 0;
    margin-inline: 0;
    box-shadow: none;
  }

  .panel,
  .card,
  .worksheet {
    padding-inline: var(--page-gutter);
    margin-bottom: 0;
    border-top: none;
    border-bottom: 1px solid var(--border);
  }

  .main-tabs {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
  }

  /* 面板内子卡片：去掉内层双框，改底部分隔线 */
  .panel > .card,
  .panel > [class*="-card"]:not(.loading-card),
  .card > .card,
  .worksheet > .card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding-inline: 0;
    box-shadow: none;
    margin-bottom: 0.625rem;
    border-bottom: 1px solid var(--border);
  }

  .panel > .card:last-child,
  .panel > [class*="-card"]:last-child,
  .card > .card:last-child,
  .worksheet > .card:last-child {
    border-bottom: none;
    margin-bottom: 0;
  }

  /* 表格区横向铺满屏宽（负边距抵消 gutter，首尾列保留内边距） */
  .table-scroll,
  .table-wrap,
  [class*="-table-wrap"] {
    margin-inline: calc(-1 * var(--page-gutter));
    width: calc(100% + 2 * var(--page-gutter));
    box-sizing: border-box;
    border-radius: 0;
    border-left: none;
    border-right: none;
    -webkit-overflow-scrolling: touch;
  }

  .table-scroll table,
  .table-wrap table,
  [class*="-table-wrap"] table {
    width: 100%;
  }

  .table-scroll th:first-child,
  .table-scroll td:first-child,
  .table-wrap th:first-child,
  .table-wrap td:first-child,
  [class*="-table-wrap"] th:first-child,
  [class*="-table-wrap"] td:first-child {
    padding-left: var(--page-gutter);
  }

  .table-scroll th:last-child,
  .table-scroll td:last-child,
  .table-wrap th:last-child,
  .table-wrap td:last-child,
  [class*="-table-wrap"] th:last-child,
  [class*="-table-wrap"] td:last-child {
    padding-right: var(--page-gutter);
  }
}
