fix(support-chat): simplify legacy mobile styles

This commit is contained in:
t
2026-08-30 19:29:53 +08:00
parent 46144ef63a
commit a27c44ee60
2 changed files with 54 additions and 39 deletions
+31 -31
View File
@@ -24,13 +24,13 @@ button:focus-visible, textarea:focus-visible { outline: 3px solid rgba(var(--the
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.support-app, .chat-shell { width: 100%; height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
.support-app, .chat-shell { width: 100%; height: 100vh; min-height: 0; overflow: hidden; }
.support-app { position: relative; display: flex; color: var(--foreground); background: var(--muted); }
.chat-shell { position: relative; display: flex; flex-direction: column; color: var(--foreground); background: var(--card); }
.chat-header { z-index: 5; min-height: 68px; padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 12px; flex: 0 0 auto; border-bottom: 1px solid rgba(226, 232, 240, .76); background: rgba(255, 255, 255, .88); box-shadow: 0 8px 28px rgba(15, 23, 42, .035); backdrop-filter: blur(20px) saturate(1.35); }
.brand-mark { position: relative; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, .65); border-radius: 14px; color: #fff; background: linear-gradient(145deg, #4f8bfc, #456eea); background: linear-gradient(145deg, color-mix(in srgb, var(--theme), #fff 14%), color-mix(in srgb, var(--theme), #6d5dfc 30%)); box-shadow: 0 10px 24px rgba(var(--theme-rgb), .24), inset 0 1px 0 rgba(255,255,255,.28); }
.brand-mark::before { content: ""; position: absolute; top: -5px; right: -5px; bottom: -5px; left: -5px; inset: -5px; z-index: -1; border-radius: 17px; background: rgba(var(--theme-rgb), .08); }
.chat-header { z-index: 5; min-height: 68px; padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 12px; flex: 0 0 auto; border-bottom: 1px solid rgba(226, 232, 240, .76); background: #fff; box-shadow: 0 8px 28px rgba(15, 23, 42, .035); }
.brand-mark { position: relative; width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid #dbe8ff; border-radius: 14px; color: #fff; background: #2475fc; box-shadow: 0 10px 24px rgba(36, 117, 252, .24); }
.brand-mark::before { content: ""; position: absolute; top: -5px; right: -5px; bottom: -5px; left: -5px; z-index: -1; border-radius: 17px; background: rgba(36, 117, 252, .08); }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 1.9; }
.header-status-dot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border: 3px solid var(--card); border-radius: 50%; background: #94a3b8; }
.header-status-dot.connected { background: #10b981; box-shadow: 0 0 0 2px rgba(16,185,129,.14); }
@@ -49,9 +49,9 @@ svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round
.icon-button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted-foreground); background: transparent; cursor: pointer; transition: color .18s ease, background .18s ease, transform .18s ease; }
.icon-button:hover { color: var(--foreground); background: rgba(15, 23, 42, .055); transform: translateY(-1px); }
.icon-button svg { width: 16px; height: 16px; }
.chat-header .icon-button { border: 1px solid rgba(226,232,240,.86); background: rgba(248,250,252,.76); box-shadow: 0 2px 8px rgba(15,23,42,.045), inset 0 1px 0 rgba(255,255,255,.8); backdrop-filter: blur(10px); }
.chat-header .icon-button { border: 1px solid rgba(226,232,240,.86); background: #f8fafc; box-shadow: 0 2px 8px rgba(15,23,42,.045); }
.chat-header .icon-button svg { width: 16px; height: 16px; stroke-width: 1.9; transition: transform .22s cubic-bezier(.2,.8,.2,1); }
#retry-button { color: #326fd1; color: color-mix(in srgb, var(--theme), #475467 32%); border-color: rgba(var(--theme-rgb), .12); background: rgba(var(--theme-rgb), .055); }
#retry-button { color: #326fd1; border-color: #dce8fb; background: #f1f6ff; }
#retry-button:hover { color: var(--theme); border-color: rgba(var(--theme-rgb), .2); background: rgba(var(--theme-rgb), .1); box-shadow: 0 7px 18px rgba(var(--theme-rgb), .12); }
#retry-button:hover svg { transform: rotate(45deg); }
#retry-button:active svg { transform: rotate(120deg); transition-duration: .1s; }
@@ -60,11 +60,11 @@ svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round
.close-button:hover svg { transform: scale(.88); }
.chat-content { position: relative; min-height: 0; flex: 1; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; background: linear-gradient(180deg, #f8faff 0%, #f5f8fd 55%, #f2f6fb 100%); }
.chat-content::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; pointer-events: none; background: radial-gradient(circle at 6% 8%, rgba(var(--theme-rgb), .075), transparent 30%), radial-gradient(circle at 96% 42%, rgba(124, 93, 252, .055), transparent 28%); }
.chat-content::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; background: rgba(36, 117, 252, .025); }
.message-scroller { position: relative; z-index: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 20px 18px 24px; overscroll-behavior: contain; scroll-behavior: smooth; background: transparent; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.message-scroller::-webkit-scrollbar { width: 10px; }
.message-scroller::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: var(--border); background-clip: padding-box; }
.load-more { height: 30px; margin: 0 auto 14px; padding: 0 13px; display: block; border: 1px solid rgba(255,255,255,.8); border-radius: 999px; color: var(--muted-foreground); background: rgba(255,255,255,.72); box-shadow: 0 6px 18px rgba(15,23,42,.06); backdrop-filter: blur(12px); font-size: 12px; cursor: pointer; }
.load-more { height: 30px; margin: 0 auto 14px; padding: 0 13px; display: block; border: 1px solid #e3eaf3; border-radius: 999px; color: var(--muted-foreground); background: #fff; box-shadow: 0 6px 18px rgba(15,23,42,.06); font-size: 12px; cursor: pointer; }
.center-state { min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 12px; color: var(--muted-foreground); text-align: center; }
.center-state p { margin: 0; font-size: 14px; line-height: 24px; }
.loading-ring { width: 24px; height: 24px; margin-bottom: 12px; border: 3px solid rgba(var(--theme-rgb), .14); border-top-color: var(--theme); border-radius: 50%; animation: spin .8s linear infinite; }
@@ -72,20 +72,20 @@ svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round
.message-list { display: flex; flex-direction: column; gap: 18px; }
.timeline { margin-bottom: 14px; display: flex; justify-content: center; }
.timeline span { padding: 4px 10px; border: 1px solid rgba(255,255,255,.75); border-radius: 999px; color: var(--muted-foreground); background: rgba(255,255,255,.68); box-shadow: 0 4px 14px rgba(15,23,42,.045); backdrop-filter: blur(12px); font-size: 10px; font-weight: 550; letter-spacing: .01em; }
.timeline span { padding: 4px 10px; border: 1px solid #e8edf5; border-radius: 999px; color: var(--muted-foreground); background: #fff; box-shadow: 0 4px 14px rgba(15,23,42,.045); font-size: 10px; font-weight: 550; letter-spacing: .01em; }
.message-row { width: 100%; min-width: 0; display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.message-row.mine { flex-direction: row-reverse; }
.message-row.system { justify-content: center; }
.message-avatar { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; border: 2px solid rgba(255,255,255,.92); border-radius: 12px; color: var(--theme); background: #eaf2ff; background: color-mix(in srgb, var(--theme), #fff 91%); box-shadow: 0 5px 16px rgba(15,23,42,.07); font-size: 11px; font-weight: 650; }
.message-avatar { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; border: 2px solid #fff; border-radius: 12px; color: #2475fc; background: #eaf2ff; box-shadow: 0 5px 16px rgba(15,23,42,.07); font-size: 11px; font-weight: 650; }
.message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.message-copy { min-width: 0; max-width: 84%; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; word-break: break-word; overflow-wrap: anywhere; }
.message-copy { min-width: 0; max-width: 84%; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; word-break: break-word; }
.message-row.mine .message-copy { align-items: flex-end; }
.message-row.system .message-copy { max-width: 85%; align-items: center; }
.message-meta { padding: 0 5px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; color: #7b8496; font-size: 10px; line-height: 15px; }
.message-row.mine .message-meta { justify-content: flex-end; text-align: right; }
.message-sender { color: #596579; font-weight: 600; }
.message-bubble { width: fit-content; max-width: 100%; min-width: 0; padding: 10px 14px; overflow: hidden; border: 1px solid rgba(225,232,242,.78); border-radius: 18px 18px 18px 6px; color: var(--foreground); background: rgba(255,255,255,.93); box-shadow: 0 10px 30px rgba(15,23,42,.065), inset 0 1px 0 rgba(255,255,255,.8); font-size: 14px; line-height: 1.55; word-break: break-word; overflow-wrap: anywhere; }
.message-row.mine .message-bubble { border-color: transparent; border-radius: 18px 18px 6px 18px; color: #fff; background: linear-gradient(135deg, #397ffb, #5368ed); background: linear-gradient(135deg, color-mix(in srgb, var(--theme), #fff 6%), color-mix(in srgb, var(--theme), #7c5dfc 24%)); box-shadow: 0 12px 28px rgba(var(--theme-rgb), .22); }
.message-bubble { max-width: 100%; min-width: 0; padding: 10px 14px; overflow: hidden; border: 1px solid #e1e8f2; border-radius: 18px 18px 18px 6px; color: #101828; background: #fff; box-shadow: 0 10px 30px rgba(15,23,42,.065); font-size: 14px; line-height: 1.55; word-break: break-word; }
.message-row.mine .message-bubble { border-color: #2475fc; border-radius: 18px 18px 6px 18px; color: #fff; background: #2475fc; box-shadow: 0 12px 28px rgba(36, 117, 252, .22); }
.message-row.system .message-bubble { color: var(--muted-foreground); background: var(--muted); box-shadow: none; }
.message-read { padding: 0 5px; color: var(--muted-foreground); font-size: 10px; }
.message-bubble p { margin: 0; }
@@ -96,50 +96,50 @@ svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round
.message-bubble pre { max-width: 100%; margin: 8px 0; padding: 8px 10px; overflow-x: auto; border-radius: 8px; background: rgba(15,23,42,.06); white-space: pre-wrap; }
.message-bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.message-bubble img { display: block; max-width: 100%; max-height: 320px; border-radius: 12px; cursor: zoom-in; }
.message-image-grid { width: 100%; max-width: 360px; width: min(100%, 360px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: hidden; border-radius: 12px; }
.message-image-grid { width: 100%; max-width: 360px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; overflow: hidden; border-radius: 12px; }
.message-image-grid.count-1 { display: block; }
.message-image-grid img { width: 100%; height: 150px; max-height: none; object-fit: cover; border-radius: 8px; }
.message-image-grid.count-1 img { width: auto; max-width: 100%; height: auto; max-height: 320px; object-fit: contain; border-radius: 12px; }
.message-image-caption { margin-top: 8px; }
.message-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.attachment-card { min-width: 190px; display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.attachment-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--theme); background: rgba(var(--theme-rgb), .1); }
.attachment-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 8px; color: #2475fc; background: #eaf2ff; }
.attachment-icon svg { width: 19px; height: 19px; }
.attachment-copy { min-width: 0; display: flex; flex-direction: column; }
.attachment-copy strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-copy small { margin-top: 2px; color: var(--muted-foreground); font-size: 11px; }
.composer-area { position: relative; z-index: 2; width: 100%; min-width: 0; max-width: 100%; flex: 0 0 auto; overflow: hidden; border-top: 1px solid rgba(226,232,240,.68); background: rgba(255,255,255,.86); box-shadow: 0 -16px 40px rgba(15,23,42,.055); backdrop-filter: blur(20px) saturate(1.2); }
.composer-area { position: relative; z-index: 2; width: 100%; min-width: 0; max-width: 100%; flex: 0 0 auto; overflow: hidden; border-top: 1px solid #e2e8f0; background: #fff; box-shadow: 0 -16px 40px rgba(15,23,42,.055); }
.queue-status { margin: 10px 12px 2px; padding: 12px; display: flex; align-items: flex-start; gap: 11px; overflow: hidden; border: 1px solid rgba(var(--theme-rgb), .16); border-radius: 16px; background: linear-gradient(135deg, rgba(var(--theme-rgb), .1), rgba(124,93,252,.055)); box-shadow: 0 10px 26px rgba(var(--theme-rgb), .08), inset 0 1px 0 rgba(255,255,255,.64); }
.queue-status-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #2475fc, #4f62e9); background: linear-gradient(145deg, var(--theme), color-mix(in srgb, var(--theme), #7257f5 30%)); box-shadow: 0 8px 18px rgba(var(--theme-rgb), .22); }
.queue-status-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border-radius: 11px; color: #fff; background: #2475fc; box-shadow: 0 8px 18px rgba(36, 117, 252, .22); }
.queue-status-icon svg { width: 17px; height: 17px; }
.queue-status-copy { min-width: 0; flex: 1; }
.queue-status-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.queue-status-heading strong { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 680; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; }
.queue-position { padding: 3px 8px; flex: 0 0 auto; border: 1px solid rgba(var(--theme-rgb), .16); border-radius: 999px; color: var(--theme); background: rgba(255,255,255,.7); font-size: 10px; font-weight: 700; }
.queue-status p { margin: 3px 0 7px; color: var(--muted-foreground); font-size: 11px; line-height: 17px; }
.queue-status-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; color: #496ea6; color: color-mix(in srgb, var(--theme), #475467 42%); font-size: 10px; font-weight: 550; }
.queue-status-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; color: #496ea6; font-size: 10px; font-weight: 550; }
.queue-status-meta span { display: inline-flex; align-items: center; gap: 5px; }
.queue-status-meta span::before { width: 5px; height: 5px; content: ""; border-radius: 50%; background: currentColor; opacity: .55; }
.quick-section { padding: 10px 14px 4px; }
.quick-button { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(var(--theme-rgb), .13); border-radius: 999px; color: #315f9f; color: color-mix(in srgb, var(--theme), #1f2937 36%); background: rgba(var(--theme-rgb), .065); font-size: 12px; font-weight: 550; cursor: pointer; transition: transform .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease; }
.quick-button { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #dce8fb; border-radius: 999px; color: #315f9f; background: #f1f6ff; font-size: 12px; font-weight: 550; cursor: pointer; transition: transform .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease; }
.quick-button:hover { color: var(--theme); border-color: rgba(var(--theme-rgb), .24); background: rgba(var(--theme-rgb), .1); box-shadow: 0 7px 18px rgba(var(--theme-rgb), .1); transform: translateY(-1px); }
.quick-button svg { width: 14px; height: 14px; }
.composer-shell { width: 100%; min-width: 0; max-width: 100%; padding: 8px 12px 12px; padding: 8px 12px max(12px, env(safe-area-inset-bottom)); overflow: hidden; }
.composer-shell { width: 100%; min-width: 0; max-width: 100%; padding: 8px 12px 12px; overflow: hidden; }
.composer { width: 100%; min-width: 0; max-width: 100%; padding: 9px; overflow: hidden; border: 1px solid rgba(218,226,237,.92); border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: 0 12px 34px rgba(15,23,42,.09), inset 0 1px 0 rgba(255,255,255,.9); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.composer:focus-within { border-color: rgba(var(--theme-rgb), .5); box-shadow: 0 0 0 4px rgba(var(--theme-rgb), .08), 0 16px 38px rgba(15,23,42,.1); transform: translateY(-1px); }
.pending-uploads { width: 100%; min-width: 0; max-width: 100%; margin-bottom: 6px; padding: 2px 8px 4px 2px; display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; }
.pending-upload { width: 78%; max-width: 240px; width: min(240px, 78%); padding: 7px; display: flex; flex: 0 0 auto; align-items: center; gap: 9px; border: 1px solid rgba(var(--theme-rgb), .14); border-radius: 12px; background: rgba(var(--theme-rgb), .055); }
.pending-upload { width: 78%; max-width: 240px; padding: 7px; display: flex; flex: 0 0 auto; align-items: center; gap: 9px; border: 1px solid #dce8fb; border-radius: 12px; background: #f1f6ff; }
.pending-upload-image { position: relative; width: 66px; height: 66px; padding: 0; overflow: visible; border-radius: 12px; background: transparent; }
.pending-upload-preview { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 9px; color: var(--theme); background: rgba(var(--theme-rgb), .11); }
.pending-upload-preview { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; border-radius: 9px; color: #2475fc; background: #eaf2ff; }
.pending-upload-image .pending-upload-preview { width: 100%; height: 100%; border-radius: 11px; }
.pending-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.pending-upload-file-icon { display: grid; place-items: center; }
.pending-upload-file-icon { display: flex; align-items: center; justify-content: center; }
.pending-upload-file-icon svg { width: 20px; height: 20px; }
.pending-upload-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.pending-upload-copy strong { overflow: hidden; font-size: 12px; font-weight: 600; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }
.pending-upload-copy span { color: var(--muted-foreground); font-size: 10px; line-height: 16px; }
.pending-upload-remove { width: 28px; height: 28px; padding: 0; display: grid; place-items: center; flex: 0 0 auto; border: 0; border-radius: 9px; color: var(--muted-foreground); background: transparent; cursor: pointer; }
.pending-upload-remove { width: 28px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 0; border-radius: 9px; color: var(--muted-foreground); background: transparent; cursor: pointer; }
.pending-upload-image .pending-upload-remove { position: absolute; z-index: 1; top: -6px; right: -6px; width: 22px; height: 22px; color: #fff; border: 2px solid #fff; border-radius: 999px; background: rgba(15,23,42,.78); box-shadow: 0 3px 10px rgba(15,23,42,.18); }
.pending-upload-remove:hover { color: var(--danger); background: rgba(220,38,38,.08); }
.pending-upload-remove:disabled { opacity: .45; cursor: not-allowed; }
@@ -151,14 +151,14 @@ svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round
.attachment-actions { min-width: 0; display: flex; flex: 0 1 auto; align-items: center; gap: 6px; }
.attachment-actions .icon-button { color: var(--muted-foreground); background: transparent; }
.send-hint { min-width: 0; margin-left: auto; overflow: hidden; color: var(--muted-foreground); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.send-button { width: 40px; height: 40px; margin-left: 8px; padding: 0; display: inline-flex; flex: 0 0 40px; align-items: center; justify-content: center; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #3c80fb, #4c66ea); background: linear-gradient(145deg, color-mix(in srgb, var(--theme), #fff 8%), color-mix(in srgb, var(--theme), #6d5dfc 25%)); box-shadow: 0 10px 22px rgba(var(--theme-rgb), .28), inset 0 1px 0 rgba(255,255,255,.24); cursor: pointer; transition: filter .18s ease, transform .18s ease, box-shadow .18s ease; }
.send-button { width: 40px; height: 40px; margin-left: 8px; padding: 0; display: inline-flex; flex: 0 0 40px; align-items: center; justify-content: center; border: 0; border-radius: 13px; color: #fff; background: #2475fc; box-shadow: 0 10px 22px rgba(36, 117, 252, .28); cursor: pointer; transition: filter .18s ease, transform .18s ease, box-shadow .18s ease; }
.send-button:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 13px 28px rgba(var(--theme-rgb), .32); }
.send-button svg { width: 18px; height: 18px; }
.send-button:disabled, .quick-button:disabled, .icon-button:disabled { opacity: .45; cursor: not-allowed; }
.status-bar { padding: 8px 14px; border-top: 1px solid #fecaca; color: #b91c1c; background: #fef2f2; text-align: center; font-size: 12px; }
.dialog-overlay { position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; left: 0; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,.46); backdrop-filter: blur(8px); animation: fade-in .15s ease-out; }
.dialog-card { position: relative; width: 100%; max-width: 360px; width: min(100%, 360px); padding: 24px; border: 1px solid rgba(255,255,255,.72); border-radius: 20px; color: var(--foreground); background: rgba(255,255,255,.96); box-shadow: 0 24px 70px rgba(15,23,42,.24), inset 0 1px 0 #fff; animation: dialog-in .18s ease-out; }
.dialog-overlay { position: fixed; z-index: 20; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,.46); animation: fade-in .15s ease-out; }
.dialog-card { position: relative; width: 100%; max-width: 360px; padding: 24px; border: 1px solid #e3eaf3; border-radius: 20px; color: var(--foreground); background: #fff; box-shadow: 0 24px 70px rgba(15,23,42,.24); animation: dialog-in .18s ease-out; }
.dialog-card header { padding-right: 18px; }
.dialog-card h2 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.dialog-card header p { margin: 6px 0 0; color: var(--muted-foreground); font-size: 13px; line-height: 20px; }
@@ -167,7 +167,7 @@ svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round
.quick-item { height: 44px; min-width: 0; padding: 0 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; color: var(--foreground); background: var(--background); font-size: 14px; font-weight: 500; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.quick-item:hover { color: var(--theme); border-color: rgba(var(--theme-rgb), .4); background: rgba(var(--theme-rgb), .05); }
.quick-empty { padding: 28px 0 8px; color: var(--muted-foreground); text-align: center; font-size: 13px; }
.close-dialog { width: 100%; max-width: 320px; width: min(100%, 320px); }
.close-dialog { width: 100%; max-width: 320px; }
.dialog-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.secondary-button, .primary-button, .danger-button { height: 38px; padding: 0 15px; border-radius: 11px; font-size: 14px; cursor: pointer; }
.secondary-button { border: 1px solid var(--border); background: var(--background); }
@@ -178,8 +178,8 @@ svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round
@keyframes fade-in { from { opacity: 0; } }
@keyframes dialog-in { from { transform: scale(.97); opacity: .4; } }
.toast-region { position: fixed; z-index: 40; top: 14px; top: max(14px, env(safe-area-inset-top)); left: 50%; width: 90vw; max-width: 420px; width: min(90vw, 420px); transform: translateX(-50%); pointer-events: none; }
.toast { margin-bottom: 8px; padding: 11px 14px; border: 1px solid rgba(255,255,255,.75); border-radius: 13px; color: var(--foreground); background: rgba(255,255,255,.92); box-shadow: 0 14px 36px rgba(15,23,42,.16); backdrop-filter: blur(16px); text-align: center; font-size: 13px; animation: toast-in .18s ease-out; }
.toast-region { position: fixed; z-index: 40; top: 14px; left: 50%; width: 90vw; max-width: 420px; transform: translateX(-50%); pointer-events: none; }
.toast { margin-bottom: 8px; padding: 11px 14px; border: 1px solid #e3eaf3; border-radius: 13px; color: var(--foreground); background: #fff; box-shadow: 0 14px 36px rgba(15,23,42,.16); text-align: center; font-size: 13px; animation: toast-in .18s ease-out; }
.toast.error { color: #b42318; border-color: #fecdca; background: #fff6f5; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } }
@@ -205,7 +205,7 @@ svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round
.brand-mark { border-color: rgba(255,255,255,.16); }
.connection-badge.connecting { color: #fcd34d; border-color: rgba(245,158,11,.35); background: rgba(120,53,15,.35); }
.chat-header .icon-button { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.045); box-shadow: 0 2px 8px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.045); }
#retry-button { color: #8cb5ff; color: color-mix(in srgb, var(--theme), #fff 22%); border-color: rgba(var(--theme-rgb), .2); background: rgba(var(--theme-rgb), .12); }
#retry-button { color: #8cb5ff; border-color: rgba(36,117,252,.2); background: rgba(36,117,252,.12); }
.close-button:hover { color: #fca5a5; border-color: rgba(248,113,113,.18); background: rgba(127,29,29,.3); }
.message-avatar { border-color: rgba(255,255,255,.08); background: rgba(var(--theme-rgb),.16); }
.message-bubble { border-color: rgba(255,255,255,.08); background: rgba(22,31,48,.95); box-shadow: 0 12px 30px rgba(0,0,0,.18); }
+23 -8
View File
@@ -165,15 +165,30 @@ func TestSupportChatKeepsOlderMobileWebViewsCompatible(t *testing.T) {
t.Fatalf("read support chat stylesheet: %v", err)
}
css := string(stylesheet)
for _, fallback := range []string{
`background: linear-gradient(145deg, #3c80fb, #4c66ea);`,
`background: linear-gradient(135deg, #397ffb, #5368ed);`,
`background: #eaf2ff;`,
`top: 0; right: 0; bottom: 0; left: 0; inset: 0;`,
`width: 100%; max-width: 360px; width: min(100%, 360px);`,
for _, forbidden := range []string{
`color-mix(`,
`height: 100dvh`,
`inset:`,
`width: min(`,
`top: max(`,
`backdrop-filter`,
`place-items`,
`overflow-wrap: anywhere`,
} {
if !strings.Contains(css, fallback) {
t.Fatalf("support chat stylesheet does not contain older mobile fallback %q", fallback)
if strings.Contains(css, forbidden) {
t.Fatalf("support chat stylesheet must not require newer mobile CSS %q", forbidden)
}
}
for _, marker := range []string{
`.message-row.mine .message-bubble { border-color: #2475fc;`,
`.send-button { width: 40px; height: 40px;`,
`color: #fff; background: #2475fc;`,
`background: #eaf2ff;`,
`top: 0; right: 0; bottom: 0; left: 0;`,
`width: 100%; max-width: 360px;`,
} {
if !strings.Contains(css, marker) {
t.Fatalf("support chat stylesheet does not contain basic mobile CSS %q", marker)
}
}
}