Files
wordpress-theme-aksrt/assets/css/frontend/modal-runtime.css
T
kate522 2f571c2a98 fix(checkin): keep modal runtime shell fullscreen with modal-mini class
Trigger classes are applied to the fixed shell; .modal-mini's
width:400px + auto margins collapsed the shell (and its backdrop)
into a centered column. Neutralize dialog-only width classes on the
shell so the fullscreen backdrop covers the viewport again.
2026-09-19 15:47:23 +08:00

414 lines
9.7 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Modal runtime + ajax list primitives (shared).
*
* @package AKSRT
*/
/* ---- portal token bridge ----
*
* 弹窗由 runtime portal 到 <body>,因此它位于任何「页面级 token 作用域」之外。
* 典型陷阱:路由样式把语义别名挂在页面上,例如
*
* .aksrt-orders-page { --orders-ink: var(--color-ink, #333); }
*
* 弹窗内部再去 `var(--orders-ink)` 时该变量不存在,整条声明会被静默丢弃——
* 表现为边框消失、次级文字变透明,而不是抛错,排查成本很高。
*
* 因此共享调色板在这里声明:本壳层永远在 portal 内,任何弹窗都能直接消费
* `--modal-*`。路由样式应把自己的局部别名映射到这里,而不是映射到页面级变量。
*/
.aksrt-modal-runtime {
--modal-ink: var(--color-ink, #333333);
--modal-ink-2: var(--color-ink-2, #4e5358);
--modal-muted: var(--color-ink-3, #777777);
--modal-line: var(--color-line-stronger, rgba(50, 50, 50, 0.12));
--modal-line-soft: var(--color-line, rgba(50, 50, 50, 0.06));
--modal-surface: var(--surface-1, #ffffff);
--modal-surface-2: var(--surface-2, #eeeeee);
--modal-surface-3: var(--surface-4, #f8f8f8);
--modal-primary: var(--color-primary, #f04494);
--modal-on-primary: var(--color-on-primary, #ffffff);
--modal-warning: var(--color-warning, #f59e0b);
--modal-success: var(--color-success, #10b981);
--modal-danger: var(--color-danger, #ef4444);
}
/* ---- scroll lock ---- */
html.aksrt-modal-runtime-open,
body.aksrt-modal-runtime-open {
overflow: hidden;
}
/* ---- 对话框宽度类不得作用于壳 ----
触发器沿用参考主题的 data-class 语义(modal-mini/full-sm 等),
但这些类落在 fixed 全屏壳上时,.modal-mini 的 width:400px +
auto 边距会把壳压成居中单列,蒙版随之只覆盖一列。 */
.aksrt-modal-runtime.modal-mini,
.aksrt-modal-runtime.full-sm {
width: auto;
max-width: none;
margin: 0;
}
/* ---- modal runtime shell ---- */
.aksrt-modal-runtime {
position: fixed;
inset: 0;
z-index: 100050;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
visibility: hidden;
transition: opacity 0.2s ease, visibility 0.2s ease;
pointer-events: none;
}
.aksrt-modal-runtime.is-open {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.aksrt-modal-runtime__overlay {
position: absolute;
inset: 0;
/* 参考主题 .modal-backdrop 同款:纯黑 50%,无模糊、无色调偏移 */
background: rgba(0, 0, 0, 0.5);
}
.aksrt-modal-runtime__dialog {
position: relative;
z-index: 1;
width: min(440px, calc(100vw - 32px));
max-height: min(88vh, 720px);
overflow: auto;
background: var(--surface-1, #fff);
border-radius: 16px;
box-shadow: 0 18px 48px rgba(15, 18, 28, 0.22);
transform: translateY(12px) scale(0.98);
transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
color: var(--color-ink, #1f2937);
}
.aksrt-modal-runtime.is-open .aksrt-modal-runtime__dialog {
transform: translateY(0) scale(1);
}
.aksrt-modal-runtime--bottom {
align-items: flex-end;
}
.aksrt-modal-runtime--bottom .aksrt-modal-runtime__dialog {
width: 100%;
max-width: 100%;
border-radius: 16px 16px 0 0;
max-height: 90vh;
transform: translateY(24px);
}
.aksrt-modal-runtime--bottom.is-open .aksrt-modal-runtime__dialog {
transform: translateY(0);
}
.aksrt-modal-runtime__header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 16px 18px 0;
}
.aksrt-modal-runtime__title {
margin: 0;
font-size: 17px;
line-height: 1.35;
}
.aksrt-modal-runtime__content {
padding: 18px 18px 16px;
}
.aksrt-modal-runtime__loading,
.aksrt-modal-runtime__error-body {
padding: 28px 8px;
text-align: center;
color: var(--color-ink-2, #6b7280);
font-size: 14px;
}
.aksrt-modal-runtime__skeleton {
display: grid;
gap: 12px;
padding: 8px 2px;
}
.aksrt-modal-runtime__skeleton-line,
.aksrt-modal-runtime__skeleton-block {
display: block;
border-radius: 8px;
background: linear-gradient(90deg, rgba(148, 163, 184, 0.16), rgba(148, 163, 184, 0.3), rgba(148, 163, 184, 0.16));
background-size: 200% 100%;
animation: aksrt-modal-skeleton 1.2s ease-in-out infinite;
}
.aksrt-modal-runtime__skeleton-line {
width: 72%;
height: 12px;
}
.aksrt-modal-runtime__skeleton-line.is-wide {
width: 92%;
height: 18px;
}
.aksrt-modal-runtime__skeleton-line.is-short {
width: 44%;
}
.aksrt-modal-runtime__skeleton-block {
width: 100%;
min-height: 84px;
}
.aksrt-modal-runtime__retry {
cursor: pointer;
}
@keyframes aksrt-modal-skeleton {
0% { background-position: 100% 0; }
100% { background-position: -100% 0; }
}
.aksrt-modal-runtime .touch.border-title,
.aksrt-modal-runtime .border-title {
font-size: 16px;
font-weight: 700;
margin: 0 0 14px;
display: flex;
align-items: baseline;
flex-wrap: wrap;
gap: 6px;
}
.aksrt-modal-runtime .aksrt-modal-runtime__close {
position: absolute;
top: 10px;
right: 10px;
width: 32px;
height: 32px;
border: 0;
border-radius: 999px;
background: transparent;
color: var(--color-ink-3, #9ca3af);
cursor: pointer;
font-size: 18px;
line-height: 1;
}
.aksrt-modal-runtime .but-average.modal-buts,
.aksrt-modal-runtime .modal-buts {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin-top: 16px;
}
.aksrt-modal-runtime .but-average.modal-buts .but,
.aksrt-modal-runtime .modal-buts .but,
.aksrt-modal-runtime .modal-buts button {
min-height: 40px;
border-radius: 10px;
border: 1px solid var(--color-line, #e5e7eb);
background: var(--surface-4, #f3f4f6);
color: var(--color-ink, #111);
font-weight: 600;
cursor: pointer;
}
.aksrt-modal-runtime .modal-buts .but.c-blue,
.aksrt-modal-runtime .modal-buts button.c-blue,
.aksrt-modal-runtime .modal-buts .btn-primary {
background: var(--color-primary, #f04494);
border-color: color-mix(in srgb, var(--color-primary, #f04494) 70%, #000 0%);
color: var(--color-on-primary, #fff);
}
/* ---- 签到详情弹窗(参考主题 refresh_modal modal-mini 同构壳) ----
内容为服务端 HTML(modal-colorful-header + modal-body),与参考主题
.modal-dialog.modal-mini 几何 1:1:宽 400px、圆角 var(--main-radius)。 */
.aksrt-modal-runtime.aksrt-checkin-details-modal:not(.aksrt-modal-runtime--bottom) .aksrt-modal-runtime__dialog {
width: min(400px, calc(100vw - 32px));
border-radius: var(--main-radius, 8px);
background: var(--main-bg-color, #fff);
}
.aksrt-modal-runtime.aksrt-checkin-details-modal .aksrt-modal-runtime__content {
padding: 0;
}
.aksrt-modal-runtime.aksrt-checkin-details-modal .aksrt-modal-runtime__skeleton {
padding: 24px 18px;
}
/* ---- ajax list ---- */
.ajaxpager.is-ajax-loading {
position: relative;
min-height: 80px;
}
.ajaxpager .post_ajax_loader,
.ajaxpager .post-ajax-loader {
display: none;
}
.ajaxpager .post_ajax_loader.is-loading,
.ajaxpager .post-ajax-loader.is-loading {
display: block;
}
.ajax-item.is-fading {
opacity: 0.35;
transition: opacity 0.15s ease;
}
/* ---- order review modal content ---- */
.order-comment-from .shop-score-box {
display: flex;
align-items: center;
gap: 8px;
min-height: 36px;
}
.order-comment-from .score-title {
width: 4.5em;
flex: 0 0 auto;
font-size: 13px;
color: var(--color-ink-2, #6b7280);
}
.order-comment-from .score-icon {
display: inline-flex;
gap: 4px;
align-items: center;
height: 30px;
}
.order-comment-from .icon-star {
display: inline-flex;
width: 22px;
height: 22px;
color: #d1d5db;
cursor: pointer;
transition: color 0.12s ease, transform 0.12s ease;
}
.order-comment-from .icon-star svg {
width: 22px;
height: 22px;
fill: currentColor;
}
.order-comment-from .icon-star.active,
.order-comment-from .icon-star.hover {
color: #fc7049;
}
.order-comment-from .icon-star.hover {
transform: scale(1.08);
}
.order-comment-from .score-text {
min-width: 3em;
font-size: 13px;
color: var(--color-ink-2, #6b7280);
}
.order-comment-from textarea.form-control {
width: 100%;
border: 1px solid var(--color-line, #e5e7eb);
border-radius: 10px;
padding: 10px 12px;
font-size: 14px;
resize: vertical;
min-height: 96px;
background: var(--surface-1, #fff);
color: var(--color-ink, #111);
}
.order-comment-from .form-upload .preview {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.order-comment-from .form-upload .preview .add,
.order-comment-from .form-upload .preview .preview-item {
width: 80px;
height: 80px;
border-radius: 10px;
border: 1px dashed var(--color-line, #d1d5db);
background: var(--surface-4, #f9fafb);
position: relative;
overflow: hidden;
cursor: pointer;
}
.order-comment-from .form-upload .preview .add::before,
.order-comment-from .form-upload .preview .add::after {
content: "";
position: absolute;
left: 50%;
top: 50%;
background: var(--color-ink-3, #9ca3af);
transform: translate(-50%, -50%);
}
.order-comment-from .form-upload .preview .add::before {
width: 22px;
height: 2px;
}
.order-comment-from .form-upload .preview .add::after {
width: 2px;
height: 22px;
}
.order-comment-from .form-upload .preview .preview-item img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.order-comment-from .form-upload .preview .preview-item .remove {
position: absolute;
top: 2px;
right: 2px;
width: 20px;
height: 20px;
border: 0;
border-radius: 999px;
background: rgba(0, 0, 0, 0.55);
color: #fff;
font-size: 12px;
line-height: 1;
cursor: pointer;
}
.order-comment-from .form-upload .hide {
display: none !important;
}
.order-comment-from .review-error {
color: #ef4444;
font-size: 13px;
margin-top: 8px;
}
@media (max-width: 768px) {
.aksrt-modal-runtime:not(.aksrt-modal-runtime--bottom) .aksrt-modal-runtime__dialog {
width: calc(100vw - 20px);
}
}