/* ============ 后台管理样式 ============ */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #f5f7fa; color: #333; } .admin-layout { display: flex; min-height: 100vh; } /* ============ 侧边栏 ============ */ .sidebar { width: 240px; background: #1a1a2e; color: #fff; position: fixed; top: 0; left: 0; bottom: 0; overflow-y: auto; z-index: 100; } .logo { padding: 20px; font-size: 18px; font-weight: bold; border-bottom: 1px solid rgba(255,255,255,0.1); } .logo i { color: #e74c3c; margin-right: 8px; } .nav-menu { padding: 10px 0; } .nav-item { display: flex; align-items: center; padding: 14px 20px; color: #a0a0b0; text-decoration: none; transition: all 0.2s; border-left: 3px solid transparent; } .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; } .nav-item.active { background: rgba(231, 76, 60, 0.1); color: #fff; border-left-color: #e74c3c; } .nav-item i { width: 20px; margin-right: 12px; text-align: center; } /* ============ 主内容区 ============ */ .main { flex: 1; margin-left: 240px; } .topbar { background: #fff; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 3px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 50; } .topbar h2 { font-size: 18px; font-weight: 600; } .btn-link { color: #e74c3c; text-decoration: none; font-size: 14px; } .content { padding: 24px; } /* ============ 仪表盘 ============ */ .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; } .stat-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); } .stat-card .icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; } .stat-card .icon.blue { background: #e3f2fd; color: #1976d2; } .stat-card .icon.green { background: #e8f5e9; color: #388e3c; } .stat-card .icon.orange { background: #fff3e0; color: #f57c00; } .stat-card .icon.purple { background: #f3e5f5; color: #7b1fa2; } .stat-card .icon.red { background: #fce4ec; color: #c62828; } .stat-card .value { font-size: 28px; font-weight: 700; margin-bottom: 4px; } .stat-card .label { font-size: 14px; color: #666; } /* ============ 表格 ============ */ .table-container { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); } .table-header { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #eee; } .table-header h3 { font-size: 16px; font-weight: 600; } .btn { padding: 8px 16px; border-radius: 6px; border: none; cursor: pointer; font-size: 14px; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; } .btn-primary { background: #e74c3c; color: #fff; } .btn-primary:hover { background: #c0392b; } .btn-secondary { background: #f0f0f0; color: #333; } .btn-secondary:hover { background: #e0e0e0; } .btn-danger { background: #fff; color: #e74c3c; border: 1px solid #e74c3c; } .btn-danger:hover { background: #e74c3c; color: #fff; } .btn-sm { padding: 4px 10px; font-size: 12px; } table { width: 100%; border-collapse: collapse; } th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #f0f0f0; } th { font-weight: 600; font-size: 13px; color: #666; background: #fafafa; } td { font-size: 14px; } tr:last-child td { border-bottom: none; } tr:hover { background: #f9f9f9; } .cover-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: #f0f0f0; } .actions-cell { display: flex; gap: 8px; } /* ============ 模态框 ============ */ .modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; } .modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); } .modal-content { position: relative; background: #fff; border-radius: 12px; width: 90%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.2); } .modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; } .modal-header h3 { font-size: 16px; font-weight: 600; } .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #666; } .modal-body { padding: 20px; } /* ============ 表单 ============ */ .form-group { margin-bottom: 16px; } .form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: #333; } .form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; outline: none; transition: border-color 0.2s; } .form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: #e74c3c; } .form-group textarea { min-height: 100px; resize: vertical; } .form-group .file-upload { position: relative; display: inline-block; } .form-group .file-upload input[type="file"] { position: absolute; opacity: 0; width: 0; height: 0; } .form-group .file-upload label { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; background: #f0f0f0; border-radius: 6px; cursor: pointer; font-size: 13px; } .form-group .file-upload label:hover { background: #e0e0e0; } .form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #eee; } /* ============ 空状态 ============ */ .empty-state { text-align: center; padding: 60px 20px; color: #999; } .empty-state i { font-size: 48px; margin-bottom: 16px; color: #ddd; } .empty-state p { font-size: 14px; } /* ============ 响应式 ============ */ @media (max-width: 768px) { .sidebar { width: 60px; } .sidebar .logo { font-size: 0; padding: 16px; text-align: center; } .sidebar .logo i { font-size: 20px; } .sidebar .nav-item span { display: none; } .sidebar .nav-item { justify-content: center; padding: 14px; } .sidebar .nav-item i { margin: 0; } .main { margin-left: 60px; } .content { padding: 16px; } .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .stat-card { padding: 16px; } .stat-card .value { font-size: 22px; } /* 表格横向滚动 */ .table-container { overflow-x: auto; } table { min-width: 600px; } } @media (max-width: 480px) { .stats-grid { grid-template-columns: 1fr; } } /* ============ 通知 ============ */ .toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; color: #fff; font-size: 14px; z-index: 2000; animation: slideIn 0.3s ease; } .toast.success { background: #27ae60; } .toast.error { background: #e74c3c; } .toast.info { background: #3498db; } @keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }