/**
 * 2026企业CMS - 后台管理样式表
 */

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

body {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f0f2f5;
}

a {
    color: #2c82e0;
    text-decoration: none;
}

a:hover {
    color: #1a6bc4;
}

/* ============================================
   顶部栏
   ============================================ */
.admin-topbar {
    height: 60px;
    background: #001529;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.admin-logo h1 {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-user a {
    color: #ccc;
    font-size: 18px;
    transition: color 0.3s;
}

.admin-user a:hover {
    color: #fff;
}

/* ============================================
   后台主体布局
   ============================================ */
.admin-body {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* ============================================
   侧边栏
   ============================================ */
.admin-sidebar {
    width: 240px;
    background: #001529;
    min-height: calc(100vh - 60px);
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    overflow-y: auto;
    transition: width 0.3s;
}

.admin-menu {
    list-style: none;
    padding: 10px 0;
}

.admin-menu li {
    display: block;
}

.admin-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #ccc;
    transition: all 0.3s;
}

.admin-menu li a:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.admin-menu li.active a {
    color: #fff;
    background: #2c82e0;
}

.admin-menu li.menu-group {
    color: #666;
    font-size: 12px;
    padding: 15px 20px 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.admin-menu .fas {
    width: 20px;
    text-align: center;
}

/* ============================================
   右侧内容区
   ============================================ */
.admin-content {
    flex: 1;
    margin-left: 240px;
    padding: 20px;
    min-width: 0;
}

/* ============================================
   后台通用组件
   ============================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.page-header h2 {
    font-size: 20px;
    color: #333;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #2c82e0;
    color: #fff;
}

.btn-primary:hover {
    background: #1a6bc4;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-success:hover {
    background: #389e0d;
}

.btn-danger {
    background: #f5222d;
    color: #fff;
}

.btn-danger:hover {
    background: #cf1322;
}

.btn-warning {
    background: #faad14;
    color: #fff;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* 提示框 */
.alert {
    padding: 12px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.alert-danger {
    background: #fff1f0;
    color: #f5222d;
    border: 1px solid #ffa39e;
}

.alert-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

/* 表格 */
.table-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: #fafafa;
    padding: 12px 15px;
    text-align: left;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #e8e8e8;
}

table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e8e8e8;
    color: #666;
}

table tr:hover td {
    background: #fafafa;
}

table .actions {
    display: flex;
    gap: 5px;
}

/* 表单 */
.form-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 30px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2c82e0;
}

.form-group textarea {
    min-height: 200px;
    resize: vertical;
}

.form-group .hint {
    color: #999;
    font-size: 12px;
    margin-top: 5px;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-bar input {
    flex: 1;
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.search-bar button {
    padding: 8px 20px;
    background: #2c82e0;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
}

.pagination span.current {
    background: #2c82e0;
    color: #fff;
    border-color: #2c82e0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
}

.stat-info h3 {
    font-size: 28px;
    color: #333;
    margin-bottom: 5px;
}

.stat-info p {
    color: #999;
    font-size: 14px;
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
}

.badge-danger {
    background: #fff1f0;
    color: #f5222d;
}

/* 响应式 */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 0;
        overflow: hidden;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
