Files
cube/apps/write/frontend/src/styles.css
T
Fam Zheng 9328c01c1b
deploy write / build-and-deploy (push) Failing after 4s
write: 进 cube 仓库 + 接 gitea CI 自动部署
- 整 apps/write/ 进 git(含 frontend 源码 + Makefile + systemd unit + k8s service/ingress)
- .gitea/workflows/deploy-write.yml: act_runner fam 用户跑 host shell
    cargo build → npm build → install 到 ~/.local/bin/share/config →
    systemctl --user daemon-reload + restart → kubectl apply svc/ingress
- 前端 3 处"麻薯"字样去掉(思考中 / placeholder × 2)

注意 ~/.config/write/env 已有 passphrase,CI placeholder 逻辑会跳过不覆盖。
2026-05-24 17:16:44 +01:00

328 lines
7.5 KiB
CSS

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; width: 100%; overflow-x: hidden; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
background: #fafafa;
color: #222;
font-size: 14px;
}
.app { max-width: 100vw; overflow-x: hidden; }
button { font: inherit; cursor: pointer; }
textarea, input { font: inherit; }
/* ====== layout ====== */
.app {
display: grid;
grid-template-columns: 260px 1fr;
height: 100vh;
}
.sidebar {
border-right: 1px solid #e5e5e5;
background: #fff;
display: flex;
flex-direction: column;
min-width: 0;
}
.sidebar-header {
padding: 14px 16px;
border-bottom: 1px solid #eee;
display: flex;
align-items: center;
gap: 8px;
}
.sidebar-header h1 { margin: 0; font-size: 16px; font-weight: 600; }
.sidebar-header .new-btn {
margin-left: auto;
border: 1px solid #ddd;
background: #fff;
padding: 4px 10px;
border-radius: 6px;
font-size: 13px;
}
.sidebar-header .new-btn:hover { background: #f5f5f5; }
.doc-list { flex: 1; overflow-y: auto; padding: 6px; }
.doc-item {
padding: 8px 10px;
border-radius: 6px;
cursor: pointer;
margin-bottom: 2px;
font-size: 13px;
display: flex;
align-items: center;
gap: 8px;
}
.doc-item:hover { background: #f3f3f3; }
.doc-item.active { background: #e8efff; }
.doc-item .title {
flex: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.doc-item .meta { font-size: 11px; color: #888; }
.doc-item .del {
border: none;
background: transparent;
color: #c44;
font-size: 12px;
visibility: hidden;
}
.doc-item:hover .del { visibility: visible; }
/* ====== workspace ====== */
.workspace {
display: grid;
grid-template-rows: 1fr auto;
min-width: 0;
min-height: 0;
background: #fafafa;
overflow: hidden;
}
.editor-pane > * { min-width: 0; min-height: 0; }
.workspace > * { min-width: 0; }
.input-bar { min-width: 0; box-sizing: border-box; overflow: hidden; }
.editor-pane {
display: grid;
grid-template-columns: 1fr 1fr;
min-height: 0;
border-bottom: 1px solid #e5e5e5;
}
.title-row {
grid-column: 1 / -1;
padding: 10px 16px;
border-bottom: 1px solid #eee;
background: #fff;
}
.title-row input {
width: 100%;
border: none;
outline: none;
font-size: 16px;
font-weight: 600;
background: transparent;
}
.editor, .preview {
min-height: 0;
overflow-y: auto;
padding: 16px;
}
.editor {
border-right: 1px solid #e5e5e5;
background: #fff;
}
.editor { overflow-x: hidden; }
.editor textarea {
width: 100%;
max-width: 100%;
height: 100%;
border: none;
outline: none;
resize: none;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 13px;
line-height: 1.6;
background: transparent;
word-break: break-all;
}
.preview {
background: #fff;
line-height: 1.6;
overflow-x: hidden;
word-wrap: break-word;
overflow-wrap: anywhere;
}
.preview h1, .preview h2, .preview h3 { margin: 18px 0 8px; }
.preview p { margin: 8px 0; }
.preview pre {
background: #f5f5f5; padding: 10px; border-radius: 6px;
font-size: 12px; overflow-x: auto;
max-width: 100%;
}
.preview code { background: #f5f5f5; padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.preview pre code { background: transparent; padding: 0; word-wrap: normal; overflow-wrap: normal; }
.preview blockquote { border-left: 3px solid #ddd; margin: 8px 0; padding: 4px 12px; color: #555; }
.preview img { max-width: 100%; height: auto; }
.preview table { display: block; max-width: 100%; overflow-x: auto; }
/* ====== input bar ====== */
.input-bar {
background: #fff;
border-top: 1px solid #e5e5e5;
padding: 10px 12px;
}
.input-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
.input-row textarea {
flex: 1 1 0;
min-width: 0;
min-height: 40px;
max-height: 160px;
resize: none;
padding: 9px 12px;
border: 1px solid #ddd;
border-radius: 8px;
outline: none;
font-size: 14px;
line-height: 1.4;
}
.input-row textarea:focus { border-color: #6b7cff; }
.btn {
height: 40px;
padding: 0 14px;
border-radius: 8px;
border: 1px solid #ddd;
background: #fff;
font-size: 14px;
}
.btn:hover { background: #f5f5f5; }
.btn.primary { background: #5566ee; border-color: #4455dd; color: #fff; }
.btn.primary:hover { background: #4455dd; }
.btn.primary:disabled { background: #aaa; border-color: #aaa; cursor: not-allowed; }
.btn.mic { width: 44px; padding: 0; }
.btn.mic.on { background: #ee5566; border-color: #dd4455; color: #fff; }
.status {
font-size: 12px;
color: #666;
padding: 4px 4px 0;
min-height: 18px;
}
.status.err { color: #c44; }
/* ====== mobile-only chrome ====== */
.mobile-bar {
display: none;
align-items: center;
gap: 8px;
padding: 8px 12px;
background: #fff;
border-bottom: 1px solid #e5e5e5;
padding-top: max(8px, env(safe-area-inset-top));
}
.mobile-bar .hamburger,
.mobile-bar .pane-tabs button {
border: 1px solid #ddd;
background: #fff;
border-radius: 6px;
font-size: 14px;
padding: 6px 10px;
}
.mobile-bar .pane-tabs {
margin-left: auto;
display: flex;
gap: 4px;
}
.mobile-bar .pane-tabs button.active {
background: #5566ee;
color: #fff;
border-color: #4455dd;
}
.mobile-bar .doc-title {
flex: 1 1 0;
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 600;
font-size: 14px;
}
.mobile-bar .doc-title input { min-width: 0; }
.sidebar-backdrop {
display: none;
position: fixed; inset: 0;
background: rgba(0,0,0,0.35);
z-index: 50;
}
/* ====== mobile layout ====== */
@media (max-width: 768px) {
.app {
grid-template-columns: 1fr;
grid-template-rows: auto 1fr;
height: 100dvh;
}
.mobile-bar { display: flex; }
/* sidebar becomes a slide-in drawer */
.sidebar {
position: fixed;
top: 0; left: 0; bottom: 0;
width: 78vw;
max-width: 320px;
border-right: 1px solid #e5e5e5;
border-bottom: none;
transform: translateX(-100%);
transition: transform 0.2s ease;
z-index: 60;
box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}
.app.drawer-open .sidebar { transform: translateX(0); }
.app.drawer-open .sidebar-backdrop { display: block; }
/* workspace fills the screen; editor + preview overlay each other,
pane-tabs picks which one shows */
.editor-pane {
grid-template-columns: 1fr;
grid-template-rows: 1fr;
position: relative;
}
.title-row { display: none; } /* title shows in the mobile-bar instead */
.editor, .preview {
grid-column: 1;
grid-row: 1;
border-right: none;
border-bottom: none;
padding: 12px;
}
.editor { display: none; }
.preview { display: none; }
.app.pane-editor .editor { display: block; }
.app.pane-preview .preview { display: block; }
/* input bar honors safe area at bottom */
.input-bar {
padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.input-row textarea {
font-size: 16px; /* iOS won't zoom in if >= 16px */
}
.btn { height: 44px; } /* easier thumb target */
.btn.mic { width: 48px; }
}
/* ====== modal ====== */
.modal-backdrop {
position: fixed; inset: 0;
background: rgba(0,0,0,0.4);
display: flex; align-items: center; justify-content: center;
z-index: 100;
}
.modal {
background: #fff; padding: 20px; border-radius: 10px;
width: 360px; max-width: 90vw;
}
.modal h2 { margin: 0 0 12px; font-size: 16px; }
.modal input {
width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 6px;
margin-bottom: 12px; outline: none;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }