/* ============================================================ * shell.scss — Issue#6 P3 重写(sub2api 契约 v3.2.1) * 职责:topbar(64 glass)/sidebar(256·折叠72,品牌头部)/page-head(24)/ * main(32)/card(r16 实底 shadow-card)/metrics/badge/delta/quick-item/ * ch-table(td 14·py16/px20)/版本 chip/基础重置/语义徽章/移动端抽屉。 * 真值:sub2api style.css(.sidebar/.sidebar-link/.card/.glass)+alignment-report * 源码规格表;aurora 极光退役;类名锚点(.sidebar/.nav-item/...)全保留 * 供 verify-layout 与 views 消费。变量一律 var(--gosms-*)。 * ============================================================ */ body { font-family: var(--gosms-font); font-size: var(--gosms-fs-body); line-height: var(--gosms-lh-body); color: var(--gosms-text); background: var(--gosms-bg-page); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; } .num { font-variant-numeric: tabular-nums; } .num-glow { /* 退役兼容(sub2api 无数字 glow) */ } /* ---- 入场动画(sub2api fadeIn/slideUp 同族) ---- */ @keyframes slide-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } } .animate-slide-up { animation: slide-up 0.3s ease-out both; } @media (prefers-reduced-motion: reduce) { .animate-slide-up { animation: none; } } /* ---- 顶栏(sub2api AppHeader:glass sticky h-64,左页标题右动作) ---- */ .topbar { position: sticky; top: 0; z-index: 50; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 16px; background: var(--gosms-glass-header); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-bottom: 1px solid var(--gosms-border-strong); } .top-title { font-size: var(--gosms-fs-lg); font-weight: 600; color: var(--gosms-text-bright); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; } .avatar-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px; border-radius: var(--gosms-radius-base); border: 1px solid var(--gosms-border); cursor: pointer; transition: all 0.2s; background: none; } .avatar-chip:hover { background: var(--gosms-input-veil); border-color: var(--gosms-border-strong); } .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--gosms-gradient); color: #fff; font-size: var(--gosms-fs-xs); font-weight: 700; display: grid; place-items: center; } .avatar-name { font-size: var(--gosms-fs-base); color: var(--gosms-text-bright); } .theme-btn { font-size: var(--gosms-fs-xs); color: var(--gosms-text-secondary); background: none; border: 1px solid var(--gosms-border); border-radius: var(--gosms-radius-base); padding: 6px 12px; cursor: pointer; transition: all 0.2s; white-space: nowrap; } .theme-btn:hover { color: var(--gosms-primary); border-color: var(--gosms-primary); background: var(--gosms-primary-soft); } /* 移动端汉堡(项目补充;纯原生,不引入 EP) */ .menu-btn { display: none; width: 36px; height: 36px; place-items: center; border: 1px solid var(--gosms-border); border-radius: var(--gosms-radius-base); background: none; color: var(--gosms-text-secondary); cursor: pointer; font-size: 16px; } .menu-btn:hover { color: var(--gosms-primary); border-color: var(--gosms-primary); } /* ---- 布局 ---- */ .shell { position: relative; z-index: 1; display: flex; min-height: 100vh; } .sidebar { width: 256px; flex-shrink: 0; position: sticky; top: 64px; height: calc(100vh - 64px); overflow: hidden; display: flex; flex-direction: column; background: var(--gosms-bg-2); border-right: 1px solid var(--gosms-border); transition: width 0.3s ease; } /* 品牌头部(sub2api sidebar-header:h-64 px-24,logo 36 r12 glow+品牌 18/700+版本徽章) */ .sidebar-header { flex-shrink: 0; height: 64px; padding: 0 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--gosms-border); text-decoration: none; } .brand { display: flex; align-items: center; gap: 12px; min-width: 0; } .brand-mark { flex-shrink: 0; width: 36px; height: 36px; border-radius: var(--gosms-radius-base); background: var(--gosms-gradient); display: grid; place-items: center; color: #fff; font-size: 17px; box-shadow: var(--gosms-shadow-glow); transition: opacity 0.2s; } .brand:hover .brand-mark { opacity: 0.85; } .brand-name { font-weight: 700; font-size: var(--gosms-fs-xl); color: var(--gosms-text-bright); letter-spacing: 0.01em; white-space: nowrap; } /* 版本徽章(sub2api VersionBadge:12px bg-gray-100 无边框;go-sms 置品牌下方=用户指令位) */ .ver-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; padding: 2px 8px; border-radius: var(--gosms-radius-sm); background: var(--gosms-input-veil); color: var(--gosms-text-secondary); font-size: var(--gosms-fs-xs); font-family: var(--gosms-font-num); white-space: nowrap; } /* 菜单滚动区(sub2api sidebar-nav:px-12 py-16) */ .nav-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 16px 12px; } .nav-scroll::-webkit-scrollbar { display: none; } .sidebar-foot { flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 12px 0; border-top: 1px solid var(--gosms-border); } /* 分组标题(源码 12/600 uppercase;go-sms 覆盖 14px 对齐菜单=用户显式项) */ .nav-group { font-size: var(--gosms-fs-base); font-weight: 600; color: var(--gosms-text-muted); letter-spacing: 0.05em; padding: 16px 12px 8px; white-space: nowrap; } /* 菜单项(sub2api sidebar-link:14/500 r12 py-10 pl-17 pr-14 gap-12;激活=primary-50 底+primary 字,无指示条) */ .nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 17px; border-radius: var(--gosms-radius-base); margin-bottom: 4px; color: var(--gosms-text-secondary); font-size: var(--gosms-fs-base); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; overflow: hidden; transition: background-color 0.2s, color 0.2s; } .nav-item .ic { flex-shrink: 0; width: 20px; height: 20px; display: grid; place-items: center; } .nav-item:hover { background: var(--gosms-input-veil); color: var(--gosms-text-bright); } .nav-item.active { background: var(--gosms-primary-soft); color: var(--gosms-primary); font-weight: 600; } html:not(.dark) .nav-item.active { background: var(--gosms-primary-50); color: var(--gosms-primary-600); } /* 折叠态(w-72:图标居中/文字隐/分组隐;品牌缩 logo) */ .sidebar.collapsed { width: 72px; } .sidebar.collapsed .sidebar-header { padding: 0; justify-content: center; } .sidebar.collapsed .brand-name, .sidebar.collapsed .ver-badge, .sidebar.collapsed .nav-item .txt, .sidebar.collapsed .nav-group { display: none; } .sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; } .main { flex: 1; padding: 32px; min-width: 0; } /* ---- 页头(sub2api page-header:mb-24;title 24/700) ---- */ .page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; } .page-head h2 { font-size: var(--gosms-fs-stat); font-weight: 700; color: var(--gosms-text-bright); margin: 0; } .page-head .sub { font-size: var(--gosms-fs-base); color: var(--gosms-text-secondary); } .page-head-extra { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; } .live-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: var(--gosms-fs-xs); color: var(--gosms-primary); background: var(--gosms-primary-soft); padding: 4px 12px; border-radius: 999px; } .live-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--gosms-primary); animation: pulse 2s infinite; } @keyframes pulse { 50% { opacity: 0.4; } } /* ---- stagger 入场 ---- */ .stagger > * { opacity: 0; animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards; } .stagger > *:nth-child(1) { animation-delay: 0.05s; } .stagger > *:nth-child(2) { animation-delay: 0.11s; } .stagger > *:nth-child(3) { animation-delay: 0.17s; } .stagger > *:nth-child(4) { animation-delay: 0.23s; } @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } } @media (prefers-reduced-motion: reduce) { .stagger > * { animation: none; opacity: 1; } } /* ---- 卡片(sub2api .card:实底 r16 边 gray-100 shadow-card;p16=契约) ---- */ .card { position: relative; border-radius: var(--gosms-radius); padding: 16px; background: var(--gosms-card); border: 1px solid var(--gosms-border); box-shadow: var(--gosms-shadow-card); transition: box-shadow 0.3s, border-color 0.3s; } .card:hover { box-shadow: var(--gosms-shadow-card-hover); } /* ---- 指标卡(KPI value 20/700 tabular;P4 Dashboard 组件化承载配色) ---- */ .metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; } .metric .label { font-size: var(--gosms-fs-xs); color: var(--gosms-text-secondary); display: flex; align-items: center; gap: 6px; } .metric .value { font-size: var(--gosms-fs-hero); font-weight: 700; color: var(--gosms-text-bright); margin: 10px 0 8px; line-height: 1.2; font-variant-numeric: tabular-nums; } .metric .value .unit { font-size: var(--gosms-fs-base); color: var(--gosms-text-muted); font-weight: 400; } .delta { font-size: var(--gosms-fs-xs); display: inline-flex; gap: 5px; align-items: center; padding: 2px 9px; border-radius: 999px; } .delta.up { color: var(--gosms-primary); background: var(--gosms-primary-soft); } .delta.down { color: var(--gosms-red); background: rgba(239, 68, 68, 0.1); } .delta.warn { color: var(--gosms-amber); background: rgba(245, 158, 11, 0.1); } /* ---- 图表 + 快捷 ---- */ .duo { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 16px; } .card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: var(--gosms-fs-base); font-weight: 600; color: var(--gosms-text-bright); } .card-head small { margin-left: auto; font-weight: 400; font-size: var(--gosms-fs-xs); color: var(--gosms-text-muted); } .trend-svg { width: 100%; height: auto; display: block; } .quick-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--gosms-radius-base); cursor: pointer; transition: background-color 0.2s; border: 1px solid transparent; text-decoration: none; } .quick-item:hover { background: var(--gosms-input-veil); } .quick-item .qic { flex-shrink: 0; width: 48px; height: 48px; border-radius: var(--gosms-radius-base); display: grid; place-items: center; background: var(--gosms-primary-soft); color: var(--gosms-primary); font-size: var(--gosms-fs-xl); } .quick-item .qt { font-size: var(--gosms-fs-base); font-weight: 500; color: var(--gosms-text-bright); } .quick-item .qd { font-size: var(--gosms-fs-xs); color: var(--gosms-text-muted); margin-top: 2px; } .quick-item .arrow { margin-left: auto; color: var(--gosms-text-muted); transition: transform 0.2s; } .quick-item:hover .arrow { transform: translateX(3px); color: var(--gosms-primary); } /* ---- 表格语义(契约 td:14/20 gray-700 py16/px20;th 12/500) ---- */ .ch-table { width: 100%; border-collapse: collapse; font-size: var(--gosms-fs-base); } .ch-table thead th { font-size: var(--gosms-fs-xs); font-weight: 500; color: var(--gosms-text-secondary); letter-spacing: 0.02em; text-align: left; padding: 12px 20px; border-bottom: 1px solid var(--gosms-border); white-space: nowrap; } .ch-table thead th.r, .ch-table td.r { text-align: right; } .ch-table tbody td { padding: 16px 20px; border-bottom: 1px solid var(--gosms-border); white-space: nowrap; color: var(--gosms-text); } .ch-table tbody tr { transition: background-color 0.15s; } .ch-table tbody tr:hover { background: var(--gosms-input-veil); } .mono { font-family: var(--gosms-font-num); color: var(--gosms-text-bright); } .badge { font-size: var(--gosms-fs-xs); padding: 3px 10px; border-radius: 999px; border: 1px solid; font-weight: 500; display: inline-block; } .badge.ok { color: var(--gosms-primary); border-color: var(--gosms-border-glow); background: var(--gosms-primary-soft); } .badge.warn { color: var(--gosms-amber); border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); } .badge.err { color: var(--gosms-red); border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.08); } .badge.violet { color: var(--gosms-violet); border-color: rgba(167, 139, 250, 0.35); background: rgba(167, 139, 250, 0.08); } .rate-bar { display: inline-flex; align-items: center; gap: 8px; } .rate-bar .rb { width: 54px; height: 4px; border-radius: 4px; background: var(--gosms-border); overflow: hidden; } .rate-bar .rb i { display: block; height: 100%; background: var(--gosms-gradient); border-radius: 4px; } /* ---- 全局工具类 ---- */ .hint { font-size: var(--gosms-fs-xs); color: var(--gosms-text-muted); line-height: 1.5; } .page-stack { display: flex; flex-direction: column; gap: 16px; } .glass-card { border-radius: var(--gosms-radius); padding: 16px; background: var(--gosms-card); border: 1px solid var(--gosms-border); box-shadow: var(--gosms-shadow-card); } .btn-gradient { background: var(--gosms-gradient); color: #fff; border: none; border-radius: var(--gosms-radius-base); padding: 10px 20px; font-size: var(--gosms-fs-base); font-weight: 600; cursor: pointer; box-shadow: 0 2px 12px var(--gosms-glow); transition: all 0.2s; } .btn-gradient:hover { filter: brightness(1.08); box-shadow: 0 4px 20px var(--gosms-glow); } /* ---- 折叠钮 + 版本 chip(Issue#4 资产;折叠钮留 foot,版本徽章迁 brand 下) ---- */ .collapse-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--gosms-border); border-radius: var(--gosms-radius-base); background: none; color: var(--gosms-text-secondary); cursor: pointer; font-size: 14px; transition: all 0.2s; } .collapse-btn:hover { color: var(--gosms-primary); border-color: var(--gosms-primary); background: var(--gosms-primary-soft); } .collapse-btn .cg { display: inline-block; transition: transform 0.25s; } ver-chip { text-decoration: none; } .ver-badge { cursor: pointer; transition: color 0.2s; } .ver-badge:hover { color: var(--gosms-primary); } .ver-badge .ver-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #ef4444; animation: gosms-ver-blink 1.1s ease-in-out infinite; } @keyframes gosms-ver-blink { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(245, 108, 108, 0.55); } 50% { opacity: 0.45; box-shadow: 0 0 0 5px rgba(245, 108, 108, 0); } } /* ---- 滚动条(细条契约化) ---- */ * { scrollbar-width: thin; scrollbar-color: var(--gosms-border-strong) transparent; } ::-webkit-scrollbar { width: 6px; height: 6px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: var(--gosms-border-strong); border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: var(--gosms-primary-soft); } /* ---- 移动端(≤900 抽屉;顶栏 64) ---- */ @media (max-width: 900px) { .sidebar { display: none; } .duo { grid-template-columns: 1fr; } .menu-btn { display: grid; } .sidebar.open { display: flex; flex-direction: column; position: fixed; top: 64px; left: 0; z-index: 60; height: calc(100vh - 64px); background: var(--gosms-bg-2); box-shadow: var(--gosms-shadow-glass); } .nav-scrim { position: fixed; inset: 64px 0 0 0; z-index: 55; background: rgba(0, 0, 0, 0.45); } .main { padding: 16px; } .collapse-btn, .sidebar-foot { display: none; } .sidebar.open { width: 256px; } .sidebar.open .nav-item { justify-content: flex-start; padding: 10px 14px 10px 17px; } .sidebar.open .nav-item .txt { display: inline; } .sidebar.open .nav-group { padding: 16px 12px 8px; } } @media (min-width: 901px) { .nav-scrim { display: none; } } /* ---- 键盘焦点可见性 ---- */ :focus-visible { outline: 2px solid var(--gosms-primary); outline-offset: 2px; } /* ============================================================ * 基础重置 * ============================================================ */ * { box-sizing: border-box; } html, body, #app { height: 100%; margin: 0; padding: 0; } table, .el-table { font-variant-numeric: tabular-nums; } ::selection { background: var(--gosms-primary-soft); } /* ============================================================ * 语义徽章/趋势胶囊 * ============================================================ */ .sem-badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: var(--gosms-fs-xs); line-height: 18px; border: 1px solid transparent; } .sem-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; } .sem-badge--ok { color: var(--el-color-success); background: var(--el-color-success-light-9); border-color: var(--el-color-success-light-7); } .sem-badge--fail { color: var(--el-color-danger); background: var(--el-color-danger-light-9); border-color: var(--el-color-danger-light-7); } .sem-badge--pending { color: var(--el-color-warning); background: var(--el-color-warning-light-9); border-color: var(--el-color-warning-light-7); } .sem-badge--off { color: var(--gosms-text-muted); background: var(--el-fill-color-light); border-color: var(--gosms-border); } .trend-up, .trend-down, .trend-flat { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 999px; font-size: var(--gosms-fs-xs); font-weight: 500; line-height: 16px; width: fit-content; } .trend-up { color: var(--el-color-success); background: var(--el-color-success-light-9); } .trend-down { color: var(--el-color-danger); background: var(--el-color-danger-light-9); } .trend-flat { color: var(--gosms-text-muted); background: var(--gosms-input-veil); }