| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- /* --- 全局与变量定义 (新拟物风格) --- */
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');
- :root {
- /* 色彩方案 - 白天模式 */
- --primary-color: #5b86e5;
- --background-color: #e0e5ec;
- --text-color: #555e67;
- --text-muted-color: #9ba1a8;
-
- /* 字体 */
- --font-family-sans-serif: 'Inter', sans-serif;
- /* 新拟物阴影 */
- --neumorph-shadow-light: inset -5px -5px 10px #ffffff, inset 5px 5px 10px #bec3c9;
- --neumorph-shadow-dark: -5px -5px 10px #ffffff, 5px 5px 10px #bec3c9;
- --neumorph-shadow-dark-active: inset -3px -3px 7px #ffffff, inset 3px 3px 7px #bec3c9;
- /* 圆角 */
- --border-radius: 20px;
- }
- body.dark-mode {
- /* 色彩方案 - 黑夜模式 */
- --primary-color: #6a82fb;
- --background-color: #2c2f35;
- --text-color: #e2e2e2;
- --text-muted-color: #8f9297;
- /* 新拟物阴影 - 黑夜模式 */
- --neumorph-shadow-light: inset -5px -5px 10px #35393f, inset 5px 5px 10px #232529;
- --neumorph-shadow-dark: -5px -5px 10px #35393f, 5px 5px 10px #232529;
- --neumorph-shadow-dark-active: inset -3px -3px 7px #35393f, inset 3px 3px 7px #232529;
- }
- * { margin: 0; padding: 0; box-sizing: border-box; }
- body {
- font-family: var(--font-family-sans-serif);
- background-color: var(--background-color);
- color: var(--text-color);
- line-height: 1.6;
- transition: background-color 0.4s ease, color 0.4s ease;
- -webkit-font-smoothing: antialiased;
- }
- .container { max-width: 980px; margin: 0 auto; padding: 0 20px; }
- /* --- 页头与导航 (新拟物风格) --- */
- header {
- background-color: transparent; /* 背景透明以融入页面 */
- padding: 1.5rem 0;
- position: sticky; top: 0; z-index: 1000;
- }
- header .container { display: flex; align-items: center; justify-content: space-between; }
- .logo { font-size: 1.8rem; font-weight: 700; color: var(--text-color); text-decoration: none; flex-shrink: 0; }
- .main-nav { flex-grow: 1; }
- .main-nav ul { list-style: none; display: flex; justify-content: center; }
- .main-nav li { margin: 0 5px; }
- .main-nav a { text-decoration: none; color: var(--text-muted-color); font-weight: 500; padding: 10px 20px; border-radius: 15px; transition: all 0.3s ease; }
- .main-nav a:hover { color: var(--primary-color); }
- .main-nav a.active { color: var(--primary-color); font-weight: 700; box-shadow: var(--neumorph-shadow-dark-active); }
- .header-controls { display: flex; align-items: center; flex-shrink: 0; gap: 15px; }
- /* --- 统一控制按钮样式 --- */
- .control-btn {
- background: var(--background-color);
- border: none;
- width: 45px;
- height: 45px;
- border-radius: 50%;
- cursor: pointer;
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: var(--neumorph-shadow-dark);
- transition: box-shadow 0.2s ease, color 0.2s ease;
- color: var(--text-muted-color);
- }
- .control-btn:hover { color: var(--primary-color); }
- .control-btn:active, .control-btn.active { box-shadow: var(--neumorph-shadow-dark-active); }
- #theme-switcher { font-size: 1.2rem; }
- .hamburger { padding-top: 2px; } /* 微调汉堡图标位置 */
- /* --- 轮播图 (新拟物风格) --- */
- .carousel { position: relative; width: 100%; margin: 2rem 0 3rem; border-radius: var(--border-radius); overflow: hidden; box-shadow: var(--neumorph-shadow-dark); }
- .carousel-inner { position: relative; width: 100%; aspect-ratio: 16 / 7; }
- .carousel-item { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; visibility: hidden; transition: opacity 0.7s ease-in-out; }
- .carousel-item.active { opacity: 1; visibility: visible; z-index: 2; }
- .carousel-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
- .carousel-control { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; opacity: 0.8; }
- .carousel-control.prev { left: 15px; }
- .carousel-control.next { right: 15px; }
- /* --- 主体内容 (新拟物风格) --- */
- main { padding: 2rem 0; }
- h1 { font-size: 2.5rem; text-align: center; margin-bottom: 3rem; color: var(--text-color); }
- .article-list { display: grid; gap: 2.5rem; }
- .article-card { background-color: var(--background-color); border-radius: var(--border-radius); padding: 2.5rem; box-shadow: var(--neumorph-shadow-dark); transition: box-shadow 0.3s ease; }
- .article-card:hover { box-shadow: var(--neumorph-shadow-dark-active); }
- .article-card h2 { font-size: 1.5rem; margin-bottom: 0.75rem; color: var(--text-color); }
- .article-card .meta { font-size: 0.9rem; color: var(--text-muted-color); margin-bottom: 1rem; }
- .article-card p { margin-bottom: 1.5rem; }
- /* --- 按钮与表单 (新拟物风格) --- */
- .btn { display: inline-block; background-color: var(--primary-color); color: #fff; padding: 14px 28px; border-radius: 15px; text-decoration: none; font-weight: 500; border: none; cursor: pointer; transition: all 0.2s ease; box-shadow: -3px -3px 7px rgba(255,255,255,0.1), 3px 3px 7px rgba(0,0,0,0.2); }
- .btn:hover { filter: brightness(1.1); }
- .btn:active { transform: scale(0.98); box-shadow: inset -3px -3px 7px rgba(255,255,255,0.1), inset 3px 3px 7px rgba(0,0,0,0.2); }
- /* --- 联系我页面 - 社交链接样式 --- */
- .social-links-container {
- display: flex;
- justify-content: center;
- align-items: center;
- flex-wrap: wrap; /* 在小屏幕上自动换行 */
- gap: 2.5rem; /* 链接之间的间距 */
- margin-top: 4rem; /* 与标题的间距 */
- text-align: center;
- }
- .social-link-card {
- display: flex;
- flex-direction: column; /* 图标和文字垂直排列 */
- align-items: center;
- justify-content: center;
- width: 150px;
- height: 150px;
- text-decoration: none;
- background-color: var(--background-color);
- border-radius: var(--border-radius);
- box-shadow: var(--neumorph-shadow-dark);
- transition: all 0.3s ease;
- color: var(--text-color); /* 统一卡片文字颜色 */
- }
- .social-link-card:hover {
- transform: translateY(-10px); /* 悬停时向上浮动 */
- box-shadow: var(--neumorph-shadow-dark-active);
- color: var(--primary-color);
- }
- .social-icon {
- font-size: 3rem; /* 图标大小 */
- margin-bottom: 1rem; /* 图标和文字的间距 */
- color: var(--primary-color);
- transition: color 0.3s ease;
- }
- .social-link-card:hover .social-icon {
- color: inherit; /* 继承父元素 a 的颜色 */
- }
- .social-text {
- font-size: 1rem;
- font-weight: 500;
- transition: color 0.3s ease;
- color: inherit; /* 继承父元素 a 的颜色 */
- }
- /* --- 页脚 --- */
- footer { text-align: center; padding: 3rem 0; margin-top: 3rem; color: var(--text-muted-color); font-size: 0.9rem; }
- footer p { margin: 0.5rem 0; }
- /* --- 响应式设计 --- */
- .hamburger span { display: block; width: 22px; height: 2px; background-color: var(--text-muted-color); margin: 5px 0; transition: all 0.3s ease-in-out; border-radius: 2px; }
- @media (max-width: 768px) {
- .main-nav { display: none; position: fixed; top: 0; left: -100%; width: 280px; height: 100%; background-color: var(--background-color); transition: left 0.4s ease; z-index: 1000; box-shadow: 10px 0 20px -5px rgba(0,0,0,0.1); }
- .main-nav.active { left: 0; }
- .main-nav ul { flex-direction: column; align-items: flex-start; padding: 80px 30px; }
- .main-nav li { margin: 15px 0; width: 100%; }
- .main-nav a { font-size: 1.2rem; }
- .hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
- .hamburger.active span:nth-child(2) { opacity: 0; }
- .hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
- .header-controls { position: relative; z-index: 1001; }
- }
|