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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
    height: 64px;
}

.nav-logo {
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    text-decoration: none;
    margin-right: 40px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 5px;
    flex: 1;
}

.nav-menu li a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s;
    font-size: 0.95em;
}

.nav-menu li a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-form input {
    padding: 8px 15px;
    border: none;
    border-radius: 20px 0 0 20px;
    outline: none;
    width: 200px;
    font-size: 0.9em;
}

.search-form button {
    padding: 8px 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 0 20px 20px 0;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: rgba(255,255,255,0.3);
}

/* ============ 主内容 ============ */
.main-content {
    min-height: calc(100vh - 200px);
}

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

/* ============ 提示消息 ============ */
.alert {
    padding: 15px 20px;
    margin: 10px auto;
    max-width: 1200px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-close {
    cursor: pointer;
    font-size: 1.2em;
    opacity: 0.5;
}

.alert-close:hover {
    opacity: 1;
}

/* ============ Hero 区域 ============ */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* ============ 内容布局 ============ */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
}

/* ============ 文章卡片 ============ */
.post-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.post-card h3 {
    margin-bottom: 10px;
}

.post-card h3 a {
    color: #333;
    text-decoration: none;
    font-size: 1.3em;
    transition: color 0.3s;
}

.post-card h3 a:hover {
    color: #667eea;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    color: #888;
    font-size: 0.85em;
    margin-bottom: 15px;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    text-decoration: none;
    transition: opacity 0.3s;
}

.tag:hover {
    opacity: 0.8;
}

.post-card-body p {
    color: #666;
    line-height: 1.8;
}

.post-card-footer {
    margin-top: 15px;
}

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

.btn-read-more:hover {
    gap: 10px;
}

/* ============ 侧边栏 ============ */
.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.sidebar-widget h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    color: #333;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .tag {
    padding: 5px 12px;
    font-size: 0.85em;
}

.recent-posts {
    list-style: none;
}

.recent-posts li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.recent-posts li:last-child {
    border-bottom: none;
}

.recent-posts a {
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recent-posts .post-title {
    color: #333;
    font-size: 0.9em;
}

.recent-posts .post-date {
    color: #999;
    font-size: 0.8em;
}

.friend-links {
    list-style: none;
}

.friend-links li {
    padding: 5px 0;
}

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

.friend-links a:hover {
    text-decoration: underline;
}

/* ============ 文章详情 ============ */
.post-detail {
    padding: 40px 0;
}

.post-header {
    text-align: center;
    margin-bottom: 40px;
}

.post-header h1 {
    font-size: 2em;
    margin-bottom: 15px;
    color: #333;
}

.post-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    line-height: 1.8;
    font-size: 1.05em;
}

.post-content h2 {
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    color: #333;
}

.post-content h3 {
    margin: 25px 0 10px;
    color: #444;
}

.post-content p {
    margin-bottom: 15px;
    color: #555;
}

.post-content ul, .post-content ol {
    margin: 15px 0;
    padding-left: 25px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content pre {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #e1e4e8;
}

.post-content code {
    background: #f0f2f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e83e8c;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content blockquote {
    border-left: 4px solid #667eea;
    margin: 20px 0;
    padding: 10px 20px;
    background: #f8f9ff;
    border-radius: 0 8px 8px 0;
    color: #666;
}

.post-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.post-content th, .post-content td {
    border: 1px solid #e1e4e8;
    padding: 10px 15px;
    text-align: left;
}

.post-content th {
    background: #f6f8fa;
    font-weight: 600;
}

/* ============ 关于页面 ============ */
.about-page {
    max-width: 800px;
    margin: 0 auto;
}

.about-header {
    text-align: center;
    padding: 40px 0;
}

.avatar {
    font-size: 6em;
    color: #667eea;
    margin-bottom: 20px;
}

.about-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    color: #333;
}

.subtitle {
    color: #888;
    font-size: 1.1em;
}

.about-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.about-section {
    margin-bottom: 35px;
}

.about-section h2 {
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    font-size: 1.3em;
}

.about-section p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 10px;
}

.skill-category {
    margin-bottom: 15px;
}

.skill-desc {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 10px;
    font-style: italic;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tag {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    cursor: default;
    transition: transform 0.3s, box-shadow 0.3s;
}

.skill-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.summary-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.summary-item {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 15px;
    border: 1px solid #e8ecff;
}

.summary-item h4 {
    color: #667eea;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.summary-item p {
    color: #666;
    font-size: 0.85em;
    margin: 0;
}

.contact-info, .site-info {
    list-style: none;
}

.contact-info li, .site-info li {
    padding: 8px 0;
    color: #666;
    font-size: 0.95em;
}

.contact-info li i {
    width: 25px;
    color: #667eea;
}

.site-info li {
    padding: 6px 0;
}

/* ============ 归档页面 ============ */
.archive-section {
    margin-bottom: 30px;
}

.archive-year {
    color: #667eea;
    font-size: 1.5em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
}

.archive-posts {
    list-style: none;
}

.archive-posts li {
    padding: 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.archive-posts .post-date {
    color: #999;
    font-size: 0.85em;
    min-width: 40px;
}

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

.archive-posts a:hover {
    color: #667eea;
}

/* ============ 分页 ============ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: white;
    color: #333;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.page-link:hover {
    background: #667eea;
    color: white;
}

.page-link.active {
    background: #667eea;
    color: white;
}

.page-link.disabled {
    opacity: 0.5;
    cursor: default;
}

/* ============ 登录页面 ============ */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    min-height: 400px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

.btn-submit, .btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-submit:hover, .btn-primary:hover {
    transform: translateY(-2px);
}

/* ============ 文件卡片 ============ */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.file-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}

.file-card:hover {
    transform: translateY(-5px);
}

.file-icon {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 15px;
}

.file-card h4 {
    color: #333;
    margin-bottom: 10px;
    word-break: break-all;
}

.file-card p {
    color: #888;
    font-size: 0.85em;
    margin-bottom: 15px;
}

/* ============ 管理后台 ============ */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-actions {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-edit {
    background: #ffc107;
    color: #333;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-back {
    color: #667eea;
    text-decoration: none;
}

/* ============ 空状态 ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 4em;
    margin-bottom: 20px;
    color: #ddd;
}

/* ============ 页脚 ============ */
.footer {
    background: #333;
    color: white;
    padding: 40px 0 0;
    margin-top: 60px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding: 0 20px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 1.1em;
}

.footer-section p {
    color: #999;
    font-size: 0.9em;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    padding: 5px 0;
}

.footer-section ul li a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #444;
    color: #666;
    font-size: 0.85em;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
    .content-layout {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        display: none;
    }
    
    .search-form input {
        width: 120px;
    }
    
    .summary-box {
        grid-template-columns: 1fr;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
    }
}
