sq-nav-header.scss 2.9 KB

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