fix(ui): 统一下载页主题与智能路由页签间距

This commit is contained in:
zhanjunhao
2026-11-18 17:39:19 +08:00
parent 89188a9a65
commit ed0c06a93c
12 changed files with 253 additions and 324 deletions
+64 -92
View File
@@ -1,53 +1,42 @@
/* WeyAi 桌面端下载页:控制台风格,配色全部从主题 token 派生。
独立路由时由本页渲染 <PageBackground>;嵌入用户中心时 shell 已提供背景,本页不再自绘。 */
/* The standalone and embedded download views share the system theme. */
.weyai-download {
--wd-ink: var(--text-primary);
--wd-muted: var(--text-secondary);
--wd-line: var(--border-subtle);
--wd-card: var(--surface-card);
--wd-accent: var(--ui-color-primary);
--wd-accent-deep: var(--ui-color-primary-active, var(--ui-color-primary));
--wd-tint: color-mix(in srgb, var(--ui-color-primary) 8%, transparent);
--wd-tint-strong: color-mix(
in srgb,
var(--ui-color-primary) 14%,
transparent
);
--wd-accent-line: color-mix(
in srgb,
var(--ui-color-primary) 28%,
transparent
);
--wd-accent: var(--brand-primary);
--wd-accent-deep: var(--brand-primary);
--wd-tint: color-mix(in srgb, var(--brand-primary) 8%, transparent);
--wd-tint-strong: color-mix(in srgb, var(--brand-primary) 14%, transparent);
--wd-accent-line: color-mix(in srgb, var(--brand-primary) 28%, transparent);
--wd-danger: var(--ui-color-danger);
--wd-danger-tint: color-mix(in srgb, var(--ui-color-danger) 8%, transparent);
--wd-focus: var(--brand-primary);
position: relative;
min-width: 0;
color: var(--wd-ink);
}
.weyai-download--standalone {
min-height: calc(100vh - 60px);
overflow: hidden;
margin-top: calc(
var(--console-header-offset, 72px) - var(--content-top-offset, 0px)
);
min-height: calc(100dvh - var(--console-header-offset, 72px));
background: var(--surface-bg-base);
}
.weyai-download__inner {
position: relative;
z-index: 10;
max-width: 1120px;
margin: 0 auto;
padding: 16px;
padding: 24px 30px;
display: flex;
flex-direction: column;
gap: 20px;
gap: 18px;
}
@media (min-width: 640px) {
@media (max-width: 768px) {
.weyai-download__inner {
padding: 24px;
gap: 24px;
}
}
@media (min-width: 1024px) {
.weyai-download__inner {
padding: 32px;
padding: 16px;
}
}
/* 嵌入用户中心:跟随内容区宽度,不再居中收窄;内边距与面包屑对齐 .uc-page 统一边距 */
@@ -56,14 +45,9 @@
padding: var(--uc-page-pad-top, 30px) var(--uc-page-pad-x, 36px)
var(--uc-page-pad-bottom, 36px);
}
.weyai-download--embedded .ui-user-center-breadcrumb {
margin-bottom: 0;
}
/* 「其他平台与架构」锚点:独立路由下顶栏 64px 与跑马灯 40px 都是 fixed,
scrollIntoView 会把标题顶到它们后面;嵌入模式滚动容器本身在顶栏之下 */
/* Keep package headings visible below the fixed header and announcement. */
.weyai-download--standalone #weyai-download-all {
scroll-margin-top: 120px;
scroll-margin-top: calc(var(--console-header-offset, 72px) + 16px);
}
.weyai-download--embedded #weyai-download-all {
scroll-margin-top: 16px;
@@ -71,11 +55,13 @@
/* ───── hero ───── */
.wd-hero {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
justify-content: space-between;
gap: 16px 24px;
min-width: 0;
}
.wd-hero > .wd-eyebrow {
margin-bottom: 8px;
}
.wd-hero .uc-page-header {
margin-bottom: 0;
}
.wd-eyebrow {
display: inline-flex;
@@ -87,25 +73,6 @@
letter-spacing: 0.08em;
text-transform: uppercase;
}
.wd-hero h1 {
margin: 8px 0 6px;
font-size: 24px;
font-weight: 700;
letter-spacing: -0.01em;
line-height: 1.3;
color: var(--wd-ink);
}
@media (min-width: 640px) {
.wd-hero h1 {
font-size: 28px;
}
}
.wd-hero p {
margin: 0;
font-size: 13px;
line-height: 20px;
color: var(--wd-muted);
}
.wd-hero-meta {
display: flex;
flex-wrap: wrap;
@@ -119,7 +86,7 @@
gap: 6px;
padding: 3px 10px;
border: 1px solid var(--wd-accent-line);
border-radius: 999px;
border-radius: 8px;
background: var(--wd-tint);
font-size: 12px;
font-weight: 600;
@@ -141,7 +108,7 @@
/* ───── 卡片基础 ───── */
.wd-card {
border: 1px solid var(--wd-line);
border-radius: 14px;
border-radius: 12px;
background: var(--wd-card);
}
@@ -149,28 +116,21 @@
.wd-reco {
position: relative;
overflow: hidden;
padding: 20px;
padding: 24px;
border-color: var(--wd-accent-line);
background:
radial-gradient(120% 160% at 100% 0%, var(--wd-tint) 0%, transparent 55%),
var(--wd-card);
}
@media (min-width: 640px) {
.wd-reco {
padding: 24px 28px;
}
background: var(--wd-card);
}
.wd-reco::before {
content: '';
position: absolute;
inset: 0 auto 0 0;
width: 4px;
background: linear-gradient(180deg, var(--wd-accent), var(--wd-accent-deep));
background: var(--wd-accent);
}
.wd-reco__row {
display: flex;
flex-direction: column;
gap: 18px;
gap: 16px;
}
@media (min-width: 768px) {
.wd-reco__row {
@@ -192,7 +152,7 @@
justify-content: center;
width: 52px;
height: 52px;
border-radius: 14px;
border-radius: 10px;
border: 1px solid var(--wd-accent-line);
background: var(--wd-tint-strong);
color: var(--wd-accent-deep);
@@ -233,7 +193,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
gap: 8px;
}
@media (min-width: 768px) {
.wd-reco__actions {
@@ -247,7 +207,7 @@
.wd-features {
display: grid;
grid-template-columns: minmax(0, 1fr);
gap: 12px;
gap: 16px;
}
@media (min-width: 640px) {
.wd-features {
@@ -273,14 +233,6 @@
display: flex;
gap: 12px;
padding: 14px 16px;
transition:
transform 0.18s ease,
box-shadow 0.18s ease;
}
.wd-feature:hover {
transform: translateY(-2px);
box-shadow: 0 8px 24px -12px
color-mix(in srgb, var(--ui-color-primary) 45%, transparent);
}
.wd-feature__icon {
flex-shrink: 0;
@@ -317,8 +269,8 @@
}
.wd-section-head h2 {
margin: 0;
font-size: 16px;
font-weight: 700;
font-size: 15px;
font-weight: 600;
letter-spacing: -0.01em;
color: var(--wd-ink);
}
@@ -384,7 +336,9 @@
gap: 12px;
padding: 12px 16px;
border-bottom: 1px solid var(--wd-line);
transition: background 0.15s ease;
}
.wd-file > .ant-btn {
flex-shrink: 0;
}
.wd-file:last-child {
border-bottom: 0;
@@ -403,10 +357,18 @@
flex-wrap: wrap;
align-items: center;
gap: 6px;
font-size: 13px;
font-size: 14px;
font-weight: 600;
color: var(--wd-ink);
}
.wd-file__title .ant-tag {
margin-inline-end: 0;
}
.wd-recommended-tag.ant-tag {
color: var(--wd-accent);
background: var(--wd-tint);
border-color: var(--wd-accent-line);
}
.wd-file__meta {
display: block;
margin-top: 2px;
@@ -443,8 +405,8 @@
width: 28px;
height: 28px;
border-radius: 999px;
background: linear-gradient(135deg, var(--wd-accent), var(--wd-accent-deep));
color: var(--ui-color-white, var(--surface-card));
background: var(--wd-tint-strong);
color: var(--wd-accent);
font-size: 13px;
font-weight: 700;
font-variant-numeric: tabular-nums;
@@ -478,7 +440,7 @@
justify-content: center;
width: 56px;
height: 56px;
border-radius: 16px;
border-radius: 12px;
background: var(--wd-tint);
color: var(--wd-accent-deep);
margin-bottom: 4px;
@@ -523,7 +485,17 @@
.weyai-download button:focus-visible,
.weyai-download a:focus-visible {
outline: 2px solid
color-mix(in srgb, var(--ui-color-primary) 55%, transparent);
outline: 2px solid var(--wd-focus);
outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
.weyai-download .ant-btn,
.weyai-download .wd-skeleton .ant-skeleton.ant-skeleton-active *,
.weyai-download *,
.weyai-download *::before,
.weyai-download *::after {
animation: none;
transition: none;
scroll-behavior: auto;
}
}