/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", Arial, sans-serif;
}

body {
    font-size: 14px;
    color: #333;
    background: #f5f7fa;
    line-height: 1.5;
}

/* 后台顶部导航 */
.admin-header {
    height: 60px;
    background: #2d3748;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-header .title {
    font-size: 18px;
    font-weight: 600;
}
.admin-header .logout {
    margin-left: auto;
    color: #fff;
    text-decoration: none;
    padding: 6px 12px;
    background: #e53e3e;
    border-radius: 4px;
}

/* 后台主体布局 - 左右分栏 */
.admin-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* 左侧菜单 */
.admin-sidebar {
    width: 200px;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    padding-top: 20px;
    flex-shrink: 0; /* 防止菜单被挤压 */
}
.admin-sidebar .menu-item {
    display: block;
    padding: 12px 20px;
    color: #4a5568;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.admin-sidebar .menu-item.active {
    background: #e8f4f8;
    color: #2b6cb0;
    border-left-color: #2b6cb0;
    font-weight: 500;
}
.admin-sidebar .menu-item:hover:not(.active) {
    background: #f7fafc;
    color: #2d3748;
}

/* 右侧主内容区 */
.admin-main {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

/* 内容卡片 - 核心分区样式 */
.content-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 24px;
    margin-bottom: 20px;
}
.content-card .card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

/* 按钮样式（优化间距+视觉） */
.btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 8px 8px 0; /* 合理间距，避免拥挤 */
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    border: none;
    transition: all 0.2s;
}
.btn-primary {
    background: #2b6cb0;
    color: #fff;
}
.btn-primary:hover {
    background: #2c5282;
}
.btn-danger {
    background: #e53e3e;
    color: #fff;
}
.btn-danger:hover {
    background: #c53030;
}
.btn-success {
    background: #38a169;
    color: #fff;
}
.btn-success:hover {
    background: #2f855a;
}

/* 表格样式（清晰易读） */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}
.data-table th {
    background: #f7fafc;
    color: #2d3748;
    font-weight: 500;
}
.data-table tr:hover {
    background: #f7fafc;
}
/* 操作列固定宽度，避免挤压 */
.data-table .operate-col {
    width: 180px;
    white-space: nowrap;
}

/* 表单样式（添加模板专用） */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #2d3748;
    font-weight: 500;
}
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}
/* 文本域专门优化（添加模板用） */
.form-control.textarea-large {
    min-height: 300px;
    resize: vertical; /* 仅允许上下调整高度 */
    line-height: 1.8;
    font-family: "Consolas", "Microsoft Yahei";
}

/* 提示信息 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.alert-success {
    background: #c6f6d5;
    color: #2f855a;
    border: 1px solid #9ae6b4;
}
.alert-error {
    background: #fed7d7;
    color: #c53030;
    border: 1px solid #fc8181;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
        padding: 10px;
    }
    .admin-sidebar .menu-item {
        display: inline-block;
        padding: 8px 12px;
        margin: 0 8px 8px 0;
    }
    .content-card {
        padding: 16px;
    }
    .data-table .operate-col {
        width: auto;
        white-space: normal;
    }
}