@@ -11,12 +11,24 @@
--drawer-bg : rgb ( 249 , 250 , 251 ) ; /* 侧边栏底色(与页面白底区分;分组表头吸顶同色) */
--drawer-bg : rgb ( 249 , 250 , 251 ) ; /* 侧边栏底色(与页面白底区分;分组表头吸顶同色) */
--border : #ececf1 ;
--border : #ececf1 ;
--radius-lg : 24 px ;
--radius-lg : 24 px ;
/* 安全区与软键盘(成因与注入约定见 js/viewport.js 顶部注释):
--sat / --sab 默认取 env()——iOS 独立 PWA 下有效;安卓 WebView 的 env() 只反映
屏幕挖孔(display cutout),不含状态栏/导航栏高度,基本恒为 0,需由套壳 App 用
documentElement.style.setProperty 注入真实高度覆盖。
--kb 是键盘占用的高度,取两个来源的较大值:--kb-page 由 viewport.js 按 visualViewport
算(壳不注入时也能工作),--kb-native 由壳按 IME insets 注入(WebView 完全感知不到
键盘时只能走这条)。两个变量分开放,避免页面与壳互相覆盖同一个值。 */
--sat : env ( safe - area - inset - top , 0 px ) ;
--sab : env ( safe - area - inset - bottom , 0 px ) ;
--kb-page : 0 px ;
--kb-native : 0 px ;
--kb : max ( var ( - - kb - page ) , var ( - - kb - native ) ) ;
}
}
* { margin : 0 ; padding : 0 ; box-sizing : border-box ; -webkit- tap-highlight-color : transparent ; }
* { margin : 0 ; padding : 0 ; box-sizing : border-box ; -webkit- tap-highlight-color : transparent ; }
/* 整站是视口锁定的 app shell:文档本身永不滚动,滚动只发生在内部容器
/* 整站是视口锁定的 app shell:文档本身永不滚动,滚动只发生在内部容器
(消息流 #chat-view / 抽屉列表 .drawer-list / 设置页 .set-scroll,均已 overflow-y:auto)。
(消息流 #chat-view / 抽屉列表 .drawer-list / 设置页 .set-scroll,均已 overflow-y:auto)。
不写 overflow:hidden 时,桌面端只要有一行内容没收缩下(nowrap 胶囊/代码块/宽表格),
不写 overflow:hidden 时,桌面端只要有一行内容没收缩下(nowrap 胶囊/代码块/宽表格),
浏览器就给窗口加横向滚动条;横向条又吃掉一屏高度,而 #app 死守 height:100% ,
浏览器就给窗口加横向滚动条;横向条又吃掉一屏高度,而 #app 死守视口高度 ,
于是竖横向滚动条一起出现、缩窗口页面不动。 */
于是竖横向滚动条一起出现、缩窗口页面不动。 */
html , body { height : 100 % ; overflow : hidden ; }
html , body { height : 100 % ; overflow : hidden ; }
body {
body {
@@ -37,7 +49,9 @@ input, textarea { font: inherit; color: inherit; border: 0; outline: none; backg
/* ================= 应用骨架 ================= */
/* ================= 应用骨架 ================= */
# app {
# app {
height : 100 % ;
/* 减去 --kb:键盘弹起时整块 shell 收缩,footer 才会落在键盘上沿。
壳已正确 resize( adjustResize / resizes-content)时 --kb 恒为 0,不重复收缩。 */
height : calc ( 100 % - var ( - - kb ) ) ;
max-width : 760 px ;
max-width : 760 px ;
margin : 0 auto ;
margin : 0 auto ;
display : flex ;
display : flex ;
@@ -53,7 +67,8 @@ input, textarea { font: inherit; color: inherit; border: 0; outline: none; backg
display : flex ;
display : flex ;
align-items : center ;
align-items : center ;
gap : 8 px ;
gap : 8 px ;
padding : 10 px 12 px ;
/* 顶栏自己吃下状态栏高度(背景跟着铺上去,不留白条);设置页顶栏同用 .header */
padding : calc ( 10 px + var ( - - sat ) ) 12 px 10 px ;
min-height : 56 px ;
min-height : 56 px ;
background : var ( - - drawer - bg ) ;
background : var ( - - drawer - bg ) ;
}
}
@@ -280,7 +295,7 @@ main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
. tool-card . tool-time . act-del : hover { color : #c0392b ; }
. tool-card . tool-time . act-del : hover { color : #c0392b ; }
/* ================= 底部输入区 ================= */
/* ================= 底部输入区 ================= */
footer { position : relative ; flex : none ; padding : 8 px 12 px calc ( 10 px + env ( safe - area - inset - bottom , 0 px ) ) ; background : var ( - - page ) ; }
footer { position : relative ; flex : none ; padding : 8 px 12 px calc ( 10 px + var ( - - sab ) ) ; background : var ( - - page ) ; }
. attach-chips { display : flex ; flex-wrap : wrap ; gap : 6 px ; margin-bottom : 8 px ; }
. attach-chips { display : flex ; flex-wrap : wrap ; gap : 6 px ; margin-bottom : 8 px ; }
. attach-chip {
. attach-chip {
display : inline-flex ; align-items : center ; gap : 6 px ;
display : inline-flex ; align-items : center ; gap : 6 px ;
@@ -436,12 +451,12 @@ body.voice-active .scroll-bottom-btn { display: none; }
# voice-overlay {
# voice-overlay {
position : absolute ;
position : absolute ;
top : -72 px ;
top : -72 px ;
bottom : calc ( -11 px - env ( safe - area - inset - bottom , 0 px ) ) ;
bottom : calc ( -11 px - var ( - - sab ) ) ;
left : -13 px ; right : -13 px ;
left : -13 px ; right : -13 px ;
z-index : 6 ;
z-index : 6 ;
display : flex ; flex-direction : column ; align-items : center ; justify-content : flex-end ;
display : flex ; flex-direction : column ; align-items : center ; justify-content : flex-end ;
gap : 20 px ;
gap : 20 px ;
padding-bottom : calc ( 70 px + env ( safe - area - inset - bottom , 0 px ) ) ;
padding-bottom : calc ( 70 px + var ( - - sab ) ) ;
/* 底色必须是**不透明**的 var(--page):早先只铺一层 9% 蓝渐变,遮罩伸进会话流的那一段
/* 底色必须是**不透明**的 var(--page):早先只铺一层 9% 蓝渐变,遮罩伸进会话流的那一段
会把底下的消息文字透出来,「松手传送」看着就成了半透明。
会把底下的消息文字透出来,「松手传送」看着就成了半透明。
顶层那 20px 由透明渐变到 --page 只是把上边缘与会话流接上,别把整块都做成渐变。 */
顶层那 20px 由透明渐变到 --page 只是把上边缘与会话流接上,别把整块都做成渐变。 */
@@ -508,7 +523,7 @@ body.voice-active .scroll-bottom-btn { display: none; }
border-radius : 16 px 16 px 0 0 ;
border-radius : 16 px 16 px 0 0 ;
box-shadow : 0 -6 px 24 px rgba ( 20 , 30 , 70 , 0.16 ) ;
box-shadow : 0 -6 px 24 px rgba ( 20 , 30 , 70 , 0.16 ) ;
transform : translateY ( 105 % ) ; transition : transform .25 s ease ; /* 收起时滑出屏幕 */
transform : translateY ( 105 % ) ; transition : transform .25 s ease ; /* 收起时滑出屏幕 */
padding-bottom : env ( safe - area - inset - bottom , 0 px ) ;
padding-bottom : var ( - - sab ) ;
overflow : hidden ;
overflow : hidden ;
}
}
. files-panel . open { transform : translateY ( 0 ) ; }
. files-panel . open { transform : translateY ( 0 ) ; }
@@ -604,7 +619,7 @@ body.voice-active .scroll-bottom-btn { display: none; }
padding : 10 px 14 px ;
padding : 10 px 14 px ;
border-top : 1 px solid var ( - - border ) ;
border-top : 1 px solid var ( - - border ) ;
background : var ( - - page ) ;
background : var ( - - page ) ;
padding-bottom : calc ( 10 px + env ( safe - area - inset - bottom , 0 px ) ) ;
padding-bottom : calc ( 10 px + var ( - - sab ) ) ;
}
}
. files-panel-count {
. files-panel-count {
font-size : 13 px ; color : var ( - - gray ) ;
font-size : 13 px ; color : var ( - - gray ) ;
@@ -757,7 +772,9 @@ body.voice-active .scroll-bottom-btn { display: none; }
}
}
# scrim . show { opacity : 1 ; pointer-events : auto ; }
# scrim . show { opacity : 1 ; pointer-events : auto ; }
# drawer {
# drawer {
position : fixed ; top : 0 ; bottom : 0 ; left : 0 ; z-index : 50 ;
/* 抽屉是 fixed 全屏层:顶部让出状态栏,底部随键盘收缩(搜索框输入时列表不被盖住) */
position : fixed ; top : 0 ; bottom : var ( - - kb ) ; left : 0 ; z-index : 50 ;
padding-top : var ( - - sat ) ;
width : min ( 78 vw , 320 px ) ;
width : min ( 78 vw , 320 px ) ;
background : var ( - - drawer - bg ) ;
background : var ( - - drawer - bg ) ;
display : flex ; flex-direction : column ;
display : flex ; flex-direction : column ;
@@ -848,7 +865,7 @@ body.voice-active .scroll-bottom-btn { display: none; }
/* 底部用户区 */
/* 底部用户区 */
. drawer-user {
. drawer-user {
flex : none ; display : flex ; align-items : center ; gap : 10 px ;
flex : none ; display : flex ; align-items : center ; gap : 10 px ;
padding : 12 px 14 px calc ( 12 px + env ( safe - area - inset - bottom , 0 px ) ) ;
padding : 12 px 14 px calc ( 12 px + var ( - - sab ) ) ;
border-top : 1 px solid var ( - - border ) ;
border-top : 1 px solid var ( - - border ) ;
}
}
. avatar {
. avatar {
@@ -933,12 +950,12 @@ body.voice-active .scroll-bottom-btn { display: none; }
/* 两层 img 绝对定位居中叠放:滑动切换时旧图滑出、新图同步滑入(见 js/stream.js 的 slideTo) */
/* 两层 img 绝对定位居中叠放:滑动切换时旧图滑出、新图同步滑入(见 js/stream.js 的 slideTo) */
# img-viewer img { position : absolute ; inset : 0 ; margin : auto ; max-width : 100 vw ; max-height : 88 vh ; touch-action : none ; cursor : grab ; user-select : none ; -webkit- user-drag : none ; will-change : transform ; }
# img-viewer img { position : absolute ; inset : 0 ; margin : auto ; max-width : 100 vw ; max-height : 88 vh ; touch-action : none ; cursor : grab ; user-select : none ; -webkit- user-drag : none ; will-change : transform ; }
/* 组内页码:底部居中悬浮,不参与命中测试(点它等于点背景会关闭) */
/* 组内页码:底部居中悬浮,不参与命中测试(点它等于点背景会关闭) */
# img-count { position : fixed ; left : 50 % ; bottom : calc ( 18 px + env ( safe - area - inset - bottom , 0 px ) ) ; transform : translateX ( -50 % ) ; z-index : 151 ; padding : 3 px 12 px ; border-radius : 999 px ; background : rgba ( 0 , 0 , 0 , 0.5 ) ; color : #fff ; font-size : 12 px ; letter-spacing : .5 px ; pointer-events : none ; }
# img-count { position : fixed ; left : 50 % ; bottom : calc ( 18 px + var ( - - sab ) ) ; transform : translateX ( -50 % ) ; z-index : 151 ; padding : 3 px 12 px ; border-radius : 999 px ; background : rgba ( 0 , 0 , 0 , 0.5 ) ; color : #fff ; font-size : 12 px ; letter-spacing : .5 px ; pointer-events : none ; }
# fs-viewer { position : fixed ; inset : 0 ; z-index : 130 ; background : rgba ( 8 , 10 , 20 , 0.88 ) ; padding : 40 px 14 px 24 px ; overflow : auto ; /* 缩放后支持横纵滚动 */ }
# fs-viewer { position : fixed ; inset : 0 ; z-index : 130 ; background : rgba ( 8 , 10 , 20 , 0.88 ) ; padding : 40 px 14 px 24 px ; overflow : auto ; /* 缩放后支持横纵滚动 */ }
# fs-viewer . hidden { display : none ; }
# fs-viewer . hidden { display : none ; }
. fs-panel { max-width : 860 px ; margin : 0 auto ; background : var ( - - page ) ; border-radius : 14 px ; padding : 18 px 20 px ; font-size : 15.5 px ; }
. fs-panel { max-width : 860 px ; margin : 0 auto ; background : var ( - - page ) ; border-radius : 14 px ; padding : 18 px 20 px ; font-size : 15.5 px ; }
/* 顶部操作区:默认右上角悬浮(消息全屏用);文件预览走 fs-bar 模式时独立成一行 */
/* 顶部操作区:默认右上角悬浮(消息全屏用);文件预览走 fs-bar 模式时独立成一行 */
. fs-actions { position : fixed ; top : calc ( 2 px + env ( safe - area - inset - top , 0 px ) ) ; right : 14 px ; z-index : 131 ; display : flex ; align-items : center ; gap : 8 px ; }
. fs-actions { position : fixed ; top : calc ( 2 px + var ( - - sat ) ) ; right : 14 px ; z-index : 131 ; display : flex ; align-items : center ; gap : 8 px ; }
. fs-name { display : none ; min-width : 0 ; overflow : hidden ; text-overflow : ellipsis ; white-space : nowrap ; font-size : 13 px ; font-weight : 600 ; color : var ( - - ink ) ; }
. fs-name { display : none ; min-width : 0 ; overflow : hidden ; text-overflow : ellipsis ; white-space : nowrap ; font-size : 13 px ; font-weight : 600 ; color : var ( - - ink ) ; }
. fs-btn {
. fs-btn {
flex : none ; display : flex ; align-items : center ; justify-content : center ;
flex : none ; display : flex ; align-items : center ; justify-content : center ;
@@ -955,8 +972,8 @@ body.voice-active .scroll-bottom-btn { display: none; }
# fs-viewer . fs-bar . fs-actions {
# fs-viewer . fs-bar . fs-actions {
position : sticky ; top : 0 ; z-index : 1 ;
position : sticky ; top : 0 ; z-index : 1 ;
flex : none ; width : 100 % ;
flex : none ; width : 100 % ;
height : calc ( 40 px + env ( safe - area - inset - top , 0 px ) ) ;
height : calc ( 40 px + var ( - - sat ) ) ;
padding : env ( safe - area - inset - top , 0 px ) 10 px 0 14 px ;
padding : var ( - - sat ) 10 px 0 14 px ;
justify-content : flex-end ; gap : 6 px ;
justify-content : flex-end ; gap : 6 px ;
background : var ( - - page ) ; border-bottom : 1 px solid var ( - - border ) ;
background : var ( - - page ) ; border-bottom : 1 px solid var ( - - border ) ;
}
}
@@ -971,14 +988,14 @@ body.voice-active .scroll-bottom-btn { display: none; }
# fs-viewer . fs-bar # fs-body . bubble-ai ,
# fs-viewer . fs-bar # fs-body . bubble-ai ,
# fs-viewer . fs-bar # fs-body . bubble-user {
# fs-viewer . fs-bar # fs-body . bubble-user {
max-width : 100 % ; margin : 0 ; border-radius : 0 ; box-shadow : none ; background : var ( - - page ) ;
max-width : 100 % ; margin : 0 ; border-radius : 0 ; box-shadow : none ; background : var ( - - page ) ;
padding : 14 px 12 px calc ( 28 px + env ( safe - area - inset - bottom , 0 px ) ) ; font-size : 15.5 px ;
padding : 14 px 12 px calc ( 28 px + var ( - - sab ) ) ; font-size : 15.5 px ;
}
}
# fs-viewer . fs-bar # fs-src-pane { overflow : auto ; }
# fs-viewer . fs-bar # fs-src-pane { overflow : auto ; }
# fs-viewer . fs-bar # fs-src-code { max-height : none ; border : 0 ; border-radius : 0 ; padding : 12 px 14 px calc ( 28 px + env ( safe - area - inset - bottom , 0 px ) ) ; }
# fs-viewer . fs-bar # fs-src-code { max-height : none ; border : 0 ; border-radius : 0 ; padding : 12 px 14 px calc ( 28 px + var ( - - sab ) ) ; }
# fs-viewer . fs-bar . fs-img-frame { max-width : 100 % ; max-height : 100 % ; border-radius : 0 ; margin : 0 auto ; }
# fs-viewer . fs-bar . fs-img-frame { max-width : 100 % ; max-height : 100 % ; border-radius : 0 ; margin : 0 auto ; }
. fs-close {
. fs-close {
/* 顶到视口最上沿(避开刘海),不再压住预览面板顶部 */
/* 顶到视口最上沿(避开刘海),不再压住预览面板顶部 */
position : fixed ; top : calc ( 2 px + env ( safe - area - inset - top , 0 px ) ) ; right : 14 px ; z-index : 131 ; width : 34 px ; height : 34 px ;
position : fixed ; top : calc ( 2 px + var ( - - sat ) ) ; right : 14 px ; z-index : 131 ; width : 34 px ; height : 34 px ;
border : none ; border-radius : 50 % ; background : rgba ( 0 , 0 , 0 , 0.42 ) ; color : #fff ;
border : none ; border-radius : 50 % ; background : rgba ( 0 , 0 , 0 , 0.42 ) ; color : #fff ;
box-shadow : 0 1 px 5 px rgba ( 0 , 0 , 0 , 0.22 ) ;
box-shadow : 0 1 px 5 px rgba ( 0 , 0 , 0 , 0.22 ) ;
font-size : 15 px ; line-height : 1 ; cursor : pointer ;
font-size : 15 px ; line-height : 1 ; cursor : pointer ;
@@ -1028,7 +1045,7 @@ body.voice-active .scroll-bottom-btn { display: none; }
. header-right . icon-btn : active , . header-right label . icon-btn : active { background : var ( - - surface ) ; }
. header-right . icon-btn : active , . header-right label . icon-btn : active { background : var ( - - surface ) ; }
label . icon-btn { cursor : pointer ; }
label . icon-btn { cursor : pointer ; }
# set-body { flex : 1 ; min-height : 0 ; background : var ( - - surface ) ; display : flex ; flex-direction : column ; }
# set-body { flex : 1 ; min-height : 0 ; background : var ( - - surface ) ; display : flex ; flex-direction : column ; }
. set-scroll { flex : 1 ; min-height : 0 ; overflow-y : auto ; overflow-x : hidden ; padding : 12 px 12 px calc ( 16 px + env ( safe - area - inset - bottom , 0 px ) ) ; }
. set-scroll { flex : 1 ; min-height : 0 ; overflow-y : auto ; overflow-x : hidden ; padding : 12 px 12 px calc ( 16 px + var ( - - sab ) ) ; }
. empty-tip { color : var ( - - gray - light ) ; text-align : center ; padding : 18 px ; font-size : 13 px ; }
. empty-tip { color : var ( - - gray - light ) ; text-align : center ; padding : 18 px ; font-size : 13 px ; }
/* ---------- 设置主页卡片 ---------- */
/* ---------- 设置主页卡片 ---------- */
@@ -1261,7 +1278,7 @@ label.icon-btn { cursor: pointer; }
/* ---------- 编辑器页(config.yml 原文 / 技能文件) ---------- */
/* ---------- 编辑器页(config.yml 原文 / 技能文件) ---------- */
. set-editor {
. set-editor {
flex : 1 ; min-height : 0 ; display : flex ; flex-direction : column ;
flex : 1 ; min-height : 0 ; display : flex ; flex-direction : column ;
padding : 10 px 12 px calc ( 12 px + env ( safe - area - inset - bottom , 0 px ) ) ;
padding : 10 px 12 px calc ( 12 px + var ( - - sab ) ) ;
}
}
. set-editor textarea {
. set-editor textarea {
flex : 1 ; width : 100 % ; resize : none ; background : #fff ; color : var ( - - ink ) ;
flex : 1 ; width : 100 % ; resize : none ; background : #fff ; color : var ( - - ink ) ;
@@ -1287,7 +1304,8 @@ label.icon-btn { cursor: pointer; }
. btn-row { display : flex ; gap : 10 px ; }
. btn-row { display : flex ; gap : 10 px ; }
. btn-row . primary-btn { flex : 1 ; }
. btn-row . primary-btn { flex : 1 ; }
. modal-overlay {
. modal-overlay {
position : fixed ; inset : 0 ; background : rgba ( 20 , 25 , 50 , 0.45 ) ;
/* bottom 让出键盘:弹窗内的输入框(定时任务提示词等)不被软键盘压住 */
position : fixed ; inset : 0 ; bottom : var ( - - kb ) ; background : rgba ( 20 , 25 , 50 , 0.45 ) ;
display : flex ; align-items : center ; justify-content : center ; z-index : 100 ;
display : flex ; align-items : center ; justify-content : center ; z-index : 100 ;
}
}
. modal {
. modal {