/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 导航栏样式 */
header {
    background-color: #2c3e50;
    padding: 1rem;
    color: white;
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav h1 a {
    color: white;
    text-decoration: none;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 2rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
}

/* 主要内容区域 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 文章卡片样式 */
.post-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.post-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.post-content {
    padding: 1rem;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button[type="submit"] {
    background-color: #2c3e50;
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 1rem;
        flex-direction: column;
    }
    
    nav ul li {
        margin: 0.5rem 0;
    }
}

/* 发布文章表单样式 */
.create-post {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.create-post h2 {
    margin-bottom: 2rem;
    color: #2c3e50;
    text-align: center;
}

.post-form .form-group {
    margin-bottom: 1.5rem;
}

.post-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.post-form .form-control:focus {
    border-color: #2c3e50;
    outline: none;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #666;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-submit,
.btn-cancel {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-submit {
    background-color: #2c3e50;
    color: white;
    flex: 1;
}

.btn-submit:hover {
    background-color: #1a252f;
}

.btn-cancel {
    background-color: #95a5a6;
    color: white;
}

.btn-cancel:hover {
    background-color: #7f8c8d;
}

/* 调整 TinyMCE 编辑器样式 */
.tox-tinymce {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .create-post {
        padding: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-submit,
    .btn-cancel {
        width: 100%;
    }
}

/* 容器布局 */
.container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    gap: 2rem;
}

/* 侧边栏样式 */
.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* 分类菜单样式 */
.category-menu {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.category-menu h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.category-menu ul {
    list-style: none;
    padding: 0;
}

.category-menu li {
    margin-bottom: 0.5rem;
}

.category-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.category-menu a:hover {
    background-color: #f5f5f5;
    color: #2c3e50;
}

.category-menu a.active {
    background-color: #2c3e50;
    color: white;
}

/* 发布文章按钮 */
.action-buttons {
    padding: 0 1.5rem;
}

.btn-create {
    display: block;
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.btn-create:hover {
    background-color: #1a252f;
}

/* 调整主内容区域 */
.main-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .category-menu {
        margin-bottom: 1rem;
    }
    
    .category-menu ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .category-menu li {
        margin: 0;
    }
    
    .action-buttons {
        padding: 0;
    }
}

/* 调整页脚，防止遮挡内容 */
footer {
    position: relative;
    margin-top: 2rem;
}

/* 调整主体背景色 */
body {
    background-color: #f5f5f5;
}

/* 分类输入组样式 */
.category-input-group {
    position: relative;
}

.category-input-group input {
    width: 100%;
}

/* 分类管理页面样式 */
.categories-list {
    list-style: none;
    padding: 0;
}

.categories-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.categories-list li:last-child {
    border-bottom: none;
}

.category-count {
    color: #666;
    font-size: 0.9rem;
}

/* 下拉框样式 */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    background-size: 1em;
    padding-right: 2.5rem;
}

select.form-control:focus {
    border-color: #2c3e50;
    outline: none;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.1);
}

select.form-control option {
    padding: 0.5rem;
}

/* 管理按钮样式 */
.btn-manage {
    display: block;
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease;
    margin-top: 0.5rem;
}

.btn-manage:hover {
    background-color: #2c3e50;
}

/* 用户操作按钮样式 */
.user-actions {
    display: flex;
    align-items: center;
}

.btn-login,
.btn-logout {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
}

.btn-login:hover,
.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* 登录表单样式已包含在 login.html 中 */

.btn-settings {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s;
    margin-right: 1rem;
}

.btn-settings:hover {
    background-color: rgba(255, 255, 255, 0.2);
} 