- tokens:收紧 surface 层级/边框/圆角/阴影/间距与暗黑基线 - 组件:按钮、卡片原语、导航、侧栏、分页、模态、浮动按钮 - 首页:hero 外壳、fixed 列表/宫格、tab、skeleton/error 及各运营模块卡片化 - 内容页:单篇封面/标题/正文/blockquote/相关/TOC/上一篇下一篇、评论区 - 社区:forum board/topic/compose 子控件与卡片体系 - 交易/认证:cart/orders/revenue/product/auth 表面块与模态浮层统一 - footer:页脚主体、社交/联系、移动端 tabbar/搜索覆盖
335 lines
8.2 KiB
CSS
335 lines
8.2 KiB
CSS
/* ============================================================
|
||
* AKSRT Navigation — Editorial v3.4
|
||
*
|
||
* - 高度 60px (--nav-h)
|
||
* - 字体使用 --font-ui (Inter / 思源黑体)
|
||
* - 主色蓝调,hover 改为 primary-soft 浅底
|
||
* - 永远实心:白底深字 + 1px 分隔线,滚动后追加 box-shadow
|
||
* - 移动端:≤768 显示汉堡菜单
|
||
* ============================================================ */
|
||
|
||
.site-nav {
|
||
position: sticky;
|
||
top: 0;
|
||
z-index: 1000;
|
||
min-height: var(--nav-height, 60px);
|
||
background-color: var(--blur-bg);
|
||
border-bottom: 1px solid rgba(255, 255, 255, 0.45);
|
||
backdrop-filter: saturate(5) blur(20px);
|
||
-webkit-backdrop-filter: saturate(5) blur(20px);
|
||
transition: background-color 0.25s ease,
|
||
border-color 0.25s ease,
|
||
color 0.25s ease,
|
||
box-shadow 0.25s ease,
|
||
transform 0.3s ease; /* 滚动隐藏过渡 */
|
||
}
|
||
|
||
/* 滚动隐藏头部 — 对齐 zibll .scroll-down.nav-fixed .header.scroll-down-hide */
|
||
.site-nav.is-hidden {
|
||
transform: translateY(-105%);
|
||
}
|
||
|
||
.site-nav--static {
|
||
position: relative;
|
||
}
|
||
|
||
.site-nav--transparent {
|
||
background: transparent; /* 对齐 zibll .header.show-slide: 透明覆盖在 slider 上 */
|
||
border-bottom-color: transparent;
|
||
}
|
||
|
||
.site-nav--transparent:not(.is-scrolled) {
|
||
--header-color: #fff; /* 对齐 zibll --header-color:#fff */
|
||
color: #fff;
|
||
}
|
||
|
||
.site-nav--transparent:not(.is-scrolled) a {
|
||
color: inherit;
|
||
}
|
||
|
||
.site-nav--transparent.is-scrolled {
|
||
background: var(--blur-bg); /* 滚动后恢复毛玻璃背景 */
|
||
border-bottom-color: var(--color-line-soft);
|
||
}
|
||
|
||
.site-nav--blur {
|
||
background: var(--blur-bg);
|
||
backdrop-filter: saturate(5) blur(20px);
|
||
-webkit-backdrop-filter: saturate(5) blur(20px);
|
||
border-bottom-color: transparent;
|
||
}
|
||
|
||
html.dark .site-nav--transparent:not(.is-scrolled),
|
||
html.dark .site-nav--blur:not(.is-scrolled),
|
||
body.dark-theme .site-nav--transparent:not(.is-scrolled),
|
||
body.dark-theme .site-nav--blur:not(.is-scrolled) {
|
||
background: transparent;
|
||
border-bottom-color: transparent;
|
||
}
|
||
|
||
html.dark .site-nav--transparent.is-scrolled,
|
||
html.dark .site-nav--blur.is-scrolled,
|
||
body.dark-theme .site-nav--transparent.is-scrolled,
|
||
body.dark-theme .site-nav--blur.is-scrolled {
|
||
background: var(--blur-bg);
|
||
border-bottom-color: var(--color-line-soft);
|
||
}
|
||
|
||
/* 滚动后追加阴影 — 对齐 zibll .body-scroll .header */
|
||
.site-nav.is-scrolled {
|
||
box-shadow: var(--shadow-sm);
|
||
}
|
||
|
||
/* WordPress Admin Bar 已全局禁用,无需偏移规则 */
|
||
|
||
/* ============================================================
|
||
* Inner / Row layout
|
||
* ============================================================ */
|
||
.site-nav__inner {
|
||
max-width: var(--nav-max-width, var(--container));
|
||
margin: 0 auto;
|
||
padding: 0 16px;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 0;
|
||
}
|
||
|
||
.site-nav__row {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: flex-start;
|
||
gap: 12px;
|
||
width: 100%;
|
||
min-height: var(--nav-height, 60px);
|
||
}
|
||
|
||
/* ============================================================
|
||
* Brand
|
||
* ============================================================ */
|
||
.site-brand {
|
||
display: inline-flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
min-width: 0;
|
||
max-width: min(48vw, 360px);
|
||
padding: 7px 10px;
|
||
color: var(--color-ink);
|
||
font-size: 17px;
|
||
font-weight: 700;
|
||
letter-spacing: -0.01em;
|
||
flex-shrink: 0;
|
||
text-decoration: none;
|
||
}
|
||
|
||
.site-brand:hover {
|
||
color: var(--color-ink);
|
||
text-decoration: none;
|
||
}
|
||
|
||
.site-brand--has-logo {
|
||
gap: 0;
|
||
}
|
||
|
||
.site-brand__logo {
|
||
width: 36px;
|
||
height: 36px;
|
||
border-radius: 8px;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-weight: 800;
|
||
font-size: 13px;
|
||
color: var(--color-on-primary, #fff);
|
||
background: linear-gradient(135deg, var(--color-primary), var(--color-primary-active, var(--color-primary-dark)));
|
||
letter-spacing: 0.02em;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.site-brand__media {
|
||
display: block;
|
||
flex: 0 1 auto;
|
||
max-width: 100%;
|
||
padding: 0 30px;
|
||
line-height: 0;
|
||
box-sizing: border-box;
|
||
background: transparent !important;
|
||
border: 0;
|
||
border-radius: 0;
|
||
box-shadow: none;
|
||
filter: none !important;
|
||
opacity: 1;
|
||
}
|
||
|
||
.site-brand__img {
|
||
display: block;
|
||
height: 36px;
|
||
width: auto;
|
||
max-width: 100%;
|
||
object-fit: contain;
|
||
object-position: left center;
|
||
background: transparent !important;
|
||
border-radius: 0;
|
||
box-shadow: none;
|
||
filter: none !important;
|
||
mix-blend-mode: normal !important;
|
||
opacity: 1;
|
||
transform: none !important;
|
||
}
|
||
|
||
.site-brand__name {
|
||
font-weight: 700;
|
||
letter-spacing: -0.01em;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
/* Light/dark logo toggle */
|
||
.site-brand__logo-img--dark {
|
||
display: none;
|
||
}
|
||
|
||
html.dark .site-brand__logo-img--light,
|
||
[data-theme="dark"] .site-brand__logo-img--light,
|
||
body.dark-theme .site-brand__logo-img--light {
|
||
display: none;
|
||
}
|
||
|
||
html.dark .site-brand__logo-img--dark,
|
||
[data-theme="dark"] .site-brand__logo-img--dark,
|
||
body.dark-theme .site-brand__logo-img--dark {
|
||
display: inline-block;
|
||
}
|
||
|
||
/* ============================================================
|
||
* Desktop menu
|
||
* ============================================================ */
|
||
ul.nav-desktop {
|
||
display: none;
|
||
list-style: none;
|
||
margin: 0;
|
||
padding: 0;
|
||
align-items: center;
|
||
flex: 1 1 auto;
|
||
min-width: 0;
|
||
}
|
||
|
||
.nav-desktop--fallback {
|
||
display: none;
|
||
align-items: center;
|
||
flex: 1 1 auto;
|
||
min-width: 0;
|
||
}
|
||
|
||
ul.nav-desktop a,
|
||
.nav-desktop--fallback a {
|
||
color: var(--color-ink-3);
|
||
font-size: 14px;
|
||
font-weight: 500;
|
||
padding: 0 12px; /* 对齐 zibll:仅水平 padding,垂直居中靠 flex 行高 */
|
||
border-radius: 4px;
|
||
transition: color var(--dur-fast, 0.15s) var(--ease),
|
||
background var(--dur-fast, 0.15s) var(--ease);
|
||
}
|
||
|
||
/* Hover — 对齐 zibll: 仅变色,无背景 */
|
||
ul.nav-desktop a:hover,
|
||
.nav-desktop--fallback a:hover {
|
||
color: var(--color-primary);
|
||
background: transparent;
|
||
}
|
||
|
||
/* Active page — 对齐 zibll: 仅变色(指示器走下方胶囊条) */
|
||
ul.nav-desktop .current-menu-item > a,
|
||
ul.nav-desktop .current_page_item > a {
|
||
color: var(--color-primary);
|
||
background: transparent;
|
||
}
|
||
|
||
/* ============================================================
|
||
* Desktop submenu (dropdown)
|
||
* ============================================================ */
|
||
ul.nav-desktop .menu-item {
|
||
position: relative;
|
||
}
|
||
|
||
/* 顶部 hover/current 胶囊指示器 — 对齐 zibll .navbar-nav>li:before
|
||
(5px 高、底部 15px 圆角,从 header 顶缘垂下)。
|
||
stretch 链(row→ul→li)让 li 充满 60px 行高,::before top:0 即锚定 header 顶部;
|
||
::before 为 absolute 不进入 flex 流,不挤压链接。 */
|
||
ul.nav-desktop {
|
||
align-self: stretch;
|
||
}
|
||
|
||
ul.nav-desktop > .menu-item {
|
||
align-self: stretch;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
ul.nav-desktop > .menu-item::before {
|
||
content: '';
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
height: 5px;
|
||
background: var(--focus-color, var(--color-primary));
|
||
border-radius: 0 0 15px 15px;
|
||
opacity: 0;
|
||
transition: opacity 0.3s;
|
||
pointer-events: none;
|
||
}
|
||
|
||
ul.nav-desktop > .menu-item:hover::before,
|
||
ul.nav-desktop > .current-menu-item::before,
|
||
ul.nav-desktop > .current_page_item::before {
|
||
opacity: 1;
|
||
}
|
||
|
||
ul.nav-desktop .sub-menu {
|
||
position: absolute;
|
||
top: 100%;
|
||
left: 0;
|
||
z-index: 998; /* 保留较高 z-index(zibll 用 99,AKSRT 栈更深,避免被覆盖) */
|
||
min-width: 140px;
|
||
list-style: none;
|
||
margin: 8px 0 0;
|
||
padding: 8px 6px;
|
||
background: var(--main-bg-color, #fff);
|
||
border: 1px solid rgba(255, 255, 255, 0.55);
|
||
border-radius: var(--radius-lg, 10px);
|
||
box-shadow: var(--shadow-lg);
|
||
opacity: 0;
|
||
visibility: hidden;
|
||
transform: translateY(6px);
|
||
transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
|
||
}
|
||
|
||
ul.nav-desktop .menu-item:hover > .sub-menu {
|
||
opacity: 1;
|
||
visibility: visible;
|
||
transform: translateY(0);
|
||
}
|
||
|
||
ul.nav-desktop .sub-menu .menu-item > a {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
padding: 8px 15px;
|
||
font-size: 14px;
|
||
border-radius: 4px;
|
||
white-space: nowrap;
|
||
}
|
||
|
||
ul.nav-desktop .sub-menu .menu-item > a:hover {
|
||
background: var(--color-primary-soft, rgba(240, 68, 148, 0.08));
|
||
color: var(--color-primary);
|
||
}
|
||
|
||
/* Nested submenus fly out to the right — 对齐 zibll top:-10px,去 margin-left */
|
||
ul.nav-desktop .sub-menu .sub-menu {
|
||
top: -10px;
|
||
left: 100%;
|
||
margin: 0;
|
||
}
|
||
|