/* 信息部工作台 - 1:1 复刻样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f2f3f5;
  color: #333;
  font-size: 14px;
}
:root {
  --primary: #1e5aa8;
  --primary-dark: #17497e;
  --danger: #e05252;
  --border: #e8eaed;
  --muted: #8a919c;
}

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1e5aa8 0%, #17497e 60%, #10345c 100%);
}
.login-card {
  width: 380px;
  background: #fff;
  border-radius: 14px;
  padding: 36px 34px;
  box-shadow: 0 10px 40px rgba(0,0,0,.25);
}
.login-card h1 { font-size: 22px; color: var(--primary-dark); text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 22px; }
.login-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.login-tabs div {
  flex: 1; text-align: center; padding: 10px 0; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent;
}
.login-tabs div.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: bold; }
.login-card input {
  width: 100%; padding: 11px 12px; border: 1px solid #d5d9e0; border-radius: 8px;
  margin-bottom: 14px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--primary); }
.login-card .btn-login {
  width: 100%; padding: 12px; background: var(--primary); color: #fff; border: 0;
  border-radius: 8px; font-size: 15px; cursor: pointer; margin-top: 4px;
}
.login-card .btn-login:hover { background: var(--primary-dark); }
.login-card .tips { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }
.login-foot { color: rgba(255,255,255,.75); font-size: 12px; margin-top: 24px; }

/* ===== 主框架 ===== */
.app { display: none; max-width: 1280px; margin: 0 auto; padding: 18px 24px 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px 16px; }
.topbar .brand { font-size: 20px; font-weight: bold; color: #22324a; }
.topbar .right { display: flex; align-items: center; gap: 14px; font-size: 13px; color: #555; }
.dot-green { width: 8px; height: 8px; background: #34b96f; border-radius: 50%; display: inline-block; margin-right: 4px; }
.role-badge { color: var(--muted); }
.user-menu-wrap { position: relative; }
.btn-user {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 14px; cursor: pointer; font-size: 13px; color: #333;
}
.user-dropdown {
  display: none; position: absolute; right: 0; top: 40px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.12);
  min-width: 140px; z-index: 60; overflow: hidden;
}
.user-dropdown.show { display: block; }
.user-dropdown div { padding: 10px 16px; cursor: pointer; font-size: 13px; }
.user-dropdown div:hover { background: #f5f7fa; }
.user-dropdown div.ud-account { display: flex; align-items: center; gap: 10px; cursor: default; background: #f7f9fc; }
.user-dropdown div.ud-account:hover { background: #f7f9fc; }
.ud-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.ud-txt { display: flex; flex-direction: column; line-height: 1.4; }
.ud-txt b { font-size: 13px; color: #2a3550; }
.ud-txt i { font-style: normal; font-size: 11px; color: var(--muted); }
.ud-sep { height: 1px; background: #e8ebf0; padding: 0 !important; cursor: default !important; }
.ud-sep:hover { background: #e8ebf0 !important; }

.layout { display: flex; gap: 16px; align-items: flex-start; }
.sidebar {
  width: 132px; flex-shrink: 0; background: #fff; border-radius: 12px;
  padding: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.sidebar button {
  display: block; width: 100%; text-align: left; padding: 11px 14px;
  background: none; border: 0; border-radius: 9px; cursor: pointer;
  font-size: 14px; color: #444; margin-bottom: 2px;
}
.sidebar button:hover { background: #f0f4fa; }
.sidebar button.active { background: var(--primary); color: #fff; font-weight: bold; }

.main-panel {
  flex: 1; background: #fff; border-radius: 12px; padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05); min-height: 480px;
}

/* ===== 工具条 ===== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar input[type=search], .toolbar input[type=text] {
  padding: 9px 12px; border: 1px solid #d5d9e0; border-radius: 8px; width: 220px; outline: none; font-size: 13px;
}
.toolbar input:focus { border-color: var(--primary); }
.toolbar select { padding: 9px 10px; border: 1px solid #d5d9e0; border-radius: 8px; font-size: 13px; background: #fff; }
.btn {
  padding: 9px 16px; border: 0; border-radius: 8px; cursor: pointer; font-size: 13px;
  background: #eef1f5; color: #333;
}
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-warn { background: #fdf3e3; color: #b77b19; }
.btn-danger { background: #fdeaea; color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn-link { background: #f2f4f7; color: #556; }
/* a 标签做的按钮（如「下载」）与 button 保持完全一致的外观与对齐 */
a.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; line-height: 1.2; white-space: nowrap; font-family: inherit;
}

/* ===== 列表卡片 ===== */
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.item-row:hover { border-color: #c7d6ea; box-shadow: 0 1px 6px rgba(30,90,168,.08); }
.item-row .grow { flex: 1; min-width: 0; }
.item-title { font-weight: bold; color: #2a3550; font-size: 14px; }
.item-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: bold;
}
.badge-p0 { background: #fde3e3; color: #c33; }
.badge-p1 { background: #fdeccc; color: #b77b19; }
.badge-p2 { background: #eceff3; color: #667; }
.badge-p3 { background: #eef1f5; color: #8a919c; }
.badge-type { background: #e8eef7; color: #4468a0; font-weight: normal; }
.badge-status-todo { background: #eef1f5; color: #556; font-weight: normal; }
.badge-status-doing { background: #e3f0fd; color: #2b6cb0; font-weight: normal; }
.badge-status-done { background: #e2f5e9; color: #2f9e5f; font-weight: normal; }
.badge-status-late { background: #fdeccc; color: #b77b19; font-weight: normal; }
.badge-status-cancel { background: #f0f0f0; color: #999; font-weight: normal; }
.badge-draft { background: #eceff3; color: #667; font-weight: normal; }
.badge-published { background: #e2f5e9; color: #2f9e5f; font-weight: normal; }
.badge-effective { background: #e2f5e9; color: #2f9e5f; font-weight: normal; }
.badge-archived { background: #f0f0f0; color: #999; font-weight: normal; }
.file-ico {
  width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: bold; flex-shrink: 0;
}
.ico-exe { background: #1e5aa8; } .ico-zip { background: #8a6d3b; } .ico-pdf { background: #d04a3a; }
.ico-img { background: #2f9e5f; } .ico-doc { background: #2b6cb0; } .ico-def { background: #7a8290; }
.empty-tip { text-align: center; color: var(--muted); padding: 46px 0; font-size: 13px; }

/* ===== 双月日历 ===== */
.cal-wrap { display: flex; gap: 20px; flex-wrap: wrap; }
.cal-box { flex: 1; min-width: 400px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.cal-head .ym { font-size: 15px; font-weight: bold; color: #2a3550; }
.cal-head .nav { display: flex; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  min-height: 62px; border: 1px solid var(--border); border-radius: 8px; padding: 5px 6px;
  font-size: 12px; cursor: pointer; position: relative; background: #fff;
}
.cal-cell:hover { border-color: var(--primary); }
.cal-cell .d { font-weight: bold; color: #333; }
.cal-cell.dim .d { color: #c0c5cd; }
.cal-cell.today { border-color: var(--primary); background: #f0f6ff; }
.cal-cell .ev {
  margin-top: 3px; font-size: 10px; color: #b3261e; background: #fdeaea;
  padding: 1px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-cell .ev.other { color: #4468a0; background: #e8eef7; }
.cal-row-head { color: var(--muted); font-size: 12px; text-align: center; padding: 4px 0; }
.cal-tip { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.cal-summary { margin-top: 20px; }
.cal-summary h3 { font-size: 14px; color: #2a3550; margin-bottom: 10px; }

/* 日历防误触交互：点击=选中查看详情；悬停＋=快速新建 */
.cal-A .cal-cell.sel, .cal-B .cal-cell.sel, .cal-cell.sel {
  border-color: #2f5496 !important; background: #dcebfb !important;
  box-shadow: 0 0 0 2px rgba(47, 84, 150, .18);
}
.cal-cell .cell-add {
  position: absolute; top: 3px; right: 5px; width: 18px; height: 18px; line-height: 15px;
  text-align: center; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 12px; opacity: 0; transition: opacity .12s, transform .12s; cursor: pointer; z-index: 2;
}
.cal-cell:hover .cell-add, .cal-cell.sel .cell-add { opacity: 1; }
.cal-cell .cell-add:hover { transform: scale(1.15); }
.cal-detail {
  background: #f5f9ff; border: 1px solid #c9dcf3; border-radius: 10px;
  padding: 12px 14px; margin: 0 0 12px;
}
.cal-detail-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.cal-detail-head b { color: #2a3550; font-size: 14px; }
.cal-detail .item-row {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 6px;
}
@media (hover: none) { .cal-cell .cell-add { display: none; } }

/* 已过去的日期：灰色显示、不可新建 */
.cal-A .cal-cell.past, .cal-B .cal-cell.past, .cal-cell.past {
  background: #f5f6f8 !important; border-color: #e4e7ec !important; cursor: default;
}
.cal-cell.past .d { color: #b7bcc5 !important; }
.cal-cell.past .ev { opacity: .5; }
.cal-cell.past:hover { border-color: #e4e7ec !important; }

/* ===== 文件库布局 ===== */
.lib-layout { display: flex; gap: 16px; }
.lib-cats { width: 150px; flex-shrink: 0; background: #f7f8fa; border-radius: 10px; padding: 8px; }
.lib-cats .cat-title { font-size: 12px; color: var(--muted); padding: 8px 10px 4px; }
.lib-cats .cat-item {
  display: flex; justify-content: space-between; align-items: center; padding: 9px 10px;
  border-radius: 8px; cursor: pointer; font-size: 13px; color: #444; margin-bottom: 2px;
}
.lib-cats .cat-item:hover { background: #eceff3; }
.lib-cats .cat-item.active { background: var(--primary); color: #fff; }
.lib-cats .cat-item .cnt { font-size: 11px; opacity: .8; }
.lib-files { flex: 1; }
.drop-zone {
  border: 1.5px dashed #c3cbdb; border-radius: 10px; padding: 14px 18px; margin-bottom: 14px;
  color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center;
}
.drop-zone.dragover { border-color: var(--primary); background: #f0f6ff; }

/* ===== 系统管理 ===== */
.sys-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.sys-tabs button { padding: 8px 18px; border-radius: 8px; border: 0; cursor: pointer; background: #eef1f5; font-size: 13px; }
.sys-tabs button.active { background: var(--primary); color: #fff; }
.role-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; }
.role-card .rc-head { display: flex; align-items: center; gap: 10px; }
.role-card .rc-name { font-weight: bold; color: #2a3550; font-size: 14px; }
.role-card .rc-desc { color: var(--muted); font-size: 12px; margin-top: 4px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.perm-chip { background: #eef4fb; color: #4468a0; font-size: 11px; padding: 3px 9px; border-radius: 10px; }
.perm-chip.hidden-mod { background: #f0f0f0; color: #999; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }

/* ===== 弹窗 ===== */
.mask { display: none; position: fixed; inset: 0; background: rgba(20,30,50,.45); z-index: 100; overflow-y: auto; padding: 40px 0; }
.mask.show { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: #fff; border-radius: 14px; width: 560px; max-width: 94vw;
  padding: 24px 26px; box-shadow: 0 12px 48px rgba(0,0,0,.3);
  position: relative;
}
.modal h2 { font-size: 16px; color: #2a3550; margin-bottom: 18px; }
/* 右上角操作按钮区（查看=关闭；编辑=取消/保存） */
.modal-top { position: absolute; top: 16px; right: 20px; display: flex; gap: 8px; z-index: 2; }
.modal.has-top h2 { padding-right: 150px; }
.form-item { margin-bottom: 14px; }
.form-item label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-item input, .form-item select, .form-item textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #d5d9e0; border-radius: 8px;
  font-size: 13px; outline: none; font-family: inherit;
}
.form-item textarea { min-height: 90px; resize: vertical; }
.form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: var(--primary); }
.form-row { display: flex; gap: 12px; }
.form-row .form-item { flex: 1; }
.rich-toolbar { display: flex; gap: 8px; margin-bottom: 6px; }
.rich-area {
  min-height: 150px; border: 1px solid #d5d9e0; border-radius: 8px; padding: 10px 12px;
  outline: none; font-size: 13px; line-height: 1.7; overflow-y: auto; background: #fff;
}
.rich-area:focus { border-color: var(--primary); }
.rich-area img { max-width: 100%; border-radius: 6px; margin: 6px 0; }
.link-cards { display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow-y: auto; }
.link-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 12px;
  cursor: pointer; color: #444;
}
.link-card.sel { border-color: var(--primary); background: #f0f6ff; color: var(--primary); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 4px; }
.att-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #555; padding: 5px 0; }

/* 知识查看 */
.kb-view { line-height: 1.9; font-size: 14px; color: #333; }
.kb-view img { max-width: 100%; }
.kb-view h1, .kb-view h2, .kb-view h3 { margin: 14px 0 8px; color: #2a3550; }
.kb-view p { margin: 8px 0; }
.kb-view ul, .kb-view ol { margin: 8px 0 8px 24px; }

.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: #333; color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 13px;
  z-index: 300; display: none;
}
.toast.show { display: block; }
.toast.err { background: #c0392b; }

/* 分享弹窗 */
.share-url { width: 100%; padding: 10px; border: 1px solid #d5d9e0; border-radius: 8px; font-size: 12px; word-break: break-all; background: #f7f8fa; }
.share-exps { display: flex; gap: 8px; flex-wrap: wrap; }
.share-opt { min-width: 64px; }
.share-opt.active { background: #2f5496; border-color: #2f5496; color: #fff; }

/* ===== 日历双月强区分 + 固定格子 ===== */
.cal-wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.cal-panel {
  flex: 1; min-width: 400px; border: 1px solid var(--border); border-radius: 12px;
  padding: 0; background: #fff; overflow: hidden;
}
/* 本月 = 蓝色系 */
.cal-A { border-color: #8fb4dc; box-shadow: 0 2px 10px rgba(47,84,150,.16); border-top: 5px solid #2f5496; }
/* 次月 = 橙色系 */
.cal-B { border-color: #e2b27c; box-shadow: 0 2px 10px rgba(190,110,20,.16); border-top: 5px solid #c96f0e; }
.cal-A .cal-head { background: #cfe1f8; border-bottom: 1px solid #b0cdf0; margin: 0; padding: 8px 14px; }
.cal-B .cal-head { background: #fbe8d2; border-bottom: 1px solid #f0d0a4; margin: 0; padding: 8px 14px; }
.cal-A .cal-head .ym { color: #2f5496; }
.cal-B .cal-head .ym { color: #a85a00; }
.cal-A .cal-grid { padding: 8px; background: #e2edfb; }
.cal-B .cal-grid { padding: 8px; background: #fdf1e1; }
.cal-A .cal-row-head { color: #2f5496; font-weight: bold; padding: 3px 0; }
.cal-B .cal-row-head { color: #b35f00; font-weight: bold; padding: 3px 0; }
/* 格子背景与所在月面板底色一致，整月色调一眼区分 */
.cal-A .cal-cell { background: transparent; }
.cal-B .cal-cell { background: transparent; }
.cal-A .cal-cell.today { background: #c5dbf6; border-color: #2f5496; }
.cal-B .cal-cell.today { background: #f8e0bf; border-color: #c96f0e; }
/* 跨月格子：统一虚线淡化；次月1号仅加「下月」角标，边框样式与其余跨月日期一致 */
.cal-cell.dim { border-style: dashed; border-color: #b9c6d4; }
.cross-tag {
  position: absolute; top: 3px; right: 4px; font-size: 9px; line-height: 1;
  padding: 2px 5px; border-radius: 6px; background: #e8890c; color: #fff; font-weight: bold;
}
.cross-tag.tag-cur { background: #2f5496; }
.mtag {
  display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 8px;
  margin-right: 8px; background: #2f5496; color: #fff; font-weight: normal;
}
.mtag-B { background: #c96f0e; color: #fff; }
.cal-cell .ev { max-width: 100%; }
.cal-cell .ev-high { color: #b3261e; background: #fdeaea; }
/* 协同办公平台日程（只读）：蓝色系，与待办区分 */
.cal-cell .ev-oa { color: #1a56b3; background: #e8f0fd; font-weight: 600; }
.cal-cell .ev-oa .ev-hm { font-weight: normal; opacity: .8; }
.badge-oa { background: #e8f0fd; color: #1a56b3; font-weight: normal; }
/* 工作台来源徽标：绿色系，与 OA 蓝色对应 */
.badge-src { background: #e6f4ea; color: #1e7e34; font-weight: normal; }
/* 摘要 / 详情里 OA 日程标题用蓝色，与工作台待办区分 */
.item-title.oa { color: #1a56b3; }
/* 到期临近（≤3 天）：橙色醒目徽标，出现在标题右侧 */
.badge-due-soon {
  background: #fff1d6; color: #b26a00; font-weight: 600;
  border: 1px solid #f0c419; margin-left: 6px; animation: duePulse 3s ease-in-out infinite;
}
@keyframes duePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 137, 12, 0); }
  50% { box-shadow: 0 0 0 3px rgba(232, 137, 12, .18); }
}
/* 日历格子内：≤3 天的条目加左侧橙色竖条 + ⏰ 前缀，不覆盖 OA 蓝/高优红背景 */
.cal-cell .ev-soon { box-shadow: inset 3px 0 0 #e8890c; }
.cal-cell .ev-clock { font-size: 9px; }
.cal-cell .ev-done { opacity: .5; text-decoration: line-through; }
.cal-cell .ev-more { font-size: 10px; color: #2f5496; margin-top: 2px; font-weight: 600; }
/* 新同步进来的待办闪一下，提示"这里刚更新" */
@keyframes evFlash {
  0% { background: #fff3b0; box-shadow: 0 0 0 2px #f0c419 inset; }
  70% { background: #fff9d6; box-shadow: 0 0 0 1px #f0c419 inset; }
  100% { background: transparent; box-shadow: none; }
}
.cal-cell .ev-new { animation: evFlash 2.6s ease-out 1; }
/* 格子固定大小：内容缩字分行，不撑大 */
.cal-cell {
  height: 86px; min-height: 86px; max-height: 86px; overflow: hidden;
}
.cal-cell .ev {
  font-size: 10px; line-height: 1.35; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  word-break: break-all; white-space: normal;
}
.cal-cell .d { font-size: 12px; }

/* ===== 商品文件夹 ===== */
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; margin-bottom: 10px; flex-wrap: wrap; }
.crumb-item { cursor: pointer; color: var(--primary); }
.crumb-item:hover { text-decoration: underline; }
.crumb-sep { color: #c0c5cd; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.folder-card { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; cursor: pointer; background: #fff; }
.folder-card:hover { border-color: #c7d6ea; background: #f7fbff; }
.fc-title { font-size: 13px; font-weight: bold; color: #2a3550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.fc-ops { display: flex; gap: 10px; margin-top: 7px; font-size: 11px; color: var(--muted); }
.fc-ops span { cursor: pointer; }
.fc-ops span:hover { color: var(--primary); }
.fc-ops .del:hover { color: var(--danger); }

/* ===== 指派人多选 ===== */
.asg-wrap { position: relative; }
.asg-box {
  min-height: 38px; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; cursor: pointer; background: #fff;
}
.asg-box:hover { border-color: var(--primary); }
.asg-ph { color: #a5adba; font-size: 13px; }
.asg-chip {
  background: #e8f0fb; color: #2f5496; font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: bold;
}
.asg-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 200px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 9px; box-shadow: 0 6px 18px rgba(20,40,80,.14);
}
.asg-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #f2f4f7;
}
.asg-item:last-child { border-bottom: none; }
.asg-item:hover { background: #f5f8fc; }
.asg-item i { font-style: normal; color: var(--muted); font-size: 11px; margin-left: auto; }
.asg-item { display: flex !important; align-items: center !important; }
.asg-item input[type=checkbox] { width: auto !important; flex-shrink: 0; accent-color: #2f5496; }
.asg-item span { white-space: nowrap; }

/* =========================================================
   移动端适配（平板 / 手机），断点：1024 / 768 / 480
   ========================================================= */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, video, canvas { max-width: 100%; height: auto; }
button, .cat-item, .folder-card, .cal-cell, .asg-item, .user-dropdown div { -webkit-tap-highlight-color: rgba(0,0,0,.06); }
.item-title, .fc-title, .kb-view, .item-meta { overflow-wrap: break-word; }

/* ---------- 平板 ---------- */
@media (max-width: 1024px) {
  .app { padding: 14px 16px 32px; }
  .main-panel { padding: 16px; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .cal-panel { min-width: 340px; }
}

/* ---------- 手机 / 窄屏 ---------- */
@media (max-width: 768px) {
  /* 框架 */
  .app { padding: 10px 10px 28px; max-width: 100%; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 4px 2px 10px; }
  .topbar .brand { font-size: 17px; }
  .topbar .right { gap: 10px; font-size: 12px; flex-wrap: wrap; margin-left: auto; }
  .btn-user { padding: 8px 12px; min-height: 38px; }
  .user-dropdown { top: 46px; }
  .layout { flex-direction: column; gap: 10px; align-items: stretch; }

  /* 左侧导航 → 顶部横向滚动条 */
  .sidebar {
    width: 100%; display: flex; gap: 6px; padding: 6px;
    overflow-x: auto; overflow-y: hidden; position: sticky; top: 0; z-index: 50;
    background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.06);
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar button {
    width: auto; flex: 0 0 auto; white-space: nowrap;
    padding: 10px 14px; min-height: 40px; margin-bottom: 0; font-size: 13px;
  }

  /* 主面板 */
  .main-panel { padding: 12px; border-radius: 10px; min-height: auto; width: 100%; }

  /* 工具条：输入框占满一行，按钮自动换行且够大好点 */
  .toolbar { gap: 8px; margin-bottom: 12px; }
  .toolbar input[type=search], .toolbar input[type=text] { width: 100%; flex: 1 1 100%; }
  .toolbar .hint { order: 9; flex: 1 1 100%; margin: 0 !important; }
  .btn { min-height: 38px; padding: 9px 14px; }
  .btn-sm { min-height: 34px; padding: 7px 12px; }
  /* 输入框 16px：避免 iOS 聚焦时自动放大页面 */
  .toolbar input, .form-item input, .form-item select, .form-item textarea,
  .login-card input, .asg-box { font-size: 16px; }

  /* 卡片列表：内容在上，操作按钮独占一整行（均分宽度，方便点按） */
  .item-row { flex-wrap: wrap; row-gap: 10px; padding: 11px 12px; align-items: flex-start; }
  .item-row > div:last-child { flex: 1 1 100%; width: 100%; flex-wrap: wrap; gap: 8px; align-items: stretch; }
  .item-row > div:last-child .btn,
  .item-row > div:last-child a.btn {
    flex: 1 1 0; min-width: 64px; height: 40px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    line-height: 1; box-sizing: border-box;
  }
  .item-row .file-ico { width: 38px; height: 38px; }
  .user-row { flex-wrap: wrap; row-gap: 10px; padding: 11px 12px; }
  .user-row > div:last-child { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .user-row select { flex: 1; min-height: 38px; font-size: 16px; }
  .role-card .rc-head { flex-wrap: wrap; row-gap: 8px; }

  /* 日历：双月上下堆叠，格子压缩但保持 7 列可点 */
  .cal-wrap { gap: 12px; }
  .cal-panel { min-width: 0; width: 100%; }
  .cal-A .cal-head, .cal-B .cal-head { padding: 8px 10px; }
  .cal-A .cal-grid, .cal-B .cal-grid { padding: 6px; }
  .cal-grid { gap: 3px; }
  .cal-cell {
    height: 58px; min-height: 58px; max-height: 58px;
    padding: 3px 3px; border-radius: 6px;
  }
  .cal-cell .d { font-size: 11px; }
  .cal-cell .ev { font-size: 9px; line-height: 1.25; padding: 0 2px; }
  .cal-cell .ev-more { display: none; }
  .cross-tag { font-size: 8px; padding: 1px 3px; border-radius: 4px; top: 2px; right: 2px; }
  .cal-row-head { font-size: 11px; padding: 2px 0; }
  .cal-head .ym { font-size: 14px; }
  .cal-head .nav .btn { padding: 6px 10px; min-height: 34px; font-size: 12px; }

  /* 文件库：分类条横向滚动，文件列表整宽 */
  .lib-layout { flex-direction: column; gap: 10px; }
  .lib-cats {
    width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .lib-cats::-webkit-scrollbar { display: none; }
  .lib-cats .cat-title { display: none; }
  .lib-cats .cat-item { flex: 0 0 auto; margin-bottom: 0; padding: 8px 12px; min-height: 38px; white-space: nowrap; }
  .lib-files { width: 100%; }
  .drop-zone { padding: 10px 12px; font-size: 11px; margin-bottom: 10px; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .fc-ops { flex-wrap: wrap; gap: 8px; }
  .fc-ops span { padding: 4px 2px; }

  /* 系统管理 */
  .sys-tabs { overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .sys-tabs::-webkit-scrollbar { display: none; }
  .sys-tabs button { flex: 0 0 auto; padding: 8px 14px; min-height: 38px; }
  /* 模块名称等「标签 + 输入框 + 按钮」行：窄屏标签独占一行 */
  #sysBody .form-item { flex-wrap: wrap; row-gap: 6px; }
  #sysBody .form-item > label { width: auto !important; min-width: 100%; }

  /* 弹窗：全宽、贴近屏幕，内容区可滚动 */
  .mask { padding: 10px; }
  .modal { width: 100%; max-width: 100%; padding: 16px; border-radius: 12px; }
  .modal h2 { font-size: 15px; margin-bottom: 14px; }
  .modal.has-top h2 { padding-right: 120px; }
  .modal-top { top: 12px; right: 14px; }
  .modal-top .btn { min-height: 36px; padding: 6px 12px; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; min-height: 42px; }
  .form-row { flex-direction: column; gap: 0; }
  .form-item { margin-bottom: 12px; }
  .rich-toolbar { flex-wrap: wrap; }
  .rich-area { min-height: 120px; }
  .asg-item { padding: 11px 12px; }
  .asg-hit, .asg-box { min-height: 42px; }
  .share-opt { flex: 1 1 0; min-width: 0; }

  /* 登录页 */
  .login-card { width: 100%; max-width: 340px; padding: 26px 20px; }
  .login-foot { padding: 0 16px; text-align: center; }

  .toast { max-width: 92vw; text-align: center; }
}

/* ---------- 超小屏 ---------- */
@media (max-width: 400px) {
  .app { padding: 8px 8px 24px; }
  .main-panel { padding: 10px; }
  .topbar .right { gap: 8px; font-size: 11px; }
  .sidebar button { padding: 9px 12px; font-size: 12px; }
  .folder-grid { grid-template-columns: 1fr; }
  .cal-cell { height: 52px; min-height: 52px; max-height: 52px; }
  .cal-cell .ev { font-size: 8.5px; }
  .item-row { padding: 10px; }
  .topbar .brand { font-size: 16px; }
}

/* 横屏矮屏：日历格子适当降低 */
@media (max-width: 768px) and (orientation: landscape) {
  .cal-cell { height: 56px; min-height: 56px; max-height: 56px; }
}


/* ===== 手机 App 化（PWA）增强 ===== */
html { -webkit-text-size-adjust: 100%; }
button, .btn, input, select, textarea, .cal-cell, .sidebar button, .lib-cats .cat-item, .sys-tabs button { touch-action: manipulation; }

/* iPhone 刘海/底部横条安全区（普通浏览器与独立 App 模式都生效） */
.app { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.login-page { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }

/* 已安装成 App（独立窗口模式）时：给状态栏留出空间，导航条下移 */
@media (display-mode: standalone), (-webkit-display-mode: standalone) {
  .app { padding-top: calc(10px + env(safe-area-inset-top)); }
  .sidebar { top: calc(env(safe-area-inset-top) + 4px); }
}

/* 安装引导条（底部悬浮卡片） */
#pwaTip {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translate(-50%, 140%);
  width: min(480px, calc(100vw - 20px));
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 14px; padding: 12px 12px;
  box-shadow: 0 8px 30px rgba(16,52,92,.25), 0 0 0 1px #eef1f5 inset;
  z-index: 999; transition: transform .45s cubic-bezier(.22,1,.36,1);
}
#pwaTip.show { transform: translate(-50%, 0); }
#pwaTip .pt-ico { width: 46px; height: 46px; flex-shrink: 0; }
#pwaTip .pt-ico img { width: 100%; height: 100%; border-radius: 10px; display: block; }
#pwaTip .pt-txt { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; }
#pwaTip .pt-txt b { display: block; color: #23364d; }
#pwaTip .pt-txt i { font-style: normal; color: var(--muted); font-size: 12px; }
#pwaTip .pt-btn {
  flex-shrink: 0; border: 0; background: var(--primary); color: #fff;
  font-size: 13px; font-weight: bold; padding: 10px 14px; border-radius: 9px; cursor: pointer;
}
#pwaTip .pt-btn:active { background: var(--primary-dark); }
#pwaTip .pt-x {
  flex-shrink: 0; border: 0; background: transparent; color: #b0b6bf;
  font-size: 14px; cursor: pointer; padding: 6px;
}
