- Move "新建优惠码" / "批量生成" into header-launched <dialog>s - Extract forms into PayCouponsForms trait with shared rule fields, hints, validation and currency/percent unit switching - Generated codes card gets a copy-all button; list codes copy on click - Drop old inline forms, render_generated_dump and the unread aksrt_coupon_generated redirect arg Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
55 lines
5.0 KiB
CSS
55 lines
5.0 KiB
CSS
/* 优惠码(aksrt_coupons):页头按钮 + 新建/批量生成弹窗。复用 native-ui.css 的 --an-* 令牌,规则限定在本页类名下。 */
|
|
.aksrt-coupons-page [hidden],
|
|
.aksrt-coupon-dialog [hidden] { display: none !important; }
|
|
.aksrt-coupons-page .aksrt-native-header__actions .button,
|
|
.aksrt-coupon-generated .aksrt-native-card__actions .button { display: inline-flex; align-items: center; gap: 5px; }
|
|
.aksrt-coupons-page .aksrt-native-header__actions .dashicons { margin: 0; font-size: 17px; line-height: 20px; }
|
|
.aksrt-coupon-generated .aksrt-native-card__actions .dashicons { margin: 0; font-size: 14px; width: 14px; height: 14px; }
|
|
|
|
/* ---------- 列表 ---------- */
|
|
.aksrt-coupons-page .wp-list-table { min-width: 1000px; }
|
|
.aksrt-coupons-page .wp-list-table td { vertical-align: middle; overflow-wrap: anywhere; }
|
|
.aksrt-coupon-code { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 7px; color: var(--an-text); background: var(--an-bg-soft); border: 1px solid transparent; border-radius: 5px; text-align: left; font-size: 13px; overflow-wrap: anywhere; cursor: pointer; }
|
|
.aksrt-coupon-code .dashicons { flex: none; width: 14px; height: 14px; color: var(--an-muted); font-size: 14px; }
|
|
.aksrt-coupon-code:hover { color: var(--an-primary); background: var(--an-primary-soft); border-color: var(--an-primary); }
|
|
.aksrt-coupon-code:focus-visible { outline: 2px solid var(--an-primary); outline-offset: 2px; }
|
|
.aksrt-coupon-generated textarea { margin-top: 8px; resize: vertical; }
|
|
|
|
/* ---------- 弹窗 ---------- */
|
|
html.aksrt-coupons-modal-open { overflow: hidden; }
|
|
.aksrt-coupon-dialog { width: min(720px, calc(100vw - 32px)); max-width: none; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; overflow: hidden; color: var(--an-text-2); background: var(--an-card); border: 0; border-radius: var(--an-radius); box-shadow: 0 16px 64px rgba(15, 23, 42, .2); }
|
|
.aksrt-coupon-dialog::backdrop { background: rgba(15, 23, 42, .45); }
|
|
.aksrt-coupon-dialog__frame { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
|
|
.aksrt-coupon-dialog__head { display: flex; flex: none; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 18px; border-bottom: 1px solid var(--an-border-soft); }
|
|
.aksrt-coupon-dialog .aksrt-coupon-dialog__head h2 { margin: 0; padding: 0; color: var(--an-text); font-size: 18px; font-weight: 600; line-height: 1.5; }
|
|
.aksrt-coupon-dialog__head p { margin: 5px 0 0; font-size: 13px; line-height: 1.6; }
|
|
.aksrt-coupon-dialog__close { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: var(--an-text-2); background: transparent; border: 0; border-radius: var(--an-radius-sm); cursor: pointer; }
|
|
.aksrt-coupon-dialog__close:hover { color: var(--an-text); background: var(--an-bg-soft); }
|
|
.aksrt-coupon-dialog__body { min-height: 0; padding: 20px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
|
|
.aksrt-coupon-dialog__foot { display: flex; flex: none; justify-content: flex-end; gap: 8px; padding: 14px 24px; background: var(--an-card); border-top: 1px solid var(--an-border-soft); }
|
|
.aksrt-coupon-dialog__foot .button { min-width: 110px; }
|
|
.aksrt-coupon-dialog .button:disabled { opacity: .65; cursor: not-allowed; }
|
|
.aksrt-coupon-dialog :is(a, button, input, select, textarea):focus-visible { outline: 2px solid var(--an-primary); outline-offset: 2px; }
|
|
.aksrt-coupon-dialog .aksrt-native-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
.aksrt-coupon-dialog .aksrt-coupon-batch-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
|
|
.aksrt-coupon-dialog .aksrt-coupon-section { margin: 0 0 12px; color: var(--an-text); font-size: 14px; font-weight: 600; line-height: 1.5; }
|
|
.aksrt-coupon-dialog .aksrt-coupon-section ~ .aksrt-coupon-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--an-border-soft); }
|
|
|
|
.aksrt-coupon-inline { display: flex; align-items: center; gap: 6px; }
|
|
.aksrt-coupon-inline input { flex: 1 1 auto; min-width: 0; }
|
|
.aksrt-coupon-unit { flex: none; min-width: 1.2em; color: var(--an-muted); }
|
|
|
|
/* ---------- 复制提示 ---------- */
|
|
.aksrt-coupon-toast { position: fixed; right: 24px; bottom: 24px; z-index: 100000; max-width: min(360px, calc(100vw - 48px)); padding: 10px 14px; color: #fff; background: rgba(15, 23, 42, .9); border-radius: var(--an-radius-sm); font-size: 13px; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
|
|
.aksrt-coupon-toast.is-visible { opacity: 1; transform: none; }
|
|
|
|
@media (max-width: 600px) {
|
|
.aksrt-coupon-dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
|
|
.aksrt-coupon-dialog__head,
|
|
.aksrt-coupon-dialog__body,
|
|
.aksrt-coupon-dialog__foot { padding-left: 16px; padding-right: 16px; }
|
|
.aksrt-coupon-dialog .aksrt-native-form-grid,
|
|
.aksrt-coupon-dialog .aksrt-coupon-batch-grid { grid-template-columns: 1fr; }
|
|
.aksrt-coupon-dialog__foot .button { flex: 1; min-width: 0; }
|
|
}
|