AIClient-2-API/static/components/section-guide.css
hex2077 9d383fec26 feat: 添加模型管理功能和使用指南页面
新增模型管理功能,包括模型列表展示、复制功能和样式
添加使用指南和配置教程页面,包含操作流程图和客户端配置说明
更新侧边栏导航和组件加载器以支持新页面
2026-01-15 17:33:36 +08:00

913 lines
No EOL
18 KiB
CSS

/* Guide Section Styles */
/* 操作流程图样式 */
.process-flow {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: center;
gap: 0.5rem;
padding: 1.5rem 0;
}
.flow-step {
display: flex;
flex-direction: column;
align-items: center;
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 1.25rem;
width: 200px;
min-height: 200px;
transition: all 0.3s ease;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.flow-step:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
border-color: var(--primary-color);
}
.step-number {
width: 40px;
height: 40px;
background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
color: white;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
font-weight: 700;
margin-bottom: 1rem;
box-shadow: 0 4px 12px rgba(var(--primary-rgb, 59, 130, 246), 0.3);
}
.step-content {
text-align: center;
flex: 1;
}
.step-content h4 {
font-size: 0.95rem;
font-weight: 600;
color: var(--text-primary);
margin: 0 0 0.5rem 0;
}
.step-content p {
font-size: 0.8rem;
color: var(--text-secondary);
margin: 0 0 0.75rem 0;
line-height: 1.4;
}
.step-content ul {
list-style: none;
padding: 0;
margin: 0;
text-align: left;
}
.step-content ul li {
font-size: 0.75rem;
color: var(--text-secondary);
padding: 0.25rem 0;
padding-left: 1rem;
position: relative;
}
.step-content ul li::before {
content: "•";
position: absolute;
left: 0;
color: var(--primary-color);
font-weight: bold;
}
.step-content ul li code {
font-size: 0.7rem;
background: var(--bg-tertiary);
padding: 0.1rem 0.3rem;
border-radius: 3px;
}
/* 并行分支样式 */
.flow-step-branch {
width: 280px;
}
.branch-options {
display: flex;
flex-direction: column;
gap: 0.75rem;
margin-top: 0.5rem;
}
.branch-option {
background: var(--bg-tertiary);
padding: 0.75rem;
border-radius: 8px;
border: 1px solid var(--border-color);
}
.branch-label {
font-size: 0.8rem;
font-weight: 600;
color: var(--primary-color);
margin-bottom: 0.5rem;
}
.branch-divider {
text-align: center;
font-size: 0.75rem;
color: var(--text-muted);
font-weight: 500;
position: relative;
}
.branch-divider::before,
.branch-divider::after {
content: "";
position: absolute;
top: 50%;
width: 40%;
height: 1px;
background: var(--border-color);
}
.branch-divider::before {
left: 0;
}
.branch-divider::after {
right: 0;
}
.branch-option ul {
margin: 0;
}
.branch-option ul li {
font-size: 0.7rem;
padding: 0.15rem 0;
}
.flow-arrow {
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
color: var(--primary-color);
font-weight: bold;
padding: 0 0.25rem;
margin-top: 80px;
}
/* 响应式流程图 */
@media (max-width: 1200px) {
.process-flow {
gap: 0.75rem;
}
.flow-step {
width: 180px;
min-height: 180px;
padding: 1rem;
}
.flow-arrow {
font-size: 1.25rem;
margin-top: 70px;
}
}
@media (max-width: 992px) {
.process-flow {
flex-direction: column;
align-items: center;
}
.flow-step {
width: 100%;
max-width: 400px;
min-height: auto;
flex-direction: row;
gap: 1rem;
}
.step-number {
margin-bottom: 0;
flex-shrink: 0;
}
.step-content {
text-align: left;
}
.flow-arrow {
transform: rotate(90deg);
margin-top: 0;
padding: 0.5rem 0;
}
}
/* Guide Panel */
.guide-panel {
background: var(--bg-primary);
padding: 1.5rem;
border-radius: var(--radius-lg);
box-shadow: var(--shadow-md);
margin-bottom: 1.5rem;
border: 1px solid var(--border-color);
}
.guide-panel h3 {
font-size: 1.25rem;
font-weight: 600;
color: var(--text-primary);
margin: 0 0 1rem 0;
display: flex;
align-items: center;
gap: 0.5rem;
}
.guide-panel h3 i {
color: var(--primary-color);
}
.guide-content {
color: var(--text-secondary);
line-height: 1.6;
}
.guide-content > p {
margin-bottom: 1.5rem;
}
/* Feature Grid */
.feature-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 1rem;
margin-top: 1rem;
}
.feature-card {
background: var(--bg-secondary);
padding: 1.25rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
transition: var(--transition);
}
.feature-card:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
border-color: var(--primary-30);
}
.feature-icon {
width: 48px;
height: 48px;
border-radius: var(--radius-md);
display: flex;
align-items: center;
justify-content: center;
font-size: 1.25rem;
color: var(--primary-color);
background: var(--primary-10);
margin-bottom: 0.75rem;
}
.feature-card h4 {
font-size: 1rem;
font-weight: 600;
color: var(--text-primary);
margin: 0 0 0.5rem 0;
}
.feature-card p {
font-size: 0.875rem;
color: var(--text-secondary);
margin: 0;
}
/* Provider List */
.provider-list {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1rem;
}
.provider-item {
background: var(--bg-secondary);
padding: 1rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
transition: var(--transition);
}
.provider-item:hover {
border-color: var(--primary-30);
box-shadow: var(--shadow-sm);
}
.provider-header {
display: flex;
align-items: center;
gap: 0.5rem;
margin-bottom: 0.5rem;
flex-wrap: wrap;
}
.provider-icon {
font-size: 1.25rem;
}
.provider-icon.gemini { color: #4285f4; }
.provider-icon.antigravity { color: #ea4335; }
.provider-icon.kiro { color: #9b59b6; }
.provider-icon.qwen { color: #ff6a00; }
.provider-icon.claude { color: #d97706; }
.provider-icon.openai { color: #10a37f; }
.provider-icon.iflow { color: #3b82f6; }
.provider-icon.orchids { color: #22c55e; }
.provider-name {
font-weight: 600;
color: var(--text-primary);
}
.provider-badge {
font-size: 0.7rem;
padding: 0.15rem 0.5rem;
border-radius: 9999px;
font-weight: 500;
}
.provider-badge.oauth {
background: var(--primary-10);
color: var(--primary-color);
}
.provider-badge.experimental {
background: var(--warning-bg);
color: var(--warning-text);
}
.provider-badge.free {
background: var(--success-bg);
color: var(--success-text);
}
.provider-badge.official {
background: var(--info-bg);
color: var(--info-text);
}
.provider-desc {
font-size: 0.875rem;
color: var(--text-secondary);
margin: 0;
}
/* Client Config List */
.client-config-list {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.client-config-item {
background: var(--bg-secondary);
padding: 1.25rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
}
.client-config-item h4 {
font-size: 1rem;
font-weight: 600;
color: var(--text-primary);
margin: 0 0 1rem 0;
display: flex;
align-items: center;
gap: 0.5rem;
}
.client-config-item h4 i {
color: var(--primary-color);
}
.config-steps ol {
margin: 0;
padding-left: 1.5rem;
}
.config-steps ol li {
margin-bottom: 0.5rem;
color: var(--text-secondary);
}
.config-steps ol li:last-child {
margin-bottom: 0;
}
.config-steps code {
background: var(--bg-tertiary);
padding: 0.15rem 0.4rem;
border-radius: var(--radius-sm);
font-size: 0.85rem;
color: var(--primary-color);
}
.config-steps pre {
background: var(--bg-tertiary);
padding: 1rem;
border-radius: var(--radius-md);
overflow-x: auto;
margin: 0;
}
.config-steps pre code {
background: none;
padding: 0;
font-size: 0.8rem;
color: var(--text-primary);
white-space: pre;
}
/* Guide Note */
.guide-note {
display: flex;
align-items: flex-start;
gap: 0.75rem;
background: var(--info-bg);
padding: 1rem;
border-radius: var(--radius-md);
margin-top: 1rem;
border: 1px solid var(--info-border);
}
.guide-note i {
color: var(--info-text);
font-size: 1rem;
margin-top: 0.1rem;
}
.guide-note span {
color: var(--info-text);
font-size: 0.875rem;
line-height: 1.5;
}
/* API Example */
.api-example {
background: var(--bg-secondary);
padding: 1rem;
border-radius: var(--radius-md);
margin-bottom: 1rem;
border: 1px solid var(--border-color);
}
.api-example h4 {
font-size: 0.9rem;
font-weight: 600;
color: var(--text-primary);
margin: 0 0 0.75rem 0;
}
.api-example pre {
background: var(--bg-tertiary);
padding: 1rem;
border-radius: var(--radius-md);
overflow-x: auto;
margin: 0;
}
.api-example pre code {
font-size: 0.8rem;
color: var(--text-primary);
white-space: pre;
}
/* Model Prefix List */
.model-prefix-list {
background: var(--bg-secondary);
padding: 1rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
}
.model-prefix-list h4 {
font-size: 0.9rem;
font-weight: 600;
color: var(--text-primary);
margin: 0 0 0.75rem 0;
}
.model-prefix-list ul {
margin: 0;
padding-left: 1.5rem;
}
.model-prefix-list ul li {
margin-bottom: 0.5rem;
color: var(--text-secondary);
}
.model-prefix-list ul li:last-child {
margin-bottom: 0;
}
.model-prefix-list code {
background: var(--bg-tertiary);
padding: 0.15rem 0.4rem;
border-radius: var(--radius-sm);
font-size: 0.85rem;
color: var(--primary-color);
font-weight: 600;
}
/* FAQ List */
.faq-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
.faq-item {
background: var(--bg-secondary);
padding: 1rem;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
}
.faq-question {
font-weight: 600;
color: var(--text-primary);
margin-bottom: 0.5rem;
}
.faq-answer {
color: var(--text-secondary);
font-size: 0.9rem;
line-height: 1.6;
}
/* Responsive */
@media (max-width: 768px) {
.feature-grid {
grid-template-columns: 1fr;
}
.provider-list {
grid-template-columns: 1fr;
}
.guide-panel {
padding: 1rem;
}
}
/* Dark Theme */
[data-theme="dark"] .guide-panel {
background: var(--bg-primary);
}
[data-theme="dark"] .feature-card,
[data-theme="dark"] .provider-item,
[data-theme="dark"] .client-config-item,
[data-theme="dark"] .api-example,
[data-theme="dark"] .model-prefix-list,
[data-theme="dark"] .faq-item {
background: var(--bg-secondary);
}
[data-theme="dark"] .config-steps pre,
[data-theme="dark"] .api-example pre {
background: var(--bg-tertiary);
}
/* ========================================
可用模型列表样式 (从 section-models.css 合并)
======================================== */
/* 模型描述区域 */
.models-description {
margin-bottom: 1.5rem;
}
/* 模型容器 */
.models-container {
background: var(--bg-secondary);
padding: 1.25rem;
border-radius: var(--radius-lg);
border: 1px solid var(--border-color);
}
.models-list {
display: flex;
flex-direction: column;
gap: 1.25rem;
}
/* 加载状态 */
.models-loading {
display: flex;
align-items: center;
justify-content: center;
gap: 0.75rem;
padding: 2.5rem;
color: var(--text-secondary);
font-size: 1rem;
}
.models-loading i {
font-size: 1.25rem;
color: var(--primary-color);
}
/* 提供商模型组 */
.provider-models-group {
border: 1px solid var(--border-color);
border-radius: var(--radius-lg);
overflow: hidden;
transition: var(--transition);
background: var(--bg-primary);
}
.provider-models-group:hover {
border-color: var(--primary-color);
box-shadow: var(--shadow-md);
}
/* 提供商标题 */
.provider-models-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.875rem 1.25rem;
background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
border-bottom: 1px solid var(--border-color);
cursor: pointer;
transition: var(--transition);
}
.provider-models-header:hover {
background: linear-gradient(135deg, var(--primary-10) 0%, var(--bg-tertiary) 100%);
}
.provider-models-title {
display: flex;
align-items: center;
gap: 0.75rem;
}
.provider-models-title i {
font-size: 1.125rem;
color: var(--primary-color);
}
.provider-models-title h3 {
margin: 0;
font-size: 1rem;
font-weight: 600;
color: var(--text-primary);
}
.provider-models-count {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 1.5rem;
height: 1.5rem;
padding: 0 0.4rem;
background: var(--primary-color);
color: white;
border-radius: 9999px;
font-size: 0.7rem;
font-weight: 600;
}
.provider-models-toggle {
color: var(--text-secondary);
transition: var(--transition);
}
.provider-models-header.collapsed .provider-models-toggle {
transform: rotate(-90deg);
}
/* 模型列表内容 */
.provider-models-content {
padding: 0.875rem 1.25rem;
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 0.625rem;
}
.provider-models-content.collapsed {
display: none;
}
/* 单个模型项 */
.model-item {
display: flex;
align-items: center;
gap: 0.625rem;
padding: 0.625rem 0.875rem;
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
cursor: pointer;
transition: var(--transition);
position: relative;
overflow: hidden;
}
.model-item:hover {
border-color: var(--primary-color);
background: var(--primary-10);
transform: translateY(-2px);
box-shadow: var(--shadow-sm);
}
.model-item:active {
transform: translateY(0);
}
.model-item-icon {
display: flex;
align-items: center;
justify-content: center;
width: 1.75rem;
height: 1.75rem;
background: var(--primary-10);
border-radius: var(--radius-sm);
color: var(--primary-color);
flex-shrink: 0;
font-size: 0.75rem;
}
.model-item-name {
flex: 1;
font-size: 0.8rem;
font-weight: 500;
color: var(--text-primary);
word-break: break-all;
}
.model-item-copy {
display: flex;
align-items: center;
justify-content: center;
width: 1.25rem;
height: 1.25rem;
color: var(--text-tertiary);
opacity: 0;
transition: var(--transition);
font-size: 0.75rem;
}
.model-item:hover .model-item-copy {
opacity: 1;
color: var(--primary-color);
}
/* 复制成功动画 */
.model-item.copied {
border-color: var(--success-color);
background: var(--success-10);
}
.model-item.copied .model-item-copy {
opacity: 1;
color: var(--success-color);
}
.model-item.copied::after {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--success-color);
opacity: 0.1;
animation: copyFlash 0.3s ease-out;
}
@keyframes copyFlash {
0% {
opacity: 0.3;
}
100% {
opacity: 0;
}
}
/* 空状态 */
.models-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 2.5rem;
color: var(--text-secondary);
text-align: center;
}
.models-empty i {
font-size: 2.5rem;
margin-bottom: 0.75rem;
opacity: 0.5;
}
.models-empty p {
margin: 0;
font-size: 0.9rem;
}
/* 高亮说明样式 */
.models-description .highlight-note {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.875rem 1rem;
background: linear-gradient(135deg, var(--info-bg) 0%, var(--info-bg-light, var(--info-bg)) 100%);
border: 1px solid var(--info-border);
border-radius: 0.5rem;
color: var(--info-text);
font-weight: 500;
width: 100%;
box-sizing: border-box;
font-size: 0.875rem;
}
.models-description .highlight-note i {
color: var(--info-color, var(--info-text));
font-size: 1.125rem;
flex-shrink: 0;
}
.models-description .highlight-note span {
flex: 1;
text-align: center;
}
/* 模型列表响应式 */
@media (max-width: 768px) {
.provider-models-content {
grid-template-columns: 1fr;
}
.provider-models-header {
padding: 0.75rem 1rem;
}
.provider-models-title h3 {
font-size: 0.9rem;
}
.model-item {
padding: 0.5rem 0.75rem;
}
}
/* 模型列表暗黑主题 */
[data-theme="dark"] .provider-models-group {
background: var(--bg-primary);
border-color: var(--border-color);
}
[data-theme="dark"] .provider-models-header {
background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}
[data-theme="dark"] .provider-models-header:hover {
background: linear-gradient(135deg, var(--primary-10) 0%, var(--bg-tertiary) 100%);
}
[data-theme="dark"] .model-item {
background: var(--bg-secondary);
border-color: var(--border-color);
}
[data-theme="dark"] .model-item:hover {
background: var(--primary-10);
border-color: var(--primary-color);
}
[data-theme="dark"] .models-description .highlight-note {
background: linear-gradient(135deg, var(--info-bg) 0%, var(--info-bg-light, var(--info-bg)) 100%);
border-color: var(--info-border);
color: var(--info-text);
}
[data-theme="dark"] .models-container {
background: var(--bg-secondary);
}