index.css 10.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436
@import './fonts.css';
@import './tailwind.css';
@import './theme.css';

/* 自定义动画和过渡效果 */
.transition-opacity {
  transition-property: opacity;
}

.duration-2000 {
  transition-duration: 2000ms;
}

/* 首页三语欢迎词:切换时渐入(仅透明度) */
@keyframes welcome-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.animate-welcome-fade-in {
  animation: welcome-fade-in 0.75s ease-in-out forwards;
}

@media (prefers-reduced-motion: reduce) {
  .animate-welcome-fade-in {
    animation: none;
  }
}

/* 首页菜单槽位:不做 3D 旋转,避免绘制超出布局盒导致「间距看起来忽大忽小」 */
.carousel-tile-3d {
  transform: none;
}

/* 六边形图标底 */
.clip-hexagon {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

/* 菜单块底边:与「台面」接缝高光 */
.menu-tile-face {
  position: relative;
}

.menu-tile-face::after {
  content: "";
  position: absolute;
  z-index: 25;
  left: 8%;
  right: 8%;
  bottom: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 22%,
    rgba(220, 240, 255, 0.95) 50%,
    rgba(255, 255, 255, 0.25) 78%,
    transparent 100%
  );
  box-shadow:
    0 0 10px 1px rgba(180, 220, 255, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 垂直镜像倒影(WebKit):遮罩渐变与先前相反 — 近接缝弱、越远越强再淡出 */
.tile-reflect {
  -webkit-box-reflect: below 6px
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.03) 18%,
      rgba(255, 255, 255, 0.08) 38%,
      rgba(255, 255, 255, 0.16) 55%,
      rgba(255, 255, 255, 0.28) 72%,
      rgba(255, 255, 255, 0.38) 88%,
      transparent 100%
    );
}

/* 第 3、4 矩形入口:倒影更贴按钮底 */
.tile-reflect.tile-reflect--center-pair {
  -webkit-box-reflect: below -14px
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.03) 18%,
      rgba(255, 255, 255, 0.08) 38%,
      rgba(255, 255, 255, 0.16) 55%,
      rgba(255, 255, 255, 0.28) 72%,
      rgba(255, 255, 255, 0.38) 88%,
      transparent 100%
    );
}

/*
 * 梯形底边斜:盒模型底在长边最低角,-webkit-box-reflect 相对整盒定位,短边底角更高,
 * 短边与倒影短边会多出 ≈(Δy·H)。外梯 polygon Δy≈0.063、内梯 ≈0.032,用更大负 below 补偿。
 */
.tile-reflect.tile-reflect--trap-outer {
  -webkit-box-reflect: below clamp(-54px, -9vw - 8px, -34px)
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.03) 18%,
      rgba(255, 255, 255, 0.08) 38%,
      rgba(255, 255, 255, 0.16) 55%,
      rgba(255, 255, 255, 0.28) 72%,
      rgba(255, 255, 255, 0.38) 88%,
      transparent 100%
    );
}

.tile-reflect.tile-reflect--trap-inner {
  -webkit-box-reflect: below clamp(-38px, -6vw - 8px, -22px)
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.03) 18%,
      rgba(255, 255, 255, 0.08) 38%,
      rgba(255, 255, 255, 0.16) 55%,
      rgba(255, 255, 255, 0.28) 72%,
      rgba(255, 255, 255, 0.38) 88%,
      transparent 100%
    );
}

@media (max-width: 767px) {
  /* 窄屏保留横向滚动时 y 轴会被收成 auto,真倒影常被裁掉:关掉 reflect,用下方柔光带代替 */
  .tile-reflect {
    -webkit-box-reflect: none;
  }

  .tile-reflect::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    top: calc(100% + 4px);
    height: clamp(2.5rem, 30%, 4rem);
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(200, 225, 255, 0.07) 45%,
      rgba(255, 255, 255, 0.16) 100%
    );
    filter: blur(10px);
    opacity: 0.78;
    border-radius: 2px;
  }

  /* 首页:手机均为矩形块,与梯形无关,柔光统一且压低高度 */
  .home-menu-carousel .tile-reflect::after {
    top: calc(100% + 1px) !important;
    height: clamp(0.65rem, 5dvh, 1.1rem) !important;
    opacity: 0.48 !important;
    filter: blur(5px) !important;
  }
}

@supports not (-webkit-box-reflect: below 0 linear-gradient(transparent, transparent)) {
  .tile-reflect {
    -webkit-box-reflect: none;
    padding-bottom: 2.75rem;
  }

  /* Firefox 等:无真镜像,用底部柔光模拟反光带 */
  .tile-reflect::after {
    content: "";
    position: absolute;
    left: 6%;
    right: 6%;
    top: calc(100% + 3px);
    height: clamp(2.25rem, 26%, 3.75rem);
    max-width: 100%;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      transparent 0%,
      rgba(200, 225, 255, 0.06) 40%,
      rgba(255, 255, 255, 0.13) 100%
    );
    filter: blur(8px);
    opacity: 0.7;
    border-radius: 2px;
  }
}

@media (max-width: 767.98px) {
  @supports not (-webkit-box-reflect: below 0 linear-gradient(transparent, transparent)) {
    .home-menu-carousel .tile-reflect::after {
      top: calc(100% + 1px) !important;
      height: clamp(0.65rem, 5dvh, 1.1rem) !important;
      opacity: 0.48 !important;
      filter: blur(5px) !important;
    }
  }
}

@media (prefers-reduced-motion: reduce) and (min-width: 768px) {
  .tile-reflect {
    -webkit-box-reflect: below 2px
      linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.035) 45%,
        rgba(255, 255, 255, 0.12) 85%,
        transparent 100%
      );
  }

  .tile-reflect.tile-reflect--center-pair {
    -webkit-box-reflect: below -12px
      linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.035) 45%,
        rgba(255, 255, 255, 0.12) 85%,
        transparent 100%
      );
  }

  .tile-reflect.tile-reflect--trap-outer {
    -webkit-box-reflect: below clamp(-48px, -7.5vw - 6px, -30px)
      linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.035) 45%,
        rgba(255, 255, 255, 0.12) 85%,
        transparent 100%
      );
  }

  .tile-reflect.tile-reflect--trap-inner {
    -webkit-box-reflect: below clamp(-34px, -5.5vw - 6px, -18px)
      linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.035) 45%,
        rgba(255, 255, 255, 0.12) 85%,
        transparent 100%
      );
  }
}

/*
 * 首页手机(<768px):六块均为圆角矩形,去掉梯形 clip;控制高度与柔光倒影,便于两列一屏内看完。
 */
@media (max-width: 767.98px) {
  .home-menu-carousel .menu-tile-face {
    clip-path: none !important;
    -webkit-clip-path: none !important;
    border-radius: 0 !important;
    width: min(41vw, 8.125rem) !important;
    max-width: min(41vw, 8.125rem) !important;
    height: auto !important;
    aspect-ratio: 3 / 4 !important;
    max-height: min(28dvh, 8.5rem) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.36) !important;
  }

  .home-menu-carousel .menu-tile-content {
    gap: 0.375rem !important;
    padding: 0.2rem 0.25rem !important;
  }
}

/*
 * iPad / 平板 768~1279px:六块总宽原大于视口,易被裁切或只能露出一半。
 * 按比例缩窄(约 7/10.25)并收紧 gap,使一行完整显示;轮播区 overflow 放开以免倒影被裁。
 */
@media (min-width: 768px) and (max-width: 1279.98px) {
  .home-menu-carousel .carousel-track {
    gap: 0.5rem !important;
    overflow: visible !important;
  }

  .home-menu-carousel .menu-tile-face.menu-tile--outer {
    width: 6.73rem !important;
    height: calc(7rem * 4 / 3 * 0.932 / 0.868 / 0.82) !important;
  }

  .home-menu-carousel .menu-tile-face.menu-tile--inner-trap {
    width: 7rem !important;
    height: calc(7rem * 4 / 3 / 0.868) !important;
  }

  .home-menu-carousel .menu-tile-face.menu-tile--center {
    width: 7rem !important;
    max-width: 7rem !important;
    height: auto !important;
    aspect-ratio: 3 / 4 !important;
  }

  .home-menu-carousel .clip-hexagon {
    height: 2.85rem !important;
    width: 2.85rem !important;
  }

  .home-menu-carousel .clip-hexagon svg {
    height: 1.35rem !important;
    width: 1.35rem !important;
  }

  .home-menu-carousel .tile-reflect {
    margin-bottom: 2.75rem !important;
  }
}

/* 轮播轨道:隐藏滚动条;横向滑动仅 md+ 一排时启用(手机为两列网格) */
.carousel-track {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

@media (min-width: 768px) {
  .carousel-track {
    touch-action: pan-x pinch-zoom;
    -webkit-overflow-scrolling: touch;
  }
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

/* 平滑滚动与移动端视口(含动态工具栏的 dvh);全宽防横向溢出 */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  width: 100%;
  overflow-x: clip;
}

#root {
  width: 100%;
  min-height: 100dvh;
  min-height: 100vh;
}

.app-shell {
  min-height: 100dvh;
}

/* 共享天文台等「单屏页」:根节点不增高、不出现整页滚动条 */
html.app-viewport-lock,
html.app-viewport-lock body {
  height: 100%;
  overflow: hidden;
}

html.app-viewport-lock #root {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

/* App 外壳在锁定视口时铺满 #root,便于 Layout flex-1 吃到高度 */
html.app-viewport-lock #root .app-shell {
  height: 100%;
  min-height: 0;
  max-height: 100%;
  flex: 1 1 0%;
}

/* 路由主区域占满锁定视口下的剩余高度(与 Toast 容器分离,避免兄弟节点平分 flex) */
html.app-viewport-lock .app-shell-main {
  display: flex;
  min-height: 0;
  min-width: 0;
  flex: 1 1 0%;
  flex-direction: column;
}

@media (pointer: coarse) {
  html.app-viewport-lock #root {
    height: 100dvh;
    max-height: 100dvh;
    min-height: 0;
  }
}

/* 可滚动区域隐藏滚动条(仍可触控/滚轮滚动) */
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}

/* iPad / 触控设备:Safari 100vh 与地址栏错位时,用 -webkit-fill-available 兜底 */
@media (pointer: coarse) {
  #root {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }

  .layout-min-h-touch {
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
  }
}

/* 横屏且高度较小时:避免页面被撑得过高难滚动 */
@media (orientation: landscape) and (max-height: 480px) {
  html {
    font-size: 15px;
  }
}

/* 触控友好的点击区域 */
@media (hover: none) {
  button,
  a {
    min-height: 44px;
    min-width: 44px;
  }
}