/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    min-height: 100vh;
    display: flex;
    margin: 0;
}

/* 左侧导航栏 */
#sidebar {
    width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 2rem 1rem;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

/* Logo 容器 */
.logo-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
    cursor: pointer;
    position: relative;
    overflow: visible;
    perspective: 200px;
}

.logo-window {
    width: 100%;
    height: 100%;
    transition: transform 0.3s ease;
    overflow: visible;
    transform-origin: 50% 50%;
}

.logo-container:hover .logo-window {
    transform: scale(1.0);
}

/* 窗口背景 */
.window-bg {
    transition: fill 0.3s ease;
}

.window-inner {
    transition: fill 0.3s ease;
}

.logo-container:hover .window-bg {
    fill: #1e40af;
}

.logo-container:hover .window-inner {
    fill: #2563eb;
}

/* 红色圆圈 */
.red-circle {
    transition: stroke-width 0.3s ease, opacity 0.3s ease;
}

.logo-container:hover .red-circle {
    stroke-width: 5;
    opacity: 0.9;
}

/* 人物角色 */
.character {
    transition: transform 0.4s ease-out;
    /* 使用 viewBox 作为参考框 */
    transform-box: view-box;
    /* transform-origin 相对于 SVG viewBox (0 0 120 120)，人物在 (60, 75) */
    transform-origin: 60px 75px;
}

.logo-container:hover .character {
    /* 只放大，不移动位置 */
    transform: scale(1.1);
}

/* 移除子元素的单独动画，只保留整体放大效果 */

#sidebar h1 {
    font-size: 1.5rem;
    color: #212529;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #007bff;
    text-align: center;
}

#sidebar nav {
    display: flex;
    flex-direction: column;
}

#sidebar nav a {
    display: block;
    padding: 0.75rem 1rem;
    margin: 0.25rem 0;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s;
    font-weight: 500;
    border-radius: 5px;
}

#sidebar nav a:hover {
    background-color: #e9ecef;
    color: #007bff;
    transform: translateX(5px);
}

#sidebar nav a.active {
    background-color: #007bff;
    color: #fff;
}

/* 主内容区域 */
#content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #fff;
    padding: 2rem;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

header h1 {
    color: #212529;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header .subtitle {
    color: #6c757d;
    font-size: 1rem;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    flex: 1;
    width: 100%;
}

section {
    margin-bottom: 2rem;
}

section h2 {
    margin-bottom: 1.5rem;
    color: #212529;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

footer {
    text-align: center;
    padding: 2rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    color: #6c757d;
    margin-top: auto;
}

/* 文章列表样式 */
.article-list {
    display: grid;
    gap: 1.5rem;
}

.article-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s, transform 0.2s;
}

.article-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.article-item h3 {
    margin-bottom: 0.5rem;
}

.article-item h3 a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s;
}

.article-item h3 a:hover {
    color: #007bff;
}

.article-meta {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.article-meta span {
    margin-right: 1rem;
}

.article-excerpt {
    margin-top: 1rem;
    color: #495057;
}

/* 分类列表样式 */
.category-list {
    display: grid;
    gap: 1rem;
}

.category-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    transition: box-shadow 0.3s;
}

.category-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-item h3 {
    margin-bottom: 0.5rem;
}

.category-item h3 a {
    color: #212529;
    text-decoration: none;
    transition: color 0.3s;
}

.category-item h3 a:hover {
    color: #007bff;
}

.category-item .count {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 标签云样式 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.9rem;
    cursor: pointer;
}

.tag:hover {
    background-color: #007bff;
    color: #fff;
}

.tag:visited {
    color: #495057;
}

.tag:hover:visited {
    color: #fff;
}

/* 文章内容样式 */
.article-content {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    line-height: 1.8;
}

.article-content h1 {
    margin-bottom: 1rem;
    color: #212529;
}

.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #212529;
}

.article-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #212529;
}

.article-content p {
    margin-bottom: 1rem;
}

.article-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.article-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    #sidebar {
        width: 200px;
    }
    
    #content {
        margin-left: 200px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    main {
        padding: 0 1rem;
    }
    
    .article-item,
    .category-item,
    .article-content {
        padding: 1rem;
    }
}

@media (max-width: 600px) {
    #sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    #sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    #sidebar nav a {
        margin: 0.25rem;
        padding: 0.5rem 0.75rem;
    }
    
    #content {
        margin-left: 0;
    }
}

