429 lines
7.0 KiB
CSS
429 lines
7.0 KiB
CSS
/* 响应式样式 - 断点系统 */
|
|
|
|
/* 桌面端 (>1440px) - 大屏优化 */
|
|
@media (min-width: 1440px) {
|
|
.app-container {
|
|
grid-template-columns: 280px 1fr;
|
|
}
|
|
|
|
.sidebar {
|
|
width: 280px;
|
|
}
|
|
|
|
.search-input {
|
|
width: 400px;
|
|
}
|
|
|
|
.data-cards {
|
|
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
|
|
}
|
|
}
|
|
|
|
/* 桌面端 (1025px-1440px) - 标准布局 */
|
|
@media (min-width: 1025px) and (max-width: 1439px) {
|
|
.app-container {
|
|
grid-template-columns: 260px 1fr;
|
|
}
|
|
}
|
|
|
|
/* 平板端 (768px-1024px) - 缩小侧边栏 */
|
|
@media (min-width: 768px) and (max-width: 1024px) {
|
|
.app-container {
|
|
grid-template-columns: 240px 1fr;
|
|
}
|
|
|
|
.sidebar {
|
|
width: 240px;
|
|
}
|
|
|
|
.sidebar-header {
|
|
padding: 12px 16px;
|
|
}
|
|
|
|
.sidebar-search,
|
|
.sidebar-nav,
|
|
.sidebar-footer {
|
|
padding-left: 16px;
|
|
padding-right: 16px;
|
|
}
|
|
|
|
.search-input {
|
|
width: 250px;
|
|
}
|
|
|
|
.data-cards {
|
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
}
|
|
|
|
.content-main {
|
|
padding: 20px;
|
|
}
|
|
}
|
|
|
|
/* 移动端 (<768px) - 侧边栏隐藏 */
|
|
@media (max-width: 767px) {
|
|
.app-container {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
/* 侧边栏移动端样式 */
|
|
.sidebar {
|
|
position: fixed;
|
|
top: 0;
|
|
left: -260px;
|
|
height: 100vh;
|
|
width: 260px;
|
|
z-index: 1000;
|
|
transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.sidebar.open {
|
|
left: 0;
|
|
}
|
|
|
|
.sidebar-backdrop {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
z-index: 999;
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transition: all 0.3s ease;
|
|
display: block;
|
|
}
|
|
|
|
.sidebar.open + .sidebar-backdrop {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
}
|
|
|
|
/* 移动端菜单按钮 */
|
|
.mobile-menu-toggle {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
/* 移动端头部布局 */
|
|
.header-toolbar {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
gap: 12px;
|
|
padding: 12px 16px;
|
|
}
|
|
|
|
.breadcrumb {
|
|
order: -1;
|
|
text-align: center;
|
|
}
|
|
|
|
.header-tools {
|
|
justify-content: center;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
/* 搜索框响应式 */
|
|
.search-input {
|
|
width: 100%;
|
|
min-width: 200px;
|
|
}
|
|
|
|
.search-container {
|
|
width: 100%;
|
|
justify-content: center;
|
|
}
|
|
|
|
.search-box {
|
|
flex: 1;
|
|
max-width: 300px;
|
|
}
|
|
|
|
/* 分页信息响应式 */
|
|
.pagination-info {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
gap: 8px;
|
|
padding: 12px 16px;
|
|
text-align: center;
|
|
}
|
|
|
|
.per-page-select {
|
|
width: 100%;
|
|
max-width: 200px;
|
|
}
|
|
|
|
/* 内容区域响应式 */
|
|
.content-main {
|
|
padding: 16px;
|
|
}
|
|
|
|
/* 数据卡片响应式 */
|
|
.data-cards {
|
|
grid-template-columns: 1fr;
|
|
gap: 12px;
|
|
padding: 12px;
|
|
}
|
|
|
|
.data-card {
|
|
padding: 12px;
|
|
}
|
|
|
|
/* 数据表格响应式 */
|
|
.data-table {
|
|
font-size: 13px;
|
|
}
|
|
|
|
.data-table th,
|
|
.data-table td {
|
|
padding: 8px 12px;
|
|
}
|
|
|
|
/* 隐藏非关键列 */
|
|
@media (max-width: 480px) {
|
|
.data-table th:nth-child(n+4),
|
|
.data-table td:nth-child(n+4) {
|
|
display: none;
|
|
}
|
|
|
|
.data-table th:last-child,
|
|
.data-table td:last-child {
|
|
display: table-cell;
|
|
}
|
|
}
|
|
}
|
|
|
|
/* 小屏手机 (<480px) - 极简模式 */
|
|
@media (max-width: 479px) {
|
|
.header-toolbar {
|
|
padding: 8px 12px;
|
|
gap: 8px;
|
|
}
|
|
|
|
.header-tools {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
gap: 8px;
|
|
}
|
|
|
|
.view-controls,
|
|
.export-dropdown {
|
|
width: 100%;
|
|
}
|
|
|
|
.view-controls {
|
|
justify-content: center;
|
|
}
|
|
|
|
.export-button {
|
|
width: 100%;
|
|
justify-content: center;
|
|
}
|
|
|
|
.search-container {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.search-button {
|
|
width: 100%;
|
|
justify-content: center;
|
|
}
|
|
|
|
.content-main {
|
|
padding: 12px;
|
|
}
|
|
|
|
.data-cards {
|
|
gap: 8px;
|
|
padding: 8px;
|
|
}
|
|
|
|
.data-card {
|
|
padding: 8px;
|
|
}
|
|
|
|
.pagination-info {
|
|
padding: 8px 12px;
|
|
}
|
|
|
|
/* 单列布局 */
|
|
.data-cards {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
/* 横向模式 */
|
|
@media (max-height: 600px) and (orientation: landscape) {
|
|
.sidebar {
|
|
max-height: 100vh;
|
|
}
|
|
|
|
.sidebar-header {
|
|
padding: 8px 16px;
|
|
}
|
|
|
|
.sidebar-nav {
|
|
padding: 4px 0;
|
|
}
|
|
|
|
.nav-link {
|
|
padding: 6px 12px;
|
|
}
|
|
|
|
.nav-title {
|
|
font-size: 13px;
|
|
}
|
|
|
|
.nav-description {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.content-main {
|
|
padding: 12px 16px;
|
|
}
|
|
}
|
|
|
|
/* 触控设备优化 */
|
|
@media (hover: none) and (pointer: coarse) {
|
|
.nav-link:hover,
|
|
.view-button:hover,
|
|
.export-button:hover,
|
|
.settings-button:hover {
|
|
background: none;
|
|
}
|
|
|
|
.nav-link:active,
|
|
.view-button:active,
|
|
.export-button:active,
|
|
.settings-button:active {
|
|
background: var(--bg-tertiary);
|
|
transform: scale(0.98);
|
|
}
|
|
}
|
|
|
|
/* 高DPI屏幕优化 */
|
|
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
.sidebar {
|
|
box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.export-menu {
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
|
|
}
|
|
}
|
|
|
|
/* 暗色主题响应式 */
|
|
@media (max-width: 768px) and (prefers-color-scheme: dark) {
|
|
.sidebar {
|
|
box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
|
|
}
|
|
}
|
|
|
|
/* 无障碍支持 */
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.sidebar,
|
|
.sidebar-backdrop,
|
|
.export-menu {
|
|
transition: none;
|
|
}
|
|
}
|
|
|
|
/* 强制横向滚动 */
|
|
@media (max-width: 768px) {
|
|
.data-table-container {
|
|
overflow-x: auto;
|
|
-webkit-overflow-scrolling: touch;
|
|
}
|
|
|
|
.data-table {
|
|
min-width: 600px;
|
|
}
|
|
}
|
|
|
|
/* 打印响应式 */
|
|
@media print {
|
|
.sidebar,
|
|
.mobile-menu-toggle,
|
|
.header-tools,
|
|
.pagination-info {
|
|
display: none !important;
|
|
}
|
|
|
|
.app-container {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.main-content {
|
|
overflow: visible;
|
|
height: auto;
|
|
}
|
|
|
|
.content-header {
|
|
position: static;
|
|
border: none;
|
|
padding: 0;
|
|
}
|
|
|
|
.data-table th,
|
|
.data-table td {
|
|
border: 1px solid var(--border-dark);
|
|
}
|
|
}
|
|
|
|
/* 键盘导航响应式 */
|
|
@media (max-width: 768px) {
|
|
.sidebar:focus-within {
|
|
left: 0;
|
|
}
|
|
|
|
.sidebar-backdrop:focus-within {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
}
|
|
}
|
|
|
|
/* 系统主题检测 */
|
|
@media (prefers-color-scheme: dark) {
|
|
:root:not([data-theme]) {
|
|
--bg-primary: #0f172a;
|
|
--bg-secondary: #1e293b;
|
|
--bg-tertiary: #334155;
|
|
--text-primary: #f8fafc;
|
|
--text-secondary: #e2e8f0;
|
|
--text-tertiary: #cbd5e1;
|
|
--border-light: #334155;
|
|
--border-medium: #475569;
|
|
--border-dark: #64748b;
|
|
}
|
|
}
|
|
|
|
/* 高对比度模式响应式 */
|
|
@media (prefers-contrast: high) {
|
|
.sidebar {
|
|
border-right: 2px solid var(--border-dark);
|
|
}
|
|
|
|
.nav-link.active {
|
|
border: 2px solid var(--accent-600);
|
|
}
|
|
|
|
.search-input:focus {
|
|
border-width: 2px;
|
|
}
|
|
}
|
|
|
|
/* 自定义滚动条响应式 */
|
|
@media (max-width: 768px) {
|
|
.sidebar::-webkit-scrollbar {
|
|
width: 8px;
|
|
}
|
|
|
|
.sidebar::-webkit-scrollbar-thumb {
|
|
background: var(--border-dark);
|
|
border-radius: 4px;
|
|
}
|
|
} |