/* ============================================================
   结构性按钮兜底层（2026-11-02）
   ------------------------------------------------------------------
   背景：skins/skin-components.css 给 #appView 里**所有** button 加了
   outline/底色，unified.css 又给 .spanel/.card 里**所有** button 统一加了
   min-height + padding —— 于是「整行/整块点击区」被撑成了普通按钮：
     · .catseg（学段页签）4 个装不下 → 职高被裁掉/挡住
     · .catchaphd（教材目录每章一行）文字被顶到行上方
     · .libfilename（教案文件名，整行点击）文字偏上、外面多个方框
     · .catbook / .catsubjs（册、学科）同病
     · 下拉/更多菜单每项变成 32px 高的大按钮
   本文件在 theme.css / skin-components.css **之后**加载；选择器都写成
   「button.类名:not(.primary):not(.danger)」以压过通用按钮规则（同优先级靠后胜）。
   普通操作按钮不在此列，不受影响。
   ============================================================ */

/* ---------- 教材目录：学段页签（小学/初中/高中/职高） ---------- */
html[data-skin] #appView .catseg{flex-wrap:wrap}
html[data-skin] #appView .catseg button:not(.primary):not(.danger){
  min-height:0!important; height:auto!important; padding:0 0 10px!important;
  border:0!important; border-radius:0!important; outline:0!important;
  box-shadow:none!important; background:transparent!important; font-size:14px!important;
}
html[data-skin] #appView .catseg button.on{
  color:var(--accent-d)!important; font-weight:600!important;
  border-bottom:2px solid var(--accent)!important;
}
html[data-skin] #appView .catseg button:hover{color:var(--accent-d)!important}

/* ---------- 教材目录：学科胶囊（语文/数学/英语…） ---------- */
html[data-skin] #appView .catsubjs button:not(.primary):not(.danger){
  min-height:26px!important; height:26px!important; padding:0 7px!important; font-size:12.5px!important;
  border:1px solid var(--line)!important; border-radius:999px!important; outline:0!important;
  box-shadow:none!important; background:transparent!important;
}
html[data-skin] #appView .catsubjs button.on{
  background:var(--accent-bg)!important; border-color:var(--accent)!important; color:var(--accent-d)!important;
}

/* ---------- 教材目录：册按钮（整块点击区） ---------- */
html[data-skin] #appView button.catbook:not(.primary):not(.danger){
  min-height:0!important; height:auto!important; padding:9px 10px!important;
  border:0!important; border-radius:8px!important; outline:0!important;
  box-shadow:none!important; background:transparent!important; font-size:14px!important;
}
html[data-skin] #appView .catbook.on{background:var(--accent-bg)!important}

/* ---------- 教材目录：每章一行（整行点击区） ---------- */
html[data-skin] #appView button.catchaphd:not(.primary):not(.danger){
  min-height:0!important; height:auto!important; padding:15px 6px 11px!important;
  border:0!important; border-radius:0!important; outline:0!important;
  box-shadow:none!important; background:transparent!important;
}
html[data-skin] #appView button.catchaphd:not(.primary):not(.danger):hover{background:var(--tint)!important}

/* ---------- 教案库 / 我的教案：文件名（整行点击区） ---------- */
html[data-skin] #appView button.libfilename:not(.primary):not(.danger){
  min-height:0!important; height:auto!important; padding:0!important;
  border:0!important; border-radius:0!important; outline:0!important;
  box-shadow:none!important; background:transparent!important;
  align-content:center!important; justify-items:start!important; text-align:left!important;
}

/* ---------- 下拉/更多菜单：恢复紧凑行高 ---------- */
html[data-skin] #appView .qmenu button:not(.primary):not(.danger),
html[data-skin] #appView .pmenu button:not(.primary):not(.danger),
html[data-skin] #paperView .pq-menu button:not(.primary):not(.danger),
html[data-skin] #appView .padel .men button:not(.primary):not(.danger),
html[data-skin] #appView #tabMoreMenu button:not(.primary):not(.danger){
  min-height:0!important; height:auto!important; padding:6px 10px!important;
  font-size:15px!important; border:0!important; border-radius:6px!important;
  outline:0!important; box-shadow:none!important; background:transparent!important;
}
html[data-skin] #appView .qmenu button:hover,
html[data-skin] #appView .pmenu button:hover,
html[data-skin] #paperView .pq-menu button:hover{background:var(--sunken)!important}


/* ---------- 皮肤切换弹层：收窄到与「皮肤」按钮差不多宽，紧贴按钮下方 ---------- */
#spSkinSwitch > div{
  width:auto!important;
  min-width:0!important;
  padding:4px!important;
  top:calc(100% + 4px)!important;
  border-radius:8px!important;
}
#spSkinSwitch > div button{
  padding:4px 7px!important;
  gap:6px!important;
  justify-content:flex-start!important;
  font-size:12.5px!important;
  line-height:1.4!important;
  white-space:nowrap!important;
  border-radius:6px!important;
}
#spSkinSwitch > div button span{white-space:nowrap}
/* 选中态高亮也收窄成小方块，不再是一条大色块 */
#spSkinSwitch > div button[aria-pressed="true"]{
  box-shadow:none!important;
}
#tabNav #spSkinSwitch > div button{
  min-height:0!important;
  height:30px!important;
  padding:0 7px!important;
}
/* 窄屏给父页功能栏留出左右安全区，避免盖住内容卡片边缘 */
@media(max-width:1600px){
/* ★ 2026-11-04：不再为整卷切题改动 main 宽度（会造成切换页签时左移 80px 的漂移） */
/* ★ 2026-11-04：同上，保持各页签布局一致 */
}
/* ★★ 2026-11-02（老师）：配图抽屉打开时，iframe 要顶到屏幕最右（抽屉才贴得上功能栏那条线）。
   这里不再用媒体查询写死宽度 —— 老师的屏幕超过 1600（main 被 max-width:1620 居中），
   媒体查询不生效，抽屉就停在卡片右边框上。改由 split-rail-dock.js 的 applyFigWide() 按实测左边距动态算。 */
/* 外层只保留主站卡片这一层框，去掉 iframe 自己的边框；
   ★ 2026-11-02：背景必须透明 —— iframe 要往右伸到浏览器边（功能栏才贴得住），
     不透明就会把卡片右边框盖住。透明之后卡片原来的边框原样露出，不用再补画线。 */
body.split-full #physicsSplitFrame{box-shadow:none!important;background:transparent!important}
html[data-skin] body.split-full #physicsSplitFrame{box-shadow:none!important;background:transparent!important}
/* ★★ 2026-11-02 22:xx（老师）：卡片右边框曾被向右溢出的 iframe 盖住，当时在父页叠了一层
   描边伪元素 —— 它压在 iframe 之上，把切题页自己的抽屉也挡住了（老师截图里那条穿过抽屉的竖线）。
   现在这条线改由切题页在 iframe 内部画（z-index 低于抽屉），父页这里整段撤掉。 */

/* ==========================================================================
   2026-11-04（老师：课堂反馈缩略图上的复制/旋转/删除小图标看不见）
   原因：本文件的 `html[data-skin] #appView button { background:var(--panel)!important }`
        把缩略图上的小图标也刷成了白底，配白字 → 隐形。
        这些是「浮在照片上的操作小标」，必须用深色半透明底 + 白字。
   说明：本文件加载在 main.css 之后，所以修复必须写在这里才压得住。
   ========================================================================== */
html[data-skin] #appView .fbimg button.fbcopy,
html[data-skin] #appView .fbimg button.fbrot,
html[data-skin] #appView .fbimg button.fbimgx,
html[data-skin] #appView .fbimg button[data-fbcopy],
html[data-skin] #appView .fbimg button[data-fbrot],
html[data-skin] #appView .fbimg button[data-fbimgx]{
  background:rgba(17,24,39,.78) !important;
  background-color:rgba(17,24,39,.78) !important;
  color:#fff !important;
  border:0 !important;
  box-shadow:none !important;
  opacity:1 !important;
  visibility:visible !important;
  padding:0 !important;
  min-width:0 !important;
  min-height:0 !important;
  font-weight:400 !important;
  line-height:1 !important;
  position:absolute !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  z-index:3;
}
/* 复制：左下一个扁标（保留内边距，因为要包住两个字） */
html[data-skin] #appView .fbimg button.fbcopy,
html[data-skin] #appView .fbimg button[data-fbcopy]{
  left:3px !important; bottom:3px !important; top:auto !important; right:auto !important;
  padding:1px 6px !important;
  border-radius:4px !important;
  font-size:10.5px !important;
  width:auto !important; height:auto !important;
}
/* 旋转：右下圆钮 */
html[data-skin] #appView .fbimg button.fbrot,
html[data-skin] #appView .fbimg button[data-fbrot]{
  left:auto !important; top:auto !important;
  right:3px !important; bottom:3px !important;
  width:19px !important; height:19px !important;
  border-radius:50% !important;
  font-size:12px !important;
}
/* 删除：右上圆钮 */
html[data-skin] #appView .fbimg button.fbimgx,
html[data-skin] #appView .fbimg button[data-fbimgx]{
  left:auto !important; bottom:auto !important;
  top:3px !important; right:3px !important;
  width:19px !important; height:19px !important;
  border-radius:50% !important;
  font-size:13px !important;
}
html[data-skin] #appView .fbimg button.fbcopy:hover,
html[data-skin] #appView .fbimg button.fbrot:hover{
  background:rgba(47,111,237,.95) !important; background-color:rgba(47,111,237,.95) !important;
}
html[data-skin] #appView .fbimg button.fbimgx:hover{
  background:rgba(220,38,38,.95) !important; background-color:rgba(220,38,38,.95) !important;
}

/* ==========================================================================
   2026-11-04（老师：很多表格下面的横线没有呈现出来）
   原因：本文件的 `#appView table tr:last-child td{border-bottom:0}` 是给**列表类表格**
        去掉末行下边线用的（避免和外框重复）；但题干里的数据表格（.mdtab）常只有
        「表头 + 1 行数据」，数据行正好是 last-child → 底边线被清掉，看起来缺一条线。
   修法：题干内的数据表格恢复四边齐全，不受 last-child 影响。
   ========================================================================== */
#appView .mdtab tr:last-child td,
#appView .mdtab tr:last-child th,
#appView .qcontent table.mdtab tr:last-child td,
html[data-skin] #appView .mdtab tr:last-child td,
html[data-skin] #appView .mdtab tr:last-child th{
  border-bottom:1px solid var(--line2) !important;
}
/* 表格本体也补一圈外框，视觉上更完整（只对题干数据表格） */
#appView .mdtab,
html[data-skin] #appView .mdtab{
  border:1px solid var(--line2) !important;
}
/* 最后一行若同时是 tbody 末行，仍保留底边 */
#appView .mdtab tbody tr:last-child td,
html[data-skin] #appView .mdtab tbody tr:last-child td{
  border-bottom:1px solid var(--line2) !important;
}

/* ==========================================================================
   2026-11-04 续：题干数据表格边框「颜色与粗细」统一
   上一版恢复了四边边框，但继承了 --line2 变量 —— 当前皮肤下它是纯黑 #0b0d12，
   在浅色页面上像加了黑框。这里固定成柔和的灰蓝色，不跟随皮肤。
   打印用 0.5pt（试卷标准细线），屏幕用 1px。
   ========================================================================== */
#appView .mdtab,
#appView .mdtab th,
#appView .mdtab td,
html[data-skin] #appView .mdtab,
html[data-skin] #appView .mdtab th,
html[data-skin] #appView .mdtab td{
  border-color:#c9d2e0 !important;
}
/* 表头与数据行之间的分隔线略深一点，层次更清楚 */
#appView .mdtab thead th,
html[data-skin] #appView .mdtab thead th{
  border-bottom-color:#aab6c8 !important;
}
@media print{
  /* 试卷打印：细实线，四边齐全 */
  #appView .mdtab, html[data-skin] #appView .mdtab{border:0.5pt solid #8a8a8a !important}
  #appView .mdtab th, #appView .mdtab td,
  html[data-skin] #appView .mdtab th, html[data-skin] #appView .mdtab td{
    border:0.5pt solid #8a8a8a !important;
  }
  /* 打印时不要斑马纹底色，省墨且更像试卷 */
  #appView .mdtab tbody tr:nth-child(even) td,
  html[data-skin] #appView .mdtab tbody tr:nth-child(even) td{
    background:transparent !important;
  }
  #appView .mdtab th, html[data-skin] #appView .mdtab th{
    background:#f2f2f2 !important;
  }
}
