* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Heiti SC', '黑体-简', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 40px 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    color: #7f8c8d;
    font-size: 1.2em;
    margin-bottom: 20px;
}

.stats-text {
    color: #95a5a6;
    font-size: 0.85em;
    margin-top: 15px;
    text-align: center;
}

.search-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    min-width: 300px;
    padding: 15px 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

.search-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 120px;
}

.search-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f4e79 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-group:first-child {
    flex: 1;
    min-width: 300px;
}

.filter-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
}

.collection-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    background: white;
    flex: 1;
    min-width: 250px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.checkbox-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.checkbox-item input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
    transform: scale(1.1);
}

.results-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
    font-size: 1.2em;
}

.results-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.results-count {
    font-size: 1.3em;
    color: #2c3e50;
    font-weight: bold;
}

.result-item {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    border-left: 5px solid #3498db;
    transition: all 0.3s ease;
}

.result-item:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.result-title {
    font-size: 1.3em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: bold;
}

.result-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.meta-tag {
    padding: 5px 12px;
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.result-content {
    color: #555;
    line-height: 1.8;
    margin-bottom: 10px;
}

.highlight {
    background: linear-gradient(120deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
    color: #856404;
}

.result-path {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
}

.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination button {
    margin: 0 5px;
    padding: 10px 15px;
    border: 2px solid #3498db;
    background: white;
    color: #3498db;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    background: #3498db;
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active {
    background: #3498db;
    color: white;
}

.error {
    background: rgba(231, 76, 60, 0.1);
    border-left: 5px solid #e74c3c;
    padding: 20px;
    border-radius: 5px;
    color: #c0392b;
    margin: 20px 0;
}

.footer {
    margin-top: 40px;
    padding: 30px 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.footer p {
    color: #7f8c8d;
    margin: 5px 0;
    font-size: 0.9em;
}

.footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #2980b9;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.6em;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input {
        min-width: 100%;
    }
    
    .result-meta {
        flex-direction: column;
        gap: 10px;
    }

    .collection-checkboxes {
        padding: 8px;
    }

    .checkbox-item {
        font-size: 13px;
        padding: 4px 8px;
    }
    
    .directory-grid,
    .files-grid {
        grid-template-columns: 1fr;
    }
}

/* Text file page specific styles */
.text-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    font-family: 'Noto Sans SC', 'Noto Sans CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Heiti SC', '黑体-简', Arial, sans-serif;
}

.text-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.8;
    color: #333;
    font-size: 16px;
    margin: 0;
    font-family: inherit;
}

.text-meta {
    background: rgba(52, 152, 219, 0.1);
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.text-meta h2 {
    color: #2c3e50;
    margin: 0 0 5px 0;
    font-size: 1.5em;
}

.text-meta p {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.9em;
}

.text-meta a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.text-meta a:hover {
    text-decoration: underline;
}

/* Document metadata styles for frontmatter */
.document-meta {
    background: rgba(46, 204, 113, 0.1);
    border-left: 4px solid #2ecc71;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    font-size: 0.95em;
}

.document-meta .meta-title {
    font-size: 1.1em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(46, 204, 113, 0.2);
}

.document-meta .meta-item {
    margin-bottom: 12px;
    line-height: 1.5;
}

.document-meta strong {
    color: #27ae60;
    font-weight: 600;
}

.document-meta a {
    color: #3498db;
    text-decoration: none;
}

.document-meta a:hover {
    text-decoration: underline;
}

/* Markdown content styling */
.markdown-content {
    font-family: inherit;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 15px;
}

.markdown-content p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

/* Mobile styles for text pages */
@media (max-width: 768px) {
    .text-content {
        padding: 20px;
    }
    
    .text-content pre {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* About page specific styles */
.content-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.content-section h2 {
    color: #2c3e50;
    font-size: 1.8em;
    margin-bottom: 20px;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.content-section h3 {
    color: #2c3e50;
    font-size: 1.3em;
    margin: 20px 0 10px 0;
}

.content-section p {
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1em;
}

.content-section ul {
    margin: 15px 0;
    padding-left: 30px;
}

.content-section li {
    margin-bottom: 8px;
    color: #555;
}

.highlight-box {
    background: rgba(52, 152, 219, 0.1);
    border-left: 5px solid #3498db;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: rgba(52, 152, 219, 0.1);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #2980b9;
    display: block;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Directory page specific styles */
.breadcrumb {
    margin: 0 0 20px 0;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    font-size: 1.2em;
    color: #7f8c8d;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(52, 152, 219, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .current {
    font-weight: bold;
    color: #2c3e50;
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.directory-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    border-left: 5px solid #3498db;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    cursor: pointer;
}

.directory-item:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.directory-item h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 1.3em;
    font-weight: bold;
}

.directory-item:hover h3 {
    color: #3498db;
}

.file-count {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-top: 5px;
    padding: 5px 12px;
    background: rgba(52, 152, 219, 0.1);
    color: #2980b9;
    border-radius: 20px;
    display: inline-block;
    font-weight: bold;
}

.files-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.file-item {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e0e0e0;
    padding: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    color: #2c3e50;
    font-weight: 500;
    cursor: pointer;
}

.file-item:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
    color: #3498db;
}

.stats {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 10px;
    color: #2980b9;
    font-weight: bold;
}

