/* ==========================================================
   初中学习系统 - 全局样式
   角色主题：默认家长端（靛蓝），body.student-mode 学生端（青绿）
   ========================================================== */

:root{
  --primary:#4f46e5;
  --primary-2:#6366f1;
  --primary-deep:#4338ca;
  --primary-light:#eef2ff;
  --bg:#f2f4fa;
  --card:#ffffff;
  --border:#e6e9f2;
  --text:#1f2937;
  --muted:#6b7280;
  --danger:#dc2626;
  --danger-light:#fee2e2;
  --radius:12px;
  --shadow:0 8px 30px rgba(31,41,55,.08);
  --shadow-sm:0 2px 10px rgba(31,41,55,.06);
}
body.student-mode{
  --primary:#0d9488;
  --primary-2:#14b8a6;
  --primary-deep:#0f766e;
  --primary-light:#ccfbf1;
  --bg:#fafbfd; /* 学生默认页最底层背景：趋近白色，与顶部 banner 及纯白卡片仍有区分 */
}

/* ---------- 基础重置 ---------- */
*{margin:0;padding:0;box-sizing:border-box;}
html,body{height:100%;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  background:var(--bg);color:var(--text);font-size:15px;line-height:1.6;
}
.hidden{display:none !important;}
.muted{color:var(--muted);}
.flex-sp{flex:1;}
a{color:var(--primary);text-decoration:none;}
a:hover{text-decoration:underline;}
::placeholder{color:#b3b9c9;}

/* ---------- 按钮 ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:5px;
  height:36px;padding:0 16px;border-radius:8px;border:1px solid transparent;
  font-size:15px;cursor:pointer;user-select:none;white-space:nowrap;
  transition:all .15s ease;background:none;
}
.btn:active{transform:translateY(1px);}
.btn[disabled]{opacity:.45;cursor:not-allowed;transform:none;}
.btn-primary{
  background:linear-gradient(135deg,var(--primary),var(--primary-2));color:#fff;
  box-shadow:0 4px 12px rgba(79,70,229,.28);
}
body.student-mode .btn-primary{background:linear-gradient(135deg,#7ab481,#7ab481);box-shadow:0 4px 12px rgba(45,212,191,.25);} /* 学生端提交类按钮整体再浅淡一档 */
.btn-primary:hover:not([disabled]){filter:brightness(1.08);}
.btn-plain{background:#fff;border-color:#d6dbe8;color:#4b5563;}
.btn-plain:hover:not([disabled]){border-color:var(--primary);color:var(--primary);}
.btn-danger{background:var(--danger);color:#fff;}
.btn-danger:hover:not([disabled]){filter:brightness(1.08);}
.btn-danger-plain{background:#fff;border-color:#f3b8b8;color:var(--danger);}
.btn-danger-plain:hover:not([disabled]){background:#fff5f5;border-color:var(--danger);}
.btn-ghost{color:var(--muted);}
.btn-ghost:hover:not([disabled]){background:#f1f3f9;color:var(--text);}
/* 已关联状态的按钮 */
.btn.linked-ok{border-color:#b5e0cf;color:#059669;background:#f2fdf9;}
.btn-sm{height:30px;padding:0 12px;font-size:14px;border-radius:7px;}
.btn-block{width:100%;}
.btn-lg{height:42px;font-size:16px;border-radius:10px;}

/* 文字操作链接 */
.link-btn{background:none;border:none;color:var(--primary);cursor:pointer;font-size:14px;padding:2px 6px;border-radius:5px;}
.link-btn:hover{background:var(--primary-light);}
.link-btn.danger{color:var(--danger);}
.link-btn.danger:hover{background:var(--danger-light);}
.link-btn[disabled]{color:#c1c6d4;cursor:not-allowed;background:none;}

/* ---------- 表单 ---------- */
.field{margin-bottom:16px;}
.field label{display:block;font-size:14px;color:#4b5563;margin-bottom:6px;font-weight:500;}
.field input,.field select,.field textarea,
.input{
  width:100%;height:38px;border:1px solid #d6dbe8;border-radius:8px;
  padding:0 12px;font-size:15px;color:var(--text);background:#fff;
  outline:none;transition:border .15s,box-shadow .15s;font-family:inherit;
}
.field textarea,.textarea{height:auto;padding:8px 12px;resize:vertical;line-height:1.6;}
.field input:focus,.field select:focus,.field textarea:focus,.input:focus{
  border-color:var(--primary);box-shadow:0 0 0 3px rgba(99,102,241,.15);
}
.form-err{color:var(--danger);font-size:13.5px;min-height:18px;margin:-4px 0 8px;}
.form-tip{font-size:13px;color:#9aa1b2;margin-top:4px;}
.char-count{font-size:13px;color:#9aa1b2;text-align:right;margin-top:3px;}
.char-count.over{color:var(--danger);}

/* ---------- 登录界面 ---------- */
#authScreen{
  position:fixed;inset:0;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#4338ca 0%,#6366f1 45%,#8b5cf6 100%);
  overflow:hidden;z-index:10;
}
#authScreen.student-mode{
  background:linear-gradient(135deg,#0f766e 0%,#14b8a6 45%,#2dd4bf 100%);
  --primary:#0d9488;--primary-2:#14b8a6;--primary-deep:#0f766e;--primary-light:#ccfbf1;
}
.auth-deco{position:absolute;border-radius:50%;filter:blur(60px);opacity:.5;pointer-events:none;}
.auth-deco.d1{width:420px;height:420px;background:#a5b4fc;top:-120px;left:-100px;}
.auth-deco.d2{width:360px;height:360px;background:#f0abfc;bottom:-120px;right:-80px;opacity:.4;}
.auth-deco.d3{width:260px;height:260px;background:#67e8f9;bottom:10%;left:15%;opacity:.3;}
.auth-card{
  position:relative;width:410px;max-width:92vw;background:#fff;border-radius:20px;
  padding:36px 38px 26px;box-shadow:0 25px 60px rgba(0,0,0,.25);
  animation:riseIn .45s ease;
}
@keyframes riseIn{from{opacity:0;transform:translateY(24px);}to{opacity:1;transform:none;}}
.auth-brand{text-align:center;margin-bottom:22px;}
.brand-logo{
  display:inline-flex;align-items:center;justify-content:center;
  width:40px;height:40px;border-radius:11px;color:#fff;font-size:20px;font-weight:700;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  box-shadow:0 4px 12px rgba(79,70,229,.35);
}
.brand-logo.big{width:56px;height:56px;font-size:27px;border-radius:16px;margin-bottom:10px;}
.auth-brand h1{font-size:22px;font-weight:700;letter-spacing:1px;}
.auth-brand p{font-size:13.5px;color:#9aa1b2;margin-top:3px;letter-spacing:2px;}

.role-tabs{display:flex;background:#f1f3f9;border-radius:10px;padding:4px;margin-bottom:20px;}
.rt-btn{
  flex:1;height:36px;border:none;background:none;border-radius:8px;cursor:pointer;
  font-size:15px;color:#6b7280;transition:all .18s;
}
.rt-btn.active{background:#fff;color:var(--primary);font-weight:600;box-shadow:0 2px 8px rgba(31,41,55,.1);}
#authScreen.student-mode .rt-btn.active{color:var(--primary);}

.auth-foot{text-align:center;font-size:14px;color:#6b7280;margin-top:16px;}
.auth-tip{
  margin-top:16px;padding:9px 12px;border-radius:8px;background:#f6f7fb;
  font-size:13px;color:#8b92a5;text-align:center;border:1px dashed #e2e6f0;
}

/* ---------- 顶栏与页面 ---------- */
.topbar{
  height:58px;background:#fff;border-bottom:1px solid var(--border);
  position:sticky;top:0;z-index:100;
}
.topbar-inner{
  width:80%;max-width:none;margin:0 auto;height:100%;padding:0 24px; /* 与下方筛选/列表模块（浏览器宽度80%+24px内边距）同宽，左右缘完全对齐 */
  display:flex;align-items:center;justify-content:space-between;
}
.brand{display:flex;align-items:center;gap:10px;font-size:17px;font-weight:700;}
.brand-logo{width:34px;height:34px;font-size:17px;border-radius:9px;}
.top-right{display:flex;align-items:center;gap:10px;}
.top-user{font-weight:600;}
.chip{
  display:inline-flex;align-items:center;height:26px;padding:0 10px;border-radius:13px;
  font-size:13px;font-weight:500;
}
.chip-role{background:var(--primary-light);color:var(--primary);}
.chip-linked{background:#ecfdf5;color:#059669;}
/* ---------- 视频预览与文件图标 ---------- */
.f-ico.vid{background:#8b5cf6;}
.video-wrap{width:100%;height:100%;display:flex;align-items:center;justify-content:center;background:#0b1020;border-radius:10px;overflow:hidden;}
.video-player{max-width:100%;max-height:100%;width:auto;height:auto;outline:none;}

/* ---------- 相机弹框：录像按钮 / 录制态 / 计时红点 ---------- */
.btn-rec{background:#ef4444;color:#fff;border:1px solid #ef4444;}
.btn-rec:hover{background:#dc2626;}
.btn-rec.recording{background:#7f1d1d;border-color:#7f1d1d;animation:recPulse 1.2s ease-in-out infinite;}
@keyframes recPulse{0%,100%{opacity:1;}50%{opacity:.72;}}
.rec-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#ef4444;margin-right:6px;vertical-align:1px;animation:recPulse 1s ease-in-out infinite;}
.camera-tip b{color:#ef4444;}

/* ---------- 上传进度条（学生端，文件上传服务器时顶部居中显示，成功后自动消失） ---------- */
.upload-progress{
  position:fixed;top:14px;left:50%;transform:translateX(-50%);z-index:4000;
  width:min(440px,88vw);background:#fff;border:1px solid var(--border);border-radius:12px;
  box-shadow:0 10px 32px rgba(15,23,42,.18);padding:11px 14px;display:flex;flex-direction:column;gap:7px;
}
.up-info{display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:13px;color:#334155;}
.up-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.up-pct{font-weight:700;color:#4f46e5;flex-shrink:0;}
.up-track{height:6px;border-radius:99px;background:#e2e8f0;overflow:hidden;}
.up-fill{height:100%;width:0;border-radius:99px;background:linear-gradient(90deg,#6366f1,#8b5cf6);transition:width .18s ease;}

/* 家长列表"提交数"：有提交时绿色显示 */
.submitted-num{color:#059669;font-weight:700;}

/* ---------- 项目用时（时长）---------- */
/* 时段标题行最右侧的时段总用时（家长草稿列表/详情分组行、学生首页时段行共用） */
.slot-duration{font-size:13.5px;font-weight:700;color:#4f46e5;white-space:nowrap;letter-spacing:.5px;}
/* 学生端项目标题行：标题居左（过长省略号截断）、预览按钮紧贴标题、状态/用时贴最右且上下对齐 */
.pi-title{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;}
.pi-title .pi-title-text{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pi-title .badge{flex-shrink:0;margin-left:auto;} /* auto 边距：状态+用时整体贴右，预览按钮紧贴标题 */
.pi-duration{font-size:13.5px;font-weight:600;color:#4f46e5;white-space:nowrap;flex-shrink:0;text-align:right;}
/* 添加作业弹框：标题右侧的用时输入框（两框下边缘严格对齐，与详情框间距=标题与详情间距） */
.p-title-row{display:flex;gap:8px;align-items:flex-end;margin-bottom:9px;} /* 间距统一由行容器提供 */
.proj-fields .p-title-row .p-title{margin-bottom:0;} /* 去掉标题框自身的下边距，避免垫高导致底边不齐 */
.p-title-row .p-title{flex:1;min-width:0;}
.p-duration{display:flex;align-items:center;gap:5px;flex-shrink:0;}
.p-duration input{width:84px;height:30px;border:1px solid var(--border);border-radius:8px;padding:0 10px;font-size:14px;background:#fff;}
.p-duration input:focus{outline:none;border-color:var(--primary);}
.p-duration span{font-size:13px;color:var(--muted);white-space:nowrap;}
/* 新增作业安排草稿行内的单项用时 */
.d-duration{margin-left:8px;font-size:12.5px;color:#4f46e5;font-weight:600;white-space:nowrap;}
/* 详情表格时段分组行内的总用时 */
.slot-group-inner{display:flex;align-items:center;gap:10px;}
/* 时段标题栏最右端的复制图标按钮（作业详情弹框） */
.slot-copy-btn{margin-left:auto;width:30px;height:30px;border-radius:8px;border:none;background:rgba(79,70,229,.08);color:#4f46e5;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s ease;}
.slot-copy-btn:hover{background:rgba(79,70,229,.18);}
.slot-copy-btn:active{transform:scale(.94);}
.page{width:80%;max-width:none;margin:0 auto;padding:20px 24px 50px;} /* 家长/学生默认页列表模块：浏览器宽度80% */

/* ---------- 家长端默认页：固定视口布局（页面不滚动，表头吸顶，表格内容滚动，分页栏固定底部） ---------- */
body.parent-home{overflow:hidden;}
body.parent-home .page{
  height:calc(100dvh - 58px);display:flex;flex-direction:column;
  overflow:hidden;padding-bottom:0;
}
/* #viewRoot 是 .page 的实际 flex 子元素（列表模块都在其内部），
   需要同样建立纵向 flex 链，table-card 的 flex:1/min-height:0 才能生效 */
body.parent-home #viewRoot{flex:1;min-height:0;display:flex;flex-direction:column;}
body.parent-home .filter-card,body.parent-home .toolbar{flex-shrink:0;}
/* 表格卡片占满剩余高度内部滚动；底部圆角去掉，与分页栏无缝融合为一体 */
body.parent-home .table-card{flex:1;min-height:0;overflow:auto;margin-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;}
body.parent-home .data-table th{position:sticky;top:0;z-index:2;} /* 表头吸顶（相对表格滚动容器） */
/* 分页栏作为列表卡片的一部分（flex 底部成员，仍在浏览器底部）：与表格卡片同宽同框、无上边框无缝衔接 */
body.parent-home .page-bar{
  position:static;flex-shrink:0;
  border-radius:0;border-top:none;border-bottom:none;
  justify-content:center;gap:26px;margin:0;
}

/* ---------- 家长端默认页分页栏 ---------- */
.page-bar{
  display:flex;align-items:center;gap:16px;
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-sm);padding:10px 16px;font-size:14px;color:#5b6474;
}
.page-bar b{color:#1f2937;font-weight:700;}
.page-bar .pg-ctrl{display:flex;align-items:center;gap:10px;margin:0 auto;}
.page-bar .pg-btn{
  width:30px;height:30px;border-radius:7px;border:1px solid #d6dbe8;background:#fff;
  color:#4b5563;font-size:17px;line-height:1;cursor:pointer;transition:all .15s;
}
.page-bar .pg-btn:hover:not([disabled]){border-color:var(--primary);color:var(--primary);}
.page-bar .pg-btn[disabled]{opacity:.4;cursor:not-allowed;}
.page-bar .pg-size{display:flex;align-items:center;gap:8px;}
.page-bar select{
  height:30px;padding:0 6px;border-radius:7px;border:1px solid #d6dbe8;background:#fff;
  font-size:14px;color:#374151;cursor:pointer;outline:none;
}

/* ---------- 卡片 ---------- */
.card{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow-sm);border:1px solid var(--border);}

/* ---------- 家长端：筛选模块 ---------- */
.filter-card{padding:16px 18px;display:flex;flex-wrap:wrap;gap:12px 14px;margin-bottom:4px;}
.filter-field{position:relative;}
.ff-label{font-size:13.5px;color:var(--muted);margin-bottom:5px;display:block;}
.ff-box{
  min-width:190px;height:36px;padding:0 30px 0 12px;border:1px solid #d6dbe8;border-radius:8px;
  background:#fff;display:flex;align-items:center;font-size:14px;cursor:pointer;color:#9aa1b2;
  transition:border .15s;gap:6px;max-width:280px;
}
.ff-box .ff-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.ff-box.has-value{color:var(--text);}
.ff-box:hover{border-color:var(--primary);}
.ff-box::after{
  content:"";position:absolute;right:11px;top:50%;width:7px;height:7px;margin-top:-5px;
  border-right:1.5px solid #9aa1b2;border-bottom:1.5px solid #9aa1b2;
  transform:rotate(45deg);pointer-events:none;
}
.filter-field{min-width:0;}
.filter-field .ff-box{position:relative;}

/* 科目下拉浮层 */
.pop{
  position:absolute;top:calc(100% + 6px);left:0;z-index:600;min-width:180px;
  background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);
  padding:6px;animation:popIn .15s ease;
}
@keyframes popIn{from{opacity:0;transform:translateY(-4px);}to{opacity:1;transform:none;}}
.pop-item{
  display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:7px;
  cursor:pointer;font-size:14.5px;
}
.pop-item:hover{background:#f4f6fb;}
.pop-item input{accent-color:var(--primary);width:15px;height:15px;}
.pop-foot{border-top:1px solid var(--border);margin-top:5px;padding:6px 4px 2px;text-align:right;}

/* ---------- 家长端：按钮模块 ---------- */
.toolbar{display:flex;align-items:center;gap:10px;margin:14px 0;}

/* ---------- 表格 ---------- */
.table-card{padding:0;overflow:hidden;}
.data-table{width:100%;border-collapse:collapse;font-size:14.5px;}
.data-table th{
  text-align:left;padding:12px 16px;background:#f8f9fd;color:#5b6474;font-weight:600;
  border-bottom:1px solid var(--border);white-space:nowrap;
}
.data-table td{padding:12px 16px;border-bottom:1px solid #f0f2f8;vertical-align:middle;}
.data-table tbody tr:last-child td{border-bottom:none;}
.data-table tbody tr{transition:background .12s;}
.data-table tbody tr:hover{background:#fafbff;}
.td-date{white-space:nowrap;color:#4b5563;}
/* 今天的作业日期：醒目区分色 */
.td-date.is-today{color:#e11d48;font-weight:700;}
.td-date.is-future{color:#15803d;font-weight:700;} /* 明天及以后的作业日期：深绿色 */
/* 今天/未来条目整行底色：今天浅红、明天及以后浅绿（悬停略加深） */
.data-table tbody tr.row-today{background:#fffafb;}
.data-table tbody tr.row-today:hover{background:#fff4f4;}
.data-table tbody tr.row-future{background:#f9fffb;}
.data-table tbody tr.row-future:hover{background:#f3fff7;}
.today-tag{
  display:inline-flex;align-items:center;height:18px;padding:0 7px;border-radius:9px;
  font-size:12px;font-weight:600;background:#ffe4e9;color:#e11d48;
}
/* 详情表头"速通"批量按钮 */
.th-quick{margin-left:8px;font-weight:500;font-size:13px;cursor:pointer;}
.copy-subs{display:flex;flex-wrap:wrap;gap:6px 14px;padding:8px 0 2px;}
.copy-subs .pop-item{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-size:14.5px;}
.chips-cell{display:flex;flex-wrap:wrap;gap:5px;max-width:260px;}

/* 科目彩色标签 */
.subject-chip{
  display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:11px;
  font-size:13px;font-weight:500;white-space:nowrap;
}
.sc-0{background:#fff1f2;color:#e11d48;} /* 语文 玫红 */
.sc-1{background:#eff6ff;color:#1d4ed8;} /* 数学 深蓝 */
.sc-2{background:#fffbeb;color:#b45309;} /* 英语 琥珀 */
.sc-3{background:#f0f9ff;color:#0284c7;} /* 物理 天蓝（原粉色与英语过近，已换） */
.sc-4{background:#f5f3ff;color:#7c3aed;} /* 化学 亮紫 */
.sc-5{background:#ecfeff;color:#0e7490;} /* 生物 青 */
.sc-6{background:#fff7ed;color:#ea580c;} /* 地理 亮橙（与英语暗棕琥珀拉开明度） */
.sc-7{background:#fdf4ff;color:#a21caf;} /* 历史 品紫红（原靛蓝与数学过近，已换） */
.sc-8{background:#f8fafc;color:#475569;} /* 道德与法治 石板灰 */
.sc-9{background:#fefce8;color:#ca8a04;} /* 其他 金黄（原品紫红与历史重复，已换） */
/* 科目色板共 10 色：一科一色互不重复，且均避开时段的绿色系 */

/* 时段徽标（上午/下午/晚上） */
.slot-chip{
  display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:11px;
  background:#eef2ff;color:#4f46e5;font-size:13px;font-weight:500;white-space:nowrap;vertical-align:middle;
}
.slot-chip-big{height:30px;padding:0 18px;font-size:16px;font-weight:700;letter-spacing:1px;box-shadow:0 2px 6px rgba(79,70,229,.18);}
.slot-head{margin:22px 0 12px;display:flex;align-items:center;gap:12px;}
.slot-head::after{content:'';flex:1;height:2px;background:linear-gradient(to right,#c7d2fe,transparent);border-radius:1px;} /* 标题右侧延伸线，更醒目 */
.slot-section + .slot-section .slot-head{margin-top:2px;} /* 时段区域自带间距，组内标题统一贴近容器顶部 */

/* 学生端首页时段区域：全部统一采用"下午"的绿色样式（区域/边框/装饰线/徽章同色系）；
   每个时段标题前有醒目的时段图标（上午太阳 / 下午云日 / 晚上月亮）用于区分时段；
   科目样式中的绿色系（sc-3、sc-8）已调整为粉 / 橙，避免与时段绿色混淆。
   注意：规则限定 body.student-mode，家长端（含新增作业弹框的时段列表）保持原靛蓝样式不受影响 */
body.student-mode .slot-section{border-radius:16px;padding:12px 12px 4px;margin-bottom:16px;background:#dcfce7;border:1px solid #a7dbba;}
body.student-mode .slot-section .slot-head{margin:2px 4px 12px;}
body.student-mode .slot-section .slot-head::after{background:linear-gradient(to right,#15803d,#22c55e 45%,rgba(22,163,74,0));} /* 顶部装饰线：颜色加重，左右三段自然过渡 */
body.student-mode .slot-section .slot-chip-big{background:#4ade80;color:#0c3a1e;box-shadow:0 2px 6px rgba(20,83,45,.28);gap:8px;} /* 徽章容器、文字与图标再次加深 */
body.student-mode .slot-section .slot-chip-big svg{width:20px;height:20px;flex-shrink:0;}

/* 时段标题右侧：该时段科目的圆形标签（单字圆标，沿用各科目色系；"其他"为两字圆角标），浮于行最右端、不占流不截断装饰线 */
.slot-head{position:relative;} /* 作为圆标的定位参照 */
.slot-subs{position:absolute;right:2px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;gap:7px;}
.slot-sub-dot{
  width:27px;height:27px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  font-size:13.5px;font-weight:700;line-height:1;
  box-shadow:0 1px 4px rgba(15,23,42,.10);border:1px solid rgba(15,23,42,.06);cursor:default;
}
.slot-sub-dot.two-chars{width:38px;border-radius:14px;font-size:11.5px;letter-spacing:1px;}

.review-layout{position:relative;} /* 预览区悬浮切换按钮的定位参照 */
.pv-nav-btn{
  position:absolute;top:50%;transform:translateY(-50%);z-index:5;
  width:44px;height:44px;border-radius:50%;border:1px solid rgba(255,255,255,.35);
  background:rgba(15,23,42,.38);color:#fff;font-size:26px;line-height:1;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);
  transition:background .15s ease, opacity .15s ease;
}
.pv-nav-btn:hover{background:rgba(15,23,42,.62);}
.pv-nav-btn:disabled{opacity:.25;cursor:default;background:rgba(15,23,42,.38);}
.pv-prev{left:calc(240px + 24px);} /* 避开左侧 240px 文件列表 */
.pv-next{right:24px;}
@media (max-width:860px){.pv-nav-btn{display:none;}} /* 窄屏纵向堆叠布局下隐藏悬浮按钮 */

/* 家长端详情/批改弹框：刷新图标按钮与循环检查 */
.detail-table{table-layout:fixed;width:100%;border:1px solid var(--border);border-radius:10px;} /* 列宽固定，不随内容增减而变宽变窄 */
.btn-ico{padding:0 10px !important;}
.btn-ico.spinning svg{animation:fab-spin .8s linear infinite;}
.rc-cycle{display:flex;align-items:center;gap:8px;margin:0 auto;visibility:hidden;}
.rc-cycle .cyc-pos{font-size:13.5px;color:var(--muted);min-width:52px;text-align:center;font-variant-numeric:tabular-nums;}
/* 作业详情表格内的时段分组行：吸顶显示 */
.slot-group-row td{
  position:sticky;top:0;z-index:2;
  background:#eef2ff;padding:6px 12px;border-bottom:1px solid var(--border);
}

/* 学生端右下角快捷刷新按钮 */
.fab-refresh{
  position:fixed;right:22px;bottom:22px;width:48px;height:48px;border-radius:50%;
  border:none;cursor:pointer;z-index:50;
  background:var(--primary);color:#fff;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 6px 18px rgba(37,99,235,.35);
  transition:transform .15s ease, box-shadow .15s ease;
}
.fab-refresh:hover{transform:translateY(-2px);box-shadow:0 10px 22px rgba(37,99,235,.42);}
.fab-refresh:active{transform:scale(.94);}
.fab-refresh.spinning svg{animation:fab-spin .8s linear infinite;}
@keyframes fab-spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}

/* 状态徽章 */
.badge{
  display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:11px;
  font-size:13px;font-weight:500;white-space:nowrap;
}
.st-gray{background:#f3f4f6;color:#6b7280;}
.st-blue{background:#dbeafe;color:#2563eb;}
.st-red{background:#fee2e2;color:#dc2626;}
.st-purple{background:#ede9fe;color:#7c3aed;}
.st-green{background:#d1fae5;color:#059669;}

/* 完成度进度条 */
.pbar-wrap{display:flex;align-items:center;gap:8px;min-width:120px;}
.pbar{flex:1;height:7px;border-radius:4px;background:#eef0f6;overflow:hidden;min-width:60px;}
.pbar i{display:block;height:100%;border-radius:4px;background:linear-gradient(90deg,var(--primary),var(--primary-2));transition:width .3s;}
.pbar-pct{font-size:13.5px;color:#4b5563;width:38px;text-align:right;}

/* ---------- 弹框 ---------- */
.modal-overlay{
  position:fixed;inset:0;background:rgba(23,28,45,.45);backdrop-filter:blur(2px);
  display:flex;align-items:center;justify-content:center;padding:24px;
  opacity:0;transition:opacity .18s;
}
.modal-overlay.show{opacity:1;}
.modal{
  width:100%;max-width:560px;background:#fff;border-radius:14px;box-shadow:0 24px 60px rgba(0,0,0,.22);
  max-height:92vh;display:flex;flex-direction:column;animation:modalIn .2s ease;
}
@keyframes modalIn{from{opacity:0;transform:translateY(16px) scale(.98);}to{opacity:1;transform:none;}}
.modal-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 20px 12px;border-bottom:1px solid #f0f2f8;flex-shrink:0;
}
.modal-head h3{font-size:17px;font-weight:600;}
.modal-x{
  width:28px;height:28px;border:none;background:none;border-radius:7px;cursor:pointer;
  font-size:20px;color:#9aa1b2;line-height:1;display:flex;align-items:center;justify-content:center;
}
.modal-x:hover{background:#f1f3f9;color:var(--text);}
.modal-body{flex:1 1 auto;min-height:0;padding:16px 20px;overflow-y:auto;}
.modal-foot{
  display:flex;align-items:center;justify-content:flex-end;gap:10px;
  padding:13px 20px;border-top:1px solid #f0f2f8;flex-shrink:0;
}
.modal-foot.foot-left{justify-content:space-between;}
.modal-foot.foot-left .foot-right{display:flex;gap:10px;align-items:center;}
.modal-foot .sp-count{font-size:13.5px;color:#8b92a5;}
.confirm-msg{font-size:15px;color:#374151;padding:6px 0 2px;white-space:pre-wrap;}

/* ---------- 日历（范围/单日选择） ---------- */
.cal-toolbar{display:flex;align-items:center;gap:8px;}
.cal-panels{display:flex;gap:18px;flex:1;justify-content:center;flex-wrap:wrap;}
.cal-nav-btn{
  width:30px;height:30px;border:1px solid var(--border);background:#fff;border-radius:8px;
  cursor:pointer;font-size:17px;color:#6b7280;align-self:center;flex-shrink:0;
}
.cal-nav-btn:hover{border-color:var(--primary);color:var(--primary);}
.cal-month{min-width:225px;}
.cal-title{text-align:center;font-weight:600;font-size:14.5px;margin-bottom:8px;}
/* 单日期选择器：年月标题行（下拉选择 + 左右箭头），高度固定 */
.dp-titlebar{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:8px;height:22px;}
.dp-selects{display:flex;gap:2px;}
.dp-titlebar select{
  border:none;background:transparent;font-weight:600;font-size:14.5px;color:#1f2937;
  cursor:pointer;outline:none;padding:0;height:20px;text-align:center;
}
.dp-titlebar select:hover{color:var(--primary);}
.dp-titlebar #dpYear{width:64px;}
.dp-titlebar #dpMonth{width:52px;}
.dp-titlebar .cal-nav-btn{width:20px;height:20px;font-size:15px;border-radius:6px;}
/* 日历网格固定 6 行高度：切换月份时弹框尺寸恒定不变 */
.dp-titlebar ~ .cal-panels .cal-grid{min-height:202px;}
.cal-week{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:4px;}
.cal-week span{text-align:center;font-size:13px;color:#9aa1b2;padding:4px 0;}
.cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;}
.cal-day{
  height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px;
  font-size:14px;cursor:pointer;position:relative;transition:background .1s,color .1s;
}
.cal-day:hover:not(.empty):not(.disabled){background:var(--primary-light);color:var(--primary);}
.cal-day.empty{cursor:default;}
.cal-day.disabled{color:#c9cede;cursor:not-allowed;background:none;}
.cal-day.in-range{background:var(--primary-light);color:var(--primary);border-radius:0;}
.cal-day.sel-edge{background:var(--primary);color:#fff;font-weight:600;}
.cal-day.today{color:#dc2626;font-weight:700;} /* 今天的日期数字红色定位 */
.cal-day.sel-edge.today{color:#fff;} /* 今天恰为选中端点时保持白字 */
.cal-day.sel-edge:first-child,.cal-day.sel-edge:last-child{border-radius:8px;}
/* 日历"有作业"日期标记：底部小圆点 */
.cal-day.has-mark::after{
  content:'';position:absolute;left:50%;bottom:3px;transform:translateX(-50%);
  width:5px;height:5px;border-radius:50%;background:var(--primary);pointer-events:none;
}
.cal-day.sel-edge.has-mark::after,.cal-day.in-range.has-mark::after{background:#fff;}
.cal-day.disabled.has-mark::after{opacity:.35;}
.range-info{
  text-align:center;margin-top:12px;padding:8px;border-radius:8px;background:#f6f7fb;
  font-size:14px;color:#4b5563;
}
.range-info.ok{background:var(--primary-light);color:var(--primary);font-weight:500;}

/* ---------- 完成度范围选择 ---------- */
.chips-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px;}
.chip-btn{
  height:30px;padding:0 14px;border-radius:15px;border:1px solid #d6dbe8;background:#fff;
  font-size:14px;color:#4b5563;cursor:pointer;transition:all .15s;
}
.chip-btn:hover{border-color:var(--primary);color:var(--primary);}
.chip-btn.active{background:var(--primary);border-color:var(--primary);color:#fff;}
.slider-row{display:flex;align-items:center;gap:12px;margin-bottom:14px;}
.slider-row>span{font-size:14px;color:#6b7280;width:34px;flex-shrink:0;}
.slider-row b{width:46px;text-align:right;font-size:14.5px;color:var(--primary);}
.slider-row input[type=range]{flex:1;accent-color:var(--primary);height:4px;}

/* ---------- 新增作业：一级弹框 ---------- */
.draft-head{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;margin-bottom:14px;}
.field-inline label{display:block;font-size:13.5px;color:var(--muted);margin-bottom:5px;}
.pick-box{
  min-width:160px;height:36px;border:1px solid #d6dbe8;border-radius:8px;background:#fff;
  display:flex;align-items:center;padding:0 12px;font-size:14.5px;cursor:pointer;gap:8px;
  transition:border .15s;color:var(--text);
}
.pick-box:hover{border-color:var(--primary);}
.pick-box .cal-ico{font-size:15px;opacity:.7;}
.draft-list{border:1px solid var(--border);border-radius:10px;min-height:180px;max-height:340px;overflow-y:auto;padding:10px;}
.draft-empty{height:160px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:#9aa1b2;font-size:14px;}
.draft-subject{margin-bottom:10px;}
.draft-subject:last-child{margin-bottom:0;}
.draft-subject-head{
  display:flex;align-items:center;gap:10px;padding:7px 10px;background:#f8f9fd;
  border-radius:8px;margin-bottom:6px;
}
.draft-count{font-size:13px;color:var(--muted);flex:1;}
.draft-row{
  display:flex;align-items:center;gap:12px;padding:8px 10px;border-radius:8px;
  border:1px solid #f0f2f8;margin-bottom:5px;transition:background .12s;
}
.draft-row:hover{background:#fafbff;}
.draft-proj{flex:1;min-width:0;}
.draft-proj b{display:block;font-size:14.5px;font-weight:600;}
.draft-proj .d-detail{
  font-size:13.5px;color:#8b92a5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;
}
.draft-ops{display:flex;gap:2px;flex-shrink:0;}

/* ---------- 新增作业弹框：草稿列表时段化样式（时段区域清晰区分、卡片更精致） ---------- */
.draft-list .slot-section{
  background:#f5f6fb;border:1px solid #e4e7f4;border-radius:12px;
  padding:12px;margin-bottom:12px;
}
.draft-list .slot-section:last-child{margin-bottom:0;}
.draft-list .slot-head{margin:0 0 10px;} /* 消除首个时段距列表容器顶部的大段空隙 */
.draft-list .slot-chip-big{height:26px;padding:0 14px;font-size:14px;box-shadow:0 1px 4px rgba(79,70,229,.14);}
.draft-list .draft-subject{
  background:#fff;border:1px solid #eceff8;border-radius:10px;
  padding:10px 12px;margin-bottom:10px;box-shadow:0 1px 3px rgba(30,41,59,.04);
}
.draft-list .draft-subject:last-child{margin-bottom:0;}
.draft-list .draft-subject-head{
  background:none;padding:0 0 8px;margin-bottom:8px;
  border-bottom:1px dashed #edf0f8;border-radius:0;
}
.draft-list .draft-row{border:1px solid #f1f3fa;background:#fbfcfe;}
.draft-list .draft-row:hover{background:#f4f6fd;border-color:#dfe4f7;}
.draft-list .draft-row:last-child{margin-bottom:0;}
.draft-list .draft-proj b{font-size:15px;}

/* ---------- 新增作业：二级弹框（项目卡片） ---------- */
.proj-scroll{flex:1;min-height:0;overflow-y:auto;margin-top:4px;padding-right:4px;}
.proj-card{
  display:flex;gap:12px;background:#fff;border:1px solid var(--border);border-radius:12px;
  padding:14px;margin-bottom:12px;box-shadow:var(--shadow-sm);
  transition:border .15s, box-shadow .15s;
}
.proj-card:hover{border-color:#c7cff5;box-shadow:0 4px 16px rgba(79,70,229,.10);}
.proj-no{
  width:28px;height:28px;border-radius:50%;flex-shrink:0;margin-top:2px;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));color:#fff;
  font-size:14px;font-weight:700;display:flex;align-items:center;justify-content:center;
}
.proj-fields{flex:1;min-width:0;}
.proj-fields .p-title{
  width:100%;border:none;border-bottom:1.5px solid #e6e9f2;border-radius:0;
  padding:6px 2px;font-size:16px;font-weight:600;background:transparent;
  outline:none;margin-bottom:9px;transition:border .15s;font-family:inherit;color:var(--text);
}
.proj-fields .p-title:focus{border-bottom-color:var(--primary);}
.proj-fields .p-detail{
  width:100%;border:1px solid #e6e9f2;border-radius:9px;background:#f8f9fd;
  padding:9px 12px;font-size:14.5px;line-height:1.7;resize:vertical;outline:none;
  font-family:inherit;color:var(--text);transition:all .15s;
}
.proj-fields .p-detail:focus{border-color:var(--primary);background:#fff;box-shadow:0 0 0 3px rgba(99,102,241,.12);}
.field-row{display:flex;gap:12px;}
.field-row .field{flex:1;}

/* ---------- 查阅弹框：批改列表 ---------- */
.review-cell-detail{
  max-width:400px;font-size:13.5px;color:#8b92a5;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
/* 项目标题列：单行显示；浏览器变窄列宽不足时溢出内容以省略号隐藏，不与相邻列重叠 */
.review-cell-title{font-weight:600;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.td-time{white-space:nowrap;color:#6b7280;font-size:13.5px;}
.op-group{display:flex;gap:2px;}

/* 批改弹框 */
.reject-area{margin-top:14px;}
.reject-area .ra-label{font-size:14px;font-weight:600;margin-bottom:8px;display:block;}
.reject-area .ra-label em{color:var(--danger);font-style:normal;}
/* 驳回说明弹框：富文本编辑器填满整个弹框内容区 */
#rdEditor{height:100%;display:flex;flex-direction:column;}
#rdEditor .rt-toolbar{flex-shrink:0;}
#rdEditor .rt-area{flex:1;min-height:0;max-height:none;overflow-y:auto;}

/* ---------- 富文本编辑器 ---------- */
.rt-toolbar{display:flex;gap:4px;padding:6px;border:1px solid #d6dbe8;border-bottom:none;border-radius:8px 8px 0 0;background:#f8f9fd;}
.rt-toolbar button{
  min-width:30px;height:28px;border:none;background:none;border-radius:6px;cursor:pointer;
  font-size:14px;color:#4b5563;display:flex;align-items:center;justify-content:center;padding:0 8px;
}
.rt-toolbar button:hover{background:#eceff7;color:var(--primary);}
.rt-area{
  min-height:110px;max-height:220px;overflow-y:auto;border:1px solid #d6dbe8;border-radius:0 0 8px 8px;
  padding:10px 12px;font-size:15px;outline:none;line-height:1.7;background:#fff;
}
.rt-area:focus{border-color:var(--primary);}
.rt-area:empty::before{content:attr(data-placeholder);color:#b3b9c9;pointer-events:none;}
.rt-view{
  border:1px solid var(--border);border-radius:8px;background:#fafbfe;padding:10px 12px;
  font-size:14px;color:#374151;white-space:pre-wrap;max-height:150px;overflow-y:auto;
}

/* ---------- 学生端：今日作业 ---------- */
.today-banner{
  position:sticky;top:58px;z-index:60;
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;
  padding:16px 20px;margin-bottom:16px;
  background:linear-gradient(120deg,var(--primary),var(--primary-2));border-radius:var(--radius);
  color:#fff;box-shadow:var(--shadow);
}
.today-banner h2{font-size:19px;font-weight:700;}
.today-banner p{font-size:14px;opacity:.85;margin-top:2px;}
.today-banner .tb-stat{font-size:14px;background:rgba(255,255,255,.18);padding:6px 14px;border-radius:16px;}
/* "回到今天"按钮：紧挨标题右侧 */
.today-banner .tb-title-row{display:flex;align-items:center;gap:10px;}
.today-banner .tb-title-row .btn{background:rgba(255,255,255,.16);border-color:transparent;color:#fff;}
.today-banner .tb-title-row .btn:hover:not([disabled]){background:rgba(255,255,255,.28);}
/* 今日作业全部完成：横幅中央醒目文字 */
.today-banner .tb-all-done{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  font-size:21px;font-weight:800;letter-spacing:2px;color:#fde68a;
  text-shadow:0 2px 10px rgba(0,0,0,.25);pointer-events:none;
  animation:allDonePop .45s ease;
}
@keyframes allDonePop{from{opacity:0;transform:translate(-50%,-50%) scale(.6);}to{opacity:1;transform:translate(-50%,-50%) scale(1);}}

.subject-card{margin-bottom:16px;}
.subject-card-head{
  display:flex;align-items:center;gap:10px;padding:13px 18px;border-bottom:1px solid #f0f2f8;
}
.subject-card-head .sc-name{font-size:16px;font-weight:700;}
.subject-card-head .sc-count{font-size:13.5px;color:var(--muted);flex:1;}

.project-item{
  display:flex;gap:14px;padding:15px 18px;border-bottom:1px solid #f0f2f8;
  transition:background .12s;align-items:flex-start;
}
.project-item:last-child{border-bottom:none;}
.project-item:hover{background:#fafbff;}
.pi-main{flex:1;min-width:0;}
.pi-title{font-size:15.5px;font-weight:600;display:flex;align-items:center;gap:8px;flex-wrap:nowrap;}
.pi-detail{font-size:14px;color:#6b7280;margin-top:4px;}
.pi-meta{display:flex;flex-wrap:wrap;gap:6px 18px;margin-top:9px;font-size:13.5px;color:#8b92a5;}
.pi-meta b{color:#4b5563;font-weight:600;}
.pi-comment{
  width:100%;background:#fff5f5;border:1px solid #fde2e2;color:#b91c1c;border-radius:8px;
  padding:7px 11px;font-size:13.5px;margin-top:2px;white-space:pre-wrap;
}
.pi-ops{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-top:10px;width:100%;} /* 操作按钮独立成行（位于提交文件信息行下一行），占满容器宽并贴右排列 */

/* ---------- 文件上传 / 列表 ---------- */
.upload-btns{display:flex;gap:10px;margin-bottom:6px;}
.up-tip{font-size:13px;color:#9aa1b2;margin-bottom:12px;}
.up-list{border:1px solid var(--border);border-radius:10px;min-height:120px;max-height:260px;overflow-y:auto;padding:8px;}
.up-empty{height:100px;display:flex;align-items:center;justify-content:center;color:#9aa1b2;font-size:14px;flex-direction:column;gap:6px;}
.file-item{
  display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;
  border:1px solid #f0f2f8;margin-bottom:6px;cursor:pointer;transition:background .12s;
}
.file-item:last-child{margin-bottom:0;}
.file-item:hover{background:#f6f8ff;}
.file-item.clickable:hover{background:var(--primary-light);}
.f-ico{
  width:34px;height:34px;border-radius:8px;flex-shrink:0;display:flex;align-items:center;justify-content:center;
  font-size:11.5px;font-weight:700;color:#fff;letter-spacing:.5px;
}
.f-ico.pdf{background:#ef4444;}
.f-ico.doc{background:#3b82f6;}
.f-ico.img{background:#10b981;}
.f-ico.unk{background:#9ca3af;}
.f-info{flex:1;min-width:0;}
.f-name{font-size:14.5px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.f-size{font-size:13px;color:#9aa1b2;}
.f-ops{display:flex;gap:2px;flex-shrink:0;align-items:center;}
.f-ops .link-btn{opacity:.85;}
.f-view-tag{font-size:12px;color:#b3b9c9;}

/* ---------- 文件预览 ---------- */
.preview-layout{display:flex;gap:14px;min-height:380px;}
.preview-list{
  width:190px;flex-shrink:0;border:1px solid var(--border);border-radius:10px;
  padding:8px;overflow-y:auto;max-height:440px;
}
.pv-item{
  display:flex;align-items:center;gap:8px;padding:8px;border-radius:8px;cursor:pointer;
  font-size:13.5px;margin-bottom:4px;border:1px solid transparent;
}
.pv-item:hover{background:#f4f6fb;}
.pv-item.active{background:var(--primary-light);border-color:var(--primary);color:var(--primary);font-weight:600;}
.pv-item .f-ico{width:26px;height:26px;font-size:10px;border-radius:6px;}
.pv-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;}
.preview-main{
  flex:1;border:1px solid var(--border);border-radius:10px;background:#f3f4f8;
  display:flex;align-items:center;justify-content:center;overflow:hidden;min-height:380px;position:relative;
}
.preview-main img{max-width:100%;max-height:520px;object-fit:contain;display:block;}
.preview-main iframe{position:absolute;inset:0;width:100%;height:100%;border:none;background:#fff;}
.preview-placeholder{display:flex;flex-direction:column;align-items:center;gap:10px;color:#9aa1b2;font-size:14px;padding:30px;}
.preview-placeholder .big-ico{font-size:43px;opacity:.5;}
.pv-toolbar{position:absolute;top:10px;right:10px;display:flex;gap:8px;}
.pv-count{position:absolute;top:12px;left:14px;font-size:13px;color:#8b92a5;}

/* ---------- 草稿、空状态 ---------- */
.empty-state{
  padding:50px 20px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#9aa1b2;
}
.empty-state .es-ico{width:58px;height:58px;border-radius:16px;background:#f1f3f9;display:flex;align-items:center;justify-content:center;font-size:25px;}
.empty-state p{font-size:14.5px;}

/* ---------- 吐司 ---------- */
#toastWrap{position:fixed;top:20px;left:50%;transform:translateX(-50%);z-index:9999;display:flex;flex-direction:column;gap:10px;align-items:center;}
.toast{
  display:flex;align-items:center;gap:8px;padding:10px 18px;border-radius:10px;background:#fff;
  box-shadow:0 8px 30px rgba(31,41,55,.18);font-size:14.5px;font-weight:500;
  animation:toastIn .25s ease;border-left:3px solid var(--primary);
}
.toast.out{animation:toastOut .25s ease forwards;}
.toast.success{border-left-color:#10b981;}
.toast.warn{border-left-color:#f59e0b;}
.toast.error{border-left-color:#ef4444;}
.toast .t-ico{
  width:19px;height:19px;border-radius:50%;flex-shrink:0;position:relative;
}
.toast.success .t-ico{background:#10b981;}
.toast.warn .t-ico{background:#f59e0b;}
.toast.error .t-ico{background:#ef4444;}
.toast.success .t-ico::after{
  content:"";position:absolute;left:6px;top:4px;width:5px;height:9px;
  border-right:2px solid #fff;border-bottom:2px solid #fff;transform:rotate(42deg);
}
@keyframes toastIn{from{opacity:0;transform:translateY(-14px);}to{opacity:1;transform:none;}}
@keyframes toastOut{to{opacity:0;transform:translateY(-14px);}}

/* ---------- 注册弹框角色选择 ---------- */
.role-pick{display:flex;gap:10px;margin-bottom:4px;}
.role-opt{
  flex:1;height:42px;border:1.5px solid #d6dbe8;border-radius:10px;background:#fff;cursor:pointer;
  font-size:15px;color:#6b7280;transition:all .15s;display:flex;align-items:center;justify-content:center;gap:6px;
}
.role-opt.active{border-color:var(--primary);color:var(--primary);background:var(--primary-light);font-weight:600;}

/* ---------- 响应式 ---------- */
@media (max-width:900px){
  .page{width:auto;max-width:1240px;} /* 窄屏恢复自适应，避免80%过窄 */
  .topbar-inner{width:auto;max-width:1240px;} /* 顶栏内容与列表模块同步恢复自适应，保持左右对齐 */
  .filter-field,.filter-field .ff-box{width:100%;}
  .ff-box{max-width:none;}
  .preview-layout{flex-direction:column;}
  .preview-list{width:100%;max-height:130px;display:flex;gap:6px;overflow-x:auto;align-items:flex-start;flex-shrink:0;}
  /* 竖屏堆叠时覆盖 fill 规则的 height:100%（该规则按桌面横排设计）：
     文件列表取自然高度，预览区占剩余高度，避免预览内容被挤出弹框可视区 */
  .modal-body .preview-layout.fill .preview-list{height:auto;}
  .modal-body .preview-layout.fill .preview-main{height:auto;flex:1;min-height:0;}
  .pv-item{min-width:150px;margin-bottom:0;}
  .project-item{flex-direction:column;}
  .project-item .pi-main{width:100%;} /* iPad 竖屏堆叠时主区域占满容器宽 */
  .project-item .pi-ops{width:100%;justify-content:flex-end;} /* 按钮行贴右 */
  .project-item .pi-title .badge{margin-left:auto;} /* 状态/用时在标题行内贴右 */
  .review-layout{flex-direction:column;height:auto;flex:1;min-height:0;}
  .review-side{width:100%;}
  .review-file-list{max-height:140px;}
  .review-main{height:auto;flex:1;min-height:0;} /* 纵向堆叠时占剩余高度，避免按100%整高溢出到下方控制区 */
}

/* ==========================================================
   v2 新增：弹性弹框 / 批改工作台 / 缩放预览 / 提交记录 / 拍照
   ========================================================== */

/* 弹性布局弹框（固定高宽、内部滚动） */
.modal-body.modal-body-flex{display:flex;flex-direction:column;overflow:hidden;}

/* 作业详情弹框：项目列表滚动区（适配弹框高度，底部少留白） */
.detail-scroll{flex:1;min-height:0;overflow-y:auto;}

/* 新增作业弹框：草稿列表填满剩余空间 */
.modal-body-flex .draft-list{flex:1;min-height:160px;max-height:none;}

/* 记录弹框：内容区填满剩余空间 */
.modal-body-flex .history-list{flex:1;min-height:0;overflow-y:auto;}
.modal-body-flex .empty-state{flex:1;min-height:0;}

/* 今日作业横幅：标题旁操作按钮 */
.today-banner .tb-right{display:flex;align-items:center;gap:10px;}
.today-banner .tb-right .btn{background:rgba(255,255,255,.16);border-color:transparent;color:#fff;}
.today-banner .tb-right .btn:hover:not([disabled]){background:rgba(255,255,255,.28);}

/* 回退按钮 */
.btn-warn-plain{background:#fff;border-color:#f2ce93;color:#b45309;}
/* 重提按钮：琥珀色实心，与"提交"主题色区分 */
.btn-resub{background:#d97706;border-color:#d97706;color:#fff;}
.btn-resub:hover:not([disabled]){background:#b45309;}
.btn-warn-plain:hover:not([disabled]){background:#fffaf1;border-color:#b45309;}

/* 已完成只读提示 */
.done-banner{
  background:#ecfdf5;border:1px solid #bbe7d4;color:#047857;border-radius:9px;
  padding:9px 13px;font-size:14px;margin-bottom:12px;flex-shrink:0;
}

/* 文件列表填充模式（提交弹框内部滚动） */
.up-list.fill{flex:1;min-height:0;max-height:none;}
.up-list .file-item.active-fi,.review-files .file-item.active-fi{
  border-color:var(--primary);background:var(--primary-light);
}

/* ---------- 批改工作台：左侧文件列表 + 右侧预览 ---------- */
/* 上半部分填满弹框剩余高度（底栏仅一行卡片），左右两区域严格等高 */
.review-layout{
  flex:1 1 auto;min-height:280px;
  display:flex;gap:14px;
}
.review-side{width:240px;flex-shrink:0;min-height:0;}
.review-side-head{
  display:flex;align-items:center;justify-content:space-between;
  font-size:14px;font-weight:600;color:#4b5563;padding:2px 4px 8px;flex-shrink:0;
}
.review-files{
  height:100%;display:flex;flex-direction:column;min-height:0;
  border:1px solid var(--border);border-radius:10px;padding:8px;background:#fafbfe;
}
.review-file-list{flex:1;min-height:0;overflow-y:auto;}
.review-files .file-item{cursor:pointer;background:#fff;}
/* 预览区：覆盖全局 min-height，保证与左侧文件列表等高、内部预览内容占满 */
.review-main{flex:1;min-width:0;min-height:0;height:100%;}
.review-main.preview-main{min-height:0;align-items:stretch;justify-content:stretch;}
.review-main.preview-main > *{width:100%;height:100%;}
.review-main.preview-main > img{width:auto;height:auto;max-width:100%;max-height:100%;object-fit:contain;}
.review-controls{
  flex-shrink:0;border-top:1px solid #f0f2f8;margin-top:12px;padding-top:12px;
  display:flex;gap:16px;align-items:stretch;
}
/* 科目 / 项目 / 批改结果水平一行，三卡等宽 */
.review-controls > .rc-card{flex:1;min-width:0;}
.rc-card{
  background:#f8f9fd;border:1px solid #e6e9f4;border-radius:10px;
  padding:6px 12px;display:flex;align-items:center;gap:8px;white-space:nowrap;
}
.rc-label{font-size:13px;color:#8b92a5;flex-shrink:0;}
.rc-value{
  font-size:14.5px;color:#1f2937;font-weight:600;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.rc-seg{display:flex;background:#eef0f7;border-radius:8px;padding:3px;gap:3px;flex-shrink:0;}
.rc-seg button{
  border:none;background:transparent;padding:4px 14px;border-radius:6px;cursor:pointer;
  font-size:14px;color:#6b7280;font-weight:500;transition:all .15s;
}
.rc-seg button:hover{color:#374151;}
.rc-seg button.active{background:#fff;box-shadow:0 1px 4px rgba(31,41,55,.14);font-weight:600;}
.rc-seg button[data-r="pass"].active{color:#059669;}
.rc-seg button[data-r="reject"].active{color:var(--danger);}

/* ---------- 缩放预览 ---------- */
.zoom-wrap{width:100%;height:100%;display:flex;flex-direction:column;position:relative;}
.zoom-bar{
  position:absolute;top:10px;right:12px;z-index:6;display:flex;align-items:center;gap:4px;
  background:rgba(255,255,255,.95);border:1px solid var(--border);border-radius:9px;
  padding:3px 6px;box-shadow:var(--shadow-sm);
}
.zoom-btn{
  width:26px;height:26px;border:none;background:none;border-radius:6px;cursor:pointer;
  font-size:16px;color:#4b5563;display:flex;align-items:center;justify-content:center;
}
.zoom-btn:hover{background:#f1f3f9;color:var(--primary);}
.zoom-pct{font-size:13px;color:#6b7280;min-width:38px;text-align:center;}
.zoom-viewport{flex:1;min-height:0;overflow:auto;padding:14px 0;cursor:grab;touch-action:pan-x pan-y;} /* 无横向内边距：内容宽度恒等于预览区宽度 */
.zoom-viewport.dragging{cursor:grabbing;user-select:none;}
.zoom-content{margin:0 auto;display:block;width:fit-content;} /* 块级+auto外边距：窄于区域时水平居中，超出时可从左侧滚动 */
.zoom-content img{max-width:none;max-height:none;display:block;box-shadow:var(--shadow-sm);}

/* Word 文档纸张式预览 */
.doc-preview{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:18px;}
.doc-paper{
  background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-sm);
  padding:30px 34px;display:flex;flex-direction:column;align-items:center;gap:10px;
  max-width:min(420px,90%);max-height:100%;overflow-y:auto;text-align:center;
}
.doc-paper .f-ico{width:52px;height:52px;font-size:16px;border-radius:12px;}
.doc-name{font-size:16px;font-weight:600;color:#1f2937;word-break:break-all;}
.doc-meta{font-size:13.5px;color:#8b92a5;}
.doc-note{
  font-size:13.5px;color:#6b7280;line-height:1.7;background:#f8f9fd;
  border:1px dashed #d8dceb;border-radius:9px;padding:9px 13px;
}
.doc-paper [data-dl]{margin-top:4px;}
/* Word 文档真实内容预览（mammoth 渲染的纸张） */
.doc-loading{
  width:100%;height:100%;display:flex;align-items:center;justify-content:center;
  color:#8b92a5;font-size:15px;letter-spacing:1px;
}
.docx-paper{
  width:min(860px,100%);height:100%;margin:16px auto;background:#fff;border-radius:10px;
  box-shadow:0 6px 24px rgba(0,0,0,.09);padding:44px 54px;overflow-y:auto;
}
.docx-render{font-size:15.5px;line-height:1.95;color:#24292f;word-break:break-word;}
.docx-render h1,.docx-render h2,.docx-render h3{color:#111827;line-height:1.5;margin:18px 0 10px;}
.docx-render h1{font-size:22px;}.docx-render h2{font-size:19px;}.docx-render h3{font-size:17px;}
.docx-render p{margin:10px 0;}
.docx-render img{max-width:100%;border-radius:6px;}
.docx-render table{border-collapse:collapse;width:100%;margin:12px 0;}
.docx-render th,.docx-render td{border:1px solid #e2e5ec;padding:7px 11px;font-size:14.5px;}
.docx-render th{background:#f6f7fb;font-weight:600;}
.docx-render ul,.docx-render ol{margin:10px 0;padding-left:24px;}
.docx-render a{color:var(--primary);}
/* PDF.js 连续页面预览：纵向排列、上下滚动、每页水平居中 */
.pdf-flow{
  width:100%;height:100%;overflow-y:auto;
  display:flex;flex-direction:column;align-items:center;gap:16px;
  padding:16px 0;box-sizing:border-box; /* 无横向内边距：页面宽度恒等于预览区宽度 */
}
.pdf-page-canvas{
  width:100%;height:auto; /* 显示宽度恒等于弹框预览区宽度（等比高度），与渲染分辨率解耦 */
  background:#fff;border-radius:6px;box-shadow:0 4px 18px rgba(0,0,0,.12);
  flex-shrink:0;
}

/* 预览弹框填充 */
.preview-layout.fill{flex:1;min-height:0;}
.preview-layout.fill .preview-list{max-height:none;height:100%;}
.preview-layout.fill .preview-main{height:100%;min-height:0;}
.preview-main.fill-h{height:100%;}
.preview-main{position:relative;}

/* ---------- 提交记录（时间轴） ---------- */
.history-list{position:relative;padding-left:6px;}
.h-item{position:relative;padding:0 0 18px 20px;border-left:2px solid #e6e9f2;}
.h-item:last-child{padding-bottom:2px;}
.h-dot{
  position:absolute;left:-8px;top:3px;width:12px;height:12px;border-radius:50%;
  background:#fff;border:3px solid var(--primary);
}
.h-item.h-pass .h-dot{border-color:#10b981;}
.h-item.h-reject .h-dot{border-color:var(--danger);}
.h-item.h-rollback .h-dot{border-color:#f59e0b;}
.h-head{display:flex;align-items:baseline;gap:10px;}
.h-head b{font-size:14.5px;}
.h-time{font-size:13px;color:#9aa1b2;}
.h-files{margin-top:6px;display:flex;flex-direction:column;gap:4px;align-items:flex-start;}
.h-file{
  font-size:13.5px;color:#4b5563;background:#f6f7fb;border-radius:6px;
  padding:4px 9px;width:fit-content;max-width:100%;
}
.h-comment{
  margin-top:6px;background:#fff5f5;border:1px solid #fde2e2;color:#b91c1c;
  border-radius:8px;padding:7px 11px;font-size:13.5px;white-space:pre-wrap;
}
.h-note{margin-top:6px;font-size:13.5px;color:#6b7280;}

/* ---------- 拍照上传（摄像头） ---------- */
.camera-wrap{
  background:#101318;border-radius:12px;overflow:hidden;aspect-ratio:4/3;
  max-height:60vh;margin:0 auto; /* 取景框比例由 JS 按摄像头实际流尺寸动态设置，与拍出的照片严格一致 */
  display:flex;align-items:center;justify-content:center;
}
.camera-wrap video{width:100%;height:100%;object-fit:contain;} /* contain 保证所见即所得，不裁切 */
.camera-tip{text-align:center;margin-top:10px;font-size:13.5px;color:var(--muted);}

/* ---------- 家长端作业详情：表格内时段分组行（字号比通用大号徽标小一号） ---------- */
.slot-group-row .slot-chip-big{height:28px;padding:0 16px;font-size:15px;box-shadow:none;}

/* ---------- 学生账户全局文字 +1px（body.student-mode 作用域，家长端不受影响） ---------- */
body.student-mode{font-size:16px;}
body.student-mode .btn{font-size:16px;}
body.student-mode .btn-sm{font-size:15px;}
body.student-mode .btn-lg{font-size:17px;}
body.student-mode .link-btn{font-size:15px;}
body.student-mode .field label{font-size:15px;}
body.student-mode .form-err{font-size:14.5px;}
body.student-mode .form-tip,body.student-mode .char-count{font-size:14px;}
body.student-mode .modal-head h3{font-size:18px;}
body.student-mode .confirm-msg{font-size:16px;}
body.student-mode .today-banner h2{font-size:20px;}
body.student-mode .today-banner p,body.student-mode .today-banner .tb-stat{font-size:15px;}
body.student-mode .subject-card-head .sc-name{font-size:21px;} /* 科目标题 +1+3 */
body.student-mode .subject-card-head .subject-chip{
  height:26px;padding:0 11px;border-radius:13px;font-size:18.4px; /* 首页科目名称增大0.15倍（基础16px×1.15），容器同步加大 */
}
body.student-mode .subject-card-head .sc-count{font-size:14.5px;}
body.student-mode .pi-title{font-size:19.5px;} /* 作业标题 +3 */
body.student-mode .pi-detail{font-size:18px;}  /* 作业详情 +3 */
body.student-mode .pi-meta{font-size:16.7px;}  /* 提交文件/最后提交时间/批改时间等字段增大0.15倍 */
body.student-mode .pi-ops .btn-sm{height:36px;font-size:17.25px;padding:0 14px;} /* 重提/预览/记录/回退按钮增大0.15倍 */
body.student-mode .up-tip,body.student-mode .up-empty{font-size:14px;}
body.student-mode .f-name{font-size:15.5px;}
body.student-mode .f-size{font-size:14px;}
body.student-mode .f-view-tag{font-size:13px;}
body.student-mode .pv-item .f-ico{font-size:11px;}
body.student-mode .preview-placeholder{font-size:15px;}
body.student-mode .pv-count{font-size:14px;}
body.student-mode .empty-state p{font-size:15.5px;}
body.student-mode .slot-chip{font-size:14px;}
body.student-mode .slot-chip-big{font-size:17px;font-weight:800;} /* 时段文字加粗 */
body.student-mode .slot-duration{font-weight:800;} /* 时段后的时长文字加粗 */
body.student-mode .h-head b{font-size:15.5px;}
body.student-mode .h-time{font-size:14px;}
body.student-mode .h-note{font-size:14.5px;}
body.student-mode .camera-tip{font-size:14.5px;}
body.student-mode .cal-title{font-size:15.5px;}
body.student-mode .dp-titlebar .cal-nav-btn{font-size:16px;}
body.student-mode .cal-week span{font-size:14px;}
body.student-mode .slider-row>span{font-size:15px;}
body.student-mode .slider-row b{font-size:15.5px;}
body.student-mode .field-inline label{font-size:14.5px;}
body.student-mode .zoom-pct{font-size:14px;}
body.student-mode .doc-name{font-size:17px;}
body.student-mode .doc-meta{font-size:14.5px;}
body.student-mode .docx-render{font-size:16.5px;}
body.student-mode .docx-render h1{font-size:23px;}
body.student-mode .docx-render h2{font-size:20px;}
body.student-mode .docx-render h3{font-size:18px;}
body.student-mode .docx-render th,body.student-mode .docx-render td{font-size:15.5px;}
body.student-mode .brand{font-size:18px;}

/* ==========================================================
   聊天（家长/学生共用）
   ========================================================== */
/* 顶栏关联学生图标按钮（退出登录左侧）：未关联灰色，已关联绿色 */
.btn-link-ico{ width:34px;height:34px;border-radius:50%;border:1.5px solid #cbd5e1;color:#94a3b8;
  background:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;
  transition:all .15s ease;padding:0; }
.btn-link-ico:hover{ border-color:#94a3b8;color:#64748b; }
.btn-link-ico.is-linked{ border-color:#86efac;background:#f0fdf4;color:#16a34a; }
.btn-link-ico.is-linked:hover{ background:#dcfce7;border-color:#4ade80; }

/* 聊天弹框 */
.chat-wrap{ display:flex;flex-direction:column;height:100%;min-height:0; }
.chat-topbar{ display:flex;gap:8px;align-items:center;padding-bottom:10px;border-bottom:1px solid #eef0f4; }
.chat-date,.chat-q{ height:34px;border:1px solid #d9dee7;border-radius:8px;padding:0 10px;font-size:14px;color:#1f2937;background:#fff; }
.chat-date{ width:150px;flex-shrink:0; }
.chat-q{ flex:1;min-width:0; }
.chat-list{ flex:1;min-height:0;overflow-y:auto;padding:14px 4px 6px;display:flex;flex-direction:column;gap:12px; }
.chat-empty{ margin:auto;color:#94a3b8;font-size:14.5px;text-align:center;padding:20px 0; }
.msg-row{ display:flex; }
.msg-row.me{ justify-content:flex-end; }
.msg-row.other{ justify-content:flex-start; }
.msg-bubble{ max-width:76%;background:#f1f5f9;border-radius:12px;padding:8px 12px; }
.msg-row.me .msg-bubble{ background:#dbeafe; }
.msg-meta{ display:flex;align-items:center;gap:10px;font-size:12.5px;color:#64748b; }
.msg-revoke{ border:0;background:none;color:#94a3b8;font-size:12.5px;cursor:pointer;padding:0; }
.msg-revoke:hover{ color:#ef4444; }
.msg-text{ margin-top:4px;font-size:15px;color:#1f2937;white-space:pre-wrap;word-break:break-word; }
.msg-files{ display:flex;flex-direction:column;gap:6px;margin-top:6px; }
.msg-file{ display:inline-flex;align-items:center;gap:8px;background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:6px 10px;cursor:pointer;max-width:100%; }
.msg-file:hover{ border-color:#93c5fd; }
.mf-name{ font-size:14px;color:#1f2937;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:260px; }
.mf-size{ font-size:12.5px;color:#94a3b8;flex-shrink:0; }
/* 消息中的图片缩略图：约占对话框（80vw）宽度三分之一，宽高比不变；点击弹框预览 */
.msg-imgwrap{ display:inline-block;cursor:pointer;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden;background:#fff;max-width:100%; }
.msg-imgwrap:hover{ border-color:#93c5fd; }
.msg-img{ display:block;width:calc(80vw / 3);height:auto; }
.chat-attach{ display:flex;flex-wrap:wrap;gap:6px;padding:8px 0 2px;border-top:1px dashed #eef0f4; }
.att-chip{ display:inline-flex;align-items:center;gap:6px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:4px 8px; }
.ac-name{ font-size:13.5px;color:#1f2937;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.ac-size{ font-size:12px;color:#94a3b8;flex-shrink:0; }
.ac-x{ border:0;background:none;color:#94a3b8;cursor:pointer;font-size:16px;line-height:1;padding:0 2px; }
.ac-x:hover{ color:#ef4444; }
.chat-inputbar{ display:flex;gap:8px;align-items:center;padding-top:10px;border-top:1px solid #eef0f4; }
.chat-inputbar #chatText{ flex:1;min-width:0;height:38px;border:1px solid #d9dee7;border-radius:8px;padding:0 12px;font-size:14.5px; }
.chat-inputbar .btn-sm{ height:38px; } /* 文件/发送按钮与文字输入框等高 */

/* 文件选择二级弹框：左右各 50% */
.fp-layout{ display:flex;gap:14px;height:100%;min-height:0; }
.fp-col{ flex:1;min-width:0;display:flex;flex-direction:column;border:1px solid #e8ebf1;border-radius:12px;padding:10px; }
.fp-col-head{ display:flex;gap:8px;align-items:center;margin-bottom:8px; }
.fp-col-head input[type=text]{ flex:1;min-width:0;height:34px;border:1px solid #d9dee7;border-radius:8px;padding:0 10px;font-size:14px; }
.fp-list{ flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:6px; }
.fp-item{ display:flex;align-items:center;gap:8px;border:1px solid #eef0f4;border-radius:8px;padding:7px 9px;cursor:pointer;background:#fff; }
.fp-item:hover{ background:#f8fafc; }
.fp-item input[type=checkbox]{ width:16px;height:16px;flex-shrink:0;cursor:pointer; }
.fp-item .fi-name{ flex:1;min-width:0;font-size:14px;color:#1f2937;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.fp-item .fi-size{ font-size:12px;color:#94a3b8;flex-shrink:0; }
.fp-item .fi-date{ font-size:12px;color:#94a3b8;flex-shrink:0; }
.fp-col-foot{ padding-top:8px;display:flex;justify-content:flex-end; }
.fp-empty{ margin:auto;color:#94a3b8;font-size:14px; }

/* 学生端聊天悬浮按钮（刷新按钮上方）+ 未读徽标 */
.fab-chat{ bottom:86px; }
.fab-badge{ position:absolute;top:-5px;right:-5px;min-width:20px;height:20px;border-radius:10px;background:#ef4444;color:#fff;
  font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;padding:0 5px;
  box-shadow:0 2px 6px rgba(239,68,68,.4); }
/* 家长端聊天按钮右上角未读徽标 */
.btn-badge-host{ position:relative; }
.btn-badge-host .fab-badge{ top:-7px;right:-9px;z-index:2; }

/* 文件选择弹框行尾预览按钮 */
.fp-pv{ flex-shrink:0;width:28px;height:28px;border-radius:7px;border:1px solid #e2e8f0;background:#fff;
  color:#64748b;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;
  transition:all .15s ease; }
.fp-pv:hover{ border-color:#93c5fd;background:#eff6ff;color:#2563eb; }

/* 弹框打开期间锁定页面滚动；弹框内滚动到头不向下层传递（触摸端防滚动穿透） */
body.modal-open{ overflow:hidden; }
.modal-body{ overscroll-behavior:contain; }
.chat-list,.fp-list,.detail-scroll,.preview-main{ overscroll-behavior:contain; }

/* 单文件预览弹框（聊天附件） */
.pv-solo{ height:100%;display:flex; }
.pv-solo .preview-main{ flex:1;min-width:0;height:100%; }

/* ==========================================================
   项目库（家长）+ 标题 @ 联想 + @ 标题关联图片预览（家长/学生共用）
   ========================================================== */

/* @ 项目标题右侧的关联图片预览按钮（眼睛图标，家长详情表格 + 学生列表通用） */
.tpv-btn{
  flex-shrink:0;width:26px;height:26px;border-radius:8px;border:none;cursor:pointer;padding:0;
  background:rgba(79,70,229,.1);color:#4f46e5;
  display:inline-flex;align-items:center;justify-content:center;
  transition:background .15s ease;
}
.tpv-btn:hover{background:rgba(79,70,229,.22);}
.tpv-btn svg{width:15px;height:15px;}
body.student-mode .tpv-btn{width:30px;height:30px;border-radius:9px;} /* 学生端标题字号更大，按钮同步放大 */
body.student-mode .tpv-btn svg{width:17px;height:17px;}
td .tpv-btn{margin-left:8px;} /* 家长详情表格单元格内紧跟标题 */

/* ---------- 项目库列表弹框（70vw × 90vh，底部固定分页栏） ---------- */
.tpl-toolbar{display:flex;gap:8px;align-items:center;flex-shrink:0;padding-bottom:12px;}
.tpl-toolbar input{
  flex:1;min-width:0;height:36px;border:1px solid var(--border);border-radius:8px;
  padding:0 12px;font-size:14.5px;background:#fff;
}
.tpl-toolbar input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(99,102,241,.12);}
.tpl-toolbar .btn{flex-shrink:0;}
.tpl-scroll{flex:1;min-height:0;overflow:auto;border:1px solid var(--border);border-radius:10px;background:#fff;}
.tpl-table{table-layout:fixed;} /* 固定列宽：名称列收窄，图片列相应加宽 */
.tpl-table th{position:sticky;top:0;z-index:2;} /* 表头吸顶（data-table th 已有吸底色） */
.tpl-table td{padding:16px;} /* 行高较默认增加约 50%，保证关联图更大 */
.tpl-td-name{overflow:hidden;}
.tpl-table .tpl-name{font-weight:600;color:#1f2937;word-break:break-all;}
.tpl-table .tpl-subject{
  display:inline-block;margin-left:10px;padding:2px 10px;border-radius:99px;
  background:#eef2ff;color:#4f46e5;font-size:12.5px;font-weight:600;vertical-align:1px;white-space:nowrap;
}
.tpl-thumb{
  width:96px;height:69px;object-fit:cover;border-radius:8px;border:1px solid #e8ebf1;
  background:#f6f7fb;display:block;cursor:zoom-in;transition:border-color .15s ease,transform .15s ease;
}
.tpl-thumb:hover{border-color:#a5b4fc;transform:scale(1.03);}
/* 科目下拉多选框（项目库查询栏最前） */
.tpl-sub-multi{position:relative;flex-shrink:0;}
.tpl-sub-btn{
  height:36px;min-width:96px;padding:0 14px;border:1px solid var(--border);border-radius:8px;
  background:#fff;font-size:14px;font-weight:600;color:#334155;cursor:pointer;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;white-space:nowrap;max-width:260px;overflow:hidden;
}
.tpl-sub-btn::after{content:'▾';font-size:11px;color:#94a3b8;}
.tpl-sub-btn:hover{border-color:#a5b4fc;}
.tpl-sub-btn.active{color:#4f46e5;border-color:#c7d2fe;background:#eef2ff;}
/* 面板紧贴按钮下沿（top:100% 无间隙），鼠标从按钮移入面板不会中断 */
.tpl-sub-panel{
  position:absolute;top:100%;left:0;z-index:30;width:220px;
  background:#fff;border:1px solid #e2e8f0;border-radius:12px;box-shadow:0 16px 40px rgba(15,23,42,.16);padding:8px;
}
.tpl-sub-head{
  display:flex;align-items:center;justify-content:space-between;
  padding:4px 8px 8px;margin-bottom:6px;border-bottom:1px solid #eef2f7;
}
.tpl-sub-head span{font-size:12.5px;font-weight:700;color:#94a3b8;letter-spacing:1px;}
.tpl-sub-list{max-height:330px;overflow:auto;}
.tpl-sub-opt{
  display:flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;
  border:none;background:none;padding:8px 10px;border-radius:8px;
  font-size:14px;color:#334155;cursor:pointer;white-space:nowrap;text-align:left;
}
.tpl-sub-opt:hover{background:#f1f5f9;}
.tpl-sub-opt.sel{background:#eef2ff;color:#4f46e5;font-weight:600;} /* 当前选中科目 */
.tpl-sub-opt.sel::after{content:'✓';margin-left:auto;font-size:13px;font-weight:700;} /* 居左排列，选中项右侧对勾 */
/* 项目库按科目分组的分组行 */
.tpl-table .tpl-group-row td{
  background:#f6f8ff;border-top:1px solid #e4e9f5;border-bottom:1px solid #e4e9f5;
  padding:10px 16px;overflow:hidden;
}
.tpl-table .tpl-group-row .tpl-group-count{margin-left:10px;font-size:13px;font-weight:600;color:#64748b;}
/* 弹框底部固定分页栏（复用家长端 page-bar 样式；覆盖 body.parent-home .page-bar 的 fixed 贴底规则，固定在弹框底部而非浏览器底部） */
.modal-overlay .page-bar.tpl-pagebar{
  position:static;
  width:100%;justify-content:center;gap:26px;
  border:none;box-shadow:none;background:transparent;padding:8px 0 0;flex-shrink:0;
}

/* ---------- 新增/编辑项目关联图（科目、名称、图片上传区：点击选择或拖拽） ---------- */
.req{color:#ef4444;font-style:normal;margin-left:2px;}
.tpl-upload{
  position:relative;height:150px;border:1.5px dashed #c7cbe0;border-radius:12px;
  background:#fafbff;cursor:pointer;overflow:hidden;
  transition:border-color .15s ease,background .15s ease;
}
.tpl-upload:hover{border-color:#818cf8;background:#f5f6ff;}
.tpl-upload.drag{border-color:var(--primary);background:#eef2ff;}
.tpl-up-empty{
  height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  color:#8b92a5;font-size:14.5px;font-weight:500;text-align:center;padding:0 16px;
}
.tpl-up-tip{font-size:12.5px;color:#aab0c0;font-weight:400;}
.tpl-up-prev{position:relative;height:100%;display:flex;align-items:center;justify-content:center;background:#f6f7fb;}
.tpl-up-prev img{max-width:100%;max-height:100%;object-fit:contain;display:block;}
.tpl-up-clear{
  position:absolute;top:6px;right:6px;width:26px;height:26px;border-radius:50%;border:none;
  background:rgba(17,24,39,.55);color:#fff;font-size:16px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;padding:0;
}
.tpl-up-clear:hover{background:rgba(17,24,39,.78);}

/* ---------- 标题输入 @ 联想下拉（挂在输入框父元素上） ---------- */
.p-title-row,.field{position:relative;} /* 作为 .at-dd 的定位参照 */
.at-dd{
  position:absolute;left:0;top:100%;margin-top:4px;z-index:30;
  width:min(360px,100%);max-height:240px;overflow-y:auto;
  background:#fff;border:1px solid #e2e5f0;border-radius:10px;
  box-shadow:0 10px 32px rgba(31,41,55,.16);padding:4px;
}
.at-item{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:8px;cursor:pointer;}
.at-item:hover,.at-item.active{background:#eef2ff;} /* .active 为键盘上下选择的高亮项 */
.at-name{flex:1;min-width:0;font-size:14px;color:#1f2937;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.at-img{width:44px;height:33px;object-fit:cover;border-radius:6px;border:1px solid #e8ebf1;background:#f6f7fb;flex-shrink:0;}
.at-empty{padding:12px 10px;font-size:13.5px;color:#9aa1b2;text-align:center;}
/* @ 联想缩略图悬浮放大层：跟随鼠标附近显示大图，pointer-events 不阻挡输入操作 */
.at-zoom{position:fixed;z-index:4000;width:450px;height:337px;background:#fff;border:1px solid #d9dee7;border-radius:10px;box-shadow:0 12px 32px rgba(15,23,42,.22);padding:6px;pointer-events:none;opacity:0;transform:scale(.96);transition:opacity .12s ease,transform .12s ease;display:flex;align-items:center;justify-content:center;overflow:hidden;}
.at-zoom.show{opacity:1;transform:scale(1);}
.at-zoom img{max-width:100%;max-height:100%;border-radius:6px;object-fit:contain;}

/* ---------- 关联图片灯箱（家长/学生 @ 预览共用）：遮罩 + 居中展示 + 右上角关闭 ---------- */
.img-lightbox{
  position:fixed;inset:0;z-index:10000;background:rgba(15,23,42,.72);
  display:flex;align-items:center;justify-content:center;padding:4vh 4vw;
  opacity:0;transition:opacity .18s ease;overscroll-behavior:contain; /* 灯箱内不滚动、不向下层传递 */
}
.img-lightbox.show{opacity:1;}
.il-box{position:relative;display:flex;align-items:center;justify-content:center;}
.il-box img{
  max-width:70vw;max-height:70vh;object-fit:contain;border-radius:10px;background:#fff; /* 较整屏缩小20%，避免占满全屏 */
  box-shadow:0 18px 60px rgba(0,0,0,.45);display:block;
}
.il-close{
  position:absolute;top:-14px;right:-14px;width:34px;height:34px;border-radius:50%;border:none;
  background:#fff;color:#334155;font-size:20px;line-height:1;cursor:pointer;padding:0;
  box-shadow:0 4px 14px rgba(0,0,0,.3);display:flex;align-items:center;justify-content:center;
}
.il-close:hover{background:#fee2e2;color:#b91c1c;}

/* ---------- iPad 竖屏：标题较长时状态徽标/用时/预览按钮保持垂直居中对齐 ---------- */
@media (max-width:900px) and (orientation:portrait){
  .pi-title{align-items:center;}
  .pi-title .pi-title-text{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .pi-title .badge{flex-shrink:0;margin-left:auto;white-space:nowrap;} /* 状态/用时贴右 */
  .pi-title .pi-duration{flex-shrink:0;text-align:right;white-space:nowrap;}
  .pi-title .tpv-btn{flex-shrink:0;white-space:nowrap;}
  .pi-main{width:100%;}
  .pi-ops{width:100%;justify-content:flex-end;} /* 按钮行占满容器宽并贴右 */
}
