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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.1);
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 5px;
    z-index: 1000;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #333 !important;
    padding: 10px 15px;
    display: block;
    border-bottom: 1px solid #eee;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background: #f5f5f5;
}

/* 主布局 */
.main-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

/* 侧边栏 */
.sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: fit-content;
}

.sidebar h3 {
    margin-bottom: 1rem;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-list {
    list-style: none;
}

.date-list li {
    margin-bottom: 0.5rem;
}

.date-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    color: #555;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
}

.date-list a:hover {
    background: #f0f0f0;
    color: #667eea;
}

.date-list a.active {
    background: #667eea;
    color: white;
}

.article-count {
    background: #e0e0e0;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

.date-list a.active .article-count {
    background: rgba(255,255,255,0.3);
}

/* 内容区域 */
.content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page-title {
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f0f0;
}

/* 文章卡片 */
.article-card {
    border-bottom: 1px solid #eee;
    padding: 1.5rem 0;
}

.article-card:last-child {
    border-bottom: none;
}

.article-header {
    margin-bottom: 1rem;
}

.article-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.article-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.article-title a:hover {
    color: #667eea;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: #666;
    font-size: 0.9rem;
}

.article-meta i {
    margin-right: 5px;
}

.article-preview {
    color: #555;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.article-preview img {
    max-width: 100%;
    height: auto;
}

.article-preview pre {
    background: #f6f8fa;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
}

.article-preview code {
    background: #f6f8fa;
    padding: 2px 5px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.read-more:hover {
    color: #764ba2;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.page-link {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.3s;
}

.page-link:hover {
    background: #764ba2;
}

.page-info {
    color: #666;
}

/* 上传页面 */
.upload-container {
    max-width: 800px;
    margin: 2rem auto;
}

.upload-info {
    margin: 2rem 0;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-card h3 {
    color: #667eea;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.info-card li {
    margin-bottom: 0.5rem;
}

.metadata-example {
    background: #f6f8fa;
    padding: 1rem;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    color: #333;
    overflow-x: auto;
}

/* 上传表单 */
.upload-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.file-label {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.file-label:hover {
    background: #764ba2;
}

.file-label input[type="file"] {
    display: none;
}

.file-name {
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.btn-upload {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.3s;
}

.btn-upload:hover {
    transform: translateY(-2px);
}

/* 现有文件列表 */
.existing-files {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.file-list {
    list-style: none;
    margin-top: 1rem;
}

.file-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.file-list li:last-child {
    border-bottom: none;
}

.file-list a {
    color: #333;
    text-decoration: none;
    flex-grow: 1;
}

.file-list a:hover {
    color: #667eea;
}

.file-date {
    color: #666;
    font-size: 0.9rem;
}

.no-files {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* 文章详情 */
.article-detail {
    max-width: 800px;
    margin: 2rem auto;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    color: #666;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
}

.breadcrumb span {
    color: #333;
}

.full-article {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.full-article .article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.full-article .article-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.full-article .article-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    margin: 1.5em 0 1em;
    color: #333;
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1rem 0;
}

.article-content pre {
    background: #f6f8fa;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content code {
    font-family: 'Courier New', monospace;
    background: #f6f8fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.article-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: #555;
    font-style: italic;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-content th,
.article-content td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.article-content th {
    background: #f6f8fa;
    font-weight: bold;
}

.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid #f0f0f0;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.btn-back:hover {
    background: #764ba2;
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-share {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.btn-share:hover {
    transform: translateY(-2px);
}

.btn-share.twitter {
    background: #1da1f2;
}

.btn-share.weibo {
    background: #e6162d;
}

/* 闪存消息 */
.flash-messages {
    margin: 1rem 0;
}

.flash {
    padding: 12px 20px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    color: #0c5460;
    margin-bottom: 10px;
}

/* 无文章状态 */
.no-articles {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.no-articles i {
    margin-bottom: 1rem;
    color: #ddd;
}

/* 页脚 */
footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .full-article .article-meta {
        grid-template-columns: 1fr;
    }
    
    .article-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
}

/* 文件名样式 */
.filename-badge {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    margin-left: 10px;
    vertical-align: middle;
}

.filename-hint {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* 标题区域样式优化 */
.article-title-area {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.article-title-area h2 {
    margin-bottom: 0;
}