Files
wordpress-theme-aksrt/assets/css/routes/tickets-compose.css
T
kate522andClaude Fable 5 8d871c0828 fix(tickets): hide native radio dot in department picker
Global input[type=radio] rules in main.css out-specified the ticket
picker's hide rule, pulling the radio back into flow before the pill.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-10-27 23:22:38 +08:00

416 lines
13 KiB
CSS

/* User center ticket (工单) — 回复框 / 新建表单 / 图片待发送区 / 提交成功
*
* 依赖 tickets.css 定义的 --tickets-* token(同面板同条件入队,先于本文件)。
* 回复框布局自上而下:工具栏(图片 | 催单 · 关闭)→ 引用条 → 待发送缩略图 →
* 输入框 → 发送行;作为详情弹窗 flex 列的最后一段固定在底部,不参与滚动。
*/
/* ------------------------------------------------------------------ *
* 已关闭提示(占据回复框位置)
* ------------------------------------------------------------------ */
.aksrt-ticket-detail__closed {
display: flex;
flex: 0 0 auto;
gap: 8px;
align-items: center;
justify-content: center;
margin: 0;
padding: 14px 18px 16px;
border-top: 1px solid var(--tickets-line);
color: var(--tickets-muted);
font-size: 13px;
}
/* ------------------------------------------------------------------ *
* 回复框
* ------------------------------------------------------------------ */
.aksrt-ticket-composer {
display: grid;
flex: 0 0 auto;
gap: 8px;
padding: 10px 18px 14px;
border-top: 1px solid var(--tickets-line);
background: var(--surface-1, #fff);
}
.aksrt-ticket-composer__toolbar {
display: flex;
flex-wrap: wrap;
gap: 6px;
align-items: center;
justify-content: space-between;
}
.aksrt-ticket-composer__tools,
.aksrt-ticket-composer__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.aksrt-ticket-composer__quote {
display: flex;
gap: 8px;
align-items: center;
padding: 7px 10px;
border-radius: 8px;
background: color-mix(in srgb, var(--tickets-primary) 8%, transparent);
color: var(--tickets-ink-2);
font-size: 12px;
}
.aksrt-ticket-composer__quote[hidden] { display: none; }
.aksrt-ticket-composer__quote > .fa { color: var(--tickets-primary); }
.aksrt-ticket-composer__quote > span { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.aksrt-ticket-composer__quote button {
flex: 0 0 auto;
padding: 2px 4px;
border: 0;
background: transparent;
color: var(--tickets-muted);
cursor: pointer;
}
.aksrt-ticket-composer__input textarea {
display: block;
width: 100%;
min-height: 64px;
max-height: 160px;
padding: 9px 12px;
border: 1px solid var(--tickets-line);
border-radius: 10px;
background: var(--surface-1, #fff);
color: inherit;
font-family: inherit;
font-size: 13px;
line-height: 1.6;
resize: none;
scrollbar-width: thin;
transition: border-color .15s ease, box-shadow .15s ease;
}
.aksrt-ticket-composer__input textarea:focus {
border-color: var(--tickets-primary);
outline: none;
box-shadow: 0 0 0 3px color-mix(in srgb, var(--tickets-primary) 16%, transparent);
}
.aksrt-ticket-composer__input textarea[aria-invalid="true"] { border-color: var(--tickets-danger); }
.aksrt-ticket-composer__input .aksrt-ticket-field__error { margin-top: 4px; }
.aksrt-ticket-composer__bar { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.aksrt-ticket-composer__hint { margin-right: auto; color: var(--tickets-muted); font-size: 11px; }
.aksrt-ticket-composer__bar .btn-primary { min-width: 88px; }
/* 工具按钮:图片为幽灵按钮;催单 / 关闭为描边胶囊,与输入区视觉分层。 */
.aksrt-ticket-tool {
display: inline-flex;
align-items: center;
gap: 5px;
height: 30px;
padding: 0 10px;
border: 1px solid transparent;
border-radius: 8px;
background: transparent;
color: var(--tickets-muted);
font-size: 12px;
white-space: nowrap;
cursor: pointer;
transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.aksrt-ticket-tool:hover:not(:disabled) { background: var(--tickets-soft); color: var(--tickets-ink); }
.aksrt-ticket-tool:focus-visible { outline: 2px solid var(--tickets-primary); outline-offset: 1px; }
.aksrt-ticket-tool:disabled { opacity: .5; cursor: not-allowed; }
.aksrt-ticket-tool__count {
color: var(--tickets-muted);
font-size: 11px;
font-variant-numeric: tabular-nums;
}
.aksrt-ticket-tool__count.is-zero { display: none; }
.aksrt-ticket-tool.is-chip {
height: 28px;
border-color: var(--tickets-line);
border-radius: 999px;
}
.aksrt-ticket-tool.is-chip:hover:not(:disabled) {
border-color: color-mix(in srgb, var(--tickets-primary) 40%, transparent);
background: color-mix(in srgb, var(--tickets-primary) 7%, transparent);
color: var(--tickets-primary);
}
.aksrt-ticket-tool.is-danger:hover:not(:disabled) {
border-color: color-mix(in srgb, var(--tickets-danger) 40%, transparent);
background: color-mix(in srgb, var(--tickets-danger) 7%, transparent);
color: var(--tickets-danger);
}
.aksrt-ticket-tool.is-confirming,
.aksrt-ticket-tool.is-confirming:hover:not(:disabled) {
border-color: var(--tickets-danger);
background: color-mix(in srgb, var(--tickets-danger) 12%, transparent);
color: var(--tickets-danger);
}
/* 催单冷却:保持可读的倒计时,而不是灰掉不解释。 */
.aksrt-ticket-tool.is-cooling:disabled {
opacity: 1;
border-style: dashed;
color: var(--tickets-muted);
font-variant-numeric: tabular-nums;
cursor: default;
}
/* ------------------------------------------------------------------ *
* 新建表单
* ------------------------------------------------------------------ */
.aksrt-ticket-form { display: grid; gap: 16px; text-align: left; }
.aksrt-ticket-field {
position: relative;
display: grid;
gap: 6px;
min-width: 0;
margin: 0;
padding: 0;
border: 0;
}
.aksrt-ticket-field > label,
.aksrt-ticket-field > legend,
.aksrt-ticket-field__label {
display: flex;
gap: 6px;
align-items: center;
padding: 0;
color: var(--tickets-ink-2);
font-size: 13px;
font-weight: 600;
}
.aksrt-ticket-field em { color: var(--tickets-danger); font-style: normal; }
.aksrt-ticket-field__optional { color: var(--tickets-muted); font-size: 12px; font-weight: 400; }
.aksrt-ticket-field input[type="text"],
.aksrt-ticket-field select,
.aksrt-ticket-field textarea {
width: 100%;
padding: 9px 12px;
border: 1px solid var(--tickets-line);
border-radius: 9px;
background: var(--surface-1, #fff);
color: inherit;
font-family: inherit;
font-size: 13px;
line-height: 1.6;
transition: border-color .15s ease, box-shadow .15s ease;
}
.aksrt-ticket-field textarea { min-height: 120px; padding-bottom: 24px; resize: vertical; }
.aksrt-ticket-field input[type="text"]:focus,
.aksrt-ticket-field select:focus,
.aksrt-ticket-field textarea:focus {
border-color: var(--tickets-primary);
outline: none;
box-shadow: 0 0 0 3px color-mix(in srgb, var(--tickets-primary) 16%, transparent);
}
.aksrt-ticket-field [aria-invalid="true"],
.aksrt-ticket-field[aria-invalid="true"] .aksrt-ticket-type span {
border-color: var(--tickets-danger) !important;
}
.aksrt-ticket-field__error { margin: 0; color: var(--tickets-danger); font-size: 12px; }
.aksrt-ticket-field__hint { margin: 0; color: var(--tickets-muted); font-size: 12px; }
.aksrt-ticket-field__row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
/* 新建表单的「添加图片」用描边按钮,和其他表单控件同一视觉重量。 */
.aksrt-ticket-field__row .aksrt-ticket-tool { margin-left: -1px; border-color: var(--tickets-line); }
.aksrt-ticket-counter { color: var(--tickets-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.aksrt-ticket-counter.is-near { color: var(--color-warning, #f59e0b); }
/* 新建表单内计数器贴在输入框右下角;回复框的计数器在发送行里。 */
.aksrt-ticket-form .aksrt-ticket-field > .aksrt-ticket-counter {
position: absolute;
right: 10px;
bottom: 7px;
pointer-events: none;
}
.aksrt-ticket-form .aksrt-ticket-field:has(.aksrt-ticket-field__error) > .aksrt-ticket-counter { bottom: 27px; }
.aksrt-ticket-form .aksrt-ticket-field input[type="text"] { padding-right: 72px; }
/* 部门:单选卡片(替代下拉,选项一目了然)。 */
.aksrt-ticket-types__list { display: flex; flex-wrap: wrap; gap: 8px; }
.aksrt-ticket-type { position: relative; margin: 0; cursor: pointer; }
/* 原生单选点视觉隐藏,选中态由胶囊承载。选择器需压过 main.css 全局
* input[type=radio] 及其 :hover / :checked(会把它拉回文档流并显出圆点)。 */
.aksrt-ticket-types .aksrt-ticket-type input[type="radio"],
.aksrt-ticket-types .aksrt-ticket-type input[type="radio"]:hover,
.aksrt-ticket-types .aksrt-ticket-type input[type="radio"]:checked {
position: absolute;
inset: 0;
width: 1px;
min-width: 0;
height: 1px;
margin: 0;
border: 0;
box-shadow: none;
opacity: 0;
overflow: hidden;
clip-path: inset(50%);
pointer-events: none;
}
.aksrt-ticket-type span {
display: inline-flex;
align-items: center;
height: 34px;
padding: 0 14px;
border: 1px solid var(--tickets-line);
border-radius: 999px;
background: var(--surface-1, #fff);
font-size: 13px;
transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.aksrt-ticket-type:hover span { border-color: color-mix(in srgb, var(--tickets-primary) 45%, transparent); }
.aksrt-ticket-type input:checked + span {
border-color: var(--tickets-primary);
background: color-mix(in srgb, var(--tickets-primary) 10%, transparent);
color: var(--tickets-primary);
font-weight: 600;
}
.aksrt-ticket-type input:focus-visible + span { outline: 2px solid var(--tickets-primary); outline-offset: 2px; }
.aksrt-ticket-form__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.aksrt-ticket-form__actions > button { min-width: 96px; }
/* ------------------------------------------------------------------ *
* 待发送图片条(回复框与新建表单共用)
* ------------------------------------------------------------------ */
.aksrt-ticket-tray {
display: flex;
gap: 8px;
padding: 2px 0;
overflow-x: auto;
scrollbar-width: thin;
}
.aksrt-ticket-tray:empty { display: none; }
.aksrt-ticket-image {
position: relative;
flex: 0 0 auto;
width: 64px;
height: 64px;
border: 1px solid var(--tickets-line);
border-radius: 9px;
overflow: hidden;
background: var(--tickets-soft);
animation: aksrt-ticket-pop .18s ease-out;
}
.aksrt-ticket-image img { width: 100%; height: 100%; object-fit: cover; }
.aksrt-ticket-image.is-uploading { display: grid; place-items: center; }
.aksrt-ticket-image__spinner {
width: 20px;
height: 20px;
border: 2px solid var(--tickets-line);
border-top-color: var(--tickets-primary);
border-radius: 50%;
animation: aksrt-ticket-spin .8s linear infinite;
}
.aksrt-ticket-image__remove {
position: absolute;
top: 3px;
right: 3px;
display: grid;
place-items: center;
width: 20px;
height: 20px;
padding: 0;
border: 0;
border-radius: 50%;
background: rgb(0 0 0 / 55%);
color: #fff;
font-size: 10px;
cursor: pointer;
transition: background-color .15s ease;
}
.aksrt-ticket-image__remove:hover { background: rgb(0 0 0 / 75%); }
.aksrt-ticket-image__remove:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
@keyframes aksrt-ticket-spin { to { transform: rotate(360deg); } }
@keyframes aksrt-ticket-pop { from { opacity: 0; transform: scale(.9); } }
/* ------------------------------------------------------------------ *
* 提交成功
* ------------------------------------------------------------------ */
.aksrt-ticket-done { display: grid; gap: 8px; justify-items: center; padding: 12px 4px 4px; text-align: center; }
.aksrt-ticket-done__icon {
display: inline-grid;
place-items: center;
width: 56px;
height: 56px;
margin-bottom: 4px;
border-radius: 50%;
background: color-mix(in srgb, var(--color-success, #10b981) 14%, transparent);
color: var(--color-success, #10b981);
font-size: 24px;
}
.aksrt-ticket-done h4 { margin: 0; font-size: 17px; }
.aksrt-ticket-done > p { margin: 0; color: var(--tickets-muted); font-size: 13px; }
.aksrt-ticket-done__notice {
width: 100%;
margin-top: 6px;
padding: 12px 14px;
border-radius: 10px;
background: var(--tickets-soft);
color: var(--tickets-ink-2);
font-size: 13px;
line-height: 1.7;
text-align: left;
}
.aksrt-ticket-done__notice > :last-child { margin-bottom: 0; }
.aksrt-ticket-done .aksrt-ticket-form__actions { justify-content: center; width: 100%; margin-top: 10px; }
/* 按钮忙碌态(发送 / 提交 / 催单中)。 */
.aksrt-ticket-modal .is-busy { opacity: .7; cursor: progress; }
/* ------------------------------------------------------------------ *
* 窄屏
* ------------------------------------------------------------------ */
@media (max-width: 640px) {
.aksrt-ticket-composer { padding: 8px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
.aksrt-ticket-composer__hint { display: none; }
.aksrt-ticket-composer__bar { justify-content: space-between; }
.aksrt-ticket-form__actions > button { flex: 1 1 0; }
}
@media (hover: none) {
.aksrt-ticket-composer__hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
.aksrt-ticket-image { animation: none; }
}