/* 只补齐玻璃液态主题的屏幕界面，不影响打印纸张与图片本身。 */
@layer site-glass-surfaces {
  body[data-theme="liquid"] :is(.modal:has(.dialog),.confirm-modal,.modal-mask,.sheet-mask,.mm-picker-overlay,.att-reward-overlay,.order-image-lightbox) {
    background:rgba(40,39,66,.22)!important;
    backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  }
  body[data-theme="liquid"] .glass-window {
    background:var(--glass-window-surface)!important;
    border-color:rgba(255,255,255,.66)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.82),inset 1px 0 0 rgba(255,255,255,.26),inset 0 -1px 0 rgba(94,89,135,.1),0 26px 75px rgba(38,35,70,.18)!important;
    backdrop-filter:blur(24px) saturate(135%)!important;
    -webkit-backdrop-filter:blur(24px) saturate(135%)!important;
  }
  body[data-theme="liquid"] .glass-window::before {display:none!important}
  body[data-theme="liquid"] .glass-window-header {
    background:linear-gradient(110deg,rgba(var(--admin-accent-rgb),.12),rgba(255,255,255,.22),rgba(var(--admin-accent-2-rgb),.09))!important;
    border-color:rgba(255,255,255,.65)!important;
  }
  body[data-theme="liquid"] .glass-window-header :is(h1,h2,h3,p,small,.subtitle) {color:var(--admin-text)!important}
  body[data-theme="liquid"] :is(.glass-audit-surface,.glass-audit-field) {
    background:var(--glass-inner-surface)!important;
  }
  /* 字段统一材质，避免旧主题的 72% 白底漏过纯白检查；不改变尺寸和原生控件。 */
  body[data-theme="liquid"] :is(input,select,textarea):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([data-glass-preserve]) {
    background:var(--glass-inner-surface)!important;
    border-color:rgba(117,116,155,.27)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.58),inset 0 -1px 0 rgba(91,87,128,.04),0 1px 2px rgba(39,36,65,.035)!important;
    transition:border-color .25s ease,box-shadow .25s ease,background-color .25s ease;
  }
  body[data-theme="liquid"] :is(input,select,textarea):focus-visible {
    outline:2px solid rgba(var(--admin-accent-rgb),.45);outline-offset:2px;
  }
  body[data-theme="liquid"] .glass-search-control,
  body[data-theme="liquid"] :is(.toolbar,.orders-filter-card,.quotation-filter-card,.statement-filter,.notes-filter,.memo-tools,.member-toolbar,.fm-toolbar,.mat-toolbar-row,.invoices-toolbar-row,.customer-orders-search) {
    background:transparent!important;box-shadow:none!important;border-color:transparent!important;
    backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
  }
  body[data-theme="liquid"] :is(.toolbar,.statement-filter-row,.member-toolbar,.fm-toolbar,.mat-toolbar-row,.invoices-toolbar-row,.memo-tools,.customer-orders-search) {gap:12px!important;align-items:center}
  body[data-theme="liquid"] .glass-search-control>input {background:transparent!important;box-shadow:none!important;border:0!important}
  body[data-theme="liquid"] :is(main,.modal,.modal-mask,.sheet-mask,.mm-picker-overlay) :is(tbody>tr,.customer-order-row,.mm-item):hover {
    background:transparent!important;
  }
  body[data-theme="liquid"] :is(main,.modal,.modal-mask,.sheet-mask,.mm-picker-overlay) tbody>tr:hover>td {background:transparent!important}
  body[data-theme="liquid"] .glass-audit-panel {
    background:var(--admin-surface)!important;
    border-color:rgba(255,255,255,.78)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 6px 20px rgba(48,43,84,.05)!important;
    backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);
  }
  /* 同类卡片保持同一块玻璃，悬停仅改变位移和阴影，不浮出白底。 */
  body[data-theme="liquid"] :is(.card,.metric-card,.customer-card,.member-card,.data-card,.section-card,.head-stat-card,.supplier-card,.staff-card,.purchase-stat,.quote-card,.kpi-cell,.fm-card,.mat-stat,.memo-stat,.glass-audit-panel):hover {
    background:var(--admin-surface)!important;
  }
  body[data-theme="liquid"] :is(.table-wrap,.data-table,.product-table,.customer-table) :is(tr,td):hover {
    background-color:transparent!important;
  }
  body[data-theme="liquid"] #orders-table-view tr.om-selected td {background:rgba(var(--admin-accent-rgb),.08)!important}
  body[data-theme="liquid"] #orders-table-view .th-sort {
    background:transparent!important;border:0!important;box-shadow:none!important;
    border-radius:0!important;backdrop-filter:none!important;padding:0!important;
    color:inherit!important;transform:none!important;min-height:0!important;
  }
  body[data-theme="liquid"] #orders-table-view .om-customer-person .emp-avatar {width:40px!important;height:40px!important;flex:0 0 40px;font-size:16px!important}
  body[data-theme="liquid"] :is(.modal,.mm-picker-overlay,.modal-mask,.sheet-mask,.att-reward-overlay) * {
    scrollbar-width:none!important;scrollbar-gutter:auto!important;
  }
  body[data-theme="liquid"] :is(.modal,.mm-picker-overlay,.modal-mask,.sheet-mask,.att-reward-overlay) ::-webkit-scrollbar {width:0!important;height:0!important}
  /* 只增加间距，不给按钮加外层容器；输入框内的图标按钮保持原定位。 */
  body[data-theme="liquid"] :is(.form-actions,.modal-foot,.invoice-pagination,.order-builder-actions,.qt-actions,.memo-dialog-actions,.mm-picker-actions,.filter-tabs,.view-switch,.view-toggle) {gap:12px!important}
  body[data-theme="liquid"] :is(.view-switch,.view-toggle,.orders-view-switch,.filter-tabs,.period-switch,.range-switch,.module-tabs) {background:transparent!important;border-color:transparent!important;box-shadow:none!important}
  body[data-theme="liquid"] :is(.om-actions,.card-actions,.table-actions,.button-group,.quick-actions) {gap:12px!important}
  body[data-theme="liquid"] .head-stat-card {position:relative;transform:scale(1)!important;transition:transform .55s cubic-bezier(.22,.75,.25,1),filter .45s ease!important}
  @media(hover:hover) and (pointer:fine){
    body[data-theme="liquid"] .head-stat-card:hover {transform:scale(1.1)!important;z-index:2}
    body[data-theme="liquid"] :is(.supplier-head-stats,.outsourcing-head-stats):has(>.head-stat-card:hover)>.head-stat-card:not(:hover){transform:scale(.9)!important;filter:blur(10px)}
  }
  body[data-theme="liquid"] :is(.data-table,.product-table,.customer-table) td>button+button {margin-left:10px}
}
/* 半透明层、薄边缘和内侧折射阴影共同表现材质，不额外增加背景 DIV。 */
body[data-theme="liquid"] {
  --admin-surface:rgba(255,255,255,.34);--admin-surface-hover:rgba(255,255,255,.34);
  --admin-surface-soft:rgba(255,255,255,.22);--admin-surface-blur:blur(16px) saturate(135%);
  --glass-window-surface:linear-gradient(135deg,rgba(255,255,255,.64),rgba(237,238,252,.43));
  --glass-inner-surface:rgba(255,255,255,.12);
  --admin-card-shadow:inset 0 1px 0 rgba(255,255,255,.9),inset 1px 0 0 rgba(255,255,255,.32),inset 0 -1px 0 rgba(92,96,130,.07),0 10px 28px -18px rgba(40,42,60,.22);
}
/* 流光放在独立屏幕装饰层，既不裁切，也不改变弹窗的尺寸及滚动范围。 */
body[data-theme="liquid"] .popup-flow-edge.card-light-edge {
  position:fixed!important;left:var(--popup-x)!important;top:var(--popup-y)!important;
  right:auto!important;bottom:auto!important;pointer-events:none!important;
  opacity:.86;transition:opacity .4s ease;box-sizing:border-box;
}
body[data-theme="liquid"] .popup-flow-edge.card-light-edge rect {animation-play-state:running!important}
body:not([data-theme="liquid"]) .popup-flow-edge {display:none!important}
@media print {.popup-flow-edge{display:none!important}}

/* 一个屏幕装饰 span 复用订单行的七色渐变，不插入表格、不撑高行。 */
body[data-theme="liquid"] .list-flow-edge {
  position:fixed;pointer-events:none;contain:layout style;isolation:isolate;
  --list-beam:linear-gradient(90deg,transparent,#ff5470 10%,#ffb347 24%,#ffe66d 36%,#5de2a5 50%,#43c9ff 64%,#8b7bff 76%,#ed72db 90%,transparent);
}
body[data-theme="liquid"] .list-flow-edge::before,
body[data-theme="liquid"] .list-flow-edge::after {
  content:"";position:absolute;bottom:0;left:25%;width:50%;height:1px;
  background:var(--list-beam);background-size:180% 100%;transform-origin:center;
  mask-image:radial-gradient(ellipse,#000 25%,rgba(0,0,0,.5) 60%,transparent 100%);
  animation:list-beam-enter .7s cubic-bezier(.22,.75,.25,1) both,list-beam-flow 5s ease-in-out infinite alternate,list-beam-reach 6s .7s ease-in-out infinite;
}
body[data-theme="liquid"] .list-flow-edge::before {height:3px;bottom:-1px;filter:blur(2px);opacity:.55}
@keyframes list-beam-enter {from{scale:0 1;opacity:0}to{scale:1 1}}
@keyframes list-beam-flow {from{background-position:0% 50%}to{background-position:100% 50%}}
@keyframes list-beam-reach {0%,100%{transform:scaleX(1)}50%{transform:scaleX(2)}}
@media(prefers-reduced-motion:reduce){body:not([data-card-motion="forced"]) .list-flow-edge::before,body:not([data-card-motion="forced"]) .list-flow-edge::after{animation:none}}
@media print {.list-flow-edge{display:none!important}}

body[data-theme="liquid"][data-card-motion="forced"] .list-flow-edge::before,
body[data-theme="liquid"][data-card-motion="forced"] .list-flow-edge::after {
  animation:list-beam-enter .7s cubic-bezier(.22,.75,.25,1) both,list-beam-flow 5s ease-in-out infinite alternate,list-beam-reach 6s .7s ease-in-out infinite!important;
}
