www.skxjx/css/style.css
2025-05-05 08:12:39 +08:00

798 lines
14 KiB
CSS

/* 全局样式 - 默认暗黑模式 */
:root {
--primary-color: #0a192f;
--secondary-color: #64ffda;
--text-primary: #ccd6f6;
--text-secondary: #8892b0;
--white: #e6f1ff;
--bg-color: #0a192f;
--card-bg: rgba(10, 25, 47, 0.8);
--footer-bg: #020c1b;
--section-bg: rgba(100, 255, 218, 0.03);
--header-bg: rgba(10, 25, 47, 0.9);
}
/* 亮色模式 */
[data-theme="light"] {
--primary-color: #f8f9fa;
--secondary-color: #007bff;
--text-primary: #212529;
--text-secondary: #495057;
--white: #ffffff;
--bg-color: #f8f9fa;
--card-bg: rgba(255, 255, 255, 0.9);
--footer-bg: #e9ecef;
--section-bg: rgba(0, 123, 255, 0.03);
--header-bg: rgba(248, 249, 250, 0.9);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
transition: background-color 0.3s ease, color 0.3s ease;
}
body {
background-color: var(--bg-color);
color: var(--text-primary);
line-height: 1.6;
}
a {
text-decoration: none;
color: var(--secondary-color);
transition: all 0.3s ease;
}
a:hover {
color: var(--white);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
.btn {
display: inline-block;
padding: 12px 28px;
background: transparent;
color: var(--secondary-color);
border: 1px solid var(--secondary-color);
border-radius: 4px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
}
.btn:hover {
background: rgba(100, 255, 218, 0.1);
transform: translateY(-3px);
}
[data-theme="light"] .btn:hover {
background: rgba(0, 123, 255, 0.1);
}
/* 导航栏 */
header {
position: fixed;
top: 0;
left: 0;
right: 0;
background-color: var(--header-bg);
backdrop-filter: blur(10px);
z-index: 1000;
padding: 20px 0;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 24px;
font-weight: 700;
color: var(--secondary-color);
}
.nav-links {
display: flex;
list-style: none;
align-items: center;
}
.nav-links li {
margin-left: 30px;
}
.nav-links a {
color: var(--text-primary);
font-size: 16px;
font-weight: 500;
}
.nav-links a:hover {
color: var(--secondary-color);
}
.logo img {
width: auto;
height: 50px;
}
/* 汉堡菜单按钮 */
.hamburger {
display: none;
cursor: pointer;
width: 30px;
height: 21px;
position: relative;
z-index: 1001;
background: none;
border: none;
padding: 0;
}
.hamburger span {
display: block;
position: absolute;
height: 3px;
width: 100%;
background: var(--text-primary);
border-radius: 3px;
opacity: 1;
left: 0;
transform: rotate(0deg);
transition: .25s ease-in-out;
}
.hamburger span:nth-child(1) {
top: 0;
}
.hamburger span:nth-child(2),
.hamburger span:nth-child(3) {
top: 9px;
}
.hamburger span:nth-child(4) {
top: 18px;
}
.hamburger.open span:nth-child(1) {
top: 9px;
width: 0%;
left: 50%;
}
.hamburger.open span:nth-child(2) {
transform: rotate(45deg);
}
.hamburger.open span:nth-child(3) {
transform: rotate(-45deg);
}
.hamburger.open span:nth-child(4) {
top: 9px;
width: 0%;
left: 50%;
}
/* 主题切换开关 */
.theme-switch {
position: relative;
display: inline-block;
width: 60px;
height: 30px;
margin-left: 20px;
}
.theme-switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 34px;
}
.slider:before {
position: absolute;
content: "";
height: 22px;
width: 22px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked+.slider {
background-color: var(--secondary-color);
}
input:checked+.slider:before {
transform: translateX(30px);
}
.slider .icon {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 14px;
color: white;
}
.slider .moon {
left: 8px;
}
.slider .sun {
right: 8px;
}
/* 移动端导航菜单 */
.mobile-nav {
position: fixed;
top: 0;
right: -100%;
width: 80%;
max-width: 300px;
height: 100vh;
background: var(--header-bg);
backdrop-filter: blur(10px);
z-index: 1000;
padding: 80px 30px 30px;
transition: right 0.3s ease;
overflow-y: auto;
}
.mobile-nav.open {
right: 0;
}
.mobile-nav-links {
list-style: none;
}
.mobile-nav-links li {
margin-bottom: 20px;
}
.mobile-nav-links a {
color: var(--text-primary);
font-size: 18px;
display: block;
padding: 10px 0;
}
.mobile-nav-links a:hover {
color: var(--secondary-color);
}
.mobile-theme-toggle {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 30px;
padding-top: 20px;
border-top: 1px solid var(--text-secondary);
}
.mobile-theme-toggle span {
color: var(--text-primary);
font-size: 16px;
}
/* 页面标题区域 */
.page-header {
padding: 150px 0 80px;
text-align: center;
background: linear-gradient(to right, rgba(10, 25, 47, 0.9), rgba(10, 25, 47, 0.7));
position: relative;
overflow: hidden;
}
[data-theme="light"] .page-header {
background: linear-gradient(to right, rgba(248, 249, 250, 0.9), rgba(248, 249, 250, 0.7));
}
.page-header::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('images/about-bg.jpg') center/cover no-repeat;
z-index: -1;
opacity: 0.2;
}
.page-title {
font-size: 48px;
margin-bottom: 20px;
color: var(--secondary-color);
}
.page-subtitle {
font-size: 20px;
color: var(--text-secondary);
max-width: 800px;
margin: 0 auto;
}
/* 内容区域 */
.content-section {
padding: 80px 0;
}
.section-title {
text-align: center;
font-size: 36px;
margin-bottom: 60px;
position: relative;
}
.section-title::after {
content: '';
display: block;
width: 80px;
height: 3px;
background: var(--secondary-color);
margin: 15px auto 0;
}
.section-description {
max-width: 800px;
margin: 0 auto 50px;
text-align: center;
color: var(--text-secondary);
font-size: 18px;
}
/* 协会简介 */
.about-intro {
display: flex;
align-items: center;
gap: 50px;
margin-bottom: 60px;
}
.about-image {
flex: 1;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.about-image img {
width: 100%;
height: auto;
display: block;
transition: transform 0.5s ease;
}
.about-image:hover img {
transform: scale(1.05);
}
.about-text {
flex: 1;
}
.about-text h3 {
font-size: 28px;
margin-bottom: 20px;
color: var(--secondary-color);
}
.about-text p {
margin-bottom: 15px;
line-height: 1.8;
}
/* 组织架构 */
.org-structure {
background: var(--section-bg);
padding: 80px 0;
}
.org-chart {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
margin-top: 50px;
}
.org-level {
display: flex;
justify-content: center;
align-items: flex-start;
width: 100%;
position: relative;
margin-bottom: 20px;
}
.org-node {
background: var(--card-bg);
padding: 20px;
border-radius: 8px;
text-align: center;
width: 200px;
margin: 0 15px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
position: relative;
z-index: 1;
}
.org-node h4 {
color: var(--secondary-color);
margin-bottom: 10px;
font-size: 18px;
}
.org-node p {
color: var(--text-secondary);
font-size: 14px;
margin: 0;
}
/* 垂直连接线 */
.org-connection.vertical {
width: 2px;
height: 30px;
background: var(--secondary-color);
margin: 0 auto;
position: relative;
}
/* 水平连接线(用于副会长到各部门) */
.org-connections.horizontal {
display: flex;
justify-content: center;
width: 100%;
position: relative;
height: 30px;
margin: 10px 0;
}
.org-connections.horizontal .org-connection {
flex: 1;
max-width: 100px;
height: 2px;
background: var(--secondary-color);
position: relative;
margin: 0 5px;
}
/* 连接线箭头 */
.org-connection::after {
content: '';
position: absolute;
width: 8px;
height: 8px;
border-right: 2px solid var(--secondary-color);
border-bottom: 2px solid var(--secondary-color);
transform: rotate(45deg);
bottom: -4px;
right: 0;
}
.org-connection.vertical::after {
right: -3px;
bottom: 0;
transform: rotate(45deg);
}
/* 响应式设计 - 小屏幕改为垂直排列 */
@media (max-width: 768px) {
.org-level {
flex-direction: column;
align-items: center;
margin-bottom: 0;
}
.org-node {
margin: 0 0 30px 0;
}
.org-connection.vertical {
height: 20px;
width: 2px;
}
.org-connections.horizontal {
display: none;
}
/* 移动端连接线 */
.org-node::after {
content: '';
position: absolute;
bottom: -15px;
left: 50%;
transform: translateX(-50%);
width: 2px;
height: 15px;
background: var(--secondary-color);
}
.org-node:last-child::after {
display: none;
}
}
/* 发展历程 */
.timeline {
position: relative;
max-width: 1000px;
margin: 0 auto;
padding: 40px 0;
}
.timeline::before {
content: '';
position: absolute;
top: 0;
left: 50%;
width: 2px;
height: 100%;
background: var(--secondary-color);
transform: translateX(-50%);
}
.timeline-item {
position: relative;
margin-bottom: 50px;
width: 100%;
}
.timeline-item:nth-child(odd) {
padding-right: 50%;
text-align: right;
}
.timeline-item:nth-child(even) {
padding-left: 50%;
text-align: left;
}
.timeline-content {
background: var(--card-bg);
padding: 20px;
border-radius: 8px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
position: relative;
}
.timeline-content::before {
content: '';
position: absolute;
width: 20px;
height: 20px;
background: var(--secondary-color);
border-radius: 50%;
top: 20px;
}
.timeline-item:nth-child(odd) .timeline-content::before {
right: -60px;
}
.timeline-item:nth-child(even) .timeline-content::before {
left: -60px;
}
.timeline-date {
color: var(--secondary-color);
font-weight: bold;
margin-bottom: 10px;
}
.timeline-title {
font-size: 20px;
margin-bottom: 10px;
}
.timeline-desc {
color: var(--text-secondary);
}
/* 荣誉展示 */
.honors {
background: var(--section-bg);
padding: 80px 0;
}
.honors-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 30px;
margin-top: 50px;
}
.honor-card {
background: var(--card-bg);
border-radius: 8px;
overflow: hidden;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.honor-card:hover {
transform: translateY(-10px);
}
.honor-image {
height: 200px;
overflow: hidden;
}
.honor-image img {
width: 100%;
height: 100%;
object-fit: cover;
transition: transform 0.5s ease;
}
.honor-card:hover .honor-image img {
transform: scale(1.1);
}
.honor-content {
padding: 20px;
}
.honor-title {
font-size: 20px;
margin-bottom: 10px;
}
.honor-date {
color: var(--secondary-color);
font-size: 14px;
margin-bottom: 10px;
}
.honor-desc {
color: var(--text-secondary);
font-size: 15px;
}
/* 页脚 */
footer {
background: var(--footer-bg);
padding: 50px 0 20px;
text-align: center;
}
.footer-links {
display: flex;
justify-content: center;
list-style: none;
margin-bottom: 30px;
}
.footer-links li {
margin: 0 15px;
}
.copyright {
color: var(--text-secondary);
font-size: 14px;
}
/* 响应式设计 */
@media (max-width: 992px) {
.about-intro {
flex-direction: column;
}
.about-image {
width: 100%;
}
.nav-links {
display: none;
}
.hamburger {
display: block;
}
}
@media (max-width: 768px) {
.page-title {
font-size: 36px;
}
.page-subtitle {
font-size: 16px;
}
.section-title {
font-size: 28px;
}
.timeline::before {
left: 30px;
}
.timeline-item:nth-child(odd),
.timeline-item:nth-child(even) {
padding: 0 0 0 70px;
text-align: left;
}
.timeline-item:nth-child(odd) .timeline-content::before,
.timeline-item:nth-child(even) .timeline-content::before {
left: 20px;
}
.honors-grid {
grid-template-columns: 1fr;
}
}
@media (max-width: 480px) {
.page-title {
font-size: 32px;
}
.theme-switch {
width: 50px;
height: 25px;
margin-left: 15px;
}
.slider:before {
height: 18px;
width: 18px;
bottom: 3.5px;
left: 3.5px;
}
input:checked+.slider:before {
transform: translateX(25px);
}
.slider .icon {
font-size: 12px;
}
}
.close-btn {
position: absolute;
top: 20px;
right: 20px;
background: none;
border: none;
color: var(--text-primary);
font-size: 24px;
cursor: pointer;
z-index: 1001;
}
.close-btn:hover {
color: var(--secondary-color);
}