Files
wordpress-theme-aksrt/assets/css/routes/user-center/shell.css
T
kate522 4b18f7ef2c fix(user-center): replicate reference theme sidebar icons via SVG sprite
The user-center sidebar rendered Font Awesome glyphs while the reference theme
paints multi-tone inline SVGs, and several glyphs were simply wrong for their
slot: fa-chart-line served both 我的等级 and 推广收益, fa-money-bill served both
余额 and 积分, and fa-pen stood in for 创作收益.

The theme already ships every sprite key the reference sidebar needs in
assets/js/runtime/svg-icon.js, and main.min.js injects the <symbol id="icon-*">
set on every frontend page, so no new icon system was needed. The two grids now
use the reference theme's icon-but-box / user-icon-but-box shell (four per row,
em16 icon, 12px muted label) in place of AKSRT's tinted 38px pill, and every
remaining sidebar glyph and arrow resolves through aksrt_icon_markup():

  我的服务  我的等级 trend-color, 官方认证 user-auth, 我的订单 order-color
  功能设置  消息通知 msg-color, 个人资料 user-color, 账户安全 security-color
  资产卡    余额 money-color-2, 积分 points-color
  中心卡    创作收益 merchant-color, 推广收益 money-color
  其它      VIP 入口 vip_1, 抽屉触发器 menu, 箭头统一 right

Dead code went with the swap: the whole .uc-service-grid block including the
unused --cart and --revenue tones, the count badge (no caller ever set count),
and the tone key. The two card selectors that targeted <i> now also cover <svg>
so the icon sizes survive the element change, and the VIP arrow keeps
uc-sidebar-vip__arrow for its hover animation. level/profile/settings gained
their missing tab keys, which completes the icon-but-* class names and lets the
existing .is-active sync cover all six entries.

Verification: node --test across widget-system, navigation, admin,
asset-ledger, dev, front-submit and fixtures (620 tests), plus php -l on the
five changed PHP files. Contract-locked in
tests/widget-system/user-center-sidebar-icons-contract.test.cjs.
2026-10-18 12:55:30 +08:00

732 lines
17 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.
/**
* User Center — shell / sidebar / content base / drawer
*/
/**
* AKSRT User Center — 本人中心专属样式
*
* 原主题风格两栏布局:左侧边栏 + 右侧内容区
* 仅在本人中心页面加载(body.aksrt-user-center)
*/
/* ==================== 用户中心容器 ==================== */
/* 主内容宽度由 frontend/layout.css 的 profile shell 合同统一管理。 */
.aksrt-profile.content-shell {
display: block;
width: 100%;
max-width: none;
padding: 0 0 40px;
box-sizing: border-box;
}
/* main 仍带 legacy .user-center 类;旧规则会把整页误设为 flex,并以
* gap:20px 挤窄第一个 flex 子项(顶部资料卡所在的 content-wrap)。 */
.aksrt-profile.user-center {
display: block;
gap: 0;
}
/* 顶部资料卡位于双栏布局之前,必须与用户中心外壳同宽,不能继续继承
* legacy .content-wrap / .container 的收窄规则。 */
.aksrt-profile.content-shell > .content-wrap,
.aksrt-profile.content-shell > .content-wrap > .uc-header,
.aksrt-profile.content-shell .uc-header {
width: 100%;
max-width: none;
box-sizing: border-box;
}
/* VIP, level and worn-medal marks share the global identity baseline. */
.uc-header__name > .img-icon,
h1.uc-header__name > .img-icon,
.uc-header__name .medal-icon.img-icon,
.uc-header__name .aksrt-identity-medal,
h1.uc-header__name .medal-icon.img-icon,
h1.uc-header__name .aksrt-identity-medal {
width: auto;
height: 1.1em;
max-width: 6em;
object-fit: contain;
vertical-align: -.15em;
margin-left: 4px;
display: inline-block;
border: none;
outline: none;
box-shadow: none;
background: transparent;
}
/* ==================== 页面自有双栏(对齐 legacy .user-center flex,不走全站 float 壳) ==================== */
/* DOM: sidebar first + content second(与 legacy user-center-sidebar / user-center-content 一致)。
* 选择器同时覆盖 body.aksrt-user-center 与 main.user-center / .aksrt-profile,避免 body class 漏打时失效。 */
body.aksrt-user-center .content-wrap,
.aksrt-profile .content-wrap,
.user-center .content-wrap {
float: none;
width: 100%;
min-width: 0;
}
/* 对齐 legacy: .user-center { display:flex; gap:20px; } */
body.aksrt-user-center .user-center-body,
body.aksrt-user-center .aksrt-profile__layout,
.aksrt-profile .user-center-body,
.aksrt-profile .aksrt-profile__layout,
.user-center .user-center-body {
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: flex-start;
gap: 20px;
width: 100%;
margin-left: 0;
margin-right: 0;
min-width: 0;
box-sizing: border-box;
}
/* 中和 site-layout-2/3 对 content-layout 的 margin 挖空(兼容旧 class) */
body.aksrt-user-center.site-layout-1 .aksrt-profile__layout,
body.aksrt-user-center.site-layout-2 .aksrt-profile__layout,
body.aksrt-user-center.site-layout-3 .aksrt-profile__layout,
body.aksrt-user-center.site-layout-1 .user-center-body,
body.aksrt-user-center.site-layout-2 .user-center-body,
body.aksrt-user-center.site-layout-3 .user-center-body {
margin-left: 0;
margin-right: 0;
}
/* 对齐 legacy: .user-center .user-center-sidebar { width:320px; flex-shrink:0; } */
body.aksrt-user-center .user-center-sidebar,
body.aksrt-user-center .uc-sidebar,
body.aksrt-user-center .aksrt-profile__aside,
.aksrt-profile .user-center-sidebar,
.aksrt-profile .uc-sidebar,
.aksrt-profile .aksrt-profile__aside,
.user-center .user-center-sidebar {
float: none;
display: flex;
flex-direction: column;
gap: 12px;
flex: 0 0 320px;
width: 320px;
max-width: 320px;
margin-left: 0;
margin-right: 0;
box-sizing: border-box;
min-width: 0;
position: sticky;
top: calc(var(--nav-height, 60px) + 20px);
align-self: flex-start;
}
/* 对齐 legacy: .user-center .user-center-content { width: calc(100% - 320px); } */
body.aksrt-user-center .user-center-content,
body.aksrt-user-center .uc-content,
.aksrt-profile .user-center-content,
.aksrt-profile .uc-content,
.user-center .user-center-content {
flex: 1 1 auto;
width: calc(100% - 340px);
min-width: 0;
max-width: none;
box-sizing: border-box;
}
.uc-header__actions {
position: relative;
display: flex;
align-items: center;
gap: 6px;
}
.uc-header__signin-btn.is-done {
color: var(--color-success, #10b981);
}
.uc-header__message-btn {
position: relative;
}
.uc-header__action-badge {
position: absolute;
top: -5px;
right: -5px;
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 16px;
height: 16px;
margin: 0;
padding: 0 4px;
border-radius: 999px;
background: var(--color-error, #ef4444);
color: #fff;
font-size: 11px;
font-weight: 700;
line-height: 1;
}
/* ==================== 左侧边栏 chrome ==================== */
/* sticky / 宽度由 .user-center-sidebar 负责;此处只定 section/btn 视觉 */
.uc-sidebar {
display: flex;
flex-direction: column;
gap: 12px;
}
.uc-sidebar__section {
background: var(--surface-1);
border-radius: var(--main-radius, var(--radius, 8px));
padding: 16px;
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
border: 1px solid var(--color-line-soft, transparent);
}
.uc-sidebar__title {
font-size: 12px;
font-weight: 600;
color: var(--color-ink-4);
margin-bottom: 12px;
text-transform: uppercase;
letter-spacing: 0.05em;
padding-bottom: 8px;
border-bottom: 1px solid var(--color-line-soft, rgba(0,0,0,0.06));
}
/* 数据统计 */
.uc-stats {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px;
}
.uc-stats__item {
display: flex;
flex-direction: column;
align-items: center;
padding: 12px 6px;
border-radius: 8px;
background: var(--surface-2);
text-decoration: none;
transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.uc-stats__item:hover {
background: var(--color-primary-soft);
transform: none;
box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}
.uc-stats__value {
font-size: 1.25rem;
font-weight: 700;
color: var(--color-primary);
line-height: 1.2;
font-variant-numeric: tabular-nums;
}
.uc-stats__label {
font-size: 11px;
color: var(--color-ink-4);
margin-top: 3px;
}
/* 侧栏按钮组 */
.uc-sidebar__buttons {
display: flex;
flex-direction: column;
gap: 2px;
}
.uc-sidebar__btn {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 10px 12px;
border: none;
border-radius: 8px;
background: transparent;
color: var(--color-ink-2);
text-decoration: none;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
text-align: left;
position: relative;
}
.uc-sidebar__btn::before {
content: '';
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 3px;
height: 0;
background: var(--color-primary);
border-radius: 0 3px 3px 0;
transition: height 0.2s ease;
}
.uc-sidebar__btn:hover {
background: var(--surface-2);
color: var(--color-ink);
}
.uc-sidebar__btn.is-active {
background: var(--color-primary-soft);
color: var(--color-primary);
font-weight: 600;
}
.uc-sidebar__btn.is-active::before {
height: 20px;
}
.uc-sidebar__btn i {
width: 18px;
text-align: center;
font-size: 14px;
flex-shrink: 0;
opacity: 0.8;
}
.uc-sidebar__btn.is-active i {
opacity: 1;
}
.uc-sidebar__badge {
margin-left: auto;
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 18px;
height: 18px;
padding: 0 5px;
border-radius: 100px;
background: var(--color-error);
color: #fff;
font-size: 11px;
font-weight: 600;
line-height: 1;
animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
/* 移动端抽屉触发器 */
.uc-sidebar__drawer-trigger {
display: none;
position: fixed;
bottom: calc(80px + env(safe-area-inset-bottom, 0px));
right: calc(20px + env(safe-area-inset-right, 0px));
width: 50px;
height: 50px;
border-radius: 50%;
border: none;
background: var(--color-primary);
color: #fff;
font-size: 20px;
cursor: pointer;
box-shadow: 0 4px 16px rgba(0,0,0,0.25);
z-index: 100;
align-items: center;
justify-content: center;
transition: transform 0.2s, box-shadow 0.2s;
}
.uc-sidebar__drawer-trigger:hover {
transform: scale(1.02);
box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.uc-sidebar__drawer-trigger:active {
transform: scale(0.92);
}
/* 抽屉遮罩 */
.uc-drawer-overlay {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,0.45);
backdrop-filter: blur(2px);
-webkit-backdrop-filter: blur(2px);
z-index: 200;
opacity: 0;
transition: opacity 0.3s;
}
.uc-drawer-overlay.is-visible {
display: block;
opacity: 1;
}
/* ==================== 右侧内容区 ==================== */
/* 宽度由 .user-center-content / flex 行负责;此处只定内容区 min-width */
.uc-content {
min-width: 0;
}
.uc-content .dashboard-panel {
background: var(--surface-1);
border-radius: var(--main-radius, var(--radius, 8px));
padding: 24px;
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
border: 1px solid var(--color-line-soft, transparent);
animation: panel-fade-in 0.25s ease;
}
@keyframes panel-fade-in {
from { opacity: 0; transform: translateY(6px); }
to { opacity: 1; transform: translateY(0); }
}
.uc-content .dashboard-panel.is-active {
display: block;
}
/* 面板内 widget-card 增强 */
.uc-content .widget-card {
border: 1px solid var(--color-line-soft, rgba(0,0,0,0.06));
border-radius: 10px;
padding: 20px;
margin-bottom: 16px;
background: var(--surface-1);
transition: box-shadow 0.2s;
}
.uc-content .widget-card:hover {
box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.uc-content .dashboard-panel:not(#panel-settings) > .widget-card,
.uc-content #panel-profile .profile-form > .widget-card {
background: transparent;
border: 0;
border-radius: 0;
box-shadow: none;
margin-bottom: 0;
padding: 0;
}
.uc-content .dashboard-panel:not(#panel-settings) > .widget-card:hover,
.uc-content #panel-profile .profile-form > .widget-card:hover {
box-shadow: none;
}
.uc-content #panel-profile .profile-form > .widget-card + .widget-card {
margin-top: 18px;
padding-top: 18px;
border-top: 1px solid var(--color-line-soft, rgba(0,0,0,0.06));
}
/* ==================== 侧栏账户仪表盘 ==================== */
.uc-sidebar__section--stats {
padding: 8px 10px;
}
.uc-sidebar__heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
margin-bottom: 14px;
color: var(--color-ink, #172033);
font-size: 14px;
font-weight: 700;
}
.uc-sidebar__heading > a {
display: inline-flex;
align-items: center;
gap: 5px;
color: var(--color-ink-4);
font-size: 12px;
font-weight: 500;
text-decoration: none;
}
.uc-sidebar__heading > a:hover {
color: var(--color-primary);
}
.uc-stats {
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 0;
}
.uc-stats__item {
position: relative;
gap: 2px;
padding: 8px 2px;
background: transparent;
}
.uc-stats__item + .uc-stats__item::before {
content: '';
position: absolute;
top: 12px;
bottom: 12px;
left: 0;
width: 1px;
background: var(--color-line-soft, rgba(15, 23, 42, 0.07));
}
.uc-stats__item:hover {
background: var(--surface-2);
box-shadow: none;
}
.uc-stats__value {
color: var(--color-ink, #172033);
font-size: 17px;
letter-spacing: -0.02em;
}
.uc-stats__label {
margin: 0;
font-size: 11px;
}
/* VIP 入口:琥珀会员券,与下方中性资产卡形成主次层级 */
.uc-sidebar .uc-sidebar-vip {
position: relative;
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
gap: 11px;
min-width: 0;
overflow: hidden;
padding: 13px 14px;
border: 1px solid rgba(255, 232, 177, 0.34);
border-radius: var(--main-radius, var(--radius, 8px));
background:
radial-gradient(circle at 88% 12%, rgba(255, 239, 190, 0.2), transparent 34%),
linear-gradient(122deg, #4a2b13 0%, #7c4a1c 48%, #a86d28 100%);
box-shadow: 0 7px 18px rgba(91, 50, 15, 0.18);
color: #fff8e8;
text-decoration: none;
isolation: isolate;
transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.uc-sidebar .uc-sidebar-vip::after {
content: '';
position: absolute;
z-index: -1;
top: -80%;
left: 58%;
width: 34px;
height: 260%;
background: linear-gradient(90deg, transparent, rgba(255, 246, 211, 0.14), transparent);
transform: rotate(24deg);
pointer-events: none;
}
.uc-sidebar-vip__icon {
display: inline-flex;
place-items: center;
align-items: center;
justify-content: center;
width: auto;
height: auto;
border: 0;
border-radius: 0;
background: transparent;
box-shadow: none;
color: #ffd982;
font-size: 16px;
}
.uc-sidebar-vip__icon .aksrt-vip-level-icon {
width: auto;
height: 1.5em;
max-width: 6em;
object-fit: contain;
vertical-align: middle;
}
.uc-sidebar-vip__content {
min-width: 0;
}
.uc-sidebar-vip__content strong,
.uc-sidebar-vip__content small {
display: block;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.uc-sidebar-vip__content strong {
color: #fffaf0;
font-size: 14px;
font-weight: 700;
letter-spacing: 0.01em;
line-height: 1.35;
}
.uc-sidebar-vip__content small {
margin-top: 3px;
color: rgba(255, 244, 216, 0.76);
font-size: 11px;
line-height: 1.35;
}
.uc-sidebar-vip__arrow {
color: rgba(255, 244, 216, 0.72);
font-size: 12px;
transition: transform 0.2s ease, color 0.2s ease;
}
.uc-sidebar .uc-sidebar-vip:hover {
border-color: rgba(255, 235, 180, 0.58);
box-shadow: 0 10px 24px rgba(91, 50, 15, 0.25);
color: #fff8e8;
transform: translateY(-1px);
}
.uc-sidebar .uc-sidebar-vip:hover .uc-sidebar-vip__arrow {
color: #fff4d8;
transform: translateX(2px);
}
.uc-sidebar .uc-sidebar-vip:focus-visible {
outline: 3px solid rgba(244, 180, 67, 0.42);
outline-offset: 2px;
}
@media (max-width: 991.98px) {
.uc-sidebar .uc-sidebar-vip {
margin-right: 12px;
margin-left: 12px;
}
}
@media (prefers-reduced-motion: reduce) {
.uc-sidebar .uc-sidebar-vip,
.uc-sidebar-vip__arrow {
transition: none;
}
.uc-sidebar .uc-sidebar-vip:hover,
.uc-sidebar .uc-sidebar-vip:hover .uc-sidebar-vip__arrow {
transform: none;
}
}
.uc-sidebar__pair {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.uc-summary-card,
.uc-center-card {
min-width: 0;
border: 1px solid var(--color-line-soft, rgba(15, 23, 42, 0.06));
border-radius: var(--main-radius, var(--radius, 8px));
background: var(--surface-1);
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
color: var(--color-ink-2);
text-decoration: none;
}
.uc-summary-card {
padding: 14px;
}
.uc-summary-card__head,
.uc-summary-card__body {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
.uc-summary-card__head {
margin-bottom: 10px;
color: var(--color-ink-4);
font-size: 12px;
}
.uc-summary-card__body strong {
overflow: hidden;
font-size: 18px;
font-variant-numeric: tabular-nums;
letter-spacing: -0.02em;
text-overflow: ellipsis;
}
.uc-summary-card__body > i,
.uc-summary-card__body > svg {
font-size: 18px;
}
.uc-summary-card--wallet .uc-summary-card__body { color: #3978d6; }
.uc-summary-card--points .uc-summary-card__body { color: #ba7a0a; }
.uc-center-card {
display: grid;
grid-template-columns: auto minmax(0, 1fr) auto;
align-items: center;
gap: 9px;
padding: 13px 12px;
}
.uc-center-card__icon {
display: grid;
place-items: center;
width: 34px;
height: 34px;
border-radius: 12px;
font-size: 15px;
}
.uc-center-card strong,
.uc-center-card small {
display: block;
white-space: nowrap;
}
.uc-center-card strong { font-size: 13px; }
.uc-center-card small { margin-top: 3px; color: var(--color-ink-4); font-size: 10px; }
.uc-center-card > i,
.uc-center-card > svg { color: var(--color-ink-4); font-size: 11px; }
.uc-center-card--creation .uc-center-card__icon { color: #6650c7; background: rgba(124, 92, 220, 0.12); }
.uc-center-card--revenue .uc-center-card__icon { color: #ce6b35; background: rgba(234, 112, 55, 0.12); }
/* Services / settings grids, ported from the reference theme sidebar:
four per row, no tinted tile behind the icon. */
.user-icon-but-box > a {
width: calc(25% - 10px);
margin: 5px;
min-width: 50px;
max-width: 100px;
color: var(--color-ink-3);
text-align: center;
text-decoration: none;
}
.user-icon-but-box > a:hover,
.user-icon-but-box > a.is-active {
color: var(--color-primary);
}
.uc-follow-management__list { display: grid; gap: 10px; margin-top: 16px; }
.uc-follow-management__item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border-color, rgba(15, 23, 42, .08)); border-radius: 12px; }
.uc-follow-management__avatar img { display: block; width: 48px; height: 48px; border-radius: 50%; }
.uc-follow-management__identity { display: grid; gap: 4px; min-width: 0; }
.uc-follow-management__identity a { color: var(--color-ink-1); font-weight: 600; }
.uc-follow-management__identity span { color: var(--color-ink-4); font-size: 12px; }
.uc-follow-management__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
@media (max-width: 560px) { .uc-follow-management__item { align-items: flex-start; flex-wrap: wrap; } .uc-follow-management__actions { width: 100%; margin-left: 60px; } }