sq-nav-header.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. // 统一页顶栏(对齐地磅「仪表盘」白底顶栏)
  2. // 结构:safe-top + nav 行;左侧返回←/标题;右侧预留胶囊;工作台可加用户区
  3. .sq-nav-header {
  4. position: sticky;
  5. top: 0;
  6. z-index: 50;
  7. background: #fff;
  8. border-bottom: 1px solid #eee;
  9. box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  10. height: var(--sq-header-height, calc(44px + 44px));
  11. padding-top: var(--sq-safe-top, 44px);
  12. box-sizing: border-box;
  13. }
  14. /* 工作台等:加高,标题行 + 独立用户行 */
  15. .sq-nav-header--tall {
  16. height: auto;
  17. min-height: calc(var(--sq-header-height, 88px) + 72px);
  18. padding-bottom: 20px;
  19. }
  20. .sq-nav-header__nav {
  21. height: var(--sq-nav-height, 44px);
  22. display: grid;
  23. grid-template-columns: minmax(0, 1fr) var(--sq-capsule-right-safe, 96px);
  24. align-items: center;
  25. padding: 0 12px 0 8px;
  26. box-sizing: border-box;
  27. }
  28. .sq-nav-header--tall .sq-nav-header__nav {
  29. height: auto;
  30. min-height: var(--sq-nav-height, 44px);
  31. align-items: center;
  32. }
  33. .sq-nav-header__main {
  34. display: flex;
  35. align-items: center;
  36. justify-content: space-between;
  37. gap: 12px;
  38. min-width: 0;
  39. width: 100%;
  40. }
  41. .sq-nav-header__left {
  42. display: flex;
  43. align-items: center;
  44. justify-content: flex-start;
  45. gap: 8px;
  46. min-width: 0;
  47. }
  48. .sq-nav-header__left--stack {
  49. flex-direction: column;
  50. align-items: flex-start;
  51. gap: 6px;
  52. }
  53. .sq-nav-header__back {
  54. font-size: 20px;
  55. color: #333;
  56. padding: 4px 8px;
  57. flex-shrink: 0;
  58. line-height: 1;
  59. }
  60. .sq-nav-header__title {
  61. font-size: 17px;
  62. font-weight: 700;
  63. color: #111827;
  64. text-align: left;
  65. overflow: hidden;
  66. text-overflow: ellipsis;
  67. white-space: nowrap;
  68. max-width: 100%;
  69. }
  70. .sq-nav-header__meta {
  71. font-size: 12px;
  72. color: #6b7280;
  73. line-height: 1.4;
  74. text-align: left;
  75. }
  76. /* 用户行:与标题分行;全宽右对齐,不预留胶囊列 */
  77. .sq-nav-header__user-row {
  78. display: flex;
  79. justify-content: flex-end;
  80. align-items: center;
  81. width: 100%;
  82. box-sizing: border-box;
  83. padding: 12px 16px 0;
  84. }
  85. .sq-nav-header__user {
  86. display: flex;
  87. flex-direction: row;
  88. align-items: center;
  89. justify-content: flex-end;
  90. gap: 10px;
  91. flex-shrink: 0;
  92. max-width: 100%;
  93. text-align: right;
  94. margin-left: auto;
  95. }
  96. .sq-nav-header__user-name {
  97. font-size: 13px;
  98. font-weight: 600;
  99. color: #111827;
  100. max-width: 100%;
  101. overflow: hidden;
  102. text-overflow: ellipsis;
  103. white-space: nowrap;
  104. }
  105. .sq-nav-header__logout {
  106. font-size: 12px;
  107. line-height: 1.3;
  108. padding: 4px 10px;
  109. border-radius: 999px;
  110. border: 1px solid #d1d5db;
  111. color: #374151;
  112. background: #fff;
  113. }
  114. .sq-nav-header__logout:active {
  115. background: #f3f4f6;
  116. }
  117. .sq-nav-header__logout--disabled {
  118. opacity: 0.55;
  119. pointer-events: none;
  120. }