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

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

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

/* Header */
.header {
    background-color: #fff;
    padding: 15px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    color: #333;
    text-decoration: none;
    font-size: 24px;
}

.nav a {
    margin-left: 20px;
    text-decoration: none;
    color: #666;
    transition: color 0.3s;
}

.nav a:hover {
    color: #007bff;
}

.welcome {
    margin-left: 20px;
    color: #666;
}

/* Main */
.main {
    min-height: calc(100vh - 200px);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: #999;
    border-top: 1px solid #eee;
    margin-top: 30px;
}

/* Blog List */
.blog-list h2 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.blog-item {
    background: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.blog-title {
    margin-bottom: 10px;
}

.blog-title a {
    color: #333;
    text-decoration: none;
}

.blog-title a:hover {
    color: #007bff;
}

.blog-meta {
    color: #999;
    font-size: 14px;
    margin-bottom: 10px;
}

.blog-meta span {
    margin-right: 15px;
}

.blog-summary {
    color: #666;
    margin-bottom: 15px;
}

.read-more {
    color: #007bff;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

/* Blog Detail */
.blog-detail article {
    background: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.blog-detail .blog-title {
    font-size: 28px;
    margin-bottom: 15px;
}

.blog-content {
    margin: 20px 0;
}

.blog-content pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
}

.blog-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Comments */
.comments-section {
    background: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.comments-section h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
    min-height: 100px;
}

.comment-list {
    margin-top: 20px;
}

.comment-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.comment-header {
    margin-bottom: 10px;
    font-size: 14px;
}

.comment-author {
    font-weight: bold;
    color: #333;
}

.comment-time {
    color: #999;
    margin-left: 15px;
}

.comment-content {
    color: #666;
    line-height: 1.8;
}

.btn-delete-comment {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 12px;
    margin-left: 15px;
}

.btn-delete-comment:hover {
    text-decoration: underline;
}

.login-tip {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
}

.login-tip a {
    color: #007bff;
}

.no-comments {
    color: #999;
    text-align: center;
    padding: 20px;
}

/* Auth Form */
.auth-form {
    max-width: 400px;
    margin: 50px auto;
    background: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 20px;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
}

.auth-link a {
    color: #007bff;
}

/* Blog Form */
.blog-form {
    background: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.blog-form h2 {
    margin-bottom: 20px;
}

.blog-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
}

/* Error Page */
.error-page {
    background: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.error-page h2 {
    margin-bottom: 20px;
}

/* Form Group */
.form-group {
    margin-bottom: 15px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-primary {
    background: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-edit {
    background: #28a745;
    color: #fff;
}

.btn-edit:hover {
    background: #1e7e34;
}

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

.btn-delete:hover {
    background: #c82333;
}

.btn-back, .btn-cancel {
    background: #6c757d;
    color: #fff;
}

.btn-back:hover, .btn-cancel:hover {
    background: #545b62;
}

/* Alerts */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

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

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

.no-data {
    text-align: center;
    color: #999;
    padding: 50px 0;
}
