/* 管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f7fa;
    color: #333;
}

/* 登录页 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: #fff;
    padding: 50px 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.login-header p {
    color: #999;
    font-size: 14px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-login:hover {
    opacity: 0.9;
}

.login-tip {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 20px;
}

/* 后台框架 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 220px;
    background: #2c3e50;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.menu {
    list-style: none;
    padding: 10px 0;
}

.menu-item {
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.3s;
    font-size: 14px;
}

.menu-item span {
    margin-right: 10px;
    font-size: 16px;
}

.menu-item:hover {
    background: rgba(255,255,255,0.1);
}

.menu-item.active {
    background: #667eea;
}

/* 主内容区 */
.main {
    flex: 1;
    margin-left: 220px;
}

.header {
    background: #fff;
    padding: 0 30px;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-title {
    font-size: 18px;
    font-weight: 500;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-user a {
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
}

.content {
    padding: 20px;
}

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-card .label {
    color: #999;
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 600;
    color: #333;
}

.stat-card .value.red { color: #ff4d4f; }
.stat-card .value.green { color: #52c41a; }
.stat-card .value.blue { color: #1890ff; }
.stat-card .value.orange { color: #fa8c16; }

/* 表格 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

th {
    background: #fafafa;
    font-weight: 600;
    color: #666;
}

tr:hover {
    background: #fafafa;
}

/* 按钮 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-success {
    background: #52c41a;
    color: #fff;
}

.btn-danger {
    background: #ff4d4f;
    color: #fff;
}

.btn-warning {
    background: #fa8c16;
    color: #fff;
}

.btn-default {
    background: #f0f0f0;
    color: #666;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 表单 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
}

.pagination button.active {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar input,
.search-bar select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-bar input {
    flex: 1;
    min-width: 200px;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.tag-success { background: #f6ffed; color: #52c41a; }
.tag-warning { background: #fffbe6; color: #fa8c16; }
.tag-danger { background: #fff2f0; color: #ff4d4f; }
.tag-default { background: #f5f5f5; color: #999; }
.tag-primary { background: #e6f7ff; color: #1890ff; }

/* 状态 */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.green { background: #52c41a; }
.status-dot.red { background: #ff4d4f; }
.status-dot.orange { background: #fa8c16; }

/* 空状态 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
}

.modal-header .close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 操作列 */
.actions {
    display: flex;
    gap: 8px;
}

/* 图片预览 */
.img-preview {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
}

/* 响应式 */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }
    
    .sidebar-header h2 {
        display: none;
    }
    
    .menu-item span {
        font-size: 20px;
    }
    
    .menu-item {
        justify-content: center;
    }
    
    .main {
        margin-left: 60px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
