config_center/app/static/css/style.css
guyue55 e71d485629 1. 去除重复的pages.py
2. 编辑和删除操作增加鼠标悬停提示
3. 搜索栏布局的优化工作:

- 调整了搜索框容器的宽度和间距
- 优化了搜索框组件的弹性布局
- 设置了下拉框和按钮的最小宽度
- 改进了按钮的对齐方式和间距
- 优化了移动端的响应式布局
2025-03-04 13:23:43 +08:00

687 lines
11 KiB
CSS

:root {
--primary-color: #1976d2;
--primary-light: #63a4ff;
--primary-dark: #004ba0;
--secondary-color: #f5f5f5;
--text-color: #333;
--text-light: #666;
--border-color: #e0e0e0;
--success-color: #4caf50;
--warning-color: #ff9800;
--danger-color: #f44336;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: #f9f9f9;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}
/* 导航栏样式 */
.navbar {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 2rem;
background-color: var(--primary-color);
color: white;
}
.nav-brand {
display: flex;
align-items: center;
}
.brand-link {
color: white;
text-decoration: none;
font-size: 1.5rem;
font-weight: bold;
}
.nav-menu {
display: flex;
align-items: center;
}
.nav-links {
display: flex;
list-style: none;
margin: 0;
padding: 0;
gap: 2rem;
}
.nav-link {
color: white;
text-decoration: none;
font-weight: 500;
transition: color 0.3s;
}
.nav-link:hover {
color: rgba(255, 255, 255, 0.8);
}
.nav-toggle {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
}
.hamburger {
display: block;
width: 24px;
height: 2px;
background-color: white;
position: relative;
transition: background-color 0.3s;
}
.hamburger::before,
.hamburger::after {
content: '';
position: absolute;
width: 24px;
height: 2px;
background-color: white;
transition: transform 0.3s;
}
.hamburger::before {
top: -6px;
}
.hamburger::after {
bottom: -6px;
}
/* 移动端适配 */
@media (max-width: 768px) {
.nav-menu {
display: none;
width: 100%;
position: absolute;
top: 100%;
left: 0;
background-color: var(--primary-color);
padding: 1rem;
}
.nav-menu.active {
display: block;
}
.nav-links {
flex-direction: column;
gap: 1rem;
}
.nav-toggle {
display: block;
}
.nav-toggle.active .hamburger {
background-color: transparent;
}
.nav-toggle.active .hamburger::before {
transform: rotate(45deg) translate(4px, 4px);
}
.nav-toggle.active .hamburger::after {
transform: rotate(-45deg) translate(4px, -4px);
}
}
/* 主内容区域 */
main {
min-height: calc(100vh - 120px);
padding: 2rem 0;
}
/* 卡片样式 */
.card {
background-color: white;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
padding: 2rem;
margin-bottom: 2rem;
transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 2px solid var(--border-color);
}
.card-title {
font-size: 1.5rem;
font-weight: 600;
color: var(--primary-color);
margin: 0;
}
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 1000;
animation: fadeIn 0.3s ease;
}
.modal-content {
background-color: white;
border-radius: 8px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
max-width: 500px;
margin: 2rem auto;
padding: 2rem;
position: relative;
animation: slideIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes slideIn {
from { transform: translateY(-20px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.card-title {
font-size: 1.25rem;
font-weight: 500;
}
/* 表格样式 */
.table-container {
overflow-x: auto;
}
.table-container {
overflow-x: auto;
margin: 1.5rem 0;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
background: white;
}
th, td {
padding: 1rem;
text-align: left;
border: none;
border-bottom: 1px solid var(--border-color);
}
th {
font-weight: 600;
background-color: var(--secondary-color);
color: var(--text-color);
}
tbody tr:hover {
background-color: rgba(99, 164, 255, 0.1);
transition: background-color 0.2s;
}
.btn-group .btn {
position: relative;
}
.btn-group .btn::before {
content: attr(data-tooltip);
position: absolute;
bottom: 100%;
left: 50%;
transform: translateX(-50%);
padding: 4px 8px;
background-color: rgba(0, 0, 0, 0.8);
color: white;
font-size: 12px;
border-radius: 4px;
white-space: nowrap;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s, visibility 0.3s;
z-index: 1000;
}
.btn-group .btn:hover::before {
opacity: 1;
visibility: visible;
}
.btn-group .btn {
border-radius: 4px;
}
.type-link {
color: var(--primary-color);
text-decoration: none;
font-weight: 500;
font-size: 1rem;
position: relative;
transition: color 0.3s ease;
}
.type-link::after {
content: '';
position: absolute;
width: 100%;
height: 2px;
bottom: -2px;
left: 0;
background-color: var(--primary-color);
transform: scaleX(0);
transform-origin: bottom right;
transition: transform 0.3s ease;
}
.type-link:hover {
color: var(--primary-dark);
}
.type-link:hover::after {
transform: scaleX(1);
transform-origin: bottom left;
}
tr:hover {
background-color: rgba(0, 0, 0, 0.02);
}
/* 按钮样式 */
.btn {
display: inline-block;
padding: 0.5rem 1rem;
border-radius: 4px;
font-weight: 500;
text-align: center;
cursor: pointer;
transition: all 0.3s;
border: none;
}
.btn-primary {
background-color: var(--primary-color);
color: white;
}
.btn-primary:hover {
background-color: var(--primary-dark);
}
.btn-secondary {
background-color: var(--secondary-color);
color: var(--text-color);
}
.btn-secondary:hover {
background-color: #e0e0e0;
}
.btn-success {
background-color: var(--success-color);
color: white;
}
.btn-success:hover {
background-color: #3d8b40;
}
.btn-danger {
background-color: var(--danger-color);
color: white;
}
.btn-danger:hover {
background-color: #d32f2f;
}
.btn-sm {
padding: 0.25rem 0.5rem;
font-size: 0.875rem;
}
/* 表单样式 */
.form-group {
margin-bottom: 1rem;
}
.form-label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
}
.form-control {
display: block;
width: 100%;
padding: 0.5rem;
font-size: 1rem;
border: 1px solid var(--border-color);
border-radius: 4px;
transition: border-color 0.3s;
}
.form-control:focus {
border-color: var(--primary-color);
outline: none;
}
/* 搜索框 */
.search-container {
margin-bottom: 1.5rem;
padding: 0;
}
.search-box {
display: flex;
gap: 1rem;
flex-wrap: wrap;
align-items: center;
width: 100%;
}
.search-box select {
min-width: 150px;
max-width: 200px;
}
.search-input {
flex: 1;
min-width: 200px;
}
.search-box .btn {
flex-shrink: 0;
white-space: nowrap;
min-width: 80px;
}
@media (max-width: 768px) {
.search-box {
gap: 0.5rem;
}
.search-box select,
.search-input,
.search-box .btn {
width: 100%;
margin: 0;
}
.search-box select {
max-width: 100%;
}
}
.input-group {
display: flex;
gap: 0.5rem;
align-items: center;
width: 100%;
}
.input-group-text {
display: flex;
align-items: center;
padding: 0.5rem;
background: var(--background-light);
border-radius: 4px;
color: var(--text-light);
}
.search-box select {
min-width: 150px;
max-width: 200px;
border-radius: 4px;
border: 1px solid var(--border-color);
padding: 0.5rem;
background: white;
}
.search-input {
flex: 1;
min-width: 200px;
border-radius: 4px;
border: 1px solid var(--border-color);
padding: 0.5rem;
transition: border-color 0.3s;
}
.search-input:focus {
border-color: var(--primary-color);
outline: none;
}
/* 标签样式 */
.tag {
display: inline-block;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.875rem;
margin-right: 0.5rem;
margin-bottom: 0.5rem;
background-color: var(--primary-light);
color: white;
}
/* 页脚样式 */
footer {
background-color: var(--secondary-color);
padding: 1rem 0;
text-align: center;
color: var(--text-light);
}
/* 响应式设计 */
@media (max-width: 768px) {
nav {
flex-direction: column;
align-items: flex-start;
}
.nav-links {
margin-top: 1rem;
flex-direction: column;
}
.nav-links li {
margin-left: 0;
margin-bottom: 0.5rem;
}
.auth-links {
margin-top: 10px;
}
.card-header {
flex-direction: column;
align-items: flex-start;
}
.card-header button {
margin-top: 10px;
}
.search-box {
flex-direction: column;
}
}
/* 在现有样式的基础上添加以下内容 */
/* 导航栏右侧认证链接样式 */
.auth-links {
display: flex;
align-items: center;
}
.auth-links a, .auth-links button {
color: white;
text-decoration: none;
margin-left: 1rem;
font-weight: 500;
}
.auth-links button {
background: transparent;
border: 1px solid white;
padding: 0.25rem 0.5rem;
border-radius: 4px;
cursor: pointer;
transition: all 0.3s;
}
.auth-links button:hover {
background-color: rgba(255, 255, 255, 0.1);
}
/* 特权模式标识样式 */
.badge {
display: inline-block;
padding: 0.25rem 0.5rem;
font-size: 0.75rem;
font-weight: bold;
border-radius: 10px;
margin-right: 0.5rem;
}
.badge-warning {
background-color: var(--warning-color);
color: white;
}
/* 消息提示样式 */
.message {
position: fixed;
top: 20px;
right: 20px;
padding: 15px;
border-radius: 4px;
color: white;
z-index: 1001;
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.message-info {
background-color: var(--primary-color);
}
.message-success {
background-color: var(--success-color);
}
.message-warning {
background-color: var(--warning-color);
color: white;
}
.message-danger {
background-color: var(--danger-color);
}
/* 警告框样式 */
.alert {
padding: 12px;
margin-bottom: 15px;
border-radius: 4px;
}
.alert-danger {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.alert-success {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
/* 模态框样式 */
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
}
.modal-content {
background-color: white;
margin: 10% auto;
padding: 20px;
border-radius: 4px;
width: 80%;
max-width: 500px;
box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid var(--border-color);
padding-bottom: 10px;
margin-bottom: 15px;
}
.modal-header h2 {
margin: 0;
font-size: 1.25rem;
}
.close {
color: var(--text-light);
font-size: 28px;
font-weight: bold;
cursor: pointer;
}
.close:hover {
color: var(--text-color);
}
/* 响应式设计补充 */
@media (max-width: 768px) {
.auth-links {
margin-top: 1rem;
align-self: flex-start;
}
.auth-links a, .auth-links button {
margin-left: 0;
margin-right: 1rem;
}
}