/* ==========================================================================
   智学伴 · 设计稿 1:1 视图层：app 集成样式（dsg-app.css）
   只负责「让 .dsg 设计视图嵌进 app 自己的 .phone>.screen>.view 框架」，
   视觉细节全部来自 dsg-core.css（设计稿原样）。幂等，可反复覆盖。
   ========================================================================== */

/* 首页视图：铺满，交给内部 .dsg 滚动，去掉 app 默认的居中/留白/宽度上限 */
.view#v-today{align-items:stretch;justify-content:flex-start;padding:0;overflow:hidden}
.view#v-today>.dsg{width:100%;height:100%;max-width:none;display:flex;flex-direction:column}

/* M02 学科页：同样铺满 */
.view#v-subject{align-items:stretch;justify-content:flex-start;padding:0;overflow:hidden}
.view#v-subject>.dsg{width:100%;height:100%;max-width:none;display:flex;flex-direction:column}
.view#v-subject .scr{padding-bottom:120px}
.dsg .subject .nx{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dsg .subject{cursor:pointer}
.dsg .subject:active{transform:scale(.985)}
.dsg .selector .s{cursor:pointer}
.dsg .stagetab .t{cursor:pointer}
/* 学科卡选中态（设计稿未画，app 集成补一个轻描边） */
.dsg .subject.on{outline:2px solid var(--mint);outline-offset:-2px}

/* 任务容器用 display:contents，让 .task 直接参与 .scr 的间距体系（与设计稿一致） */
.dsg #dshTasks{display:contents}

/* 底部留白：让最后一排（换个方式学 6 图标）滚到 app 居中凸起按钮之上，不被压住 */
.view#v-today .scr{padding-bottom:34px}

/* 设计稿里的可点区块给手感 */
.dsg .task{cursor:pointer;transition:transform .12s ease}
.dsg .task:active{transform:scale(.985)}
.dsg .way{cursor:pointer}
.dsg .iconbtn{cursor:pointer}
.dsg .btn.pri{cursor:pointer}

/* 桌面宽屏：把设计稿的手机版内容居中成一列，避免被拉成超宽行 */
@media (min-width:900px){
  .view#v-today>.dsg{max-width:none}
  /* 旧规则把内容挤成 460 窄条，右侧留一大片空白；改由 dsg-dock 的
     840 居中列接管，这里只清掉多余左右内边距 */
  .view#v-today .phone{padding-left:0;padding-right:0}
}

/* M11 掌握度页：铺满 */
.view#v-mastery{align-items:stretch;justify-content:flex-start;padding:0;overflow:hidden}
.view#v-mastery>.dsg{width:100%;height:100%;max-width:none;display:flex;flex-direction:column}
.view#v-mastery .scr{padding-bottom:120px}
.dsg .wrow{cursor:default}
.dsg .wg{cursor:pointer}
.dsg #dsgWeek7:active{opacity:.7}

/* M08 我的页：铺满 */
.view#v-me{align-items:stretch;justify-content:flex-start;padding:0;overflow:hidden}
.view#v-me>.dsg{width:100%;height:100%;max-width:none;display:flex;flex-direction:column}
.view#v-me .scr{padding-bottom:120px}
.dsg .m8c{cursor:pointer}
.dsg .m8c:active{transform:scale(.96)}
.dsg .reportcard{cursor:pointer}
.dsg .member{cursor:pointer}

/* ===== M10 啾啾对话页：铺满 ===== */
.view#v-chat{align-items:stretch;justify-content:flex-start;padding:0;overflow:hidden;background:var(--canvas,#F7FCF9)}
.view#v-chat>.dsg{width:100%;height:100%;max-width:none;display:flex;flex-direction:column}
/* 对话页不整页滚：消息区 #chatBody 自己滚，输入条常驻底部 */
.view#v-chat .scr{overflow:hidden;padding-top:10px}
.view#v-chat .scr>*{flex:none}
.view#v-chat #chatBody{flex:1;min-height:0}
#chatBody::-webkit-scrollbar{display:none}
/* 输入框原样式是给纯文本 .ph 的，这里换成 input 需要重置 */
.dsg .cbar input.ph{border:none;background:none;outline:none;font-family:var(--font);font-size:12.5px;color:var(--ink);min-width:0}
.dsg .cbar input.ph::placeholder{color:var(--ink-3)}
.dsg .quick span{cursor:pointer}
.dsg .cbar .ci,.dsg .cbar .sd{cursor:pointer}
.dsg .cbar .sd:active,.dsg .cbar .ci:active{transform:scale(.92)}
.dsg .kpb{cursor:pointer}
/* 多媒体卡片拉满（对齐旧 .b-wide/.has-media 行为） */
.dsg #chatBody .bub.b-wide{max-width:none;flex:1;min-width:0}
.dsg #chatBody .msg.has-media .av{display:none}
/* 消息区底部留白，最后一条不被 quick 行贴住 */
#chatBody .msg:last-child{margin-bottom:2px}

/* ===== M03 章节页（浮层，设计稿 1:1） ===== */
.layer#v-chapter{padding:0;background:var(--canvas,#F7FCF9)}
.layer#v-chapter>.dsg{width:100%;min-height:100%;display:block}
.layer#v-chapter .phone{width:100%;max-width:none;height:auto;min-height:100%;border-radius:0;box-shadow:none;overflow:visible;background:var(--canvas,#F7FCF9)}
.layer#v-chapter .phone::before{display:none}
.layer#v-chapter .phone::after{border-radius:0}
.layer#v-chapter .glow{display:none}
.layer#v-chapter .scr{height:auto;overflow:visible;padding-bottom:26px}
.layer#v-chapter .kprow{cursor:pointer}
.layer#v-chapter .kprow:active{background:#F2FAF6}

/* ===== legacy 层降级后的关键补丁 =====
   旧样式表被整体降为 @layer legacy，其中用以压过内联 style 的 !important 被移除，
   导致 [data-icon] 系列图标被内联 background 简写覆盖成空白色块。
   这里只把「必须压过内联样式」的几条补回，作用域限定在 legacy 旧 DOM（不含 .dsg）。 */
[data-icon]{background-image:var(--ds-icon)!important;background-size:82% 82%!important;background-repeat:no-repeat!important;background-position:center!important;}
[data-icon]>svg{display:none!important;}
.mi-ico{background-image:var(--ds-icon)!important;background-size:82% 82%!important;background-repeat:no-repeat!important;background-position:center!important;border-radius:32%!important;}
.bs.off .bi{background-image:var(--ds-icon)!important;background-size:82% 82%!important;background-repeat:no-repeat!important;background-position:center!important;}

/* 对话首条「正在学」胶囊：单行不折行，过长省略 */
.dsg .bub .tagx{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;display:inline-block}

/* 对话输入条：语音输入按钮（样式与 .ci 一致，聆听中变红） */
.dsg .cbar .mic{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;
  background:#F3FAF7;flex:none;cursor:pointer;transition:background .15s}
.dsg .cbar .mic svg{width:17px;height:17px;stroke:var(--mint-2);fill:none;stroke-width:1.9;
  stroke-linecap:round;stroke-linejoin:round}
.dsg .cbar .mic:hover{background:#E8F6EF}
.dsg .cbar .mic.on{background:#E0653A;animation:micPulse 1.2s infinite}
.dsg .cbar .mic.on svg{stroke:#fff}
@keyframes micPulse{0%,100%{box-shadow:0 0 0 0 rgba(224,101,58,.35)}50%{box-shadow:0 0 0 7px rgba(224,101,58,0)}}

/* 章节页：单元折叠态（点单元头收起知识点列表） */
.dsg .unit.fold .kpwrap{display:none}
.dsg .unit.fold .uh{opacity:.72}
.dsg .unit .uh .state::after{content:'';margin-left:5px;font-size:9px;color:#9FB9AE}
.dsg .unit.fold .uh .state::after{content:'▾ 展开'}
.dsg .unit:not(.fold) .uh .state::after{content:'▴ 收起'}
