/* 画语集 · 设备自适应层（手机 / 平板 / 电脑）
   ─────────────────────────────────────────────
   由 index.html 头部脚本给 <html> 打类：
     dev-phone / dev-tablet / dev-desktop
     dev-touch（触屏）
     ori-portrait / ori-landscape
   约定：
     · 电脑端样式完全不动（本文件对 dev-desktop 几乎不干预）
     · 手机端细节由 mobile.css 负责，这里只做"设备级"补充
     · 平板是本次新增：768~1180px 之间的布局原来直接落到桌面版
   加载顺序：style.css → mobile.css → device.css（本文件最后，优先级最高） */

/* ============ 一、平板：补上原来没有的中间档 ============ */

.dev-tablet .app {
  max-width: 960px;
  padding: 16px 18px 40px;
}

/* 平板空间够，卡片列数介于手机与桌面之间 */
.dev-tablet .grid-2 { grid-template-columns: repeat(3, 1fr); }
.dev-tablet .grid-3 { grid-template-columns: repeat(4, 1fr); }

.dev-tablet .topbar { padding: 10px 18px; }

/* 平板竖屏：内容收窄、卡片两列，避免一行太挤 */
.dev-tablet.ori-portrait .app { max-width: 820px; }
.dev-tablet.ori-portrait .grid-2 { grid-template-columns: repeat(2, 1fr); }
.dev-tablet.ori-portrait .grid-3 { grid-template-columns: repeat(3, 1fr); }

/* 平板上的详情大图别顶太高，留出下方内容可见空间 */
.dev-tablet .detail-stage .img { max-height: 62vh; }

/* ============ 二、触屏：点击目标 ≥44px（iOS/微信规范） ============ */

.dev-touch .btn-primary,
.dev-touch .btn-line,
.dev-touch .btn-ghost {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dev-touch .nav a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

/* 输入框在触屏上字号 ≥16px，避免 iOS 聚焦时自动放大页面 */
.dev-touch input,
.dev-touch select,
.dev-touch textarea { font-size: 16px; }

/* ============ 三、数据表：窄屏可横向滚动，不挤成一团 ============ */

.dev-phone .wz-tbl,
.dev-tablet .wz-tbl {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dev-phone .wz-tr { min-width: 470px; }
.dev-phone .wz-tr4 { min-width: 430px; }
.dev-tablet .wz-tr { min-width: 420px; }
.dev-tablet .wz-tr4 { min-width: 400px; }

/* 表格里禁掉省略号，改为自然换行，避免手机上看不见关键数字 */
.dev-phone .wz-tr span,
.dev-phone .wz-tr4 span,
.dev-tablet .wz-tr span,
.dev-tablet .wz-tr4 span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* ============ 四、画布 / 图片：任何设备都不许溢出 ============ */

.dev-phone canvas,
.dev-tablet canvas { max-width: 100%; height: auto; }

/* 对比板在平板/手机上两列排，别挤成四列 */
.dev-tablet .wc-board,
.dev-phone .wc-board { grid-template-columns: repeat(2, 1fr); }

/* ============ 五、电脑端：只做安全兜底，不改变观感 ============ */

.dev-desktop .wz-tbl { overflow: visible; }

/* ============ 六、调试：设备徽标 ============
   版本号后缀由 app.js 按 data-device 追加（📱手机 / ▤平板 / 空=电脑），
   这里不再重复加，避免双份。 */

/* ============ S6：桌面提到 4 列（作品集更像"上墙"）============
   依据《画语集-界面设计规范-v1》5.1 断点表：≥1200 用 4 列、容器 1280。
   只影响真正的桌面（.dev-desktop），平板仍是 3 列。 */
@media (min-width: 1200px) {
  .dev-desktop .app { max-width: 1280px; }
  .dev-desktop .grid-2 { grid-template-columns: repeat(4, 1fr); }
  .dev-desktop .grid-3 { grid-template-columns: repeat(5, 1fr); }
}

/* ============ v122：作品卡改直角 ============
   虎哥 2026-10-17：卡片圆角去掉，用直角（更接近"上墙"的画框感）。
   只改作品卡，不动弹窗/按钮等其他圆角。 */
.card,
.card .img-box,
.card .card-foot { border-radius: 0; }

/* ============ 桌面端点评报告：单栏 + 四维横排 ============
   v128（虎哥反馈）：原来把四维评分卡挂在右侧栏，右侧会留一大片空白，
   阅读动线也不顺（先看左边标题、再跳右边分数、再回左边正文）。
   改成：头部（标题+总分）→ 四维横排 4 格 → 正文，自上而下一路读下来。
   卡片限宽 900 居中，正文限宽 44em ≈ 44 汉字（中文舒适上限 40~45）。 */

@media (min-width: 1024px) {
  .dev-desktop .report-card {
    display: block;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
  }

  /* 四维：横排 4 格，紧跟头部 */
  .dev-desktop .report-card > .ai-dims4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin: 0 0 22px;
    padding: 12px 6px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  /* 单格：名称在左、分数在右上角大字、权重在下 */
  .dev-desktop .ai-dim4 {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "n s"
      "w w";
    align-items: baseline;
    gap: 2px 6px;
    padding: 2px 16px;
    border-bottom: 0;
    border-right: 1px dashed var(--line);
  }
  .dev-desktop .ai-dim4:last-child { border-right: 0; }
  .dev-desktop .ai-dim4-n { grid-area: n; font-size: 13px; }
  .dev-desktop .ai-dim4-s { grid-area: s; font-size: 22px; line-height: 1; }
  .dev-desktop .ai-dim4-w { grid-area: w; font-size: 11.5px; }

  /* 正文行宽 44em ≈ 44 汉字 */
  .dev-desktop .report-card .core-v,
  .dev-desktop .report-card .verdict-v,
  .dev-desktop .report-card .blk-t,
  .dev-desktop .report-card .dim-c {
    max-width: 44em;
  }
}

/* 四维评分卡的通用行样式（原来只写在 .dev-phone 下，桌面复用时抽出来） */
.ai-dim4 {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  font-size: 13.5px;
  line-height: 1.45;
  border-bottom: 1px dashed var(--line);
}
.ai-dim4:last-child { border-bottom: 0; }
.ai-dim4-n { font-weight: 600; color: var(--ink); }
.ai-dim4-w { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-dim4-s {
  min-width: 34px;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
