Files
vision-tool/web/css/style.css
Geliebte f9cdeb5d64 feat: 认证简化为固定进入密钥 + 页面增强(API 文档/主题切换/版权署名)
- 移除管理员初始化/登录/JWT 流程,改为固定进入密钥(19735500),
  首次启动自动初始化到数据库 settings 表(可改库更新)
- analyze 接口支持可选密钥鉴权:X-Access-Key 请求头或 access_key 字段,
  带密钥强制校验(错误 401),不带密钥保持免鉴权
- 解锁后顶栏"复制 API 文档"按钮:以当前访问 URL 为基础地址动态生成
  Markdown 文档(免鉴权/带密钥两种 curl 示例,供智能体直接调用)
- 白昼/黑夜主题切换:CSS 变量驱动,localStorage 持久化,默认跟随系统
- 修复 hidden 属性被 display:flex 覆盖导致解锁层无法隐藏的问题
- 页面去除"免费/Agnes"文案,页脚署名青梧映星软件开发工作室
- build.bat/build.sh 简化为 Linux 交叉编译(CGO_ENABLED=0)
- 依赖精简:移除 golang-jwt/bcrypt,直接依赖仅 gin/sqlite/gorm/yaml

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-13 01:21:18 +08:00

249 lines
6.2 KiB
CSS

/* ===== 基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* 保证 hidden 属性始终生效(防止被 display:flex 等样式覆盖) */
[hidden] { display: none !important; }
:root {
--primary: #4f6ef7;
--primary-dark: #3a55d8;
--bg: #f4f6fb;
--card: #ffffff;
--text: #1f2430;
--text-light: #6b7280;
--border: #e5e9f2;
--danger: #e5484d;
--radius: 12px;
/* 组件级颜色 */
--chip-bg: #eef1fe;
--dropzone-border: #c7d2fe;
--dropzone-bg: #fafbff;
--dropzone-hover: #eef1fe;
--result-bg: #f8f9fc;
--unlock-bg-1: #eef1fe;
--unlock-bg-2: #f4f6fb;
}
/* 黑夜模式 */
[data-theme="dark"] {
--primary: #6d8bff;
--primary-dark: #8aa4ff;
--bg: #0f1524;
--card: #1a2234;
--text: #e6e9f0;
--text-light: #9aa3b5;
--border: #2b3548;
--chip-bg: rgba(109, 139, 255, .18);
--dropzone-border: #3a4760;
--dropzone-bg: #141c2e;
--dropzone-hover: #1e2a42;
--result-bg: #121a2b;
--unlock-bg-1: #0f1524;
--unlock-bg-2: #1a2234;
}
body {
font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
}
/* ===== 顶栏 ===== */
.topbar {
background: var(--card);
border-bottom: 1px solid var(--border);
padding: 14px 28px;
display: flex;
align-items: center;
justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { font-size: 30px; }
.brand h1 { font-size: 20px; font-weight: 700; }
.brand p { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.account { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.account .user-chip {
background: var(--chip-bg);
color: var(--primary);
padding: 6px 12px;
border-radius: 999px;
font-weight: 600;
}
/* 顶栏常驻于解锁层之上,主题切换随时可用 */
.topbar { position: relative; z-index: 150; }
/* ===== 布局 ===== */
.container {
flex: 1;
width: 100%;
max-width: 860px;
margin: 0 auto;
padding: 28px 20px;
display: flex;
flex-direction: column;
gap: 20px;
}
.card {
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 22px;
box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
}
/* ===== 上传区 ===== */
.dropzone {
border: 2px dashed var(--dropzone-border);
border-radius: var(--radius);
padding: 40px 20px;
text-align: center;
cursor: pointer;
transition: all .15s ease;
background: var(--dropzone-bg);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--dropzone-hover); }
.dropzone-icon { font-size: 40px; }
.dropzone-title { margin-top: 10px; font-weight: 600; font-size: 15px; }
.dropzone-hint { margin-top: 6px; font-size: 12px; color: var(--text-light); }
.preview-list {
display: flex;
flex-wrap: wrap;
gap: 12px;
margin-top: 16px;
}
.preview-item {
position: relative;
width: 96px;
height: 96px;
border-radius: 10px;
overflow: hidden;
border: 1px solid var(--border);
}
.preview-item img { width: 100%; height: 100%; object-fit: cover; }
.preview-item .remove {
position: absolute;
top: 4px;
right: 4px;
width: 20px;
height: 20px;
border-radius: 50%;
background: rgba(0, 0, 0, .55);
color: #fff;
font-size: 12px;
line-height: 20px;
text-align: center;
cursor: pointer;
border: none;
}
.preview-item .remove:hover { background: var(--danger); }
/* ===== 提问与按钮 ===== */
.prompt-row { display: flex; gap: 12px; margin-top: 18px; }
.prompt-input {
flex: 1;
padding: 12px 14px;
border: 1px solid var(--border);
border-radius: 10px;
font-size: 14px;
outline: none;
transition: border-color .15s;
}
.prompt-input:focus { border-color: var(--primary); }
.btn {
border: none;
border-radius: 10px;
padding: 12px 22px;
font-size: 14px;
font-weight: 600;
cursor: pointer;
transition: all .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-light); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-block { width: 100%; margin-top: 6px; }
/* ===== 结果区 ===== */
.result-head { display: flex; align-items: center; justify-content: space-between; }
.result-head h2 { font-size: 16px; }
.result-body {
margin-top: 14px;
background: var(--result-bg);
border: 1px solid var(--border);
border-radius: 10px;
padding: 16px;
font-size: 14px;
line-height: 1.7;
white-space: pre-wrap;
word-break: break-word;
max-height: 480px;
overflow-y: auto;
}
.result-meta { margin-top: 10px; font-size: 12px; color: var(--text-light); }
/* ===== 加载态 ===== */
.loading { display: inline-flex; align-items: center; gap: 10px; }
.spinner {
width: 18px; height: 18px;
border: 2px solid var(--border);
border-top-color: var(--primary);
border-radius: 50%;
animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ===== 进入密钥解锁层 ===== */
.unlock-mask {
position: fixed;
inset: 0;
background: linear-gradient(135deg, var(--unlock-bg-1), var(--unlock-bg-2));
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
}
.unlock-card {
background: var(--card);
border: 1px solid var(--border);
border-radius: 16px;
padding: 36px 32px;
width: 360px;
text-align: center;
box-shadow: 0 20px 60px rgba(16, 24, 40, .12);
}
.unlock-icon { font-size: 42px; }
.unlock-card h2 { font-size: 20px; margin-top: 10px; }
.unlock-desc { font-size: 13px; color: var(--text-light); margin: 6px 0 18px; }
.unlock-input {
width: 100%;
padding: 12px 14px;
margin-bottom: 10px;
border: 1px solid var(--border);
border-radius: 10px;
font-size: 16px;
letter-spacing: 2px;
text-align: center;
outline: none;
}
.unlock-input:focus { border-color: var(--primary); }
.modal-error { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 4px; }
/* ===== 页脚 ===== */
.footer {
text-align: center;
padding: 18px;
font-size: 12px;
color: var(--text-light);
}