/* 全局样式 */
* {
 margin: 0;
 padding: 0;
 box-sizing: border-box;
}

:root {
 /* 主文字（保证可读性） */
 --text-primary: #4A3A3D;
 --text-secondary: #7A5F63;

 /* 主强调色（粉色） */
 --accent-color: #E891A7;

 /* 次强调色（淡紫色） */
 --accent-secondary: #B794C8;

 /* 卡片背景（关键！） */
 --card-bg: rgba(255, 255, 255, 0.85);

 /* 边框/分割线 */
 --border-color: rgba(0, 0, 0, 0.08);
}

body {
 font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
 line-height: 1.6;
 color: var(--text-primary);
 margin: 0;
 padding: 0;
 /* 背景图 */
 background: url('./yellow.png') no-repeat center center fixed;
 background-size: cover;
 min-height: 100vh;
 position: relative;
}

/* 柔化背景（核心） */
body::before {
 content: "";
 position: fixed;
 inset: 0;
 background: rgba(255, 255, 255, 0.5); /* 50%透明度 */
 z-index: -1;
}

/* 导航栏 */
header {
 background: var(--card-bg);
 backdrop-filter: blur(12px);
 border: 1px solid var(--border-color);
 box-shadow: 0 2px 10px rgba(0,0,0,0.1);
 position: sticky;
 top: 0;
 z-index: 100;
}

nav {
 max-width: 1200px;
 margin: 0 auto;
 padding: 1rem 2rem;
 display: flex;
 justify-content: space-between;
 align-items: center;
}

.logo {
 font-size: 1.5rem;
 font-weight: 600;
 color: #4A3A3D;
}

nav ul {
 display: flex;
 list-style: none;
 gap: 2rem;
}

nav a {
 text-decoration: none;
 color: var(--text-primary);
 font-weight: 500;
 transition: color 0.3s;
}

nav a:hover, nav a.active {
 color: var(--accent-color);
}

/* 主要内容 */
main {
 max-width: 1200px;
 margin: 0 auto;
 padding: 2rem;
}

/* Hero 区域 */
.hero {
 background: var(--card-bg);
 backdrop-filter: blur(12px);
 border: 1px solid var(--border-color);
 padding: 4rem 2rem;
 text-align: center;
 border-radius: 16px;
 margin-bottom: 2rem;
 box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.hero h1 {
 font-size: 2.5rem;
 color: #4A3A3D;
 font-weight: 600;
 margin-bottom: 1rem;
}

.hero p {
 font-size: 1.2rem;
 color: var(--text-secondary);
}

/* 文章卡片 */
.articles h2 {
 margin-bottom: 1.5rem;
 color: #4A3A3D;
 font-weight: 600;
}

.post-card {
 background: var(--card-bg);
 backdrop-filter: blur(12px);
 border: 1px solid var(--border-color);
 padding: 1.5rem;
 margin-bottom: 1.5rem;
 border-radius: 16px;
 box-shadow: 0 2px 10px rgba(0,0,0,0.08);
 transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
 transform: translateY(-5px);
 box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.post-meta {
 display: flex;
 gap: 1rem;
 margin-bottom: 0.5rem;
 font-size: 0.9rem;
}

.category {
 background: var(--accent-color);
 color: white;
 padding: 0.25rem 0.75rem;
 border-radius: 15px;
 font-size: 0.85rem;
}

.date {
 color: var(--text-secondary);
}

.post-card h3 {
 margin-bottom: 0.5rem;
}

.post-card h3 a {
 color: #4A3A3D;
 text-decoration: none;
 font-size: 1.3rem;
 font-weight: 600;
 transition: color 0.3s;
}

.post-card h3 a:hover {
 color: var(--accent-color);
}

.post-card p {
 color: var(--text-secondary);
 margin-bottom: 1rem;
}

.tags {
 display: flex;
 gap: 0.5rem;
 flex-wrap: wrap;
}

.tags a {
 background: rgba(232, 145, 167, 0.15);
 color: var(--accent-color);
 padding: 0.25rem 0.75rem;
 border-radius: 15px;
 font-size: 0.85rem;
 text-decoration: none;
 transition: all 0.3s;
}

.tags a:hover {
 background: var(--accent-color);
 color: white;
}

/* 分类页面 */
.category-section {
 background: var(--card-bg);
 backdrop-filter: blur(12px);
 border: 1px solid var(--border-color);
 padding: 2rem;
 margin-bottom: 2rem;
 border-radius: 16px;
 box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.category-section h2 {
 color: #4A3A3D;
 font-weight: 600;
 margin-bottom: 1rem;
 padding-bottom: 0.5rem;
 border-bottom: 3px solid var(--accent-color);
}

.category-grid {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
 gap: 1.5rem;
 margin-top: 1.5rem;
}

.category-card {
 background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-secondary) 100%);
 padding: 2rem;
 border-radius: 16px;
 text-align: center;
 color: white;
 text-decoration: none;
 transition: transform 0.3s;
}

.category-card:hover {
 transform: scale(1.05);
}

.category-card h3 {
 font-size: 1.5rem;
 font-weight: 600;
 margin-bottom: 0.5rem;
}

.category-card p {
 opacity: 0.9;
}

/* 标签页面 */
.tag-cloud {
 background: var(--card-bg);
 backdrop-filter: blur(12px);
 border: 1px solid var(--border-color);
 padding: 2rem;
 border-radius: 16px;
 box-shadow: 0 2px 10px rgba(0,0,0,0.08);
 margin-bottom: 2rem;
}

.tag-cloud h2 {
 color: #4A3A3D;
 font-weight: 600;
 margin-bottom: 1.5rem;
}

.tag-item {
 display: inline-block;
 background: rgba(232, 145, 167, 0.15);
 color: var(--accent-color);
 padding: 0.5rem 1rem;
 margin: 0.5rem;
 border-radius: 20px;
 text-decoration: none;
 transition: all 0.3s;
}

.tag-item:hover {
 background: var(--accent-color);
 color: white;
 transform: scale(1.1);
}

/* 文章详情页 */
.post-content {
 background: var(--card-bg);
 backdrop-filter: blur(12px);
 border: 1px solid var(--border-color);
 padding: 3rem;
 border-radius: 16px;
 box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.post-content h1 {
 color: #4A3A3D;
 font-weight: 600;
 margin-bottom: 1rem;
 font-size: 2rem;
}

.post-content h2 {
 color: #4A3A3D;
 font-weight: 600;
 margin: 2rem 0 1rem 0;
 padding-bottom: 0.5rem;
 border-bottom: 2px solid rgba(232, 145, 167, 0.3);
}

.post-content p {
 margin-bottom: 1rem;
 line-height: 1.8;
 color: var(--text-primary);
}

.post-content pre {
 background: #4A3A3D;
 color: #f8f8f2;
 padding: 1rem;
 border-radius: 8px;
 overflow-x: auto;
 margin: 1rem 0;
}

.post-content code {
 background: rgba(232, 145, 167, 0.15);
 padding: 0.2rem 0.4rem;
 border-radius: 3px;
 font-family: 'Courier New', monospace;
}

.post-content pre code {
 background: transparent;
 padding: 0;
}

/* 页脚 */
footer {
 text-align: center;
 padding: 2rem;
 color: var(--text-secondary);
 margin-top: 3rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
 nav ul {
  gap: 1rem;
 }

 .hero h1 {
  font-size: 2rem;
 }

 .post-card {
  padding: 1rem;
 }
}
