Files
github-auto-sync-golang/static/style.css
T

209 lines
14 KiB
CSS

:root {
--bg: #f6f7f9; --card: #fff; --border: #e3e5e8; --text: #1f2328; --muted: #6a737d;
--blue: #185fa5; --green: #3b6d11; --green-bg: #eaf3de; --red: #a32d2d; --red-bg: #fcebeb;
--amber: #854f0b; --amber-bg: #faeeda; --gray-bg: #f1efe8; --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 500; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); display: inline-block; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.conn { font-size: 12px; color: var(--muted); margin-right: 8px; }
.conn.on { color: var(--green); }
.conn.off { color: var(--red); }
.btn { border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--text); }
.btn:hover { border-color: #b6bcc4; background: #f3f4f6; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: #124d86; border-color: #124d86; }
.btn-danger { background: #fff; border-color: #e2b6b6; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-icon { border: none; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
main { max-width: 1320px; margin: 24px auto; padding: 0 24px; }
.layout { display: flex; gap: 20px; align-items: flex-start; }
.main-col { flex: 1; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.empty { text-align: center; color: var(--muted); padding: 80px 0; }
/* 全局实时活动面板 */
.live { width: 360px; flex: none; position: sticky; top: 80px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 104px); }
.live-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.live-head h2 { margin: 0; font-size: 15px; font-weight: 500; flex: 1; }
.live-head .conn { margin: 0; }
.btn-sm { border: 1px solid var(--border); background: #fff; border-radius: 7px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--muted); }
.btn-sm:hover { border-color: #b6bcc4; background: #f3f4f6; }
.live-hint { font-size: 11px; color: var(--muted); padding: 8px 14px; border-bottom: 1px solid var(--border); }
.live-log { flex: 1; overflow-y: auto; padding: 8px 10px; font-family: Consolas, "Cascadia Code", monospace; font-size: 11.5px; line-height: 1.5; }
.live-line { display: flex; gap: 6px; padding: 2px 0; border-bottom: 1px solid #f2f2f2; }
.live-line .ll-time { color: #9aa0a6; flex: none; }
.live-line .ll-repo { color: var(--blue); flex: none; font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-line .ll-msg { color: var(--text); min-width: 0; word-break: break-word; }
.live-line.lv-err .ll-msg { color: var(--red); }
.live-line.lv-warn .ll-msg { color: var(--amber); }
.live-line.lv-err .ll-repo, .live-line.lv-warn .ll-repo { color: #b06a00; }
.last-detail { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 980px) {
.layout { flex-direction: column; }
.live { width: 100%; position: static; max-height: 360px; }
}
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.card.st-conflict { border-color: #e8c98a; background: #fffdf6; }
.card.st-error { border-color: #eec9c9; }
.card-head { display: flex; align-items: center; gap: 8px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 500; flex: 1; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.st-ok .dot { background: #4f9e33; }
.st-error .dot { background: #d34b4b; }
.st-conflict .dot { background: #e39a1d; }
.st-idle .dot { background: #b4b2a9; }
.st-running .dot { background: #378add; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.mode { font-size: 11px; color: var(--muted); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
.path { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: Consolas, monospace; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 12px; background: var(--gray-bg); border-radius: 6px; padding: 1px 8px; color: #444; }
.badge.b-up { background: var(--green-bg); color: var(--green); }
.badge.b-down { background: #e6f1fb; color: var(--blue); }
.badge.b-dirty { background: var(--amber-bg); color: var(--amber); }
.badge.b-conflict { background: var(--red-bg); color: var(--red); }
.last { font-size: 12px; color: var(--muted); }
.err { font-size: 12px; color: var(--red); background: var(--red-bg); border-radius: 8px; padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-btns { display: flex; gap: 8px; margin-top: auto; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 16px; width: min(860px, 94vw); max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 500; }
.tabs { display: flex; gap: 4px; padding: 8px 20px 0; border-bottom: 1px solid var(--border); }
.tab { border: none; background: none; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-body { padding: 16px 20px; overflow: auto; }
.tab-pane[hidden] { display: none; }
.logbox { margin: 0; background: #f6f7f9; border: 1px solid var(--border); padding: 12px; border-radius: 8px; font: 12px/1.5 Consolas, monospace; white-space: pre-wrap; word-break: break-all; max-height: 55vh; overflow: auto; }
.conflict-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.conflict-file { margin-bottom: 14px; }
.conflict-file h4 { margin: 0 0 6px; font-size: 13px; font-family: Consolas, monospace; }
.conflict-file pre { margin: 0; background: #f6f7f9; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font: 12px/1.5 Consolas, monospace; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow: auto; }
.stat-summary { display: flex; gap: 16px; margin-bottom: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.stat-summary b { color: var(--text); }
.commit-list { max-height: 55vh; overflow: auto; }
.commit { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.commit-head { display: flex; gap: 10px; align-items: baseline; padding: 8px 12px; cursor: pointer; }
.commit-head:hover { background: #f6f7f9; }
.commit-hash { font: 12px Consolas, monospace; color: var(--blue); flex: none; }
.commit-subject { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commit-meta { font-size: 12px; color: var(--muted); flex: none; }
.commit-diff { margin: 0; border-top: 1px solid var(--border); background: #f6f7f9; padding: 10px; font: 12px/1.5 Consolas, monospace; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; }
.commit-diff[hidden] { display: none; }
.login-box { width: min(360px, 92vw); }
.login-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.login-err { color: var(--red); font-size: 12px; margin: 0; }
.form-grid label.check-row { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.form-grid label.check-row input { width: auto; margin: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form-grid .full { grid-column: 1 / -1; }
input, select, textarea { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-family: inherit; color: var(--text); background: #fff; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); }
textarea { font-family: Consolas, monospace; resize: vertical; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
/* ---------- 差异显示(网页端) ---------- */
.diff-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.diff-head label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.diff-stat { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.diff-stat .df { background: var(--gray-bg); border-radius: 6px; padding: 1px 8px; font-family: Consolas, monospace; }
.diff-stat .df.df-add { background: var(--green-bg); }
.diff-stat .df.df-del { background: var(--red-bg); }
.diffbox { margin: 0; background: #f6f7f9; border: 1px solid var(--border); padding: 10px; border-radius: 8px; font: 12px/1.5 Consolas, monospace; white-space: pre; word-break: break-all; max-height: 56vh; overflow: auto; }
.diff-line { white-space: pre; }
.diff-line.diff-add { background: var(--green-bg); color: var(--green); }
.diff-line.diff-del { background: var(--red-bg); color: var(--red); }
.diff-line.diff-hunk { color: var(--blue); background: #eef3f8; }
/* ---------- 文件编辑(网页端) ---------- */
.file-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.file-current { font-size: 12px; color: var(--muted); font-family: Consolas, monospace; }
.file-body { display: flex; gap: 14px; align-items: stretch; min-height: 420px; }
.file-list { flex: none; width: 280px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; max-height: 56vh; }
.file-list:empty::after { content: '(无文件)'; color: var(--muted); font-size: 12px; padding: 4px; }
.file-item { padding: 4px 8px; border-radius: 6px; font-size: 12.5px; font-family: Consolas, monospace; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item:hover { background: #f0f3f6; }
.file-edit-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.file-editor { flex: 1; min-height: 360px; width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 10px; font: 12.5px/1.55 Consolas, monospace; color: var(--text); background: #fff; white-space: pre; overflow: auto; }
.file-editor:disabled { background: #f6f7f9; color: var(--muted); }
.file-actions { display: flex; gap: 8px; align-items: center; }
.file-msg { flex: 1; }
@media (max-width: 760px) {
.file-body { flex-direction: column; }
.file-list { width: 100%; max-height: 200px; }
}
/* ---------- 暗色模式 ---------- */
html.dark {
--bg: #16181c; --card: #1e2127; --border: #30363d; --text: #d8dee6; --muted: #8b949e;
--blue: #58a6ff; --green: #7ee787; --green-bg: #12261a; --red: #ff7b72; --red-bg: #2d1618;
--amber: #e3b341; --amber-bg: #2b2313; --gray-bg: #24272e;
}
html.dark header { background: var(--card); }
html.dark .btn { background: var(--card); }
html.dark .btn:hover { background: var(--gray-bg); border-color: #4b535d; }
html.dark .btn-sm { background: var(--card); color: var(--text); }
html.dark .btn-danger { background: var(--card); }
html.dark .btn-primary { background: var(--blue); border-color: var(--blue); color: #0d1117; }
html.dark .btn-primary:hover { background: #3d8bfd; border-color: #3d8bfd; }
html.dark .logbox,
html.dark .conflict-file pre,
html.dark .commit-diff,
html.dark .diffbox,
html.dark .file-editor:disabled { background: #12151a; }
html.dark .commit-head:hover { background: var(--gray-bg); }
html.dark .diff-line.diff-hunk { background: #17242f; }
html.dark input, html.dark select, html.dark textarea { background: #12151a; }
html.dark .file-list { background: var(--card); }
html.dark .file-item:hover { background: var(--gray-bg); }
html.dark .file-editor { background: #12151a; }
/* ---------- 日志过滤 ---------- */
.log-tools { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.log-tools label { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.log-search { flex: 1; min-width: 140px; }
/* ---------- 差异:单文件过滤提示 ---------- */
.diff-filter { font-size: 12px; color: var(--amber); background: var(--amber-bg); border-radius: 6px; padding: 2px 8px; }
.diff-filter[hidden] { display: none; }
/* ---------- 文件编辑:草稿提示与状态徽标 ---------- */
.file-draft { font-size: 12px; color: var(--amber); background: var(--amber-bg); border-radius: 6px; padding: 2px 8px; }
.file-draft[hidden] { display: none; }
.file-item { display: flex; align-items: center; gap: 6px; }
.file-item .fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.fi-status { flex: none; font-size: 11px; padding: 0 5px; border-radius: 4px; background: var(--gray-bg); color: var(--muted); }
.fi-status.s-M { background: var(--amber-bg); color: var(--amber); }
.fi-status.s-A { background: var(--green-bg); color: var(--green); }
.fi-status.s-D { background: var(--red-bg); color: var(--red); }
.fi-status.s-Q { background: var(--gray-bg); color: var(--muted); }
/* ---------- 卡片:久未同步 ---------- */
.badge.b-stale { background: var(--amber-bg); color: var(--amber); }
/* ---------- 配置:cron 下次执行预览 ---------- */
.cron-next { font-size: 12px; color: var(--muted); min-height: 16px; }
.cron-next.bad { color: var(--red); }
.cron-next.good { color: var(--green); }