138 lines
4.1 KiB
PHP
138 lines
4.1 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: 世豪定制视觉增强
|
|
* Description: 为世豪网站建设开发提供左侧菜单栏布局、高级视觉样式和字体。
|
|
*/
|
|
|
|
function shihao_enqueue_custom_styles() {
|
|
?>
|
|
<style>
|
|
:root {
|
|
--sidebar-width: 280px;
|
|
--primary-color: #0066FF;
|
|
--sidebar-bg: #1A1A1A;
|
|
--sidebar-text: #FFFFFF;
|
|
--body-bg: #F8F9FA;
|
|
}
|
|
|
|
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&family=Noto+Sans+SC:wght@400;700;900&display=swap');
|
|
|
|
body {
|
|
font-family: "Inter", "Noto Sans SC", sans-serif;
|
|
background-color: var(--body-bg);
|
|
margin: 0;
|
|
color: #333;
|
|
}
|
|
|
|
/* 侧边栏布局 - 仅在桌面端 */
|
|
@media (min-width: 1000px) {
|
|
body {
|
|
padding-left: var(--sidebar-width);
|
|
}
|
|
|
|
header.wp-block-template-part {
|
|
position: fixed;
|
|
left: 0;
|
|
top: 0;
|
|
bottom: 0;
|
|
width: var(--sidebar-width);
|
|
background-color: var(--sidebar-bg);
|
|
color: var(--sidebar-text);
|
|
padding: 40px 20px;
|
|
z-index: 9999;
|
|
display: flex;
|
|
flex-direction: column;
|
|
box-shadow: 4px 0 15px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
header .wp-block-group {
|
|
flex-direction: column !important;
|
|
align-items: flex-start !important;
|
|
width: 100% !important;
|
|
}
|
|
|
|
header .wp-block-site-title a {
|
|
color: var(--sidebar-text) !important;
|
|
font-size: 1.5rem !important;
|
|
margin-bottom: 40px;
|
|
display: block;
|
|
}
|
|
|
|
/* 垂直菜单 */
|
|
header .wp-block-navigation {
|
|
width: 100%;
|
|
}
|
|
|
|
header .wp-block-navigation__container {
|
|
flex-direction: column !important;
|
|
gap: 15px !important;
|
|
}
|
|
|
|
header .wp-block-navigation-item {
|
|
width: 100%;
|
|
}
|
|
|
|
header .wp-block-navigation-item__label {
|
|
color: rgba(255,255,255,0.7) !important;
|
|
font-size: 1.1rem !important;
|
|
padding: 10px 15px;
|
|
border-radius: 8px;
|
|
display: block;
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
header .wp-block-navigation-item__label:hover {
|
|
color: #fff !important;
|
|
background: rgba(255,255,255,0.1);
|
|
}
|
|
|
|
header .current-menu-item .wp-block-navigation-item__label {
|
|
background: var(--primary-color) !important;
|
|
color: #fff !important;
|
|
}
|
|
}
|
|
|
|
/* 移动端调整 */
|
|
@media (max-width: 999px) {
|
|
header.wp-block-template-part {
|
|
background: #fff;
|
|
padding: 15px;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
}
|
|
|
|
/* 全局美化 */
|
|
h1, h2, h3, h4, h5, h6 {
|
|
font-weight: 900;
|
|
letter-spacing: -0.02em;
|
|
color: #111;
|
|
}
|
|
|
|
.wp-block-button__link {
|
|
border-radius: 50px !important;
|
|
padding: 15px 35px !important;
|
|
font-weight: 700 !important;
|
|
transition: all 0.3s ease !important;
|
|
box-shadow: 0 10px 20px rgba(0, 102, 255, 0.15) !important;
|
|
}
|
|
|
|
.wp-block-group.has-background, .wp-block-column.has-background {
|
|
border-radius: 20px !important;
|
|
padding: 40px !important;
|
|
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
|
|
transition: transform 0.3s ease;
|
|
}
|
|
|
|
.wp-block-group.has-background:hover {
|
|
transform: translateY(-5px);
|
|
}
|
|
|
|
/* 去除底部默认版权 */
|
|
footer .wp-block-group {
|
|
border-top: 1px solid #eee;
|
|
padding-top: 40px !important;
|
|
}
|
|
</style>
|
|
<?php
|
|
}
|
|
add_action('wp_head', 'shihao_enqueue_custom_styles', 100);
|