/* ============================================================
   智能组卷 · 皮肤「紫夜 · 星轨」（v）
   配色取自老师提供的海报：深紫夜空 / 紫罗兰 / 粉色缎带 / 青色星光。
   规则：只写 token 与颜色/背景/阴影，不改布局尺寸。
   ============================================================ */

/* ===== V · 紫夜（浅紫内容 + 深紫导航/首屏 + 粉紫强调） ===== */
html[data-skin="v"]{
  --bg:#f6f1fd; --panel:#ffffff; --tint:#faf7ff; --sunken:#efe4fb;
  --line:#d3bdec; --line2:#b394dd;
  --ink:#251938; --ink2:#3d2dc0; --ink3:#6a53a0; --t4:#8f78bd; --muted:#8f78bd;
  --accent:#833cdd; --accent-d:#3d2dc0; --accent-bg:#ece0fb;
  --green:#0d7a63; --green-bg:#ddf7f0; --amber:#8a5a08; --amber-bg:#fff0cc;
  --rose:#d9527c; --rose-bg:#fbe3ee; --danger:#b3123f;
  --lime:#cb64ed;
  --brand:#833cdd; --accent-weak:#f2e6fd; --bg2:#efe2fb; --panel2:#f8f2ff;
  --card-outline:1px solid #dcc9f2;
  --card-shadow:0 10px 26px rgba(74,32,150,.12), 0 1px 0 rgba(255,255,255,.8) inset;
  --btn-outline:1px solid #d3bdec;
  --btn-primary-bg:linear-gradient(135deg,#833cdd 0%,#3d2dc0 120%);
  --btn-primary-ink:#ffffff;
  --btn-primary-shadow:0 10px 24px rgba(61,45,192,.24);
  --tab-on-bg:#833cdd; --tab-on-ink:#ffffff; --tab-on-line:#833cdd;
  --nav-bg:linear-gradient(100deg,#251938 0%,#3d2dc0 62%,#833cdd 100%);
  --nav-ink:#f5f3f4; --nav-on-bg:rgba(255,255,255,.14); --nav-on-ink:#ffffff; --nav-line:#cb64ed;
  --hero-bg:
    radial-gradient(1.6px 1.6px at 18% 22%,rgba(203,100,237,.95) 50%,transparent 56%),
    radial-gradient(1.8px 1.8px at 42% 10%,rgba(245,243,244,.95) 50%,transparent 56%),
    radial-gradient(1.4px 1.4px at 71% 28%,rgba(217,82,124,.95) 50%,transparent 56%),
    radial-gradient(1.6px 1.6px at 88% 12%,rgba(245,243,244,.9) 50%,transparent 56%),
    radial-gradient(1.2px 1.2px at 55% 46%,rgba(203,100,237,.85) 50%,transparent 56%),
    radial-gradient(2px 2px at 12% 62%,rgba(245,243,244,.8) 50%,transparent 56%),
    radial-gradient(620px 460px at 86% 10%,rgba(203,100,237,.55),transparent 64%),
    radial-gradient(640px 520px at 10% 98%,rgba(38,76,233,.55),transparent 68%),
    linear-gradient(120deg,#251938 0%,#3d2dc0 52%,#833cdd 100%);
  --hero-ink:#ffffff; --hero-muted:#e7d9f7; --hero-kicker:#cb64ed;
  --hero-cta-bg:#f5f3f4; --hero-cta-ink:#3d2dc0;
  --hero-cta-shadow:0 12px 28px rgba(37,25,56,.35);
  --hero-outline:1px solid rgba(203,100,237,.5);
  --hero-shadow:0 18px 44px rgba(37,25,56,.28);
  --preview-bg:rgba(245,243,244,.14); --preview-ink:#ffffff; --preview-line:rgba(245,243,244,.34);
  --flow-bg:rgba(245,243,244,.10);
  --hero-secondary-bg:rgba(245,243,244,.14); --hero-secondary-ink:#ffffff;
  --skin-btn-bg:#251938; --skin-btn-ink:#f5f3f4; --skin-btn-line:#7c5bc5;
  --skin-menu-on-bg:rgba(245,243,244,.16); --skin-menu-on-ink:#ffffff;
}

/* 页面底色：淡紫渐变（保留纸张白） */
html[data-skin="v"] body{
  background:linear-gradient(180deg,#f8f4ff 0%,#f2eafd 55%,#f8f4ff 100%);
  background-attachment:fixed;
}
html[data-skin="v"] ::selection{background:#ffd6ef;color:#2b0f4a}

/* 首屏：星光闪烁层（纯装饰，不参与布局） */
html[data-skin="v"] #appView .home-hero{position:relative}
html[data-skin="v"] #appView .home-hero:before{
  content:"";position:absolute;inset:0;pointer-events:none;z-index:0;
  background:
    radial-gradient(2px 2px at 64% 18%,rgba(255,255,255,.9),transparent 60%),
    radial-gradient(2px 2px at 92% 62%,rgba(159,232,255,.85),transparent 60%),
    radial-gradient(2px 2px at 24% 46%,rgba(255,143,208,.75),transparent 60%);
  animation:auroraTwinkle 4.8s ease-in-out infinite alternate;
}
@keyframes auroraTwinkle{from{opacity:.35}to{opacity:.9}}
html[data-skin="v"] #appView .home-hero>*{position:relative;z-index:1}
html[data-skin="v"] #appView .home-hero h1{letter-spacing:-.4px}

/* 首屏 kicker：海报亮兰紫 */
html[data-skin="v"] #appView .home-kicker,html[data-skin="v"] #appView .home-kicker *{color:#cb64ed!important}

/* 导航当前项：粉色下弦光 */
html[data-skin="v"] #tabNav button.on{box-shadow:0 6px 16px rgba(255,143,208,.18)}
html[data-skin="v"] #appView .brand .vdot{background:#ff8fd0!important}

/* 卡片/按钮的紫夜微光 */
/* ★★ 2026-11-02（老师：紫皮肤下把整卷加入主卷后，行操作菜单跑位）——
   原来这里有一条 `html[data-skin="v"] #appView .card{backdrop-filter:blur(2px)}`。
   它是个**纯副作用**：.card 的背景是不透明的 var(--panel)，背后什么都透不过来，blur 看不出任何变化；
   但 backdrop-filter 会给卡片**建立 fixed 定位的包含块** —— 试卷行里的「⋯」菜单是 position:fixed +
   视口坐标（见 main.css .pmenu[data-open]），于是坐标被当成「相对卡片」计算：
   实测菜单跑到 (1102,423)，而按钮在 (1213,446)，偏了 (+21,-27)；页面滚动后还会整块飞出屏幕。
   删掉这条，菜单严格落在「⋯」下方；其它皮肤/以后新增的装饰别再给 .card 加 backdrop-filter。 */
html[data-skin="v"] #appView button.primary{color:#fff!important}
html[data-skin="v"] #appView button.primary:hover{filter:brightness(1.05)}
html[data-skin="v"] #appView .chip.on{box-shadow:0 0 0 1px rgba(123,77,255,.35),0 4px 12px rgba(123,77,255,.18)}
html[data-skin="v"] #appView tbody tr:hover{background:#f8f2ff}
html[data-skin="v"] #appView .toolrow input:focus,
html[data-skin="v"] #appView .toolrow select:focus{box-shadow:0 0 0 3px rgba(123,77,255,.16)}

/* 滚动条 */
html[data-skin="v"] *::-webkit-scrollbar-thumb{background:#c7b2ee;border-radius:8px}
html[data-skin="v"] *::-webkit-scrollbar-thumb:hover{background:#a98ce0}
html[data-skin="v"] *::-webkit-scrollbar-track{background:transparent}

/* 打印：主题层已有通用白纸重置；这里再兜一层背景 */
@media print{
  html[data-skin="v"], html[data-skin="v"] body{background:#fff!important;background-image:none!important;color:#111!important}
  html[data-skin="v"] #appView .home-hero:before{display:none!important}
}
/* 窄屏给父页功能栏留出左右安全区，避免盖住内容卡片边缘 */
@media(max-width:1600px){
/* ★ 2026-11-04：不再为整卷切题改动 main 宽度（会造成切换页签时左移 80px 的漂移） */
/* ★ 2026-11-04：同上，保持各页签布局一致 */
}
/* 外层只保留主站卡片这一层框，去掉 iframe 自己的边框 */
body.split-full #physicsSplitFrame{box-shadow:none!important}
html[data-skin] body.split-full #physicsSplitFrame{box-shadow:none!important}

/* ==========================================================================
   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;
  }
}
