/* 水灵AI 2026-08-05 全量修复层：统一A4文档、交互与移动端体验 */
:root{
  --sl-a4-width:210mm;--sl-a4-min-height:297mm;--sl-a4-pad-y:18mm;--sl-a4-pad-x:16mm;
  --sl-toolbar-bg:#f8fbff;--sl-toolbar-border:#dce7f5;--sl-focus:#1e6fff;
}
.sl-document-shell{width:100%;min-width:0}
.sl-document-toolbar{position:sticky;top:0;z-index:45;display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 14px;padding:10px 12px;background:rgba(248,251,255,.97);border:1px solid var(--sl-toolbar-border);border-radius:10px;box-shadow:0 4px 14px rgba(15,46,88,.06);backdrop-filter:blur(8px)}
.sl-document-toolbar .sl-doc-title{font-weight:700;color:var(--primary-dark);margin-right:auto;min-width:140px}
.sl-document-toolbar button{min-height:34px;padding:6px 12px;border:1px solid #cddbed;border-radius:7px;background:#fff;color:#23405f;font-size:12px;font-weight:600;cursor:pointer}
.sl-document-toolbar button:hover{border-color:var(--sl-focus);color:var(--sl-focus)}
.sl-document-toolbar button[data-primary]{background:var(--primary-mid);border-color:var(--primary-mid);color:#fff}
.sl-document-toolbar button:disabled{opacity:.5;cursor:not-allowed}
.sl-save-state{font-size:12px;color:#62758d;min-width:68px;text-align:right}
.sl-save-state.ok{color:#16834b}.sl-save-state.error{color:#c6382b}.sl-save-state.busy{color:#b26812}
.a4-page,.sl-a4-document{width:min(100%,var(--sl-a4-width));max-width:var(--sl-a4-width);min-height:var(--sl-a4-min-height);margin:0 auto 22px!important;padding:var(--sl-a4-pad-y) var(--sl-a4-pad-x)!important;background:#fff;box-shadow:0 6px 24px rgba(22,45,77,.09);border:1px solid #dfe6ee;border-radius:2px;overflow:visible}
.sl-a4-document table{table-layout:fixed;width:100%;border-collapse:collapse}
.sl-a4-document td,.sl-a4-document th{overflow-wrap:anywhere;word-break:break-word;vertical-align:middle}
.sl-a4-document input,.sl-a4-document textarea,.sl-a4-document [contenteditable="true"]{max-width:100%;transition:border-color .15s,box-shadow .15s,background .15s}
.sl-a4-document input:focus,.sl-a4-document textarea:focus,.sl-a4-document [contenteditable="true"]:focus{outline:none!important;border-color:var(--sl-focus)!important;box-shadow:0 0 0 2px rgba(30,111,255,.12)!important;background:#fbfdff!important}
.sl-a4-document textarea{resize:vertical!important;min-height:72px}
.sl-a4-document .file-actions{display:flex;gap:5px;justify-content:flex-end;flex-wrap:wrap}
.sl-field-error{border-color:#dc3f35!important;background:#fff5f4!important}
.sl-empty-state{padding:32px 18px;text-align:center;color:#74859a;background:#f8fafc;border:1px dashed #cad6e4;border-radius:8px}
.sl-camera-help{position:absolute;left:14px;right:14px;bottom:82px;z-index:4;padding:10px 12px;border-radius:8px;background:rgba(0,0,0,.72);color:#fff;font-size:13px;text-align:center}
.sl-photo-preview{position:fixed;inset:0;z-index:10050;display:flex;flex-direction:column;background:rgba(4,12,24,.94);color:#fff}
.sl-photo-preview header{display:flex;align-items:center;gap:10px;padding:12px 16px;background:rgba(0,0,0,.3)}
.sl-photo-preview header strong{margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sl-photo-preview button{border:1px solid rgba(255,255,255,.35);border-radius:7px;background:rgba(255,255,255,.12);color:#fff;padding:7px 12px;cursor:pointer}
.sl-photo-preview main{flex:1;display:flex;align-items:center;justify-content:center;min-height:0;padding:16px}.sl-photo-preview img{max-width:100%;max-height:100%;object-fit:contain}
#project-video #folderViewYX.hidden,#project-video #photoViewYX.hidden{display:none!important}
#project-video .photo-list .photo-icon{width:76px;padding:8px 10px}
.sl-photo-thumb-button{display:block;width:64px;height:48px;padding:0;overflow:hidden;border:1px solid #dbe4f0;border-radius:7px;background:#f4f7fb;cursor:pointer}
.sl-photo-thumb,.sl-photo-thumb-placeholder{display:block;width:100%;height:100%}.sl-photo-thumb{object-fit:cover}.sl-photo-thumb-placeholder{display:grid;place-items:center;color:#94a3b8;font-size:11px;background:linear-gradient(135deg,#f8fafc,#eef3f9)}
.sl-auth-links{display:flex;justify-content:space-between;align-items:center;margin-top:10px;font-size:13px}.sl-auth-links button{border:0;background:none;color:var(--primary-mid);cursor:pointer;padding:4px}
.sl-auth-grid{display:grid;gap:10px}.sl-auth-grid input{width:100%;padding:11px;border:1px solid #d8e0ea;border-radius:8px;font-size:15px;box-sizing:border-box}
.sl-auth-dialog{position:relative}.sl-auth-close{position:absolute;top:10px;right:12px;width:40px;height:40px;border:0;background:transparent;border-radius:50%;color:#64748b;font-size:28px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}.sl-auth-close:hover,.sl-auth-close:focus-visible{background:#eef4fb;color:#172033;outline:none}.sl-auth-dialog h3{padding-right:38px}
.sl-voice-active{color:#d93025!important;border-color:#d93025!important;background:#fff1f0!important;animation:sl-pulse 1s infinite}
@keyframes sl-pulse{50%{box-shadow:0 0 0 5px rgba(217,48,37,.12)}}
body.sl-document-mode .ai-cabin{display:none!important}body.sl-document-mode .main-content{padding-right:0}
body.sl-document-mode .ai-float-btn{display:block!important}
.menu-sub-item[onclick*="field-inspection"],.m-menu-item[onclick*="field-inspection"]{display:none!important}

@media(max-width:768px){
  :root{--sl-a4-pad-y:16px;--sl-a4-pad-x:12px}
  .m-kungfu.sl-context-hidden{display:none!important}
  body.sl-document-mode .main-content{padding-top:54px!important;padding-bottom:72px!important}
  body.sl-document-mode .sl-document-toolbar{top:48px;margin:-4px 0 10px;border-radius:0;padding:8px;gap:6px;overflow-x:auto;flex-wrap:nowrap}
  .sl-document-toolbar .sl-doc-title{display:none}.sl-document-toolbar button{white-space:nowrap;min-height:32px;padding:5px 9px}.sl-save-state{white-space:nowrap}
  .a4-page,.sl-a4-document{width:100%;min-height:0;max-width:none;margin:0!important;border:0;box-shadow:none;border-radius:0;padding:16px 12px!important;overflow-x:auto}
  .sl-a4-document table{min-width:680px}.sl-a4-document .w-table-opt{min-width:620px}
  .ai-input-box{height:auto!important;min-height:72px;max-height:220px;resize:vertical!important}
  #project-video .photo-list .photo-icon{width:64px;padding:7px 6px}.sl-photo-thumb-button{width:54px;height:42px}
}

@media print{
  @page{size:A4 portrait;margin:0}
  body{background:#fff!important;padding:0!important}
  body *{visibility:hidden!important}
  .content-section.active,.content-section.active *{visibility:visible!important}
  .content-section.active{position:absolute!important;left:0!important;top:0!important;width:100%!important;margin:0!important;padding:0!important;background:#fff!important}
  .sl-document-toolbar,.sidebar,.ai-cabin,.top-control-bar,.m-header,.m-kungfu,.m-chat,.ai-float-btn,.btn,.btn-table,.file-actions{display:none!important}
  .a4-page,.sl-a4-document{width:210mm!important;min-height:297mm!important;margin:0!important;padding:18mm 16mm!important;border:0!important;box-shadow:none!important;page-break-after:always;overflow:visible!important}
  .a4-page:last-child,.sl-a4-document:last-child{page-break-after:auto}
  input,textarea{border:0!important;box-shadow:none!important;background:transparent!important;color:#000!important;resize:none!important}
}

.admin-actions{display:flex;flex-wrap:wrap;gap:5px;min-width:170px}
.admin-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* 正式同步：微信水印结果与统一页面细化 */
.wm-wechat-result{display:none;position:fixed;inset:0;z-index:10035;background:rgba(0,0,0,.94);padding:env(safe-area-inset-top,12px) 16px calc(18px + env(safe-area-inset-bottom,0px));flex-direction:column;align-items:center;justify-content:center;gap:14px}
.wm-wechat-result.active{display:flex}
.wm-wechat-result-img{display:block;max-width:100%;max-height:calc(100vh - 190px);object-fit:contain;border-radius:8px;background:#111;-webkit-touch-callout:default;user-select:auto}
.wm-wechat-result-tip{margin:0;color:#fff;text-align:center;font-size:15px;line-height:1.65}
.wm-wechat-result-tip strong{display:block;font-size:17px}
.wm-wechat-result-actions{display:flex;gap:12px;width:min(100%,360px)}
.wm-wechat-result-actions button{flex:1;height:44px;border-radius:10px;border:1px solid rgba(255,255,255,.3);background:rgba(255,255,255,.12);color:#fff;font-size:15px}
.wm-wechat-result-actions .primary{border-color:#1677ff;background:#1677ff}
/* 测试版第二轮：账户内项目切换、精简A4工具栏、移除无效悬浮按钮 */
#aiFloatBtn,.ai-float-btn,body.sl-document-mode .ai-float-btn{display:none!important}
.project-switcher{display:none;padding:8px 0 0;border:0;width:100%}
.project-switcher.sl-project-authorized{display:block}
.sidebar-footer{height:60px;flex-direction:column;align-items:stretch;justify-content:center;padding:8px 16px;gap:6px;transition:height .2s ease}
.sidebar.sl-has-account .sidebar-footer{height:116px}
.sidebar.sl-has-account .menu-list{padding-bottom:126px}
.sidebar-footer #loginStatusSection{min-height:32px;display:flex;align-items:center;padding-right:28px}
.sidebar-footer .operator-status-text{width:100%;justify-content:space-between}
.sidebar-footer .gear-feedback-icon{position:absolute;right:14px;bottom:15px}
.sidebar-footer .project-select{height:36px;padding:6px 10px;background:#fff;border-color:#b7cee9;font-size:12px}
.sl-mobile-account{display:none;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;margin-bottom:8px;border-radius:8px;background:#eef6ff;color:#254563;font-size:13px;font-weight:700}
.sl-mobile-account button{border:0;background:transparent;color:#1e6fff;font-size:12px;cursor:pointer}
.sl-document-toolbar{width:min(100%,210mm);min-height:48px;margin:0 auto 14px;padding:7px 9px;gap:6px;flex-wrap:nowrap;border-color:#dfe7f1;border-radius:9px;background:rgba(255,255,255,.98);box-shadow:0 3px 12px rgba(24,55,90,.06)}
.sl-document-toolbar .sl-doc-title{min-width:0;margin:0 auto 0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.sl-document-toolbar button{min-height:32px;padding:5px 10px;border-color:#d9e3ef;font-size:12px;white-space:nowrap}
.sl-document-toolbar button[data-action="back"]{width:34px;padding:5px;font-size:0}
.sl-document-toolbar button[data-action="back"]:before{content:'←';font-size:17px}
.sl-document-toolbar button[data-action="save"]{min-width:58px}
.sl-document-toolbar .sl-save-state{display:none!important}
.sl-document-toolbar.sl-toolbar-root button[data-action="back"]{display:none!important}
.sl-document-toolbar button[data-action="save"]{order:3}
.sl-document-toolbar button[data-action="ai"]{order:4}
.sl-toolbar-more{position:relative;order:5}
.sl-toolbar-more-toggle{display:flex;align-items:center;gap:4px}
.sl-toolbar-more-menu{display:none;position:absolute;right:0;top:39px;z-index:80;width:150px;padding:6px;background:#fff;border:1px solid #dce5ef;border-radius:9px;box-shadow:0 12px 30px rgba(24,45,72,.16)}
.sl-toolbar-more.open .sl-toolbar-more-menu{display:grid;gap:4px}
.sl-toolbar-more-menu button{width:100%;text-align:left;background:#fff;border:0!important;border-radius:6px;padding:8px 10px!important;color:#29445f!important}
.sl-toolbar-more-menu button:hover{background:#eef6ff!important}
#project-info .sandbox-control{display:none!important}
#weekly-report.sl-editor-active #weekEditorView .a4-page>div:nth-child(2){justify-content:flex-end!important}
/* 所有内容页以“监理方案与合同”为统一宽度基准；目录页只统一宽度，不采用 A4 固定高度。 */
#logYearView,#weekYearView,#logMonthView>div:last-child,#weekMonthView>div:last-child,
#logListView,#weekListView,#folderGridViewTZ,#fileListViewTZ,#monthly-dir-page,#monthly-list-page{
  width:210mm!important;max-width:100%!important;min-height:650px;margin:0 auto 24px!important;padding:36px 42px!important;
  box-sizing:border-box;background:#fff;border:1px solid #dfe5ed;border-radius:10px;box-shadow:0 5px 18px rgba(31,54,82,.05)
}
.sl-directory-page-title{grid-column:1/-1;width:100%;margin:0 0 18px;padding:0 0 13px;border-bottom:2px solid var(--primary-mid);box-sizing:border-box}
.sl-directory-page-title h2{margin:0;color:var(--primary-dark);font-size:22px;line-height:1.35;letter-spacing:1px}
#folderGridViewTZ>.sl-directory-page-title{align-self:start}
#folderGridViewTZ.sl-hierarchy-hidden,#fileListViewTZ.sl-hierarchy-hidden{display:none!important}
#folderGridViewTZ .folder-card-opt:not(.folder-add){cursor:pointer}
#fileTableBodyTZ tr[data-sl-file-row]{cursor:pointer}
#fileTableBodyTZ tr[data-sl-file-row]:hover{background:#f4f8ff}
#fileTableBodyTZ .file-name{display:flex;align-items:center;gap:7px;min-width:0}
#fileTableBodyTZ .notice-file-icon{flex:0 0 auto}
#fileTableBodyTZ .notice-file-number{flex:0 0 auto;color:var(--primary-mid);font-weight:700}
#fileTableBodyTZ .notice-file-subject{min-width:0;overflow-wrap:anywhere}
#logYearGrid,#logMonthGrid,#weekYearGrid,#weekMonthGrid,#folderViewYX,#folderGridViewFA,#monthly-year-grid{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:20px!important;width:100%!important;align-content:start
}
/* 通知根目录本身既是内容面板也是网格，不能被网格通用 width:100% 覆盖统一页面宽度。 */
#folderGridViewTZ{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:20px!important;align-content:start;
  width:210mm!important;max-width:100%!important;min-height:650px!important;height:auto!important
}
#logYearGrid .folder-card-opt,#logMonthGrid .folder-card-opt,#weekYearGrid .folder-card-opt,#weekMonthGrid .folder-card-opt,
#folderViewYX .folder-card-opt,#folderGridViewFA .folder-card-opt,#folderGridViewTZ .folder-card-opt,#monthly-year-grid .folder-card-opt{
  min-width:0!important;min-height:150px!important;padding:22px 18px!important;justify-content:center;border-radius:9px
}
#logYearGrid .folder-icon-opt,#logMonthGrid .folder-icon-opt,#weekYearGrid .folder-icon-opt,#weekMonthGrid .folder-icon-opt,
#folderViewYX .folder-icon-opt,#folderGridViewFA .folder-icon-opt,#folderGridViewTZ .folder-icon-opt,#monthly-year-grid .folder-icon-opt{font-size:54px!important}
#logYearGrid .folder-name-opt,#logMonthGrid .folder-name-opt,#weekYearGrid .folder-name-opt,#weekMonthGrid .folder-name-opt,
#folderViewYX .folder-name-opt,#folderGridViewFA .folder-name-opt,#folderGridViewTZ .folder-name-opt,#monthly-year-grid .folder-name-opt{font-size:15px!important}
#logListView,#weekListView,#fileListViewTZ,#monthly-list-page{min-height:650px}
/* 监理方案目录态与日志目录完全统一：标题抬头、首行位置及文件夹卡片尺寸一致。 */
#scheme-info:not(.sl-editor-active)>.a4-page{
  width:210mm!important;max-width:100%!important;min-height:650px!important;height:auto!important;
  padding:36px 42px!important;border-radius:10px
}
#scheme-info:not(.sl-editor-active)>.a4-page>div:first-child{
  min-height:0!important;margin:0 0 18px!important;padding:0 0 13px!important;align-items:center!important
}
#scheme-info:not(.sl-editor-active) #schemePageTitle{
  margin:0!important;font-size:22px!important;line-height:1.35!important;letter-spacing:1px!important
}
#scheme-info:not(.sl-editor-active) #folderGridViewFA .folder-card-opt{
  height:150px!important;min-height:150px!important;padding:22px 18px!important;border-radius:9px!important
}
#scheme-info:not(.sl-editor-active) #folderGridViewFA .folder-icon-opt{font-size:54px!important}
#scheme-info:not(.sl-editor-active) #folderGridViewFA .folder-name-opt{font-size:15px!important}
@media(max-width:768px){
  .m-drawer-project{display:none!important}.m-drawer-project.sl-project-authorized{display:block!important}
  .sl-mobile-account.sl-project-authorized{display:flex}
  .sl-document-toolbar{width:100%;min-height:44px;padding:6px;gap:5px;overflow:visible!important}
  .sl-document-toolbar .sl-doc-title{display:block;max-width:82px;font-size:12px}
  .sl-document-toolbar button{min-height:31px;padding:4px 7px}
  .sl-document-toolbar button[data-action="save"]{min-width:48px}
  .sl-toolbar-more-menu{position:fixed;right:10px;top:100px;width:160px}
  #logYearView,#weekYearView,#logMonthView>div:last-child,#weekMonthView>div:last-child,
  #logListView,#weekListView,#folderGridViewTZ,#fileListViewTZ,#monthly-dir-page,#monthly-list-page{
    width:100%!important;min-height:0;margin:0 0 12px!important;padding:16px!important;border-radius:0;box-shadow:none
  }
  .sl-directory-page-title{margin-bottom:14px;padding-bottom:10px}
  .sl-directory-page-title h2{font-size:19px}
  #logYearGrid,#logMonthGrid,#weekYearGrid,#weekMonthGrid,#folderViewYX,#folderGridViewFA,#folderGridViewTZ,#monthly-year-grid{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important
  }
  #folderGridViewTZ{width:100%!important;min-height:0!important;height:auto!important}
  #fileListViewTZ .file-list,#fileTableBodyTZ{display:block!important;width:100%!important}
  #fileTableBodyTZ tr[data-sl-file-row]{display:grid!important;grid-template-columns:1fr;grid-template-areas:'name' 'date' 'actions';gap:10px;width:100%!important;margin:0 0 12px;padding:14px;border:1px solid #dce5ef;border-radius:12px;background:#fff;box-shadow:0 4px 14px rgba(31,54,82,.06)}
  #fileTableBodyTZ tr[data-sl-file-row] td{display:block!important;width:100%!important;padding:0!important;border:0!important;writing-mode:horizontal-tb!important;white-space:normal!important;text-align:left!important}
  #fileTableBodyTZ tr[data-sl-file-row] td.file-name{grid-area:name;display:grid!important;grid-template-columns:auto 1fr;grid-template-areas:'icon number' 'icon subject';align-items:start;column-gap:9px;row-gap:3px;font-size:15px!important;line-height:1.45;color:var(--text-dark)!important}
  #fileTableBodyTZ .notice-file-icon{grid-area:icon;margin-top:2px;font-size:18px}
  #fileTableBodyTZ .notice-file-number{grid-area:number;font-size:13px;line-height:1.3}
  #fileTableBodyTZ .notice-file-subject{grid-area:subject;display:block!important;font-weight:700;color:var(--primary-dark);word-break:break-word!important;overflow-wrap:anywhere!important}
  #fileTableBodyTZ .file-date{grid-area:date;font-size:12px!important;color:#64748b!important;padding-top:8px!important;border-top:1px solid #eef2f7!important}
  #fileTableBodyTZ tr[data-sl-file-row] td.file-actions{grid-area:actions;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;white-space:normal!important}
  #fileTableBodyTZ .file-actions .btn-table{display:flex!important;align-items:center;justify-content:center;width:100%!important;min-width:0!important;min-height:40px!important;margin:0!important;padding:6px!important;border-radius:8px!important;font-size:12px!important;white-space:nowrap!important}
  #scheme-info:not(.sl-editor-active)>.a4-page{width:100%!important;min-height:0!important;padding:16px!important;border-radius:0}
  #scheme-info:not(.sl-editor-active)>.a4-page>div:first-child{margin-bottom:14px!important;padding-bottom:10px!important}
  #scheme-info:not(.sl-editor-active) #schemePageTitle{font-size:19px!important}
  #scheme-info:not(.sl-editor-active) #folderGridViewFA .folder-card-opt{height:112px!important;min-height:112px!important;padding:12px 8px!important}
  #logYearGrid .folder-card-opt,#logMonthGrid .folder-card-opt,#weekYearGrid .folder-card-opt,#weekMonthGrid .folder-card-opt,
  #folderViewYX .folder-card-opt,#folderGridViewFA .folder-card-opt,#folderGridViewTZ .folder-card-opt,#monthly-year-grid .folder-card-opt{
    min-height:112px!important;padding:12px 8px!important
  }
}
