Files
ocean/ui/css/style.css
T
2026-01-31 00:01:19 +08:00

850 lines
14 KiB
CSS

/* ========== 变量与基础 ========== */
:root {
--sidebar-bg: #0f172a;
--sidebar-text: #e2e8f0;
--sidebar-text-muted: #94a3b8;
--sidebar-accent: #38bdf8;
--sidebar-hover: rgba(56, 189, 248, 0.12);
--main-bg: #f1f5f9;
--card-bg: #ffffff;
--card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
--card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
--border: #e2e8f0;
--border-focus: #38bdf8;
--text: #1e293b;
--text-muted: #64748b;
--primary: #0ea5e9;
--primary-hover: #0284c7;
--primary-light: rgba(14, 165, 233, 0.1);
--success: #10b981;
--danger: #ef4444;
--radius: 10px;
--radius-sm: 6px;
--font-head: "Outfit", "Noto Sans SC", sans-serif;
--font-body: "Noto Sans SC", "Outfit", sans-serif;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
html {
font-size: 16px;
-webkit-font-smoothing: antialiased;
}
body {
margin: 0;
font-family: var(--font-body);
color: var(--text);
background: var(--main-bg);
line-height: 1.5;
}
/* ========== 页面1:登录页 ========== */
.view-login {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 2rem;
background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}
.view-login.hidden {
display: none;
}
.login-card {
width: 100%;
max-width: 400px;
background: var(--card-bg);
border-radius: var(--radius);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
padding: 2rem 2.25rem;
}
.login-brand {
text-align: center;
margin-bottom: 1.75rem;
}
.login-brand .brand-icon {
font-size: 2rem;
color: var(--primary);
display: block;
margin-bottom: 0.5rem;
}
.login-title {
font-family: var(--font-head);
font-weight: 600;
font-size: 1.35rem;
color: var(--text);
margin: 0 0 0.35rem 0;
}
.login-desc {
font-size: 0.875rem;
color: var(--text-muted);
margin: 0;
}
.login-form .form-group {
margin-bottom: 1rem;
}
.login-form .form-group label {
display: block;
font-size: 0.8125rem;
font-weight: 500;
color: var(--text);
margin-bottom: 0.35rem;
}
.login-form .input {
width: 100%;
padding: 0.6rem 0.85rem;
}
.login-error {
font-size: 0.8125rem;
color: var(--danger);
margin-bottom: 1rem;
padding: 0.5rem 0.75rem;
background: rgba(239, 68, 68, 0.08);
border-radius: var(--radius-sm);
}
.btn-login-submit {
width: 100%;
padding: 0.65rem 1rem;
margin-top: 0.25rem;
}
/* ========== 布局 ========== */
.app {
display: flex;
min-height: 100vh;
}
/* ========== 侧栏 ========== */
.sidebar {
width: 240px;
min-width: 240px;
background: var(--sidebar-bg);
color: var(--sidebar-text);
display: flex;
flex-direction: column;
padding: 1.5rem 0;
}
.sidebar-brand {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0 1.25rem 1.5rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
margin-bottom: 1rem;
}
.brand-icon {
font-size: 1.5rem;
color: var(--sidebar-accent);
}
.brand-text {
font-family: var(--font-head);
font-weight: 600;
font-size: 1.05rem;
letter-spacing: 0.02em;
}
.sidebar-nav {
flex: 1;
}
.nav-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.65rem 1.25rem;
color: var(--sidebar-text-muted);
text-decoration: none;
transition: color 0.15s, background 0.15s;
}
.nav-item:hover {
color: var(--sidebar-text);
background: var(--sidebar-hover);
}
.nav-item.active {
color: var(--sidebar-accent);
background: var(--sidebar-hover);
font-weight: 500;
}
.nav-icon {
font-size: 1.1rem;
opacity: 0.9;
}
.sidebar-footer {
padding: 1rem 1.25rem 0;
border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.role-switch {
margin-bottom: 0.75rem;
}
.role-label {
display: block;
font-size: 0.75rem;
color: var(--sidebar-text-muted);
margin-bottom: 0.35rem;
}
.role-select {
width: 100%;
padding: 0.5rem 0.6rem;
background: rgba(0, 0, 0, 0.2);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: var(--radius-sm);
color: var(--sidebar-text);
font-size: 0.875rem;
cursor: pointer;
}
.role-select:focus {
outline: none;
border-color: var(--sidebar-accent);
}
.btn-logout {
width: 100%;
padding: 0.5rem;
background: transparent;
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: var(--radius-sm);
color: var(--sidebar-text-muted);
font-size: 0.875rem;
cursor: pointer;
transition: color 0.15s, border-color 0.15s;
}
.btn-logout:hover {
color: var(--sidebar-text);
border-color: rgba(255, 255, 255, 0.25);
}
/* ========== 主内容区 ========== */
.main {
flex: 1;
overflow: auto;
padding: 1.5rem 2rem 2rem;
}
/* ========== 视图切换 ========== */
.view {
display: none;
}
.view.active {
display: block;
}
/* ========== 页面头部 ========== */
.page-header {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1.5rem;
flex-wrap: wrap;
}
.page-title {
font-family: var(--font-head);
font-weight: 600;
font-size: 1.35rem;
color: var(--text);
margin: 0;
}
.page-title.detail-title {
flex: 1;
min-width: 0;
}
.header-actions {
display: flex;
align-items: center;
gap: 0.75rem;
margin-left: auto;
}
.btn-back {
display: inline-flex;
align-items: center;
padding: 0.4rem 0.75rem;
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
color: var(--text);
font-size: 0.875rem;
cursor: pointer;
transition: background 0.15s, border-color 0.15s;
}
.btn-back:hover {
background: #f8fafc;
border-color: var(--primary);
color: var(--primary);
}
/* ========== 按钮 ========== */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
padding: 0.5rem 1rem;
border-radius: var(--radius-sm);
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
border: none;
transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn-primary {
background: var(--primary);
color: #fff;
}
.btn-primary:hover:not(:disabled) {
background: var(--primary-hover);
box-shadow: 0 2px 8px rgba(14, 165, 233, 0.35);
}
.btn-primary:disabled {
opacity: 0.7;
cursor: not-allowed;
}
.btn-ghost {
background: transparent;
color: var(--text-muted);
border: 1px solid var(--border);
}
.btn-ghost:hover {
color: var(--primary);
border-color: var(--primary);
background: var(--primary-light);
}
.btn-icon {
font-size: 1rem;
line-height: 1;
}
.btn-sm {
padding: 0.35rem 0.75rem;
font-size: 0.8125rem;
}
.btn-new-project .btn-icon {
font-size: 1.1rem;
font-weight: 600;
}
/* ========== 工具栏(搜索与筛选) ========== */
.toolbar {
background: var(--card-bg);
border-radius: var(--radius);
box-shadow: var(--card-shadow);
padding: 1rem 1.25rem;
margin-bottom: 1.25rem;
}
.search-row {
display: flex;
gap: 0.5rem;
margin-bottom: 0.75rem;
}
.search-row .input-select {
width: 120px;
flex-shrink: 0;
}
.search-row .input-search {
flex: 1;
min-width: 160px;
}
.btn-search {
padding: 0.5rem 1.25rem;
background: var(--primary);
color: #fff;
border: none;
border-radius: var(--radius-sm);
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
transition: background 0.15s;
}
.btn-search:hover {
background: var(--primary-hover);
}
.filter-row {
display: flex;
gap: 1.5rem;
flex-wrap: wrap;
}
.filter-group {
display: flex;
align-items: center;
gap: 0.5rem;
}
.filter-group label {
font-size: 0.8125rem;
color: var(--text-muted);
white-space: nowrap;
}
.input-filter {
min-width: 120px;
}
/* ========== 输入框 ========== */
.input {
width: 100%;
padding: 0.5rem 0.75rem;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
font-size: 0.875rem;
font-family: inherit;
color: var(--text);
background: var(--card-bg);
transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder {
color: #94a3b8;
}
.input:focus {
outline: none;
border-color: var(--border-focus);
box-shadow: 0 0 0 3px var(--primary-light);
}
.input-select,
.input-filter {
cursor: pointer;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.6rem center;
padding-right: 1.75rem;
}
.input-area {
min-height: 60px;
resize: vertical;
}
/* ========== 表格 ========== */
.table-wrap {
background: var(--card-bg);
border-radius: var(--radius);
box-shadow: var(--card-shadow);
overflow: hidden;
position: relative;
min-height: 200px;
}
.table-loading,
.table-empty {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.5rem;
color: var(--text-muted);
font-size: 0.875rem;
background: var(--card-bg);
}
.table-empty .empty-icon {
font-size: 2rem;
opacity: 0.6;
}
.table {
width: 100%;
border-collapse: collapse;
font-size: 0.875rem;
}
.table thead {
background: #f8fafc;
border-bottom: 1px solid var(--border);
}
.table th {
text-align: left;
padding: 0.75rem 1rem;
font-weight: 600;
color: var(--text);
}
.table td {
padding: 0.75rem 1rem;
border-bottom: 1px solid #f1f5f9;
color: var(--text);
}
.table tbody tr {
transition: background 0.12s;
}
.table tbody tr:hover {
background: #f8fafc;
}
.table tbody tr:last-child td {
border-bottom: none;
}
.table .cell-actions {
display: flex;
gap: 0.5rem;
}
.table .link-action {
color: var(--primary);
cursor: pointer;
background: none;
border: none;
font-size: 0.875rem;
padding: 0;
text-decoration: none;
}
.table .link-action:hover {
text-decoration: underline;
}
/* ========== 分页 ========== */
.pagination {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 1rem;
padding: 0 0.25rem;
}
.pagination-info {
font-size: 0.8125rem;
color: var(--text-muted);
}
.pagination-btns {
display: flex;
gap: 0.5rem;
}
.pagination .btn-sm:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* ========== 详情页 Tabs ========== */
.detail-loading {
display: flex;
align-items: center;
justify-content: center;
min-height: 240px;
color: var(--text-muted);
font-size: 0.875rem;
}
.detail-content {
background: var(--card-bg);
border-radius: var(--radius);
box-shadow: var(--card-shadow);
overflow: hidden;
}
.tabs {
display: flex;
gap: 0.25rem;
padding: 0 1rem;
background: #f8fafc;
border-bottom: 1px solid var(--border);
overflow-x: auto;
}
.tab {
padding: 0.75rem 1rem;
background: none;
border: none;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
font-size: 0.875rem;
color: var(--text-muted);
cursor: pointer;
white-space: nowrap;
transition: color 0.15s, border-color 0.15s;
}
.tab:hover {
color: var(--text);
}
.tab.active {
color: var(--primary);
font-weight: 500;
border-bottom-color: var(--primary);
}
.tab-panels {
padding: 1.5rem 1.5rem 2rem;
}
.tab-panel {
display: none;
}
.tab-panel.active {
display: block;
}
/* ========== 表单网格 ========== */
.form-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 1rem 1.25rem;
}
.form-group {
display: flex;
flex-direction: column;
gap: 0.35rem;
}
.form-group-full {
grid-column: 1 / -1;
}
.form-group label {
font-size: 0.8125rem;
font-weight: 500;
color: var(--text);
}
/* ========== 抽屉(操作日志) ========== */
.drawer-overlay {
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.4);
opacity: 0;
visibility: hidden;
transition: opacity 0.2s, visibility 0.2s;
z-index: 100;
}
.drawer-overlay.visible {
opacity: 1;
visibility: visible;
}
.drawer {
position: fixed;
top: 0;
right: 0;
width: 400px;
max-width: 100%;
height: 100%;
background: var(--card-bg);
box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
transform: translateX(100%);
transition: transform 0.25s ease;
z-index: 101;
display: flex;
flex-direction: column;
}
.drawer.visible {
transform: translateX(0);
}
.drawer-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1.25rem 1.5rem;
border-bottom: 1px solid var(--border);
}
.drawer-title {
font-family: var(--font-head);
font-weight: 600;
font-size: 1.125rem;
margin: 0;
color: var(--text);
}
.drawer-close {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
background: none;
border: none;
border-radius: var(--radius-sm);
font-size: 1.25rem;
color: var(--text-muted);
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.drawer-close:hover {
background: #f1f5f9;
color: var(--text);
}
.drawer-body {
flex: 1;
overflow: auto;
padding: 1rem 1.5rem;
position: relative;
}
.drawer-loading,
.drawer-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 0.5rem;
min-height: 160px;
color: var(--text-muted);
font-size: 0.875rem;
}
.drawer-empty .empty-icon {
font-size: 2rem;
opacity: 0.6;
}
.log-list {
list-style: none;
margin: 0;
padding: 0;
}
.log-item {
padding: 0.75rem 0;
border-bottom: 1px solid #f1f5f9;
font-size: 0.875rem;
}
.log-item:last-child {
border-bottom: none;
}
.log-item .log-meta {
color: var(--text-muted);
font-size: 0.8125rem;
margin-bottom: 0.25rem;
}
.log-item .log-desc {
color: var(--text);
}
/* ========== Toast ========== */
.toast {
position: fixed;
bottom: 2rem;
left: 50%;
transform: translateX(-50%) translateY(100px);
padding: 0.65rem 1.25rem;
background: var(--text);
color: #fff;
font-size: 0.875rem;
border-radius: var(--radius-sm);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
opacity: 0;
visibility: hidden;
transition: transform 0.25s ease, opacity 0.25s, visibility 0.25s;
z-index: 1000;
}
.toast.visible {
transform: translateX(-50%) translateY(0);
opacity: 1;
visibility: visible;
}
.toast.success {
background: var(--success);
}
.toast.error {
background: var(--danger);
}
/* ========== 响应式 ========== */
@media (max-width: 900px) {
.form-grid {
grid-template-columns: 1fr;
}
.sidebar {
width: 64px;
min-width: 64px;
padding: 1rem 0;
}
.brand-text,
.nav-item span:not(.nav-icon),
.role-label,
.role-select,
.btn-logout {
display: none;
}
.sidebar-brand {
justify-content: center;
padding: 0 0.5rem 1rem;
}
.nav-item {
justify-content: center;
padding: 0.75rem;
}
.sidebar-footer {
padding: 0.5rem;
}
.drawer {
width: 100%;
}
}