nomadro/apps/miniprogram/xhs/tool/hub.css
eric 626f6b19e8 Ship unified miniprogram H5/weapp parity and XHS offline portal.
Align Taro pages with Next hub/nav/book/community/VIP, pack the single-index Xiaohongshu portal with host-chrome safe areas, and refresh shared book content plus portal README constraints.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-30 09:37:03 +08:00

786 lines
15 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* nomadHub homepage — PC + H5 */
.hub-root {
--hub-bg: #0a0e17;
--hub-bg-card: rgba(17, 24, 39, 0.7);
--hub-bg-glass: rgba(255, 255, 255, 0.05);
--hub-text: #f1f5f9;
--hub-muted: #94a3b8;
--hub-accent-1: #ff6b6b;
--hub-accent-2: #ffe66d;
--hub-accent-3: #4ecdc4;
--hub-gradient-text: linear-gradient(135deg, #ff6b6b 0%, #ffe66d 50%, #4ecdc4 100%);
--hub-shadow-glow: 0 0 40px rgba(78, 205, 196, 0.15);
--hub-shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
--hub-border: 1px solid rgba(255, 255, 255, 0.08);
--hub-radius-md: 16px;
--hub-font-display: var(--font-outfit), var(--font-noto-sc), sans-serif;
--hub-font-body: var(--font-noto-sc), var(--font-outfit), sans-serif;
--hub-nav-height: 72px;
--hub-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
min-height: 100dvh;
font-family: var(--hub-font-body);
background: var(--hub-bg);
color: var(--hub-text);
line-height: 1.6;
overflow-x: hidden;
transition: background var(--hub-transition), color var(--hub-transition);
}
html.light .hub-root,
[data-theme="light"] .hub-root {
--hub-bg: #f8fafc;
--hub-bg-card: rgba(255, 255, 255, 0.85);
--hub-bg-glass: rgba(15, 23, 42, 0.04);
--hub-text: #0f172a;
--hub-muted: #64748b;
--hub-accent-1: #e11d48;
--hub-accent-2: #d97706;
--hub-accent-3: #0d9488;
--hub-gradient-text: linear-gradient(135deg, #e11d48 0%, #d97706 50%, #0d9488 100%);
--hub-shadow-glow: 0 0 40px rgba(13, 148, 136, 0.12);
--hub-shadow-card: 0 8px 32px rgba(15, 23, 42, 0.08);
--hub-border: 1px solid rgba(15, 23, 42, 0.08);
}
.hub-root a {
color: inherit;
text-decoration: none;
}
.hub-particle-canvas {
position: fixed;
inset: 0;
z-index: 0;
pointer-events: none;
}
/* Loader */
.hub-loader {
position: fixed;
inset: 0;
z-index: 9999;
display: grid;
place-items: center;
background: var(--hub-bg, #0a0e17);
transition: opacity 0.6s ease, visibility 0.6s;
}
.hub-loader.hidden {
opacity: 0;
visibility: hidden;
pointer-events: none;
}
.hub-loader-inner {
text-align: center;
}
.hub-loader-globe {
width: 64px;
height: 64px;
margin: 0 auto 12px;
}
.hub-loader-ring {
transform-origin: center;
animation: hub-spin 1.1s linear infinite;
}
@keyframes hub-spin {
to {
transform: rotate(360deg);
}
}
.hub-loader-text {
font-family: var(--hub-font-display);
font-weight: 700;
background: var(--hub-gradient-text);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
/* Nav */
.hub-navbar {
position: fixed;
top: 0;
left: 0;
right: 0;
height: var(--hub-nav-height);
z-index: 100;
transition: background var(--hub-transition), border-color var(--hub-transition);
}
.hub-navbar.scrolled {
background: rgba(10, 14, 23, 0.85);
backdrop-filter: blur(20px);
border-bottom: var(--hub-border);
}
html.light .hub-navbar.scrolled,
[data-theme="light"] .hub-navbar.scrolled {
background: rgba(248, 250, 252, 0.88);
}
.hub-nav-container {
width: min(1200px, calc(100% - clamp(2rem, 6vw, 5rem)));
margin: 0 auto;
height: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.hub-nav-actions {
display: flex;
align-items: center;
gap: 8px;
margin-left: auto;
}
.hub-logo {
display: flex;
align-items: center;
gap: 10px;
font-family: var(--hub-font-display);
font-weight: 700;
font-size: 1.2rem;
}
.hub-logo-icon {
width: 34px;
height: 34px;
animation: hub-spin 20s linear infinite;
}
/* Local-dev only shortcuts */
.hub-dev-nav {
display: flex;
align-items: center;
gap: 8px;
}
.hub-dev-link {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 36px;
padding: 0 14px;
border-radius: 10px;
border: 1px solid rgba(78, 205, 196, 0.28);
background: rgba(78, 205, 196, 0.1);
color: #4ecdc4;
font-family: var(--hub-font-display);
font-size: 0.82rem;
font-weight: 700;
letter-spacing: 0.02em;
transition: background var(--hub-transition), border-color var(--hub-transition),
transform var(--hub-transition);
}
.hub-dev-link:hover {
background: rgba(78, 205, 196, 0.18);
border-color: rgba(78, 205, 196, 0.5);
transform: translateY(-1px);
}
.hub-dev-link:nth-child(2) {
border-color: rgba(255, 107, 107, 0.28);
background: rgba(255, 107, 107, 0.1);
color: #ff8a8a;
}
.hub-dev-link:nth-child(2):hover {
background: rgba(255, 107, 107, 0.18);
border-color: rgba(255, 107, 107, 0.5);
}
/* Hero */
.hub-hero {
position: relative;
z-index: 1;
width: 100%;
min-height: 100svh;
overflow: hidden;
}
.hub-hero-bg-shapes {
position: absolute;
inset: 0;
pointer-events: none;
z-index: 0;
}
.hub-hero-bg-shapes .hub-shape {
position: absolute;
border-radius: 50%;
filter: blur(90px);
opacity: 0.45;
animation: hub-float-shape 8s ease-in-out infinite;
}
.hub-shape-1 {
width: min(52vw, 620px);
height: min(52vw, 620px);
background: var(--hub-accent-1);
top: -8%;
left: -8%;
}
.hub-shape-2 {
width: min(46vw, 560px);
height: min(46vw, 560px);
background: var(--hub-accent-3);
top: 28%;
right: -10%;
animation-delay: -3s;
}
.hub-shape-3 {
width: min(38vw, 480px);
height: min(38vw, 480px);
background: var(--hub-accent-2);
bottom: -12%;
left: 32%;
animation-delay: -5s;
}
@keyframes hub-float-shape {
0%,
100% {
transform: translate(0, 0) scale(1);
}
33% {
transform: translate(24px, -24px) scale(1.05);
}
66% {
transform: translate(-16px, 16px) scale(0.96);
}
}
.hub-hero-inner {
position: relative;
z-index: 1;
width: min(1200px, calc(100% - clamp(2rem, 6vw, 5rem)));
margin: 0 auto;
min-height: 100svh;
display: grid;
grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
grid-template-areas:
"title visual"
"portals visual";
align-content: center;
align-items: center;
column-gap: clamp(1.5rem, 4vw, 3.5rem);
row-gap: 1.75rem;
padding: calc(var(--hub-nav-height) + clamp(1.5rem, 4vh, 2.5rem)) 0
clamp(2rem, 5vh, 3.5rem);
}
.hub-hero-title {
grid-area: title;
align-self: end;
font-family: var(--hub-font-display);
font-size: clamp(2.4rem, 5vw, 3.8rem);
font-weight: 800;
line-height: 1.15;
letter-spacing: -0.02em;
}
.hub-hero-lead {
grid-area: title;
align-self: start;
margin-top: 0.75rem;
max-width: 28rem;
font-size: clamp(0.9rem, 1.6vw, 1.05rem);
color: var(--hub-muted, #94a3b8);
line-height: 1.45;
}
.hub-hero-visual {
grid-area: visual;
position: relative;
z-index: 1;
display: flex;
justify-content: center;
align-items: center;
min-width: 0;
padding: clamp(0.75rem, 2vw, 1.5rem);
align-self: center;
}
.hub-portal-grid {
grid-area: portals;
align-self: start;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 12px;
max-width: 520px;
margin-top: 0;
}
.hub-gradient-text {
background: var(--hub-gradient-text);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
background-size: 200% auto;
animation: hub-gradient-shift 4s ease-in-out infinite;
}
@keyframes hub-gradient-shift {
0%,
100% {
background-position: 0% center;
}
50% {
background-position: 100% center;
}
}
.hub-portal-card {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 14px;
padding: 20px 16px;
background: var(--hub-bg-card);
border: var(--hub-border);
border-radius: var(--hub-radius-md);
backdrop-filter: blur(18px);
box-shadow: var(--hub-shadow-card);
transition: transform var(--hub-transition), box-shadow var(--hub-transition),
border-color var(--hub-transition);
}
.hub-portal-card:hover {
transform: translateY(-4px);
box-shadow: var(--hub-shadow-glow), var(--hub-shadow-card);
border-color: rgba(78, 205, 196, 0.35);
}
.hub-portal-card--main {
background: linear-gradient(
160deg,
rgba(255, 107, 107, 0.12),
rgba(78, 205, 196, 0.08)
),
var(--hub-bg-card);
border-color: rgba(255, 107, 107, 0.22);
}
.hub-portal-ico {
width: 40px;
height: 40px;
display: grid;
place-items: center;
border-radius: 12px;
background: var(--hub-bg-glass);
border: var(--hub-border);
font-size: 1.15rem;
}
.hub-portal-name {
font-family: var(--hub-font-display);
font-size: clamp(0.92rem, 1.4vw, 1.05rem);
font-weight: 800;
letter-spacing: -0.02em;
line-height: 1.25;
white-space: nowrap;
}
.hub-portal-card--main .hub-portal-name {
background: var(--hub-gradient-text);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.hub-globe-container {
position: relative;
width: min(100%, 440px);
aspect-ratio: 1;
margin-inline: auto;
}
.hub-globe-svg {
display: block;
width: 100%;
height: 100%;
overflow: visible;
animation: hub-globe-float 6s ease-in-out infinite;
}
@keyframes hub-globe-float {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-12px);
}
}
.hub-orbit-ring,
.hub-orbit-ring-2 {
transform-box: fill-box;
transform-origin: center;
animation: hub-orbit-spin 20s linear infinite;
}
.hub-orbit-ring-2 {
animation-direction: reverse;
animation-duration: 15s;
}
@keyframes hub-orbit-spin {
to {
transform: rotate(360deg);
}
}
.hub-continent {
animation: hub-continent-pulse 4s ease-in-out infinite;
}
@keyframes hub-continent-pulse {
0%,
100% {
opacity: 0.7;
}
50% {
opacity: 1;
}
}
.hub-pulse-dot {
animation: hub-dot-pulse 2s ease-in-out infinite;
}
.hub-pulse-dot:nth-of-type(2) {
animation-delay: 0.5s;
}
.hub-pulse-dot:nth-of-type(3) {
animation-delay: 1s;
}
@keyframes hub-dot-pulse {
0%,
100% {
r: 5;
opacity: 1;
}
50% {
r: 8;
opacity: 0.6;
}
}
.hub-flight-path {
animation: hub-dash-move 3s linear infinite;
}
@keyframes hub-dash-move {
to {
stroke-dashoffset: -20;
}
}
.hub-float-card {
position: absolute;
z-index: 2;
padding: 10px 14px;
background: var(--hub-bg-card);
border: var(--hub-border);
border-radius: var(--hub-radius-md);
font-size: 0.8rem;
font-weight: 600;
backdrop-filter: blur(20px);
box-shadow: var(--hub-shadow-card);
animation: hub-card-float 4s ease-in-out infinite;
white-space: nowrap;
pointer-events: none;
}
.hub-fc-1 {
top: 6%;
right: 0;
}
.hub-fc-2 {
top: 58%;
left: 0;
animation-delay: -1.5s;
}
.hub-fc-3 {
bottom: 4%;
right: 6%;
animation-delay: -3s;
}
@keyframes hub-card-float {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-8px);
}
}
.hub-reveal {
opacity: 0;
transform: translateY(24px);
transition: opacity 0.8s ease, transform 0.8s ease;
}
.hub-reveal.visible {
opacity: 1;
transform: none;
}
/* Tablet / H5 */
@media (max-width: 960px) {
.hub-hero-inner {
grid-template-columns: 1fr;
grid-template-areas:
"visual"
"title"
"portals";
align-content: start;
justify-items: stretch;
min-height: 100svh;
gap: 0.85rem;
padding-top: calc(var(--hub-nav-height) + 0.85rem);
padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}
.hub-hero-title {
align-self: start;
text-align: center;
font-size: clamp(2.35rem, 11vw, 3.2rem);
letter-spacing: -0.04em;
}
.hub-hero-visual {
width: 100%;
padding: 0.25rem 0.5rem 0.5rem;
}
.hub-globe-container {
width: min(62vw, 300px);
}
.hub-portal-grid {
max-width: none;
width: 100%;
margin-top: 0.35rem;
}
.hub-fc-1 {
right: -2%;
font-size: 0.72rem;
padding: 8px 10px;
}
.hub-fc-2 {
left: -2%;
font-size: 0.72rem;
padding: 8px 10px;
}
.hub-fc-3 {
font-size: 0.72rem;
padding: 8px 10px;
}
}
@media (max-width: 640px) {
.hub-hero-inner {
min-height: 100svh;
gap: 0.65rem;
padding-top: calc(var(--hub-nav-height) + 0.65rem);
}
.hub-hero-title {
font-size: clamp(2.2rem, 10.5vw, 2.85rem);
}
.hub-globe-container {
width: min(64vw, 250px);
}
.hub-globe-svg {
animation-duration: 7s;
}
.hub-portal-grid {
gap: 8px;
}
.hub-portal-card {
padding: 14px 10px;
gap: 10px;
align-items: center;
text-align: center;
}
.hub-portal-ico {
width: 32px;
height: 32px;
font-size: 0.95rem;
}
.hub-portal-name {
font-size: 0.78rem;
letter-spacing: -0.03em;
}
.hub-fc-1 {
top: 4%;
right: 0;
}
.hub-fc-2 {
top: 54%;
left: 0;
}
.hub-fc-3 {
bottom: 2%;
right: 2%;
}
}
@media (max-width: 380px) {
.hub-portal-grid {
gap: 6px;
}
.hub-portal-card {
padding: 12px 6px;
}
.hub-portal-name {
font-size: 0.7rem;
}
}
@media (prefers-reduced-motion: reduce) {
.hub-reveal {
opacity: 1;
transform: none;
transition: none;
}
.hub-loader {
display: none;
}
/* 注意:小红书 Android WebView 常误报 reduce,禁止在此关掉地球/卡片动画 */
}
/* 强制动效(覆盖误报的 prefers-reduced-motion) */
.hub-globe-container {
animation: hub-globe-float 6s ease-in-out infinite !important;
}
.hub-globe-svg {
/* 漂浮交给外层 container;轨道用 SVG SMIL,兼容 XHS WebView */
animation: none !important;
}
.hub-orbit-ring,
.hub-orbit-ring-2 {
animation: none !important;
}
.hub-float-card {
animation: hub-card-float 4s ease-in-out infinite !important;
}
.hub-continent {
animation: hub-continent-pulse 4s ease-in-out infinite !important;
}
.hub-pulse-dot {
animation: none !important; /* r 动画用 SMIL */
}
.hub-flight-path {
animation: none !important; /* dash 用 SMIL */
}
.hub-logo-icon {
animation: hub-spin 20s linear infinite !important;
}
/* ===== XHS patches (align H5 hub, safe-area, buttons) ===== */
.hub-root {
--hub-safe-top: 88px;
--hub-nav-height: 44px;
--hub-font-display: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif;
--hub-font-body: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif;
z-index: 1;
}
.hub-navbar {
/* 硬编码 fallback:XHS 对嵌套 var() 常失效 → top 回落到 0 导致 logo 压返回箭头 */
top: 88px !important;
top: var(--app-pad-top, 88px) !important;
padding-top: 0 !important;
height: 44px !important;
min-height: 44px !important;
box-sizing: border-box;
}
.hub-navbar .hub-nav-container,
.hub-navbar .nav-container {
width: 100%;
max-width: none;
margin: 0;
height: 44px;
padding-left: 16px;
padding-right: 12px;
box-sizing: border-box;
}
.hub-hero-inner {
padding-top: 136px !important; /* 88 + 44 + 4 */
padding-top: calc(44px + var(--app-pad-top, 88px) + 0.25rem) !important;
}
.hub-particle-canvas {
z-index: 0;
}
.hub-hero {
z-index: 1;
}
.nd-theme-toggle {
display: inline-flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 12px;
border: 1px solid rgba(78, 205, 196, 0.28);
background: rgba(78, 205, 196, 0.1);
color: #4ecdc4;
font-size: 1.05rem;
cursor: pointer;
}
[data-theme='light'] .nd-theme-toggle,
html.light .nd-theme-toggle {
border-color: rgba(13, 148, 136, 0.3);
background: rgba(13, 148, 136, 0.1);
color: #0d9488;
}
button.hub-portal-card {
width: 100%;
color: inherit;
font: inherit;
text-align: left;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
}
@media (max-width: 640px) {
button.hub-portal-card {
text-align: center;
}
}