Files
wordpress-theme-aksrt/assets/css/frontend/cms-download.css
T
kate522 bc97c4ddc3 refactor(download): open generated links directly without the popup
The success modal added a second click between the download button and
the file: request -> "下载链接已生成" popup -> 立即下载. Drop it and open
the generated relay link right away, keeping the previous new-tab
behaviour; a missing link still surfaces the error view.

- Replace renderSuccess with startDownload (anchor + target=_blank)
- Remove the popup-only CSS: alert, code-row, copy button, chips, meta
  and the download action skin; error, cashier and scan-pay views keep
  their styles
2026-09-24 18:56:36 +08:00

769 lines
15 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.
/**
* AKSRT download / cashier modal.
*
* 下载弹窗走主题 design token(core/tokens.css);收银台沿用参考实现的
* colorful-header 结构(pay-card 契约测试锁定的类名不可改动)。
*/
/* ============================================================
* 弹窗外壳
* ============================================================ */
.aksrt-dl-modal {
position: fixed;
inset: 0;
z-index: 10000;
display: none;
}
.aksrt-dl-modal.is-open {
display: flex;
align-items: center;
justify-content: center;
}
.aksrt-dl-modal__backdrop {
position: absolute;
inset: 0;
background: rgb(15 23 42 / 55%);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
.aksrt-dl-modal__backdrop {
background: rgb(15 23 42 / 38%);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
}
}
.aksrt-dl-modal__dialog {
position: relative;
z-index: 1;
width: 420px;
max-width: calc(100% - 20px);
margin: 0 auto;
}
.aksrt-dl-modal__panel {
position: relative;
width: 100%;
max-height: calc(100vh - 20px);
overflow: hidden auto;
color: var(--main-color, #111827);
background: var(--main-bg-color, #fff);
border: 0;
border-radius: var(--radius-xl, 12px);
box-shadow: var(--shadow-lg, 0 12px 32px rgba(18, 18, 18, 0.1));
}
.aksrt-dl-modal.is-open .aksrt-dl-modal__dialog {
animation: aksrt-dl-modal-in 0.2s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
@keyframes aksrt-dl-modal-in {
from {
transform: translateY(10px) scale(0.97);
opacity: 0;
}
to {
transform: translateY(0) scale(1);
opacity: 1;
}
}
/* 关闭按钮:下载视图中悬浮在渐变头部上 */
.aksrt-dl-modal__close,
.aksrt-cashier__close {
appearance: none;
position: absolute;
z-index: 9;
top: 12px;
right: 14px;
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
padding: 0;
color: var(--muted-color, #6b7280);
font: 400 20px/1 sans-serif;
background: transparent;
border: 0;
border-radius: 50%;
box-shadow: none;
cursor: pointer;
}
.aksrt-dl-modal:not(.is-cashier) .aksrt-dl-modal__close {
color: #fff;
background: rgb(255 255 255 / 22%);
}
.aksrt-dl-modal:not(.is-cashier) .aksrt-dl-modal__close:hover {
background: rgb(255 255 255 / 34%);
}
.aksrt-dl-modal:not(.is-cashier) .aksrt-dl-modal__close:focus-visible {
outline: 2px solid rgb(255 255 255 / 70%);
outline-offset: 1px;
}
.aksrt-dl-modal.is-cashier > .aksrt-dl-modal__dialog > .aksrt-dl-modal__panel > .aksrt-dl-modal__close {
display: none;
}
/* ============================================================
* 主题化下载视图(成功 / 错误 / 扫码共用外壳)
* 色彩一律继承运行时「色彩方案」:InlineStyleBuilder 注入
* :root 的 --focus-color / --color-primary-*,配置暗色主色时
* 会自动切换到 html.dark 下的暗色主题色,无需本地另设配色。
* ============================================================ */
.aksrt-dl-modal__hero {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding: 26px 52px 22px;
overflow: hidden;
color: #fff;
text-align: center;
background: var(--focus-color, #f04494);
}
/* 装饰光斑(对应 pay-widget 的 orb 语言) */
.aksrt-dl-modal__hero::before,
.aksrt-dl-modal__hero::after {
position: absolute;
border-radius: 100%;
background: rgb(255 255 255 / 14%);
content: '';
}
.aksrt-dl-modal__hero::before {
top: -46px;
right: -34px;
width: 150px;
height: 150px;
}
.aksrt-dl-modal__hero::after {
bottom: -60px;
left: -40px;
width: 130px;
height: 130px;
opacity: 0.55;
}
.aksrt-dl-modal__hero-icon {
display: flex;
align-items: center;
justify-content: center;
width: 56px;
height: 56px;
font-size: 25px;
background: rgb(255 255 255 / 22%);
border-radius: 50%;
box-shadow: inset 0 0 0 1px rgb(255 255 255 / 25%);
}
.aksrt-dl-modal__title {
margin: 0;
color: inherit;
font: 800 20px/1.3 inherit;
}
.aksrt-dl-modal__subtitle {
margin: -2px 0 0;
font-size: 12.5px;
line-height: 1.55;
opacity: 0.82;
}
.aksrt-dl-modal__content {
padding: 18px 22px 22px;
}
.aksrt-dl-modal__msg {
margin: 0 0 14px;
color: var(--muted-color, #777);
font-size: 14px;
line-height: 1.65;
}
/* 提取码卡片 */
.aksrt-dl-modal__code-card {
padding: 13px 15px;
margin: 0 0 14px;
background: var(--surface-2, rgba(0, 0, 0, 0.04));
border: 1px dashed var(--color-line-stronger, rgba(50, 50, 50, 0.12));
border-radius: 10px;
}
.aksrt-dl-modal__code-caption {
margin-bottom: 7px;
color: var(--muted-color, #777);
font-size: 11px;
font-weight: 700;
letter-spacing: 0.08em;
}
.aksrt-dl-modal__code {
display: block;
min-width: 0;
overflow: hidden;
color: var(--focus-color, #f04494);
font: 800 20px/1.25 var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
letter-spacing: 0.12em;
text-overflow: ellipsis;
white-space: nowrap;
}
.aksrt-dl-modal__code--wrap {
font-size: 14px;
font-weight: 500;
letter-spacing: 0.02em;
word-break: break-all;
white-space: normal;
}
/* 操作按钮 */
.aksrt-dl-modal__actions {
display: flex;
flex-direction: column;
gap: 10px;
}
.aksrt-dl-modal__btn {
appearance: none;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
box-sizing: border-box;
width: 100%;
min-height: 42px;
padding: 0 18px;
color: #fff;
font-family: inherit;
font-size: 14px;
font-weight: 700;
text-decoration: none;
background: var(--focus-color, #f04494);
border: 0;
border-radius: 10px;
cursor: pointer;
transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.aksrt-dl-modal__btn:hover {
background: var(--color-primary-hover, #e0307e);
transform: translateY(-1px);
}
.aksrt-dl-modal__btn:active {
background: var(--color-primary-active, #c9206d);
transform: scale(0.98);
}
.aksrt-dl-modal__btn:focus-visible {
outline: 2px solid var(--focus-color, #f04494);
outline-offset: 2px;
}
/* ============================================================
* 收银台(参考实现契约结构)
* ============================================================ */
.aksrt-dl-modal.is-cashier .aksrt-dl-modal__body {
position: relative;
min-height: 120px;
padding-top: 120px;
}
.aksrt-dl-modal .modal-colorful-header,
.aksrt-dl-modal .colorful-bg {
position: relative;
overflow: hidden;
color: var(--this-color);
background: var(--this-bg);
background-size: 120%;
}
.aksrt-dl-modal .modal-colorful-header {
position: absolute;
top: 0;
right: 0;
left: 0;
display: flex;
align-items: center;
justify-content: center;
height: 120px;
border-radius: var(--radius-xl, 12px) var(--radius-xl, 12px) 0 0;
}
.aksrt-dl-modal .colorful-bg > .colorful-make,
.aksrt-dl-modal .colorful-bg > .colorful-make::before,
.aksrt-dl-modal .colorful-bg > .colorful-make::after {
position: absolute;
color: var(--this-color);
background: var(--this-bg);
border-radius: 100%;
content: '';
}
.aksrt-dl-modal .colorful-bg > .colorful-make {
top: 60%;
bottom: 0;
width: 323px;
height: 290px;
animation: aksrt-cashier-colorful 120s linear infinite;
}
.aksrt-dl-modal .colorful-bg > .colorful-make::before {
top: -325px;
right: -558px;
bottom: 0;
width: 677px;
height: 300px;
opacity: 0.6;
transform: rotate(341deg);
}
.aksrt-dl-modal .colorful-bg > .colorful-make::after {
top: -170px;
bottom: 0;
left: -262px;
width: 402px;
height: 214px;
opacity: 0.4;
transform: rotate(326deg);
}
.aksrt-dl-modal .colorful-bg > .colorful-make + * {
position: relative;
}
.aksrt-dl-modal .aksrt-cashier__close {
color: var(--this-color, #fff);
font-size: 18px;
opacity: 0.6;
}
.aksrt-dl-modal .modal-pay-body {
padding: 15px;
margin-top: 0;
}
.aksrt-cashier__loading {
min-height: 70px;
margin: 0;
line-height: 70px;
text-align: center;
}
/* 收银台内部使用的工具类作用域 */
.aksrt-dl-modal .text-center {
text-align: center;
}
.aksrt-dl-modal .em2x {
font-size: 2em;
}
.aksrt-dl-modal .em09 {
font-size: 0.9em;
}
.aksrt-dl-modal .em12 {
font-size: 1.2em;
}
.aksrt-dl-modal .em14 {
font-size: 1.4em;
}
.aksrt-dl-modal .mt6 {
margin-top: 6px;
}
.aksrt-dl-modal .mt10 {
margin-top: 10px;
}
.aksrt-dl-modal .mb6 {
margin-bottom: 6px;
}
.aksrt-dl-modal .mb10 {
margin-bottom: 10px;
}
.aksrt-dl-modal .mb20 {
margin-bottom: 20px;
}
.aksrt-dl-modal .mr6 {
margin-right: 6px;
}
.aksrt-dl-modal .ml6 {
margin-left: 6px;
}
.aksrt-dl-modal .ml10 {
margin-left: 10px;
}
.aksrt-dl-modal .px12 {
font-size: 12px;
}
.aksrt-dl-modal .padding-h6 {
padding-top: 6px;
padding-bottom: 6px;
}
.aksrt-dl-modal .padding-h10 {
padding-top: 10px;
padding-bottom: 10px;
}
.aksrt-dl-modal .padding-w10 {
padding-right: 10px;
padding-left: 10px;
}
.aksrt-dl-modal .line-16 {
line-height: 1.6;
}
.aksrt-dl-modal .flex {
display: flex;
}
.aksrt-dl-modal .flex.jsb {
justify-content: space-between;
}
.aksrt-dl-modal .flex.jc {
justify-content: center;
}
.aksrt-dl-modal .flex.ac {
align-items: center;
}
.aksrt-dl-modal .flex.ab {
align-items: baseline;
}
.aksrt-dl-modal .flex.hh {
flex-direction: column;
}
.aksrt-dl-modal .flex-auto {
flex: auto;
}
.aksrt-dl-modal .pointer {
cursor: pointer;
}
.aksrt-dl-modal .font-bold {
font-weight: 700;
}
.aksrt-dl-modal .muted-2-color {
color: var(--muted-2-color, #8b93a7);
}
.aksrt-dl-modal .muted-3-color {
color: var(--muted-3-color, #a9afbe);
}
.aksrt-dl-modal .c-red {
color: #ff5473;
}
.aksrt-dl-modal .c-green {
color: #20b759;
}
.aksrt-dl-modal .c-blue-2 {
color: #5c7cff;
}
.aksrt-dl-modal .muted-box {
padding: 10px;
background: var(--muted-border-color, rgb(132 145 165 / 10%));
border-radius: var(--radius-sm, 4px);
}
.aksrt-dl-modal .pay-tag {
display: inline-block;
padding: 2px 7px;
color: #2997f7;
font-size: 12px;
line-height: 1.4;
background: rgb(41 151 247 / 10%);
border-radius: var(--radius-sm, 4px);
}
.aksrt-cashier__price-row {
gap: 12px;
min-height: 27px;
}
.aksrt-cashier__regular-price {
display: flex;
gap: 10px;
align-items: baseline;
}
.aksrt-dl-modal .original-price {
position: relative;
display: inline-flex;
align-items: baseline;
padding-right: 2px;
padding-left: 1px;
color: var(--muted-color, #7d8496);
font-size: 14px;
}
.aksrt-dl-modal .original-price::before {
position: absolute;
top: 50%;
left: 0;
width: 100%;
height: 1px;
background: #ff343b;
transform: rotate(8deg);
transform-origin: center;
content: '';
}
.aksrt-cashier__vip-mark {
display: inline-block;
padding: 0 4px;
margin-left: 3px;
color: #866127;
font-size: 10px;
font-weight: 700;
line-height: 16px;
vertical-align: 1px;
background: linear-gradient(25deg, #eabe7b 10%, #f5e3c7 70%, #edc788 100%);
border-radius: var(--radius-sm, 4px);
}
.aksrt-cashier__asset-icon {
width: 1.2em;
margin-right: 6px;
color: #5c7cff;
text-align: center;
}
.aksrt-dl-modal .payment-method-radio {
min-width: 0;
padding: 5px;
text-align: center;
border: 1px solid var(--main-border-color, rgb(132 145 165 / 20%));
border-radius: var(--radius-sm, 4px);
}
.aksrt-dl-modal .payment-method-radio > * {
margin: 3px;
}
.aksrt-dl-modal .payment-method-radio img {
width: auto;
max-width: 68px;
height: 35px;
object-fit: contain;
}
.aksrt-dl-modal .payment-method-radio + .payment-method-radio {
margin-left: 10px;
}
.aksrt-dl-modal .hollow-radio.active {
color: var(--focus-color, #2997f7);
background: var(--focus-color-opacity1, rgb(41 151 247 / 10%));
border-color: var(--focus-color, #2997f7);
}
.aksrt-dl-modal .payment-method-radio:focus {
outline: 0;
box-shadow: none;
}
.aksrt-cashier__balance[hidden] {
display: none;
}
.aksrt-dl-modal .form-control {
display: block;
width: 100%;
min-height: 36px;
padding: 6px 92px 6px 10px;
color: var(--main-color, #111827);
font: inherit;
background: var(--main-bg-color, #fff);
border: 1px solid var(--main-border-color, #e5e7eb);
border-radius: var(--radius-sm, 4px);
}
.aksrt-dl-modal .relative {
position: relative;
}
.aksrt-dl-modal .abs-right {
position: absolute;
top: 50%;
right: 3px;
transform: translateY(-50%);
}
.aksrt-dl-modal .coupon-submit {
padding: 0.3em 0.8em;
}
.aksrt-cashier__coupon-desc,
.aksrt-cashier__coupon-ok {
margin-top: 6px;
font-size: 12px;
line-height: 1.5;
}
.aksrt-cashier__coupon-ok {
color: #20b759;
}
.aksrt-cashier__warn {
padding: 8px 10px;
color: #ff5473;
font-size: 13px;
line-height: 1.5;
text-align: center;
background: rgb(255 84 115 / 10%);
border-radius: var(--radius-sm, 4px);
}
.aksrt-dl-modal .but.initiate-pay {
padding: 0.6em 1em;
}
.aksrt-dl-modal .modal-buts.but-average {
overflow: hidden;
border-top: 1px solid var(--main-border-color, #e5e7eb);
border-radius: 0 0 var(--main-radius, 8px) var(--main-radius, 8px);
}
.aksrt-dl-modal .modal-buts.but-average > .but {
flex: auto;
padding: 0.8em;
margin: 0 !important;
background: transparent;
border-radius: 0;
}
.aksrt-dl-modal .modal-buts.but-average > .but + .but {
border-left: 1px solid var(--main-border-color, #e5e7eb);
}
.aksrt-cashier__recharge {
display: block;
text-decoration: none;
}
/* ============================================================
* 页面内已购信息块(下载区,随本文件一起加载)
* ============================================================ */
.resource-download-box__attrs {
display: grid;
gap: 6px;
padding: 0;
margin: 10px 0 0;
list-style: none;
}
.resource-download-box__attrs-item {
display: flex;
justify-content: space-between;
gap: 12px;
color: #6b7280;
font-size: 12px;
}
.resource-download-box__attrs-name {
flex: 0 0 auto;
}
.resource-download-box__attrs-value {
color: #111827;
text-align: right;
}
.resource-download-box__paid-badge {
color: #047857 !important;
background: #ecfdf5 !important;
}
.resource-download-box__paid-meta {
display: grid;
gap: 4px;
padding: 10px 12px;
margin: 8px 0 12px;
color: #166534;
font-size: 12px;
background: #f0fdf4;
border: 1px solid #bbf7d0;
border-radius: 10px;
}
body.aksrt-dl-modal-open {
overflow: hidden;
}
@keyframes aksrt-cashier-colorful {
from {
transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
}
20% {
transform: translate3d(-30px, -20px, 50px) rotate(87deg) scale(0.9);
}
65% {
transform: translate3d(-80px, -40px, 0) rotate(156deg) scale(0.6);
}
to {
transform: translate3d(0, 0, 0) rotate(360deg) scale(1);
}
}
@media (max-width: 480px) {
.aksrt-dl-modal__hero {
padding: 24px 44px 20px;
}
.aksrt-dl-modal__content {
padding: 16px 16px 18px;
}
.aksrt-dl-modal__code {
font-size: 18px;
}
}
@media (prefers-reduced-motion: reduce) {
.aksrt-dl-modal.is-open .aksrt-dl-modal__dialog {
animation: none;
}
.aksrt-dl-modal .colorful-bg > .colorful-make {
animation: none;
}
}