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