diff --git a/src/App.vue b/src/App.vue index 075f1e1..429b380 100644 --- a/src/App.vue +++ b/src/App.vue @@ -31,17 +31,32 @@ import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn'; import useLocale from '@/hooks/locale'; import { isLoginRouteName } from '@/utils/login-portal'; - import { consumePageFlip } from '@/utils/page-transition-flag'; + import { + consumePageFlip, + PORTAL_IRIS_ACTIVE_CLASS, + PORTAL_IRIS_SETTLED_CLASS, + shouldPortalIris, + } from '@/utils/page-transition-flag'; import GlobalSetting from '@/components/global-setting/index.vue'; const route = useRoute(); const router = useRouter(); - /** '' | 'oms-iris' — 中心虹膜散开(官网→登录 / 登录互切) */ + /** '' | 'oms-iris' — 中心展开(官网→登录 / 登录互切) */ const portalTransition = ref(''); const isPageIris = computed(() => portalTransition.value === 'oms-iris'); - const IRIS_MS = 1000; - const IRIS_EASE = 'cubic-bezier(0.22, 1, 0.36, 1)'; + /** + * 圆半径用百分比时,约 71% 就盖住视口四角。 + * 收到 80% 为止,整段时间都在铺画面,不再扩到 150% 后空转。 + * 曲线前段就有位移、后段轻轻收住,避免猛地撑开或开头发呆。 + */ + const IRIS_MS = 920; + const IRIS_EASE = 'cubic-bezier(0.33, 0.5, 0.22, 1)'; + /** 新页图片解码最多等这么久,超时也开动画,避免点击发僵 */ + const IRIS_READY_CAP_MS = 160; + const IRIS_AT = '50% 50%'; + /** 约 71% 盖住四角,收到 80% 留一点余量 */ + const IRIS_END = '80%'; function clearPortalTransition() { portalTransition.value = ''; @@ -58,89 +73,144 @@ node.style.position = 'absolute'; node.style.inset = '0'; node.style.width = '100%'; + node.style.height = '100%'; node.style.minHeight = '100%'; node.style.zIndex = String(z); - node.style.willChange = 'clip-path, opacity, filter'; + node.style.overflow = 'hidden'; } function clearSheetStyles(node: HTMLElement) { node.style.position = ''; node.style.inset = ''; node.style.width = ''; + node.style.height = ''; node.style.minHeight = ''; node.style.zIndex = ''; + node.style.overflow = ''; node.style.willChange = ''; node.style.transform = ''; node.style.filter = ''; node.style.opacity = ''; node.style.clipPath = ''; + node.style.pointerEvents = ''; node.style.removeProperty('-webkit-clip-path'); } - /** - * 中心虹膜:旧页留底层轻压暗;新页 clip-path 从中心向外展开。 - */ - function playIrisLeave(node: HTMLElement, done: () => void) { - prepareSheet(node, 1); - const anim = node.animate( - [ - { opacity: 1, filter: 'brightness(1)', offset: 0 }, - { opacity: 0.92, filter: 'brightness(0.94)', offset: 0.45 }, - { opacity: 0.82, filter: 'brightness(0.88)', offset: 1 }, - ], - { - duration: IRIS_MS, - easing: IRIS_EASE, - fill: 'forwards', - }, - ); + /** 旧页卸掉之后再调;新页铺满前不能提前放 */ + let releaseIrisLeave: (() => void) | null = null; - anim.finished - .catch(() => undefined) - .finally(() => { - done(); - }); + function markIrisSettled() { + const root = document.documentElement; + root.classList.add(PORTAL_IRIS_SETTLED_CLASS); + root.classList.remove(PORTAL_IRIS_ACTIVE_CLASS); } - function playIrisEnter(node: HTMLElement, done: () => void) { - prepareSheet(node, 4); - node.style.clipPath = 'circle(0% at 50% 50%)'; - node.style.setProperty('-webkit-clip-path', 'circle(0% at 50% 50%)'); - - const anim = node.animate( - [ - { - clipPath: 'circle(0% at 50% 50%)', - opacity: 1, - filter: 'brightness(0.98)', - offset: 0, - }, - { - clipPath: 'circle(42% at 50% 50%)', - opacity: 1, - filter: 'brightness(1)', - offset: 0.42, - }, - { - clipPath: 'circle(150% at 50% 50%)', - opacity: 1, - filter: 'brightness(1)', - offset: 1, - }, - ], - { - duration: IRIS_MS, - easing: IRIS_EASE, - fill: 'forwards', - }, + /** + * 等新页完成一次完整绘制,再开裁剪。 + * 若边裁边解码大图,每一帧都要重绘,圆就会一卡一卡地长。 + */ + function whenIncomingReady(node: HTMLElement) { + const pending = [...node.querySelectorAll('img')].filter((img) => !img.complete); + const decoded = Promise.all( + pending.map((img) => + typeof img.decode === 'function' + ? img.decode().catch(() => undefined) + : Promise.resolve(), + ), ); - - anim.finished - .catch(() => undefined) - .finally(() => { - clearSheetStyles(node); - done(); + const cap = new Promise((resolve) => { + window.setTimeout(resolve, IRIS_READY_CAP_MS); + }); + const frames = new Promise((resolve) => { + requestAnimationFrame(() => { + requestAnimationFrame(() => resolve()); }); + }); + return Promise.all([frames, Promise.race([decoded, cap])]).then(() => undefined); + } + + /** + * 旧页只作一张静止底图。亮度滤镜会让整页每一帧都重采样,是掉帧的主要来源。 + */ + function playIrisLeave(node: HTMLElement, done: () => void) { + prepareSheet(node, 2); + node.classList.add('portal-iris-frozen'); + node.style.transform = 'translateZ(0)'; + node.style.pointerEvents = 'none'; + try { + node.getAnimations({ subtree: true }).forEach((anim) => anim.pause()); + } catch { + /* 旧环境没有 getAnimations 时,样式冻结仍然生效 */ + } + + let released = false; + const release = () => { + if (released) return; + released = true; + if (releaseIrisLeave === release) releaseIrisLeave = null; + done(); + }; + releaseIrisLeave = release; + window.setTimeout(release, IRIS_MS + IRIS_READY_CAP_MS + 480); + } + + async function playIrisEnter(node: HTMLElement, done: () => void) { + prepareSheet(node, 1); + node.style.willChange = 'clip-path'; + node.style.pointerEvents = 'none'; + node.style.clipPath = 'none'; + node.style.setProperty('-webkit-clip-path', 'none'); + + let finished = false; + let anim: Animation | null = null; + const finish = () => { + if (finished) return; + finished = true; + // 先去掉内联裁剪再 cancel,避免 fill 被取消后回到 circle(0%) + node.style.clipPath = ''; + node.style.removeProperty('-webkit-clip-path'); + anim?.cancel(); + clearSheetStyles(node); + done(); + releaseIrisLeave?.(); + markIrisSettled(); + }; + + try { + await whenIncomingReady(node); + } catch { + /* 解码失败也继续展开 */ + } + + if (!node.isConnected) { + finish(); + return; + } + + const at = IRIS_AT; + const end = IRIS_END; + // 先收到 0 再抬到上层,避免动画首帧还没写上时整页闪一下 + node.style.clipPath = `circle(0% at ${at})`; + node.style.setProperty('-webkit-clip-path', `circle(0% at ${at})`); + node.style.zIndex = '3'; + try { + anim = node.animate( + [ + { clipPath: `circle(0% at ${at})` }, + { clipPath: `circle(${end} at ${at})` }, + ], + { + duration: IRIS_MS, + easing: IRIS_EASE, + fill: 'forwards', + }, + ); + } catch { + finish(); + return; + } + + anim.finished.catch(() => undefined).finally(finish); } function onPortalLeave(el: Element, done: () => void) { @@ -182,26 +252,15 @@ return true; }); - function isPcLoginRouteName(name: unknown) { - return name === 'login' || name === 'adminLogin'; - } - router.beforeEach((to, from) => { - const armed = consumePageFlip(); - const siteToLogin = - from.name === 'siteRoot' && - (to.name === 'login' || to.name === 'H5Login') && - to.query.from === 'official-site'; - const loginPortalSwitch = - isPcLoginRouteName(from.name) && - isPcLoginRouteName(to.name) && - from.name !== to.name; - const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; - - if ((armed || siteToLogin || loginPortalSwitch) && !reduceMotion) { - portalTransition.value = 'oms-iris'; + const iris = shouldPortalIris(to, from); + consumePageFlip(); + portalTransition.value = iris ? 'oms-iris' : ''; + const root = document.documentElement; + if (iris) { + root.classList.add(PORTAL_IRIS_ACTIVE_CLASS); } else { - portalTransition.value = ''; + root.classList.remove(PORTAL_IRIS_ACTIVE_CLASS, PORTAL_IRIS_SETTLED_CLASS); } }); @@ -269,7 +328,33 @@ html body .main-menu .menu-text { overflow: hidden; min-height: 100vh; min-height: 100dvh; - /* 与登录页灰底一致,避免虹膜展开时露黑缝 */ + /* 与登录页灰底一致,避免展开时露黑缝 */ background: var(--app-page-bg, #f0f3f4); } + +/* 旧页:停掉无限动画和额外合成层,让底图在展开期间保持同一张纹理 */ +.portal-iris-frozen, +.portal-iris-frozen * { + animation-play-state: paused !important; + transition: none !important; + will-change: auto !important; +} + +/* 新页:展开期间不要再叠模糊和入场动画,否则裁剪每一帧都要重绘 */ +html.portal-iris-active .login-split, +html.portal-iris-active .login-pane { + will-change: auto !important; +} + +html.portal-iris-active .login-container, +html.portal-iris-active .login-container * { + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; +} + +html.portal-iris-active .login-hero__principle, +html.portal-iris-settled .login-hero__principle { + animation: none !important; + opacity: 1 !important; +} diff --git a/src/components/h5/H5ScanInput.vue b/src/components/h5/H5ScanInput.vue index 6fc84ca..f0b9c77 100644 --- a/src/components/h5/H5ScanInput.vue +++ b/src/components/h5/H5ScanInput.vue @@ -28,42 +28,43 @@
-
-
-

{{ sheetTitle }}

-

{{ sheetHint }}

-
- -
-
@@ -128,6 +129,8 @@ let rafId = 0; let zxingControls: { stop: () => void } | null = null; let lastCode = ''; let lastAt = 0; +let starting = false; +let session = 0; let nativeDetector: { detect: (source: ImageBitmapSource) => Promise>; } | null = null; @@ -236,18 +239,36 @@ async function startZxing() { }); } -async function startCamera() { - error.value = ''; - if (running.value) return; - await nextTick(); - const video = videoRef.value; - if (!video) return; +async function waitForVideo() { + for (let i = 0; i < 20; i += 1) { + if (videoRef.value) return videoRef.value; + await new Promise((resolve) => { + window.requestAnimationFrame(() => resolve()); + }); + } + return videoRef.value; +} +async function startCamera() { + if (running.value || starting) return; + const mine = session; + starting = true; + error.value = ''; try { - if (!window.isSecureContext && location.hostname !== 'localhost') { + // 抽屉内容挂到 body 之后 video 才存在,提前取流会直接返回 + const video = await waitForVideo(); + if (mine !== session || !cameraOpen.value) return; + if (!video) { + throw new Error('取景未就绪,请关闭后重试'); + } + if (!navigator.mediaDevices?.getUserMedia) { + throw new Error('当前浏览器不支持摄像头扫码'); + } + if (!window.isSecureContext && location.hostname !== 'localhost' && location.hostname !== '127.0.0.1') { throw new Error('摄像头需在 HTTPS 或 localhost 下使用'); } await ensureNativeDetector(); + if (mine !== session || !cameraOpen.value) return; if (nativeDetector) { stream = await navigator.mediaDevices.getUserMedia({ @@ -258,6 +279,11 @@ async function startCamera() { height: { ideal: 720 }, }, }); + if (mine !== session || !cameraOpen.value) { + stream.getTracks().forEach((track) => track.stop()); + stream = null; + return; + } video.srcObject = stream; await video.play(); running.value = true; @@ -268,16 +294,23 @@ async function startCamera() { running.value = true; await startZxing(); + if (mine !== session || !cameraOpen.value) { + stopCamera(); + return; + } stream = (video.srcObject as MediaStream) || null; await attachTorchCapability(); } catch (e: any) { running.value = false; + if (mine !== session) return; const msg = e?.name === 'NotAllowedError' ? '未授权摄像头,请在系统设置中允许后重试' : e?.message || '无法打开摄像头'; error.value = msg; emit('error', msg); + } finally { + starting = false; } } @@ -309,18 +342,15 @@ function openCamera() { } function closeCamera() { + session += 1; cameraOpen.value = false; stopCamera(); focusInput(); } -watch(cameraOpen, async (open) => { - if (open) { - await nextTick(); - await startCamera(); - } else { - stopCamera(); - } +watch(cameraOpen, (open) => { + if (open) void startCamera(); + else stopCamera(); }); watch( @@ -340,8 +370,12 @@ defineExpose({ focus: focusInput, openCamera, closeCamera }); diff --git a/src/router/guard/userLoginInfo.ts b/src/router/guard/userLoginInfo.ts index 8a09c13..527d91b 100644 --- a/src/router/guard/userLoginInfo.ts +++ b/src/router/guard/userLoginInfo.ts @@ -20,7 +20,7 @@ import { } from '@/utils/login-portal'; import { preferH5Portal } from '@/utils/device'; import { applyRbacUserToUserStore } from '@/utils/enter-system'; -import { peekPageFlip } from '@/utils/page-transition-flag'; +import { shouldPortalIris } from '@/utils/page-transition-flag'; function buildLoginRedirect(to: { name?: string | symbol | null; @@ -67,7 +67,7 @@ export default function setupUserLoginInfoGuard(router: Router) { tabBarStore.getCacheList.includes(toName); // 门户翻页:跳过顶栏横条,等待感交给翻页动画 if ( - !peekPageFlip() && + !shouldPortalIris(to, from) && !isCachedTabSwitch && !String(to.path || '').startsWith('/h5') && to.path !== '/' diff --git a/src/store/modules/rbac-user.ts b/src/store/modules/rbac-user.ts index 605196c..21071ff 100644 --- a/src/store/modules/rbac-user.ts +++ b/src/store/modules/rbac-user.ts @@ -30,6 +30,15 @@ const OLD_TOKEN_KEY = 'rbac_token' const LOGIN_TYPE_KEY = 'rbac_login_type' const SSO_SESSION_FLAG = 'rbac_sso_session' +/** 中文业务文案可以展示;领域异常码(如 Fake.Rbac.Domain:UserNotExistsOrPwdErr)不展示。 */ +export function loginErrorForUser(raw: string): string { + const msg = raw.trim() + if (!msg) return '' + if (/^[A-Za-z0-9_.]+:[A-Za-z0-9_.]+$/.test(msg)) return '' + if (!/[\u4e00-\u9fff]/.test(msg)) return '' + return msg +} + function isSsoSessionActive(): boolean { return sessionStorage.getItem(SSO_SESSION_FLAG) === '1' } @@ -319,9 +328,9 @@ export const useRbacUserStore = defineStore('rbacUser', () => { await hydrateUserAfterLogin(result) return true } catch (error: unknown) { - // 交给登录页展示业务文案(如「客户已禁用」),勿一律当成账号密码错误 + // 业务文案(如「客户已禁用」)交给登录页;领域异常码不展示 const anyErr = error as { body?: { message?: string }; message?: string } - const msg = String(anyErr?.body?.message || anyErr?.message || '').trim() + const msg = loginErrorForUser(String(anyErr?.body?.message || anyErr?.message || '')) if (msg) throw new Error(msg) return false } diff --git a/src/utils/page-transition-flag.ts b/src/utils/page-transition-flag.ts index 7739f12..a741599 100644 --- a/src/utils/page-transition-flag.ts +++ b/src/utils/page-transition-flag.ts @@ -4,6 +4,16 @@ let skipOnce = false; /** 门户中心虹膜过渡(官网→登录 / 客户↔管理登录,单次消费) */ let pageFlipOnce = false; +/** 过渡进行中:旧页停掉逐帧绘制,新页先不要播入场动画 */ +export const PORTAL_IRIS_ACTIVE_CLASS = 'portal-iris-active'; + +/** 过渡结束后保持静帧,避免入场动画重播把页面再抖一次 */ +export const PORTAL_IRIS_SETTLED_CLASS = 'portal-iris-settled'; + +export function isPortalIrisActive() { + return document.documentElement.classList.contains(PORTAL_IRIS_ACTIVE_CLASS); +} + export function skipNextPageTransition() { skipOnce = true; } @@ -40,6 +50,35 @@ export function peekPageFlip(): boolean { return pageFlipOnce; } +type PortalRouteLike = { + name?: string | symbol | null; + query?: { from?: unknown }; +}; + +function portalRouteName(name: PortalRouteLike['name']) { + return name ? String(name) : ''; +} + +/** + * 是否走中心展开:已武装的翻页、官网进登录、客户登录与管理登录互切。 + * 只读标记,不消费;真正消费仍在 App 的导航守卫里。 + */ +export function shouldPortalIris(to: PortalRouteLike, from: PortalRouteLike): boolean { + if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return false; + if (pageFlipOnce) return true; + const fromName = portalRouteName(from.name); + const toName = portalRouteName(to.name); + if ( + fromName === 'siteRoot' && + (toName === 'login' || toName === 'H5Login') && + to.query?.from === 'official-site' + ) { + return true; + } + const isPcLogin = (name: string) => name === 'login' || name === 'adminLogin'; + return isPcLogin(fromName) && isPcLogin(toName) && fromName !== toName; +} + /** @deprecated 同 peekPageFlip */ export function peekOfficialLoginFlip(): boolean { return peekPageFlip(); diff --git a/src/views/h5/admin-center/locale/en-US.ts b/src/views/h5/admin-center/locale/en-US.ts index 13e5850..7304e74 100644 --- a/src/views/h5/admin-center/locale/en-US.ts +++ b/src/views/h5/admin-center/locale/en-US.ts @@ -32,6 +32,7 @@ export default { 'h5Admin.me.emptyRole': 'No roles', 'h5Admin.me.emptyOrg': 'No organization', 'h5Admin.me.emptyEmail': 'Not set', + 'h5Admin.me.changePassword': 'Change password', 'h5Admin.recharge.title': 'Recharge review', 'h5Admin.recharge.subtitle': 'Approve customer top-ups', diff --git a/src/views/h5/admin-center/locale/zh-CN.ts b/src/views/h5/admin-center/locale/zh-CN.ts index 1485600..4329347 100644 --- a/src/views/h5/admin-center/locale/zh-CN.ts +++ b/src/views/h5/admin-center/locale/zh-CN.ts @@ -32,6 +32,7 @@ export default { 'h5Admin.me.emptyRole': '暂无角色', 'h5Admin.me.emptyOrg': '未分配组织', 'h5Admin.me.emptyEmail': '未填写', + 'h5Admin.me.changePassword': '修改密码', 'h5Admin.recharge.title': '充值审核', 'h5Admin.recharge.subtitle': '审核客户充值申请', diff --git a/src/views/h5/admin-center/login/index.vue b/src/views/h5/admin-center/login/index.vue index ad7c416..3647cef 100644 --- a/src/views/h5/admin-center/login/index.vue +++ b/src/views/h5/admin-center/login/index.vue @@ -68,7 +68,7 @@ import { OmsLoginType } from '@/api/rbac'; import { isLogin, setToken } from '@/utils/auth'; import { applyRbacUserToUserStore } from '@/utils/enter-system'; import { ensureFullLocaleMessages } from '@/locale'; -import { useRbacUserStore } from '@/store/modules/rbac-user'; +import { loginErrorForUser, useRbacUserStore } from '@/store/modules/rbac-user'; import { ADMIN_H5_HOME_PATH, isAdminH5Path } from '@/utils/login-portal'; import logoImg from '@/assets/logo2.png'; import LoginLangToggle from '@/views/login/components/LoginLangToggle.vue'; @@ -144,7 +144,7 @@ async function handleSubmit() { Message.success(t('h5Admin.login.success')); await finishLogin(); } catch (e: any) { - errorBox.value = e?.message || t('h5Admin.login.failed'); + errorBox.value = loginErrorForUser(e?.message || '') || t('h5Admin.login.failed'); } finally { loading.value = false; } diff --git a/src/views/h5/admin-center/me/index.vue b/src/views/h5/admin-center/me/index.vue index 342fecc..b30a878 100644 --- a/src/views/h5/admin-center/me/index.vue +++ b/src/views/h5/admin-center/me/index.vue @@ -25,16 +25,22 @@ {{ t('h5Admin.me.email') }} {{ email }}
+ + + diff --git a/src/views/site/lib/site-urls.ts b/src/views/site/lib/site-urls.ts index 6f66492..b24a7b1 100644 --- a/src/views/site/lib/site-urls.ts +++ b/src/views/site/lib/site-urls.ts @@ -105,6 +105,8 @@ export function warmupOfficialLogin() { document.head.appendChild(prefetch); // 预拉取登录分包,翻页进入时少等 chunk void import('@/views/login/index.vue'); + const hero = new Image(); + hero.src = '/login-assets/hero-plane.webp'; } catch { /* ignore */ } diff --git a/src/views/site/styles/ai-advisor.css b/src/views/site/styles/ai-advisor.css index 6a4e694..e439d4f 100644 --- a/src/views/site/styles/ai-advisor.css +++ b/src/views/site/styles/ai-advisor.css @@ -2550,17 +2550,12 @@ body.command-home .ai-stage-map--eu { } .ai-welcome-airstrip, -.ai-welcome-compose-panel, .ai-welcome-trustline, .ai-intent-section, .ai-trust-bar { animation: ai-welcome-rise 0.78s cubic-bezier(0.22, 1, 0.36, 1) both; } -.ai-welcome-compose-panel { - animation-delay: 0.24s; -} - .ai-welcome-trustline { animation-delay: 0.34s; } @@ -2678,75 +2673,97 @@ body.command-home #navbar .site-nav-avatar:hover { width: 100%; } -/* Welcome compose — light frost, not a heavy card stack */ -.ai-welcome-compose-panel { +/* 提问卡:薄玻璃,点阵透出来 */ +.ai-ask { position: relative; isolation: isolate; overflow: hidden; margin: 0; - padding: 20px 22px 18px; - border-radius: 18px; - border: 1px solid rgba(255, 255, 255, 0.72); - background: rgba(255, 255, 255, 0.55); - backdrop-filter: blur(14px) saturate(140%); - -webkit-backdrop-filter: blur(14px) saturate(140%); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65); + padding: 18px 20px 16px; + border-radius: 16px; + border: 1px solid rgba(255, 255, 255, 0.7); + background: rgba(255, 255, 255, 0.28); + box-shadow: none; } -.ai-welcome-compose-panel::before { - display: none; -} - -.ai-welcome-compose-panel > * { - position: relative; - z-index: 1; -} - -.ai-welcome-compose-panel .ai-welcome-cta-link { - position: absolute; - top: 18px; - right: 20px; - z-index: 1; -} - -.ai-welcome-compose-panel .ai-welcome-compose__lead { - padding-right: 7.5em; - text-align: left; -} - -.ai-welcome-cta-link { - display: inline-flex; +.ai-ask__bar { + display: flex; align-items: center; - justify-content: center; - flex-shrink: 0; - min-height: 32px; - padding: 0 14px; - border: 1px solid color-mix(in srgb, var(--ai-accent, #e96a26) 28%, #fff); - border-radius: 999px; - background: color-mix(in srgb, var(--ai-accent, #e96a26) 10%, #fff); - color: var(--ai-accent, #e96a26); - font-size: 0.8rem; - font-weight: 700; - letter-spacing: 0.01em; - text-decoration: none; - white-space: nowrap; - box-shadow: 0 1px 2px rgba(233, 106, 38, 0.08); - transition: - color 0.18s var(--ai-ease), - background 0.18s var(--ai-ease), - border-color 0.18s var(--ai-ease), - box-shadow 0.18s var(--ai-ease), - transform 0.15s var(--ai-ease); + justify-content: space-between; + gap: 16px; + margin: 0 0 10px; } -.ai-welcome-cta-link:hover, -.ai-welcome-cta-link:focus { - color: #fff; - background: var(--ai-accent, #e96a26); - border-color: var(--ai-accent, #e96a26); +.ai-ask__cta { + flex-shrink: 0; + margin-left: auto; + color: var(--ai-accent, #e96a26); + font-size: 0.84rem; + font-weight: 700; + line-height: 1; text-decoration: none; - box-shadow: 0 4px 14px rgba(233, 106, 38, 0.28); - transform: translateY(-1px); +} + +.ai-ask__cta:hover, +.ai-ask__cta:focus-visible { + text-decoration: underline; + text-underline-offset: 3px; +} + +.ai-ask__dests { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; + min-width: 0; + margin: 0; +} + +.ai-ask__dest { + min-height: 34px; + padding: 0 14px; + border-radius: 999px; + border: 1px solid rgba(18, 24, 32, 0.12); + background: rgba(255, 255, 255, 0.38); + color: #3d4754; + font: inherit; + font-size: 0.84rem; + font-weight: 650; + line-height: 1; + cursor: pointer; + transition: + color 0.15s var(--ai-ease), + background 0.15s var(--ai-ease), + border-color 0.15s var(--ai-ease); +} + +.ai-ask__dest:hover:not(:disabled) { + color: #023e8a; + border-color: rgba(2, 62, 138, 0.35); + background: rgba(255, 255, 255, 0.62); +} + +.ai-ask__dest:focus-visible { + outline: none; + box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.18); +} + +.ai-ask__dest[aria-pressed='true'] { + color: #023e8a; + border-color: rgba(2, 62, 138, 0.55); + background: rgba(2, 62, 138, 0.1); +} + +.ai-ask__dest:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.ai-ask__hint { + margin: 0 0 12px; + font-size: 0.8rem; + line-height: 1.4; + color: #6a7380; } /* 意图区 · 双区分类网格(履约 3 + 代理 featured + 成长 3) */ @@ -2966,7 +2983,7 @@ body.command-home #navbar .site-nav-avatar:hover { padding: 12px 14px; border: 1px solid rgba(255, 255, 255, 0.66); border-radius: 14px; - background: color-mix(in srgb, #fff 52%, transparent); + background: color-mix(in srgb, #fff 46%, transparent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 1px 2px rgba(15, 23, 42, 0.04); @@ -2983,10 +3000,35 @@ body.command-home #navbar .site-nav-avatar:hover { -webkit-tap-highlight-color: transparent; } -/* 覆盖 command-home 全局禁 blur:仅精选卡开磨砂,透出点阵 */ +/* 提问卡的点只有 2px,模糊一大就会被白底抹平,所以比线路卡更透、更少糊 */ +body.command-home .ai-ask { + backdrop-filter: blur(6px) saturate(135%) !important; + -webkit-backdrop-filter: blur(6px) saturate(135%) !important; +} + body.command-home .ai-featured-routes__card { - backdrop-filter: blur(18px) saturate(155%) !important; - -webkit-backdrop-filter: blur(18px) saturate(155%) !important; + backdrop-filter: blur(18px) saturate(160%) !important; + -webkit-backdrop-filter: blur(18px) saturate(160%) !important; +} + +.ai-featured-routes__card::before { + content: ''; + position: absolute; + inset: 0; + z-index: 0; + border-radius: inherit; + pointer-events: none; + background: linear-gradient( + 180deg, + rgba(255, 255, 255, 0.55) 0%, + rgba(255, 255, 255, 0.05) 40%, + transparent 62% + ); +} + +.ai-featured-routes__card > * { + position: relative; + z-index: 1; } .ai-featured-routes__card:hover { @@ -3250,7 +3292,11 @@ body.command-home .ai-featured-routes__card { /* 奇数:正梯形 · 亮 */ .ai-intent-ribbon__item:nth-child(odd) .ai-intent-ribbon__face { - background: var(--ai-ribbon-light); + background: linear-gradient( + 180deg, + rgba(255, 255, 255, 0.96) 0%, + rgba(255, 255, 255, 0.62) 100% + ); clip-path: polygon( var(--ai-ribbon-cut) 0, calc(100% - var(--ai-ribbon-cut)) 0, @@ -3261,7 +3307,11 @@ body.command-home .ai-featured-routes__card { /* 偶数:反梯形 · 淡雾 */ .ai-intent-ribbon__item:nth-child(even) .ai-intent-ribbon__face { - background: var(--ai-ribbon-soft); + background: linear-gradient( + 180deg, + rgba(255, 255, 255, 0.84) 0%, + color-mix(in srgb, #d8e4ef 46%, rgba(255, 255, 255, 0.5)) 100% + ); clip-path: polygon( 0 0, 100% 0, @@ -3547,7 +3597,7 @@ body.command-home .ai-featured-routes__card { @media (prefers-reduced-motion: reduce) { .ai-welcome-plane img, .ai-welcome-airstrip, - .ai-welcome-compose-panel, + .ai-ask, .ai-welcome-trustline, .ai-intent-section, .ai-trust-bar { @@ -3579,15 +3629,19 @@ body.command-home .ai-featured-routes__card { height: 42px; } - body.command-home .ai-welcome-compose-panel { + body.command-home .ai-ask { padding: 12px 14px 10px; - border-radius: 18px; - box-shadow: none; + border-radius: 16px; } - body.command-home .ai-welcome-compose-panel .ai-welcome-cta-link { - top: 12px; - right: 14px; + body.command-home .ai-ask__dest { + min-height: 30px; + padding: 0 12px; + font-size: 0.78rem; + } + + body.command-home .ai-ask__hint { + margin-bottom: 8px; } body.command-home .ai-home-dests { @@ -4585,7 +4639,7 @@ body.command-home .ai-welcome-compose__lead { padding: 0 14px; border-radius: var(--ai-chip-radius, 999px); border: 1px solid rgba(18, 24, 32, 0.06); - background: rgba(255, 255, 255, 0.55); + background: rgba(255, 255, 255, 0.72); box-shadow: none; color: var(--ai-text-2); font-size: 0.84rem; @@ -4628,40 +4682,33 @@ body.command-home .ai-welcome-compose__lead { color: var(--ai-text-3); } -/* Welcome input — soft inner field, no heavy nested drop shadow */ +/* 输入框不再铺第二层白,点阵跟提问卡、线路卡是同一层 */ .ai-composer-slot--welcome .ai-composer { min-height: 56px; padding: 12px 12px 12px 18px; - border-radius: 16px; - border: 1px solid rgba(255, 255, 255, 0.9) !important; + border-radius: 14px; + border: 1px solid rgba(255, 255, 255, 0.66) !important; outline: none; - background: rgba(255, 255, 255, 0.72) !important; - backdrop-filter: blur(24px) saturate(170%) !important; - -webkit-backdrop-filter: blur(24px) saturate(170%) !important; - box-shadow: - inset 0 1px 0 rgba(255, 255, 255, 0.95), - inset 0 1px 6px rgba(15, 23, 42, 0.05) !important; + background: transparent !important; + backdrop-filter: none !important; + -webkit-backdrop-filter: none !important; + box-shadow: none !important; transition: - background 0.18s var(--ai-ease), - box-shadow 0.18s var(--ai-ease), - border-color 0.18s var(--ai-ease); + border-color 0.18s var(--ai-ease), + box-shadow 0.18s var(--ai-ease); } .ai-composer-slot--welcome .ai-composer::before, .ai-composer-slot--welcome .ai-composer::after { + content: none !important; display: none !important; } .ai-composer-slot--welcome .ai-composer:focus-within { - border-color: rgba(2, 62, 138, 0.28) !important; + border-color: rgba(255, 255, 255, 0.9) !important; outline: none; - background: rgba(255, 255, 255, 0.88) !important; - backdrop-filter: blur(28px) saturate(180%) !important; - -webkit-backdrop-filter: blur(28px) saturate(180%) !important; - box-shadow: - inset 0 1px 0 rgba(255, 255, 255, 1), - inset 0 1px 6px rgba(15, 23, 42, 0.06), - 0 0 0 3px rgba(2, 62, 138, 0.08) !important; + background: transparent !important; + box-shadow: 0 0 0 3px rgba(2, 62, 138, 0.08) !important; } .ai-composer-slot--welcome .ai-composer-input { @@ -4672,27 +4719,14 @@ body.command-home .ai-welcome-compose__lead { color: var(--ai-text-3, #66707d); } -.ai-composer-slot--welcome .ai-composer-send { - width: 40px; - height: 40px; - font-size: 1.1rem; - box-shadow: none; - background: var(--ai-brand, #023e8a); - color: #fff; -} - -.ai-composer-slot--welcome .ai-composer-send i { - font-size: 1rem; -} - -.ai-composer-slot--welcome .ai-composer-send:hover:not(:disabled):not(.is-empty) { - background: var(--ai-brand-hover, #012a74); - color: #fff; -} - +.ai-composer-slot--welcome .ai-composer-send, +.ai-composer-slot--welcome .ai-composer-send:hover:not(:disabled):not(.is-empty), .ai-composer-slot--welcome .ai-composer-send.is-empty { - background: color-mix(in srgb, var(--ai-brand, #023e8a) 42%, #c5d0db); - color: rgba(255, 255, 255, 0.88); + width: 32px; + height: 32px; + border-radius: 999px; + box-shadow: none; + transform: none; } .ai-composer-dock { @@ -4838,38 +4872,44 @@ body.command-home .ai-welcome-compose__lead { display: inline-flex; align-items: center; justify-content: center; - width: 52px; - height: 52px; + width: 32px; + height: 32px; border: none; - border-radius: 50%; - background: var(--ai-action); + border-radius: 999px; + background: #0d0d0d; color: #fff; - font-size: 1.35rem; - box-shadow: 0 0 0 4px var(--ai-bg); + box-shadow: none; cursor: pointer; - transition: background 0.2s var(--ai-ease), transform 0.15s var(--ai-ease); + transition: background 0.15s var(--ai-ease); } -.ai-composer-send i { - font-size: 1.2rem; - line-height: 1; +.ai-composer-send__mark { + display: block; + width: 18px; + height: 18px; + fill: none; + stroke: currentColor; + stroke-width: 2.25; + stroke-linecap: round; + stroke-linejoin: round; } -.ai-composer-send.is-empty { - background: color-mix(in srgb, var(--ai-text-3) 18%, #e9edf0); - color: color-mix(in srgb, var(--ai-text-3) 70%, #fff); +.ai-composer-send.is-empty, +.ai-composer-send.is-empty:hover { + background: #ececec; + color: #9a9a9a; cursor: default; transform: none; } -.ai-composer-send.is-empty:hover { - background: color-mix(in srgb, var(--ai-text-3) 18%, #e9edf0); +.ai-composer-send:hover:not(:disabled):not(.is-empty) { + background: #2f2f2f; transform: none; } -.ai-composer-send:hover:not(:disabled):not(.is-empty) { - background: var(--ai-action-hover); - transform: translateY(-1px); +.ai-composer-send:focus-visible { + outline: 2px solid #0d0d0d; + outline-offset: 2px; } .ai-composer-send:disabled { @@ -5337,69 +5377,31 @@ body.command-home .ai-welcome-compose__lead { padding: 0 0 calc(12px + env(safe-area-inset-bottom, 0px)); } - .ai-welcome-compose-panel { + .ai-ask { padding: 14px 14px 12px; - border-radius: 20px; } - .ai-welcome-compose-panel .ai-welcome-cta-link { - position: static; - display: flex; - align-items: center; - justify-content: center; - width: 100%; - min-height: 44px; - margin: 0 0 10px; - padding: 0 14px; - border-radius: 999px; - border: 1px solid color-mix(in srgb, var(--ai-accent, #e96a26) 28%, #fff); - background: color-mix(in srgb, var(--ai-accent, #e96a26) 12%, #fff); - color: var(--ai-accent, #e96a26); - font-size: 0.95rem; - font-weight: 700; - text-decoration: none; - box-shadow: 0 1px 2px rgba(233, 106, 38, 0.08); + .ai-ask__bar { + gap: 12px; } - .ai-welcome-compose-panel .ai-welcome-cta-link:hover, - .ai-welcome-compose-panel .ai-welcome-cta-link:focus { - color: #fff; - background: var(--ai-accent, #e96a26); - border-color: var(--ai-accent, #e96a26); - text-decoration: none; - } - - .ai-welcome-compose-panel .ai-welcome-compose__lead { - padding-right: 0; - padding-top: 0; - margin-bottom: 10px; - font-size: 0.92rem; - line-height: 1.45; - } - - .ai-home-dests { - display: flex; + .ai-ask__dests { + flex: 1; flex-wrap: nowrap; - gap: 8px; - margin-bottom: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; - mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 20px), transparent 100%); - -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 20px), transparent 100%); } - .ai-home-dests::-webkit-scrollbar { + .ai-ask__dests::-webkit-scrollbar { display: none; } - .ai-home-dest { + .ai-ask__dest { flex: 0 0 auto; min-height: 40px; - padding: 0 14px; - font-size: 0.88rem; } .ai-welcome-sub { @@ -5428,9 +5430,10 @@ body.command-home .ai-welcome-compose__lead { font-size: 16px; /* iOS 避免自动放大 */ } - .ai-composer-send { - width: 44px; - height: 44px; + .ai-composer-send, + .ai-composer-slot--welcome .ai-composer-send { + width: 32px; + height: 32px; } .ai-composer-dock {