/* 只作用于 records 脚本标记的主内容列表；桌面端保留表格顺序和交互。 */
.ar-toolbar,.ar-more,.ar-row-detail,.ar-room-summary{display:none;}
@media (max-width:760px){
  .ar-host,.ar-container{min-width:0!important;max-width:100%;box-sizing:border-box;}
  .ar-container{overflow:visible!important;}
  .ar-host{width:100%;}
  .ar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:8px 0 12px;}
  .ar-hint{flex:1;min-width:140px;color:#64748b;font-size:13px;line-height:1.5;}
  .ar-button{appearance:none;box-sizing:border-box;min-height:44px;padding:8px 12px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#334155;font:inherit;font-size:14px;line-height:1.4;cursor:pointer;white-space:normal;touch-action:manipulation;}
  .ar-button:hover{background:#f1f5f9;}
  .ar-button:focus-visible,.ar-viewport:focus-visible{outline:3px solid #818cf8;outline-offset:2px;}
  .ar-button[hidden]{display:none!important;}
  .ar-viewport{width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;}
  .ar-host:not(.ar-full):not(.ar-span-host)>.ar-viewport{overflow:visible;}
  .ar-host [hidden]{display:none!important;}
  .ar-host:not(.ar-full) .ar-record-table{display:block;width:100%!important;min-width:0!important;max-width:100%!important;table-layout:auto!important;background:transparent;border:0;}
  .ar-host:not(.ar-full) .ar-record-table>colgroup{display:none;}
  /* 表头 checkbox 仍是原节点，保留原全选事件和选中状态。 */
  .ar-host:not(.ar-full) .ar-record-table>thead{display:block;}
  .ar-host:not(.ar-full) .ar-record-table>thead>tr{display:block;}
  .ar-host:not(.ar-full) .ar-record-table>thead>tr>:not(.ar-select-head){display:none!important;}
  .ar-host:not(.ar-full) .ar-record-table>thead>tr>.ar-select-head{display:block;width:auto!important;min-width:0!important;padding:8px 12px;border:0;background:#f8fafc;}
  .ar-host:not(.ar-full) .ar-record-table>thead>tr>.ar-select-head::after{content:' 全选 / 取消全选';font-size:14px;color:#475569;}
  .ar-host:not(.ar-full) .ar-record-table>tbody{display:grid;gap:12px;width:100%;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 12px;min-width:0;width:auto!important;padding:12px;border:1px solid #e2e8f0;border-radius:12px;background:#fff;box-sizing:border-box;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr>td{min-width:0!important;max-width:none!important;width:auto!important;height:auto;padding:8px 0!important;border:0!important;font-size:14px!important;line-height:1.65;white-space:normal!important;overflow:visible!important;text-overflow:clip;overflow-wrap:anywhere;box-sizing:border-box;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr>td::before{content:attr(data-label);display:block;font-size:12px;color:#64748b;font-weight:400;line-height:1.5;margin-bottom:2px;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr>td[data-ar-kind="title"]{grid-column:1/-1;grid-row:1;font-size:16px!important;font-weight:650;color:#0f172a;padding-top:0!important;padding-right:48px!important;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr>td[data-ar-kind="title"]::before{display:none;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr>td[data-ar-kind="select"]{grid-column:2;grid-row:1;justify-self:end;align-self:start;z-index:1;min-height:44px;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr>td[data-ar-kind="select"]::before{display:none;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr:not(.ar-expanded)>td[data-ar-kind="extra"]{display:none!important;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr>td[data-ar-kind="extra"]{grid-column:1/-1;border-top:1px dashed #e2e8f0!important;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>tr>td[data-ar-kind="actions"]{grid-column:1/-1;order:2;border-top:1px solid #e2e8f0!important;padding-top:10px!important;}
  .ar-host:not(.ar-full) .ar-record-table .ar-more{display:block;margin-top:8px;font-weight:400;color:#4338ca;border-color:#c7d2fe;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>.ar-empty-row{display:block;text-align:center;}
  .ar-host:not(.ar-full) .ar-record-table>tbody>.ar-empty-row>td::before{display:none;}
  .ar-host:not(.ar-full) .ar-record-table td :is(.cell-clamp,.nm,.c-name,.coy-wrap,.tax-wrap){max-width:100%!important;white-space:normal!important;overflow:visible!important;text-overflow:clip;overflow-wrap:anywhere;}
  .ar-host .ar-record-table :is(button,a[onclick],span[onclick],[role="button"]),.ar-span-table .rt-ops a{min-height:44px;box-sizing:border-box;touch-action:manipulation;}
  .ar-host .ar-record-table :is(a[onclick],span[onclick]){display:inline-flex;align-items:center;white-space:normal;max-width:100%;overflow-wrap:anywhere;}
  .ar-host .ar-record-table :is(button,.op-btn){margin:3px 4px 3px 0;white-space:normal!important;}
  .ar-host input[type="checkbox"]{width:22px!important;height:22px!important;margin:8px;vertical-align:middle;}
  .ar-host.ar-full>.ar-viewport{border:1px solid #e2e8f0;border-radius:10px;}
  .ar-host.ar-full .ar-record-table{min-width:800px;width:max-content;}
  /* 合并单元格不改 display，不折断 rowspan，也不按物理 cellIndex 推断室友。 */
  .ar-span-host>.ar-viewport{border:1px solid #e2e8f0;border-radius:10px;isolation:isolate;}
  .ar-host .ar-span-table{min-width:980px!important;}
  .ar-host .ar-span-table.rt-tbl{min-width:1060px!important;}
  .ar-host .ar-span-table.rt-tbl td{height:auto;padding:8px 9px;white-space:normal;overflow-wrap:anywhere;overflow:visible;text-overflow:clip;}
  .ar-span-table.rt-tbl .ar-room-name{position:sticky;left:0;z-index:2;background:#fff;box-shadow:3px 0 6px #0f172a12;}
  .ar-span-table.rt-tbl tr.rt-g0>.ar-room-name{background:#f5f3ff;}
  .ar-span-table.rt-tbl tr.rt-g1>.ar-room-name{background:#eef7ff;}
  .ar-span-table.rt-tbl .ar-room-ops{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-3px 0 6px #0f172a12;}
  .ar-span-table.rt-tbl .ar-room-ops a{display:inline-flex;align-items:center;margin-right:8px;padding:6px 2px;}
  .ar-span-table .ar-row-detail{display:inline-block;margin-top:6px;}
  .ar-span-table .ar-room-summary{display:block;font-size:12px;line-height:1.6;color:#475569;margin-top:5px;white-space:normal;}
  .ar-span-table.rt-tbl .rt-name .nm{white-space:normal;overflow:visible;text-overflow:clip;}
  .ar-span-table.rt-tbl :is(select,button){min-height:44px;max-width:100%;font-size:14px;}
  .ar-span-host.ar-full :is(.ar-hint,.ar-row-detail,.ar-room-summary){display:none;}
  #roomBoard .rt-actions{display:flex;flex-wrap:wrap;gap:8px;min-width:0;}
  #roomBoard .rt-actions button{min-height:44px;max-width:100%;white-space:normal;font-size:14px;touch-action:manipulation;}
  .ar-sheet-overlay{position:fixed;inset:0;z-index:1200;display:flex;align-items:flex-end;justify-content:center;background:#0f172a80;padding:12px 12px max(12px,env(safe-area-inset-bottom));box-sizing:border-box;overscroll-behavior:contain;}
  .ar-sheet{display:flex;flex-direction:column;min-width:0;width:min(100%,620px);max-height:85vh;max-height:85dvh;border-radius:16px;background:#fff;box-shadow:0 16px 48px #0f172a40;overflow:hidden;}
  .ar-sheet-head{display:flex;align-items:center;justify-content:space-between;flex-shrink:0;gap:12px;padding:14px 16px;border-bottom:1px solid #e2e8f0;}
  .ar-sheet-head h2{font-size:18px;line-height:1.4;margin:0;color:#0f172a;}
  .ar-sheet-content{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:4px 16px 20px;}
  .ar-sheet-field{padding:12px 0;border-bottom:1px solid #e2e8f0;overflow-wrap:anywhere;}
  .ar-sheet-label{font-size:12px;color:#64748b;margin-bottom:5px;}
  .ar-sheet-value{font-size:15px;line-height:1.7;color:#1e293b;white-space:pre-wrap;}
  .ar-sheet-controls{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px;}
  .ar-sheet-controls select{min-height:44px;max-width:100%;font-size:16px;border:1px solid #cbd5e1;border-radius:8px;padding:6px 10px;background:#fff;}
  :is(#regionAdminList,#trashList)>.bank-card{min-width:0;max-width:100%;display:flex;flex-direction:column;align-items:stretch;gap:12px;box-sizing:border-box;padding:14px;}
  :is(#regionAdminList,#trashList) .bank-info{min-width:0;max-width:100%;}
  :is(#regionAdminList,#trashList) :is(.bank-name,.bank-detail){white-space:normal;overflow-wrap:anywhere;line-height:1.7;}
  :is(#regionAdminList,#trashList) .bank-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0;}
  :is(#regionAdminList,#trashList) .bank-actions button{min-height:44px;white-space:normal;}
  #regionAdminList .mgr-chip{max-width:100%;min-height:44px;white-space:normal;overflow-wrap:anywhere;box-sizing:border-box;line-height:1.7;}
}
/* 极窄内容栏不让两侧固定列叠盖姓名；右侧操作仍可横滑或从资料面板触达。 */
@media (max-width:480px){
  .ar-span-table.rt-tbl .ar-room-ops{position:static;box-shadow:none;}
}
@media print{
  .ar-owned{display:none!important;}
}
