someone-oa/pc/unified-layout.css
2025-12-11 18:08:46 +08:00

521 lines
9.9 KiB
CSS

/* 统一布局样式 - 修复所有布局错乱问题 */
/* ========== 全局布局 ========== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
background: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
color: #303133;
overflow: hidden;
height: 100vh;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* ========== 布局容器 ========== */
.layout-container {
height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ========== 导航栏(统一) ========== */
.navbar {
height: 60px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-bottom: none;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
position: relative;
z-index: 1000;
flex-shrink: 0;
}
.navbar::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}
.navbar > * {
position: relative;
z-index: 1;
}
.navbar-left {
display: flex;
align-items: center;
gap: 20px;
}
.logo {
font-size: 22px;
font-weight: 700;
color: #ffffff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
letter-spacing: 0.5px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.logo:hover {
transform: scale(1.05);
text-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.nav-menu {
display: flex;
gap: 4px;
}
.nav-item {
padding: 10px 18px;
cursor: pointer;
border-radius: 8px;
color: rgba(255, 255, 255, 0.9);
font-size: 14px;
font-weight: 500;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
}
.nav-item::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.1);
transition: left 0.3s;
}
.nav-item:hover::before {
left: 0;
}
.nav-item:hover {
color: #ffffff;
background: rgba(255, 255, 255, 0.15);
transform: translateY(-1px);
}
.nav-item.active {
background: rgba(255, 255, 255, 0.25);
color: #ffffff;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
font-weight: 600;
}
.navbar-right {
display: flex;
align-items: center;
gap: 16px;
font-size: 14px;
color: rgba(255, 255, 255, 0.9);
}
.navbar-right a {
color: rgba(255, 255, 255, 0.9);
text-decoration: none;
transition: all 0.3s;
}
.navbar-right a:hover {
color: #ffffff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
/* ========== 主容器(统一) ========== */
.main-container {
flex: 1;
display: flex;
overflow: hidden;
min-height: 0;
}
.app-main {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
background: #f0f2f5;
min-width: 0;
}
/* ========== 侧边栏菜单(统一) ========== */
.sidebar {
width: 220px;
background: #ffffff;
border-right: 1px solid #e4e7ed;
overflow-y: auto;
overflow-x: hidden;
flex-shrink: 0;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.04);
}
.sidebar::-webkit-scrollbar {
width: 6px;
}
.sidebar::-webkit-scrollbar-thumb {
background: #dcdfe6;
border-radius: 3px;
}
.menu-item {
padding: 14px 24px;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
border-left: 3px solid transparent;
color: #606266;
font-size: 14px;
position: relative;
display: flex;
align-items: center;
min-height: 48px;
}
.menu-item::before {
content: '';
position: absolute;
left: 0;
top: 0;
bottom: 0;
width: 3px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
transform: scaleY(0);
transition: transform 0.3s;
}
.menu-item:hover {
background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.05) 100%);
color: #667eea;
padding-left: 28px;
}
.menu-item:hover::before {
transform: scaleY(1);
}
.menu-item.active {
background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.08) 100%);
color: #667eea;
font-weight: 600;
border-left-color: #667eea;
}
.menu-item.active::before {
transform: scaleY(1);
}
/* ========== 内容区域(统一) ========== */
.content {
flex: 1;
padding: 24px;
overflow-y: auto;
overflow-x: hidden;
background: #ffffff;
margin: 16px;
border-radius: 12px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
min-width: 0;
}
.content::-webkit-scrollbar {
width: 8px;
}
.content::-webkit-scrollbar-thumb {
background: #dcdfe6;
border-radius: 4px;
}
.content::-webkit-scrollbar-thumb:hover {
background: #c0c4cc;
}
/* ========== 页面标题(统一) ========== */
.page-header {
margin-bottom: 24px;
padding-bottom: 16px;
border-bottom: 2px solid #f0f0f0;
display: flex;
justify-content: space-between;
align-items: center;
}
.page-title {
font-size: 24px;
font-weight: 700;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: -0.5px;
margin: 0;
}
.page-desc {
font-size: 14px;
color: #909399;
margin-top: 4px;
}
/* ========== 搜索表单(统一) ========== */
.search-form {
background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
padding: 20px;
border-radius: 12px;
margin-bottom: 20px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
border: 1px solid #ebeef5;
}
.form-row {
display: flex;
gap: 16px;
margin-bottom: 12px;
align-items: flex-end;
}
.form-row:last-child {
margin-bottom: 0;
}
.form-item {
flex: 1;
min-width: 0;
}
.form-label {
display: block;
margin-bottom: 8px;
color: #606266;
font-size: 14px;
font-weight: 500;
}
.form-input,
.form-select,
.form-textarea {
width: 100%;
padding: 10px 14px;
border: 1px solid #dcdfe6;
border-radius: 8px;
font-size: 14px;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
background: #ffffff;
color: #606266;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-textarea {
resize: vertical;
min-height: 80px;
}
/* ========== 按钮(统一) ========== */
.btn {
padding: 10px 20px;
border: none;
border-radius: 8px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
position: relative;
overflow: hidden;
white-space: nowrap;
}
.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: #ffffff;
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.btn-primary:hover {
box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
transform: translateY(-2px);
}
.btn-primary:active {
transform: translateY(0);
}
.btn-default {
background: #ffffff;
color: #606266;
border: 1px solid #dcdfe6;
}
.btn-default:hover {
border-color: #667eea;
color: #667eea;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
transform: translateY(-1px);
}
.btn-danger {
background: linear-gradient(135deg, #f56c6c 0%, #e85a5a 100%);
color: #ffffff;
box-shadow: 0 4px 12px rgba(245, 108, 108, 0.4);
}
.btn-danger:hover {
box-shadow: 0 6px 16px rgba(245, 108, 108, 0.5);
transform: translateY(-2px);
}
/* ========== 表格(统一) ========== */
.table-container {
background: #ffffff;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
overflow: hidden;
}
table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
}
th {
background: linear-gradient(135deg, #f8f9fa 0%, #f0f2f5 100%);
color: #303133;
font-weight: 600;
font-size: 14px;
padding: 16px;
text-align: left;
border-bottom: 2px solid #e4e7ed;
position: sticky;
top: 0;
z-index: 10;
}
td {
padding: 16px;
border-bottom: 1px solid #f0f0f0;
color: #606266;
font-size: 14px;
transition: background 0.2s;
}
tr {
transition: background 0.2s;
}
tr:hover {
background: #f5f7fa;
}
tr:last-child td {
border-bottom: none;
}
/* ========== 状态标签(统一) ========== */
.status-badge {
padding: 4px 12px;
border-radius: 12px;
font-size: 12px;
font-weight: 500;
display: inline-block;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}
.status-contract,
.status-published {
background: linear-gradient(135deg, #f6ffed 0%, #d9f7be 100%);
color: #52c41a;
}
.status-draft {
background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
color: #d46b08;
}
/* ========== 操作链接(统一) ========== */
.action-link {
color: #667eea;
cursor: pointer;
margin-right: 16px;
font-size: 14px;
transition: all 0.3s;
position: relative;
padding-bottom: 2px;
text-decoration: none;
}
.action-link::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background: #667eea;
transition: width 0.3s;
}
.action-link:hover {
color: #764ba2;
}
.action-link:hover::after {
width: 100%;
}
.action-link.danger {
color: #f56c6c;
}
.action-link.danger::after {
background: #f56c6c;
}
/* ========== 响应式 ========== */
@media (max-width: 768px) {
.sidebar {
width: 180px;
}
.content {
margin: 12px;
padding: 16px;
}
.navbar {
padding: 0 16px;
}
.nav-menu {
display: none;
}
}