/* BYPsNotes 个人知识库样式 - 首页、列表页专用 */

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
}

h1, h2, h3, h4 {
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
}

code {
    background-color: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
}

/* Markdown 内容容器样式（用于首页等） */
.markdown-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 网站主题标语 */
.site-tagline {
    text-align: center;
    padding: 24px 20px;
    margin-bottom: 30px;
    background: #fafbfc;
    border-radius: 8px;
    border-left: 4px solid #0969da;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tagline-icon {
    font-size: 1.8em;
    display: inline-block;
    animation: earthRotate 10s linear infinite;
}

@keyframes earthRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tagline-text {
    font-size: 1.3em;
    font-weight: 600;
    color: #24292f;
    letter-spacing: 0.12em;
}

.tagline-dot {
    color: #0969da;
    font-size: 1.5em;
    font-weight: 700;
}

/* 导航栏 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
    flex-wrap: wrap;
    gap: 10px;
}

.navbar-title {
    font-family: 'Noto Sans SC Local', sans-serif;
    font-size: 1.8em;
    color: #2c3e50;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-shadow: 0.5px 0 0 #2c3e50, -0.5px 0 0 #2c3e50,
                 0 0.5px 0 #2c3e50, 0 -0.5px 0 #2c3e50;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.nav-links a {
    margin-left: 0;
    color: #7f8c8d;
    text-decoration: none;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: #3498db;
    text-decoration: none;
    background-color: rgba(52, 152, 219, 0.1);
}

.nav-links a.active {
    color: #0969da;
    font-weight: bold;
}

/* 返回按钮 */
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: 1px solid #d0d7de;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    color: #57606a;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: #0969da;
    color: #0969da;
    background-color: rgba(9, 105, 218, 0.1);
}

/* 语言切换器 */
.lang-switcher {
    display: inline-block;
    margin-left: 8px;
    position: relative;
}

.lang-switcher select {
    background: transparent;
    border: 1px solid #d0d7de;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    color: #57606a;
    outline: none;
    max-width: 140px;
}

.lang-switcher select:hover {
    border-color: #0969da;
    color: #0969da;
}

/* 最新笔记预览 */
.note-preview {
    background-color: #f8f9fa;
    border-left: 4px solid #0969da;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}

.note-preview h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c3e50;
}

.note-preview p {
    margin: 10px 0;
    color: #57606a;
}

.note-preview small {
    display: block;
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 0.85em;
}

/* 最新笔记紧凑列表 */
.latest-notes-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.latest-notes-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eaecef;
}

.latest-notes-list li:last-child {
    border-bottom: none;
}

.latest-notes-list a {
    color: #0969da;
    font-size: 1em;
}

.latest-notes-list a:hover {
    color: #054ca2;
}

.note-date {
    color: #8b949e;
    font-size: 0.85em;
    margin-left: 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #0969da;
    color: white;
    border: 1px solid #0969da;
}

.btn-primary:hover {
    background-color: #054ca2;
    border-color: #054ca2;
}

.btn-secondary {
    background-color: #6e7781;
    color: white;
    border: 1px solid #6e7781;
}

.btn-secondary:hover {
    background-color: #57606a;
    border-color: #57606a;
}

/* 子系统入口卡片 */
.subsystem-entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin: 0 0 30px;
}

.subsystem-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.subsystem-card:hover {
    border-color: #0969da;
    box-shadow: 0 2px 8px rgba(9, 105, 218, 0.12);
    transform: translateY(-1px);
    text-decoration: none;
}

.subsystem-title {
    font-size: 1.02em;
    font-weight: 600;
    color: #0969da;
    letter-spacing: 0.01em;
}

.subsystem-desc {
    font-size: 0.85em;
    color: #57606a;
    line-height: 1.5;
}

/* 分类导航 */
.category-nav {
    margin: 25px 0;
}

.category-nav h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
}

.category-nav p {
    margin: 0;
}

/* 树形分类导航 */
.category-tree {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.category-item {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.category-link {
    display: block;
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.05em;
    margin-bottom: 8px;
}

.category-link:hover {
    color: #3498db;
    text-decoration: none;
}

.category-children {
    margin-left: 24px;
    padding-top: 8px;
    border-top: 1px dashed #e1e8ed;
}

.category-child-link {
    display: block;
    color: #64748b;
    text-decoration: none;
    padding: 6px 0;
    font-size: 0.95em;
    transition: color 0.2s ease;
}

.category-child-link:hover {
    color: #3498db;
    text-decoration: none;
    padding-left: 8px;
}

/* 笔记列表页搜索框 */
.search-input {
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 分页按钮 */
.pagination-btn {
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background-color: #e0e7ff;
    border-color: #3b82f6;
}

.category-links {
    line-height: 2;
}

.category-links a {
    color: #0969da;
    font-size: 1.05em;
}

.category-links a:hover {
    color: #054ca2;
    text-decoration: underline;
}

/* 系统状态 */
.system-status {
    background-color: #f0f8ff;
    border-left: 4px solid #0969da;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 4px 4px 0;
}

.system-status p {
    margin: 8px 0;
    color: #2c3e50;
}

.system-status strong {
    color: #0969da;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    body {
        max-width: 100%;
        padding: 15px;
    }
}

@media (max-width: 768px) {
    body {
        max-width: 100%;
        padding: 10px;
        font-size: 14px;
    }
    
    .navbar {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
    
    .navbar-title {
        font-size: 1.4em;
        width: 100%;
    }
    
    .nav-links {
        margin-top: 0;
        width: 100%;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        padding: 4px 0;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 隐藏滚动条但保留滚动功能 */
    .nav-links::-webkit-scrollbar {
        height: 0;
        display: none;
    }
    .nav-links {
        scrollbar-width: none;
    }
    
    .nav-links a {
        padding: 5px 8px;
        font-size: 0.85em;
        background-color: #f6f8fa;
        border: 1px solid #d0d7de;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .nav-links a:hover {
        background-color: rgba(52, 152, 219, 0.15);
    }
    
    .back-btn {
        padding: 4px 7px;
        font-size: 0.85em;
    }
    
    .lang-switcher {
        margin-left: 0;
        margin-top: 0;
        flex-shrink: 0;
    }
    
    .lang-switcher select {
        width: auto;
        max-width: 120px;
        padding: 5px 8px;
        font-size: 0.85em;
    }
}

/* 超小屏幕优化（手机竖屏） */
@media (max-width: 480px) {
    .navbar-title {
        font-size: 1.2em;
    }
    
    .nav-links {
        gap: 3px;
    }
    
    .nav-links a {
        padding: 4px 7px;
        font-size: 0.8em;
    }
    
    .back-btn {
        padding: 3px 6px;
        font-size: 0.8em;
    }
    
    .lang-switcher select {
        max-width: 100px;
        font-size: 0.8em;
    }
}

/* 页脚 */
.site-footer {
    margin-top: 50px;
    padding: 24px 20px;
    text-align: center;
    color: #8b949e;
    border-top: 1px solid #eaecef;
    font-size: 0.9em;
    line-height: 1.8;
}

.site-footer p {
    margin: 6px 0;
}

.site-footer a {
    color: #8b949e;
    text-decoration: none;
}

.site-footer a:hover {
    color: #0969da;
    text-decoration: underline;
}

/* 标签样式 */
.tag {
    display: inline-block;
    background-color: #e8f4f8;
    color: #0969da;
    padding: 2px 8px;
    margin: 0 4px;
    border-radius: 4px;
    font-size: 0.85em;
}
