* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 a {
    color: white;
    text-decoration: none;
    font-size: 28px;
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: opacity 0.3s;
}

.nav ul li a:hover,
.nav ul li a.active {
    opacity: 0.8;
    text-decoration: underline;
}

.main {
    padding: 40px 0;
}

.main .container {
    display: flex;
    gap: 30px;
}

.content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

.post-item {
    background: white;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-title {
    font-size: 20px;
    margin-bottom: 12px;
}

.post-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.post-title a:hover {
    color: #667eea;
}

.post-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.post-meta span {
    margin-right: 20px;
}

.post-excerpt {
    color: #555;
    margin-bottom: 15px;
}

.post-footer {
    text-align: right;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.read-more:hover {
    text-decoration: underline;
}

.post-detail {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-title-detail {
    font-size: 26px;
    margin-bottom: 15px;
    color: #333;
}

.post-meta-detail {
    font-size: 14px;
    color: #888;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.post-meta-detail span {
    margin-right: 25px;
}

.post-content {
    font-family: "Microsoft YaHei", "微软雅黑", "PingFang SC", "Hiragino Sans GB", "WenQuanYi Micro Hei", sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    text-indent: 2em;
    letter-spacing: normal;
    word-break: break-word;
}

.post-content p {
    margin-bottom: 1.5em;
    margin-top: 0;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-weight: bold;
    margin: 1.5em 0 0.8em;
    color: #2c2c2c;
    line-height: 1.4;
}

.post-content h1 { font-size: 24px; }
.post-content h2 { font-size: 22px; }
.post-content h3 { font-size: 20px; }
.post-content h4 { font-size: 18px; }
.post-content h5,
.post-content h6 { font-size: 17px; }

.post-content img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 1em !important;
    margin-bottom: 1em !important;
    padding: 0 !important;
    border: none !important;
    line-height: normal !important;
}

.post-content a {
    color: #0066cc;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}

.post-content ul,
.post-content ol {
    padding-left: 2em;
    margin-bottom: 1.5em;
}

.post-content li {
    margin-bottom: 0.5em;
    line-height: 1.8;
}

.post-content blockquote {
    border-left: 4px solid #0066cc;
    padding: 10px 20px;
    margin: 1.5em 0;
    background: #f8f9fa;
    color: #666;
    font-style: italic;
}

.post-content hr {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 2em 0;
}

.download-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #eee;
    text-align: center;
}

.download-btn {
    display: inline-block;
    padding: 15px 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.file-size {
    display: block;
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.post-nav {
    margin-top: 30px;
}

.back-btn {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.back-btn:hover {
    text-decoration: underline;
}

.widget {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.widget-title {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    color: #333;
}

.widget-content {
    list-style: none;
}

.widget-content li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}

.widget-content li:last-child {
    border-bottom: none;
}

.widget-content li a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.widget-content li a:hover,
.widget-content li a.active {
    color: #667eea;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a {
    display: inline-block;
    padding: 8px 15px;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.pagination a:hover,
.pagination a.active {
    background: #667eea;
    color: white;
}

.no-posts {
    background: white;
    padding: 50px;
    text-align: center;
    color: #888;
    border-radius: 8px;
}

.footer {
    background: #333;
    color: #999;
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
}

.admin-header {
    background: #333;
}

.admin-nav {
    background: #444;
    padding: 10px 0;
}

.admin-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.admin-nav ul li a {
    color: #ddd;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
}

.admin-nav ul li a:hover,
.admin-nav ul li a.active {
    background: #555;
    color: white;
}

.admin-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f9f9f9;
    font-weight: bold;
}

.admin-table tr:hover {
    background: #fafafa;
}

.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

textarea.form-control {
    min-height: 200px;
    resize: vertical;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.login-box {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

@media (max-width: 992px) {
    .main .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .post-item,
    .post-detail {
        padding: 20px;
    }
    
    .post-title-detail {
        font-size: 22px;
    }
}
